Since version: 1.1
In the popup profile, map authors can write expressions that return values (i.e. attributes) for display in the view's popup. Expressions can be referenced in the popup content's text template, field tables, and media charts. When the popup displays, the script will execute using the feature's attributes as variables in the expression. The script should return either text or a number and place it in the table cell or text comprising the popup's content. Values returned for charts will be used as the basis for the data-driven chart.
Context
The following products implement this profile:
- ArcGIS Maps SDK for JavaScript
- ArcGIS Pro
- ArcGIS Enterprise
- ArcGIS Online
- ArcGIS Maps SDKs for Native Apps
Spatial reference
The spatial reference of the map in which the expression executes determines the execution context's spatial reference.
Time zone
The time zone of the map in which the expression executes determines the execution context's default time zone.
Profile variables
Variable Name | Type | Description | Since version |
---|---|---|---|
$feature | Feature | Provides access to the attributes and geometry of the feature whose popup is to be displayed in the view. | 1.1 |
$layer | FeatureSet | A collection of features in the same layer as the $feature whose popup is displayed in the view. | 1.1 |
$map | FeatureSetCollection | A collection of layers in the same map as the $feature whose popup is displayed in the view. This value may be null in cases where a popup is not associated with a map. | 1.1 |
$datastore | FeatureSetCollection | A collection of layers in the same feature service or database as the $feature whose popup is displayed in the view. | 1.1 |
$userInput | Geometry | A geometry representing a user's input for a popup. Typically, this represents a location where the user clicked or tapped in a map to launch a popup. There may be cases where this value is a Point, an Extent, or null as popups are not always opened from map interaction. Therefore, it is advised to check the geometry type of this value before it is used. | 1.26 |
$graph | KnowledgeGraph | A knowledge graph associated with the feature. If no knowledge graph is available, the value will be null . | 1.26 |
$view | Dictionary | The properties available from the view, as defined in the table below. Only supported in 2D MapViews. | 1.30 |
Properties of $view
:
Variable Name | Type | Description |
---|---|---|
scale | Number | The scale of the map at the time the expression evaluates. |
timeProperties.currentStart | Date | The start time of the map's time extent as indicated by a time slider component at the time the expression evaluates. This value dynamically updates (and may trigger the re-execution of the Arcade expression) when a time slider is used to update time-aware popups based on date field. A null value indicates the start time is inclusive since the beginning of time. |
timeProperties.currentEnd | Date | The end time of the map's time extent as indicated by a time slider component at the time the expression evaluates. This value dynamically updates (and may trigger the re-execution of the Arcade expression) when a time slider is used to update time-aware popups based on date field. A null value indicates the end time is indefinite with no end. |
timeProperties.startIncluded | Boolean | Indicates if the current date is included in the map's current time extent. |
timeProperties.endIncluded | Boolean | Indicates if the current date is included in the map's current time extent. |
Function bundles
Core | Geometry | Data Access | Portal Access | Knowledge Graph
Return types
Example
Calculates the percentage of the population that participates in the labor force.
var laborForcePercentage = ( $feature.CIVLBFR_CY / $feature.POP_16UP ) * 100;
Round(laborForcePercentage, 2)