import { getExpressionsFromLayer } from "@arcgis/core/layers/support/arcadeUtils.js";const { getExpressionsFromLayer } = await $arcgis.import("@arcgis/core/layers/support/arcadeUtils.js");- Since
- ArcGIS Maps SDK for JavaScript 4.25
Contains convenience methods for getting Arcade expressions defined on a layer.
Functions
getExpressionsFromLayer
Returns all Arcade expressions defined on a given layer and provides metadata describing the context for which each expression was authored.
Known Limitations
Expressions set in the following places will not be returned from this method.
- Signature
-
getExpressionsFromLayer (layer: LayerWithExpression): ExpressionInfo[]
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| layer | The layer from which to get all Arcade expressions. | |
- Returns
- ExpressionInfo[]
Resolves to an array of objects containing all the Arcade expressions defined on the input layer along with metadata describing the context in which each expression was defined.
Type definitions
ExpressionInfo
Represents the result of the getExpressionsFromLayer() method. Contains an Arcade expression, along with metadata about the context in which the expression was defined.
profileInfo
- Type
- ProfileInfo
Information about the profile, or environment, where the expression was defined.
ProfileInfo
context
- Type
- ProfileContext
Describes the context (i.e. the API class) where the expression was defined.
source
- Type
- "layer" | "feature-reduction" | undefined
Indicates the data source used to hydrate the expression's profile variables.
returnType
- Type
- ProfileReturnType | undefined
The return type of the expression. This is typically set in popup expressions for formatting purposes.
ProfileContext
Describes the context for which an Arcade expression was defined.
- Type
- VisualizationProfileContext | PopupProfileContext | FeatureZProfileContext | "label-class" | "form-template" | "aggregate-field"
VisualizationProfileContext
Describes the context for which an Arcade expression was defined using the visualization profile.
- Type
- "unique-value-renderer" | "class-breaks-renderer" | "dot-density-renderer" | "heatmap-renderer" | "pie-chart-renderer" | "color-variable" | "size-variable" | "opacity-variable" | "rotation-variable"