An expression script using the Arcade language. More...
Header: | #include <ArcadeLabelExpression.h> |
Since: | Esri::ArcGISRuntime 100.11 |
Inherits: | Esri::ArcGISRuntime::LabelExpression |
Public Functions
ArcadeLabelExpression(QObject *parent = nullptr) | |
ArcadeLabelExpression(Esri::ArcGISRuntime::ArcadeExpression *arcadeExpression, QObject *parent = nullptr) | |
ArcadeLabelExpression(const QString &arcadeString, QObject *parent = nullptr) | |
virtual | ~ArcadeLabelExpression() override |
Esri::ArcGISRuntime::ArcadeExpression * | arcadeExpression() const |
void | setArcadeExpression(Esri::ArcGISRuntime::ArcadeExpression *arcadeExpression) |
Detailed Description
The Arcade label expression property must contain a syntactically correct Arcade script expression. An example expression that combines text with a field value is:
"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.
Note: If the expression attempts to use attributes that 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.
Relevant samples:
- Show labels on layer in 3D: This sample demonstrates how to display custom labels in a 3D scene.
- Show labels on layers: Display custom labels on a feature layer.
Member Function Documentation
[explicit]
ArcadeLabelExpression::ArcadeLabelExpression (QObject *parent = nullptr)
Creates a label arcade expression with an empty expression script.
- parent - The optional parent QObject.
An empty script is a valid Arcade expression that will evaluate to an empty string.
[explicit]
ArcadeLabelExpression::ArcadeLabelExpression (Esri::ArcGISRuntime::ArcadeExpression *arcadeExpression , QObject *parent = nullptr)
Creates a label arcade expression object using the ArcadeExpression::expression.
The expression is expected to be a complete, self-contained Arcade script that calculates a text string.
- arcadeExpression - A complete, self-contained ArcadeExpression that calculates a text string.
- parent - The optional parent QObject.
[explicit]
ArcadeLabelExpression::ArcadeLabelExpression (const QString &arcadeString , QObject *parent = nullptr)
Creates a label arcade expression object with a specified Arcade expression script.
- arcadeString - A complete, self-contained Arcade expression that calculates a text string.
- parent - The optional parent QObject.
The expression is expected to be a complete, self-contained Arcade expression.
[override virtual]
ArcadeLabelExpression::~ArcadeLabelExpression ()
Destructor.
Esri::ArcGISRuntime::ArcadeExpression *ArcadeLabelExpression::arcadeExpression () const
Returns an ArcadeExpression containing the Arcade expression script to use.
The expression is expected to be a complete, self-contained Arcade script that calculates a text string.
The ArcadeExpression::expression property of arcadeExpression is the same script string as LabelExpression::expression. Changing one will change the other.
See also setArcadeExpression().
void ArcadeLabelExpression::setArcadeExpression (Esri::ArcGISRuntime::ArcadeExpression *arcadeExpression )
Sets the arcadeExpression to arcadeExpression.
See also arcadeExpression.