import FeatureModel from "@arcgis/core/popup/FeatureModel.js";
Inheritance
FeatureModel→Accessor
Since
ArcGIS Maps SDK for JavaScript 5.2

Provides reactive state and logic for populating the Feature (Next) component. The class resolves popup template content for the current Graphic, including evaluating Arcade expressions, formatting attribute values, and fetching related feature information.

See also

Constructors

Constructor

Constructor

Parameters

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

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

abilities

autocast Property
Type
FeatureAbilities

Defines the specific FeatureAbilities that should be used when querying and displaying content.

actions

autocast Property
Type
Collection<PopupAction>

A collection of custom actions to include with the feature's popup actions.

allActions

readonly Property
Type
Collection<PopupAction>

A collection of the actions available for the feature.

content

readonly Property
Type
PopupContent | null | undefined

The PopupTemplate.content of the feature.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor
Since
ArcGIS Maps SDK for JavaScript 4.7

The name of the class. The declared class name is formatted as esri.folder.className.

defaultActions

readonly Property
Type
Collection<PopupAction>

A read-only property that specifies the Collection of default action buttons and/or toggles. By default, there is a "Zoom to" action that allows users to zoom to the selected feature.

defaultPopupTemplateEnabled

Property
Type
boolean

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 BuildingComponentSublayer, CatalogFootprintLayer, CSVLayer, FeatureLayer, GeoJSONLayer, ImageryLayer), ImageryTileLayer, KnowledgeGraphSublayer, OGCFeatureLayer, ParquetLayer, PointCloudLayer, SceneLayer, StreamLayer, Sublayer, SubtypeSublayer, VoxelLayer, WCSLayer, and WFSLayer.

Default value
false

expressionAttributes

readonly Property
Type
Record<string, any> | null | undefined

A read-only map of Arcade expression names to their evaluated values for the current feature.

formattedAttributes

readonly Property
Type
FeatureFormattedAttributes | null | undefined

The formatted attributes calculated from fieldInfo PopupTemplate formatting. They are obtained from the feature's graphic attribute values and can be read:

graphic

autocast Property
Type
Graphic | null | undefined

The Graphic used to represent the feature.

See also
Example
let 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
}
]
}
});

heading

readonly Property
Type
string

The heading for the feature.

Default value
""

includeDefaultActions

Property
Type
boolean

Indicates whether to include the default actions.

Default value
false

isFeatureFromTable

readonly Property
Type
boolean

Indicates whether the current graphic resides in a non-spatial table.

lastEditInfo

readonly Property
Type
LastEditInfo | null | undefined

A read-only property containing metadata regarding the last edit performed on a feature.

location

autocast Property
Type
Point | null | undefined

The Point representing the location of the MapView interaction used to trigger the opening of the component.

This value should be set when executing Arcade expressions in the Feature component that expect the $userInput profile variable to have a value.

See also

map

Property
Type
EsriMap | null | undefined

A map is required when the input graphic has a popupTemplate that contains Arcade expressions in ExpressionInfo or ExpressionContent that may use the $map profile variable to access data from layers within a map. Without a map, expressions that use $map will throw an error.

Alternatively, the view property can be used to provide the map instance for this property.

See also
Example
// The building footprints represent the buildings that intersect a clicked parcel
let buildingFootprints = Intersects($feature, FeatureSetByName($map, "Building Footprints"));

relatedInfos

readonly Property
Type
Map<string, RelatedInfo>

A read-only map containing information about related features for the current feature. The keys are related layer IDs as strings, and the values are RelatedInfo objects. This property is populated when the feature has related fields and is used to manage and display related feature information.

spatialReference

autocast Property
Type
SpatialReference | null | undefined

The spatial reference used for Arcade operations. This property should be set if executing Arcade expressions that contain geometry functions.

See also

state

readonly Property
Type
State

The current state of the Feature component.

Default value
"disabled"

timeZone

autocast Property
Type
TimeZone

Dates and times will be displayed in this time zone. By default this time zone is inherited from the associated MapView.timeZone or SceneView.timeZone. When a view is not associated, then the property will fallback to the system time zone.

Possible Values

ValueDescription
systemDates and times will be displayed in the timezone of the device or browser.
unknownDates and time are not adjusted for any timezone.
Specified IANA timezoneDates and times will be displayed in the specified IANA time zone. See wikipedia - List of tz database time zones.

uid

readonlyinherited Property
Type
string
Inherited from: IdentifiableMixin
Since
ArcGIS Maps SDK for JavaScript 4.33

An automatically generated unique identifier assigned to the instance. The unique id is generated each time the application is loaded.

view

Property
Type
MapViewOrSceneView | null | undefined

A reference to the MapView or SceneView.

A view is required if the user expects to display content in any of the following situations:

waitingForContent

readonly Property
Type
boolean

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

Methods

MethodSignatureClass
updateGeometry(): Promise<void>

updateGeometry

Method
Signature
updateGeometry (): Promise<void>

Fetches and updates the geometry of the graphic. This method can be called to refresh the graphic's geometry before taking actions such as calling View2D.goTo() with the graphic as the target.

Returns
Promise<void>

A promise that resolves when the geometry update attempt has completed.

Type definitions

PopupContent

Type definition

The content of a popup, which can be a string, an array of Content elements, or a single Content element.