Class ArcadeLabelExpression

java.lang.Object
com.esri.arcgisruntime.mapping.labeling.LabelExpression
com.esri.arcgisruntime.mapping.labeling.ArcadeLabelExpression

public final class ArcadeLabelExpression extends LabelExpression
An expression script using the Arcade language.

The Arcade label expression must contain a syntactically correct Arcade script expression.

 "State: " + $feature.State_Name
 

Note that quotes are needed around the literal text. See ArcGIS Arcade for full documentation on the Arcade scripting language and its function library.

Any Arcade functions allowed for the Labeling profile can be used in a label arcade expression. Other functions (for example, FeatureSet functions) are potentially too slow to be used in a dynamic label evaluation.

Warning: If the expression attempts to use attributes which don't exist then no label will be produced. This is distinct from the attribute existing but having a null or empty value, which can form part of the produced text label.

Since:
100.11.0
  • Constructor Details

    • ArcadeLabelExpression

      public ArcadeLabelExpression()
      Creates a label arcade expression with an empty expression script.

      An empty script is a valid Arcade expression that will evaluate to an empty string.

      Since:
      100.11.0
    • ArcadeLabelExpression

      public ArcadeLabelExpression(ArcadeExpression arcadeExpression)
      Creates a label arcade expression object using the ArcadeExpression.getExpression() method.

      Warning: Only the ArcadeExpression.getExpression() is used to construct the ArcadeLabelExpression. The other ArcadeExpression metadata properties are not used or stored.

      Parameters:
      arcadeExpression - An ArcadeExpression containing the Arcade expression string to use. The expression is expected to be a complete, self-contained Arcade expression that calculates a text string.
      Throws:
      IllegalArgumentException - if arcadeExpression is null
      Since:
      100.11.0
    • ArcadeLabelExpression

      public ArcadeLabelExpression(String arcadeString)
      Creates a label arcade expression object with a specified Arcade expression script string. The expression is expected to be a complete, self-contained Arcade expression that calculates a text string.
      Parameters:
      arcadeString - The Arcade expression script string. The expression is expected to be a complete, self-contained Arcade expression that calculates a text string.
      Throws:
      IllegalArgumentException - if arcadeString is null
      Since:
      100.11.0