Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Object: esri/support/expressionUtils

require(["esri/support/expressionUtils"], function(expressionUtils) { /* code goes here */ });

Description

(Added at v3.23)
A utility module that allows you to enable geometry operations referenced inside Arcade expressions. When a FeatureLayer is already loaded and geometry functions are referenced in new expressions, then geometry operations must be enabled using this utility. Apps that load FeatureLayers already using geometry operations within Arcade expressions in the renderer, infoTemplate, or labelingInfo will automatically load all geometry operations at runtime. Therefore, this utility is not needed in those situations.

Samples

Search for samples that use this class.

Methods

NameReturn typeSummary
enableGeometryOperations()PromiseLoads all geometry operations for use in any Arcade expression within the given application.
hasGeometryOperations(expression)BooleanIndicates if the given Arcade expression contains one or more geometry operations.
Method Details

enableGeometryOperations()

Loads all geometry operations for use in any Arcade expression within the given application.
Return type: Promise
Sample:

expressionUtils.enableGeometryOperations().then(function(){
  renderer.valueExpression = "$feature.POPULATION / Area(Geometry($feature), 'square-miles')";
  renderer.valueExpressionTitle = "Population per square mile";
  layer.setRenderer(renderer);
});

hasGeometryOperations(expression)

Indicates if the given Arcade expression contains one or more geometry operations.
Return type: Boolean
Parameters:
<String> expression Required The Arcade expression to evaluate for the presence of one or more geometry operations.
Sample:

var arcadeExpression = "$feature.POPULATION / Area(Geometry($feature), 'square-miles')";
if(expressionUtils.hasGeometryOperations(arcadeExpression)){
  expressionUtils.enableGeometryOperations().then(function(){
    renderer.valueExpression = arcadeExpression;
    renderer.valueExpressionTitle = "Population per square mile";
    layer.setRenderer(renderer);
  });
}
Show Modal