▾
import FeatureModel from "@arcgis/core/popup/FeatureModel.js";const FeatureModel = await $arcgis.import("@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.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
| | ||
| readonly | | |
| readonly | | |
| readonly inherited | ||
| readonly | | |
| | ||
| readonly | | |
| readonly | | |
| | ||
| readonly | | |
| | ||
| readonly | | |
| readonly | | |
| | ||
| | ||
| readonly | | |
| | ||
| readonly | | |
| | ||
| readonly inherited | ||
| | ||
| readonly | |
abilities
- Type
- FeatureAbilities
Defines the specific FeatureAbilities that should be used when querying and displaying content.
actions
- Type
- Collection<PopupAction>
A collection of custom actions to include with the feature's popup actions.
allActions
- Type
- Collection<PopupAction>
A collection of the actions available for the feature.
content
- Type
- PopupContent | null | undefined
The PopupTemplate.content of the feature.
defaultActions
- 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
- 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
formattedAttributes
- 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:
- globally using the PopupTemplate.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 PopupTemplate.content property.
graphic
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}]}});
includeDefaultActions
- Type
- boolean
Indicates whether to include the default actions.
- Default value
- false
lastEditInfo
- Type
- LastEditInfo | null | undefined
A read-only property containing metadata regarding the last edit performed on a feature.
map
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.
- Example
- // The building footprints represent the buildings that intersect a clicked parcellet buildingFootprints = Intersects($feature, FeatureSetByName($map, "Building Footprints"));
relatedInfos
- 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
- Type
- SpatialReference | null | undefined
The spatial reference used for Arcade operations. This property should be set if executing Arcade expressions that contain geometry functions.
state
- Type
- State
The current state of the Feature component.
- Default value
- "disabled"
timeZone
- 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
| Value | Description |
|---|---|
| system | Dates and times will be displayed in the timezone of the device or browser. |
| unknown | Dates and time are not adjusted for any timezone. |
| Specified IANA timezone | Dates and times will be displayed in the specified IANA time zone. See wikipedia - List of tz database time zones. |
uid
- Type
- string
- 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
- 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:
- The graphic has a popupTemplate containing Arcade expressions in ExpressionInfo or ExpressionContent that may use geometry functions or reference the
$mapprofile variable (i.e. access data from layers within a map). - Content is displayed from the popup template of an aggregate feature (i.e. a cluster or bin).
- Values from
dateandtimestamp-offsetfields should respect the associated MapView or SceneView.
waitingForContent
- Type
- boolean
Indicates whether the feature is currently waiting for all of its content to finish loading.
Methods
| Method | Signature | Class |
|---|---|---|
| updateGeometry(): Promise<void> | |
updateGeometry
- 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.
Type definitions
PopupContent
The content of a popup, which can be a string, an array of Content elements, or a single Content element.
- Supertypes
- PopupTemplateContentResolved