FeatureViewModel

require(["esri/widgets/Feature/FeatureViewModel"], function(FeatureVM) { /* code goes here */ });
Class: esri/widgets/Feature/FeatureViewModel
Inheritance: FeatureViewModel Accessor
Since: ArcGIS API for JavaScript 4.7

Provides the logic for the Feature widget.

See also:

Constructors

new FeatureViewModel(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
String | Object[] | HTMLElement | Widget

The content of the feature.

more details
more detailsFeatureViewModel
String

The name of the class.

more details
more detailsAccessor
Object

The formatted attributes calculated from fieldInfo PopupTemplate content.

more details
more detailsFeatureViewModel
Graphic

The Graphic used to represent the feature.

more details
more detailsFeatureViewModel
String

The title for the feature.

more details
more detailsFeatureViewModel
MapView | SceneView

The view associated with the Feature instance.

more details
more detailsFeatureViewModel
Boolean

Indicates whether the feature is currently waiting for all of its content to finish loading.

more details
more detailsFeatureViewModel

Property Details

The content of the feature.

Default Value:null
declaredClassStringreadonly inherited
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:
global Object
optional

The formatted attributes specified at the root level of the PopupTemplate using the PopupTemplate.fieldInfos property.

content Object
optional

The 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

API Reference search results

NameTypeModule
Loading...