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 | |
---|---|---|---|---|
String | Object[] | HTMLElement | Widget | The content of the feature. more details | more details | FeatureViewModel | |
String | The name of the class. more details | more details | Accessor | |
Object | The formatted attributes calculated from | more details | FeatureViewModel | |
Graphic | The Graphic used to represent the feature. more details | more details | FeatureViewModel | |
String | The title for the feature. more details | more details | FeatureViewModel | |
MapView | SceneView | The view associated with the Feature instance. 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
- Since: ArcGIS API for JavaScript 4.7
The name of the class. The declared class name is formatted as
esri.folder.className
.
- formattedAttributesObjectreadonly
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 type of fields on the PopupTemplate's 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 PopupTemplate content property of the PopupTemplate defined as type
fields
. - Default Value:null
- graphicGraphic
The Graphic used to represent the feature.
- Default Value:null
Example:var graphic = new Graphic({ geometry: view.center, attributes: { "name": "Spruce", "family": "Pinaceae", "count": 126 }, symbol: new SimpleMarkerSymbol({ type: "simple-marker", style: "square", color: "blue", size: "8px" }), popupTemplate: { content: [ { // Set popup template content } ] } });
- titleStringreadonly
The title for the feature.
- Default Value:null
The view associated with the Feature instance.
- Default Value:null
- waitingForContentBooleanreadonly
Indicates whether the feature is currently waiting for all of its content to finish loading.
- Default Value:true