FeatureViewModel
require(["esri/widgets/Feature/FeatureViewModel"], function(FeatureVM) { /* code goes here */ });
esri/widgets/Feature/FeatureViewModel
Provides the logic for the Feature widget.
- See also:
Constructors
- new FeatureViewModel(properties)
- Parameter:properties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
Content[]|Widget|HTMLElement|String | The content of the feature. more details | more details | FeatureViewModel | |
String | The name of the class. more details | more details | Accessor | |
Boolean | Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. more details | more details | FeatureViewModel | |
Object | The formatted attributes calculated from | more details | FeatureViewModel | |
Graphic | The Graphic used to represent the feature. more details | more details | FeatureViewModel | |
Object | A read-only property containing metadata regarding the last edit performed on a feature. more details | more details | FeatureViewModel | |
Map | A reference to the view's Map. more details | more details | FeatureViewModel | |
SpatialReference | The spatial reference used for Arcade operations. more details | more details | FeatureViewModel | |
String | The title for the feature. more details | more details | FeatureViewModel | |
MapView|SceneView | A reference to the MapView or SceneView. more details | more details | FeatureViewModel | |
Boolean | Indicates whether the feature is currently waiting for all of its content to finish loading. more details | more details | FeatureViewModel |
Property Details
The content of the feature.
- Default Value:null
The name of the class. The declared class name is formatted as
esri.folder.className
.
- defaultPopupTemplateEnabled BooleanSince: ArcGIS API for JavaScript 4.11
Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the
createPopupTemplate
method. (Supported for FeatureLayer, GeoJSONLayer, SceneLayer, CSVLayer, PointCloudLayer, StreamLayer and ImageryLayer).- Default Value:false
- formattedAttributes Objectreadonly
The formatted attributes calculated from
fieldInfo
PopupTemplate content. They are obtained from the feature's graphic attribute values and can be read:- globally using the fieldInfos property directly at the root level of the PopupTemplate, or
- per an individual content element. This element is defined with a fieldsContent popup element set on the PopupTemplate content property.
- Properties:
- optionalglobal Object
The formatted attributes specified at the root level of the PopupTemplate using the PopupTemplate.fieldInfos property.
optionalcontent ObjectThe formatted attributes for an individual content element. This is derived from the esri/PopupTemplate PopupTemplate, or per an individual content element. This element is defined with a fieldsContent popup element set on the PopupTemplate's content.
- Default Value:null
- graphic Graphic
The Graphic used to represent the feature.
- Default Value:null
- See also:
- PopupTemplate.content
Example:var graphic = new Graphic({ geometry: view.center, attributes: { "name": "Spruce", "family": "Pinaceae", "count": 126 }, symbol: new SimpleMarkerSymbol({ style: "square", color: "blue", size: "8px" }), popupTemplate: { content: [ { // Set popup template content } ] } });
- lastEditInfo Objectreadonly
A read-only property containing metadata regarding the last edit performed on a feature. This object has the following properties:
- map MapSince: ArcGIS API for JavaScript 4.11
A reference to the view's Map. Use this property when needing to get access to the underlying layers within the map. This can then be used within Arcade expressions.
- Default Value:null
- See also:
Example:// The building footprints repreent the buildings that intersect a clicked parcel let buildingFootprints = Intersects($feature, FeatureSetByName($map, "Building Footprints"));
- spatialReference SpatialReferenceSince: ArcGIS API for JavaScript 4.11
The spatial reference used for Arcade operations.
- Default Value:null
- See also:
- title Stringreadonly
The title for the feature.
- waitingForContent Booleanreadonly
Indicates whether the feature is currently waiting for all of its content to finish loading.