Feature reduction popup element

Since version: 1.16

The feature reduction popup element profile allows map authors to write expressions that return a dictionary representing either a rich text, fields table, or media (i.e. a chart or an image) popup element within a popup for a cluster or bin. The returned dictionary must follow the Web Map Specification for a popupElement. When the popup opens, the expression will execute using the aggregate feature's attributes as variables. The app executing the expression will render the popup element as defined by the expression.

Unlike the Feature Reduction Popup profile, this profile allows popup authors to return multiple values within a single element.

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 NameTypeDescriptionSince version
$featureFeatureProvides access to the aggregate fields defined in either clustering or binning popups, such as $feature.cluster_count and any other fields summarized from the points represented by the aggregate (e.g. $feature.cluster_avg_population).1.16
$aggregatedFeaturesFeatureSetA FeatureSet containing all the features represented by the cluster or bin.1.16
$viewDictionaryThe properties available from the view, as defined in the table below. Only supported in 2D MapViews.1.30

Properties of $view:

Variable NameTypeDescription
scaleNumberThe scale of the map at the time the expression evaluates.
timeProperties.currentStartDateThe 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.currentEndDateThe 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.startIncludedBooleanIndicates if the currentStart date is included in the map's current time extent.
timeProperties.endIncludedBooleanIndicates if the currentEnd date is included in the map's current time extent.

Function bundles

Core | Geometry | Data Access | Portal Access

Return types

Dictionary

See the Web Map Specification for popupElement for a list of properties required for constructing a valid popup element dictionary.

Example

Returns a HTML list that describes the number of power plants used to generate power for each fuel type in the cluster.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Expects($aggregatedFeatures, "fuel1")

var statsFS = GroupBy($aggregatedFeatures,
  [
    { name: 'Type', expression: 'fuel1'},
  ],
  [  // statistics to return for each fuel type
    { name: 'num_features', expression: '1', statistic: 'COUNT' }
  ]
);
var ordered = OrderBy(statsFs, 'num_features DESC');

var list = "<ol>";

for (var group in ordered){
  list += `<li>${group.Type} (${Text(group.num_features, "#,###")})</li>`
}
list += "</ol>";

return {
  type: "text",
  text: list
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close