Since version: 1.35
In the imagery popup profile, map authors can write expressions that return values (i.e. attributes) for display in the view's popup for both Imagery Layers and Tiled Imagery Layers. 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 pixel's variables and image metadata to compute the result. The script should return either text or a number, which may be placed in the table cell or text comprising the popup's content.
Context
The following products implement this profile:
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 |
|---|---|---|---|
| $pixel | Pixel | The pixel value and other pixel-dependent information (e.g. classification category), including virtual raster fields, for the imagery layer currently displayed in the view. | 1.35 |
| $imageCollectionItem | Feature | The metadata of the selected image collection item containing the pixel represented by $pixel. This value will be null if there is no associated image collection. | 1.35 |
| $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.35 |
| $view | Dictionary | The properties available from the view, as defined in the table below. Only supported in 2D MapViews. | 1.35 |
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
Return types
Example
Converts the pixel value from Celsius to Fahrenheit.
var c = Number($pixel["Raster.ServicePixelValue"][0]);
var f = (9/5) * c + 32;
return Round(f, 2);