LabelDefinition Class

  • LabelDefinition
  • class Esri::ArcGISRuntime::LabelDefinition

    An object that defines the text, appearance, and position of labels for features within a given scale range. More...

    Header: #include <LabelDefinition.h>
    Since: Esri::ArcGISRuntime 100.1
    Inherits: Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::JsonSerializable

    This class was introduced in Esri::ArcGISRuntime 100.1.

    Public Functions

    LabelDefinition(Esri::ArcGISRuntime::LabelExpression *labelExpression, Esri::ArcGISRuntime::TextSymbol *textSymbol, QObject *parent = nullptr)
    virtual ~LabelDefinition() override
    Esri::ArcGISRuntime::LabelAngle *angle() const
    Esri::ArcGISRuntime::LabelDeconflictionStrategy deconflictionStrategy() const
    Esri::ArcGISRuntime::LabelExpression *expression() const
    Esri::ArcGISRuntime::LabelOverlapStrategy featureBoundaryOverlapStrategy() const
    Esri::ArcGISRuntime::LabelOverlapStrategy featureInteriorOverlapStrategy() const
    bool isUseCodedValues() const
    Esri::ArcGISRuntime::LabelOverlapStrategy labelOverlapStrategy() const
    Esri::ArcGISRuntime::LabelLineConnection lineConnection() const
    double maxScale() const
    double minScale() const
    Esri::ArcGISRuntime::LabelMultipartStrategy multipartStrategy() const
    QString name() const
    double offsetDistance() const
    Esri::ArcGISRuntime::LabelOverrunStrategy overrunStrategy() const
    Esri::ArcGISRuntime::LabelingPlacement placement() const
    double priority() const
    double removeDuplicatesDistance() const
    Esri::ArcGISRuntime::LabelRemoveDuplicatesStrategy removeDuplicatesStrategy() const
    double repeatDistance() const
    Esri::ArcGISRuntime::LabelRepeatStrategy repeatStrategy() const
    void setAngle(Esri::ArcGISRuntime::LabelAngle *angle)
    void setDeconflictionStrategy(Esri::ArcGISRuntime::LabelDeconflictionStrategy deconflictionStrategy)
    void setExpression(Esri::ArcGISRuntime::LabelExpression *expression)
    void setFeatureBoundaryOverlapStrategy(Esri::ArcGISRuntime::LabelOverlapStrategy featureBoundaryOverlapStrategy)
    void setFeatureInteriorOverlapStrategy(Esri::ArcGISRuntime::LabelOverlapStrategy featureInteriorOverlapStrategy)
    void setLabelOverlapStrategy(Esri::ArcGISRuntime::LabelOverlapStrategy labelOverlapStrategy)
    void setLineConnection(Esri::ArcGISRuntime::LabelLineConnection lineConnection)
    void setMaxScale(double maxScale)
    void setMinScale(double minScale)
    void setMultipartStrategy(Esri::ArcGISRuntime::LabelMultipartStrategy multipartStrategy)
    void setName(const QString &name)
    void setOffsetDistance(double offsetDistance)
    void setOverrunStrategy(Esri::ArcGISRuntime::LabelOverrunStrategy overrunStrategy)
    void setPlacement(Esri::ArcGISRuntime::LabelingPlacement placement)
    void setPriority(double priority)
    void setRemoveDuplicatesDistance(double removeDuplicatesDistance)
    void setRemoveDuplicatesStrategy(Esri::ArcGISRuntime::LabelRemoveDuplicatesStrategy removeDuplicatesStrategy)
    void setRepeatDistance(double repeatDistance)
    void setRepeatStrategy(Esri::ArcGISRuntime::LabelRepeatStrategy repeatStrategy)
    void setStackAlignment(Esri::ArcGISRuntime::LabelStackAlignment stackAlignment)
    void setStackBreakPosition(Esri::ArcGISRuntime::LabelStackBreakPosition stackBreakPosition)
    void setStackRowLength(double stackRowLength)
    void setStackStrategy(Esri::ArcGISRuntime::LabelStackStrategy stackStrategy)
    void setTextLayout(Esri::ArcGISRuntime::LabelTextLayout textLayout)
    void setTextOrientation(Esri::ArcGISRuntime::LabelTextOrientation textOrientation)
    void setTextSymbol(Esri::ArcGISRuntime::TextSymbol *textSymbol)
    void setUseCodedValues(bool useCodedValues)
    void setWhereClause(const QString &whereClause)
    Esri::ArcGISRuntime::LabelStackAlignment stackAlignment() const
    Esri::ArcGISRuntime::LabelStackBreakPosition stackBreakPosition() const
    double stackRowLength() const
    Esri::ArcGISRuntime::LabelStackSeparatorListModel *stackSeparators() const
    Esri::ArcGISRuntime::LabelStackStrategy stackStrategy() const
    Esri::ArcGISRuntime::LabelTextLayout textLayout() const
    Esri::ArcGISRuntime::LabelTextOrientation textOrientation() const
    Esri::ArcGISRuntime::TextSymbol *textSymbol() const
    QString whereClause() const

    Reimplemented Public Functions

    virtual QString toJson() const override
    virtual QJsonObject unknownJson() const override
    virtual QJsonObject unsupportedJson() const override

    Static Public Members

    Esri::ArcGISRuntime::LabelDefinition *fromJson(const QString &json, QObject *parent = nullptr)

    Detailed Description

    A LabelDefinition describes a class of labels. A collection of label definitions can be attached to a feature data source (example FeatureLayer). Each LabelDefinition specifies:

    • which features are covered by the definition, by applying the whereClause SQL constraint
    • what text should be displayed, based on the individual feature's attributes and the chosen expression formula
    • how the text should appear, using the label definition's TextSymbol
    • where the text should appear, with respect to its feature, using the placement
    • how to move or avoid other labels or features that would overlap each label.

    Member Function Documentation

    LabelDefinition::LabelDefinition(Esri::ArcGISRuntime::LabelExpression *labelExpression, Esri::ArcGISRuntime::TextSymbol *textSymbol, QObject *parent = nullptr)

    Creates a LabelDefinition with the specified LabelExpression and TextSymbol.

    • labelExpression - The expression script used to calculate the label text.
    • textSymbol - The text symbol which describes the overall appearance of label text (e.g., font and size). If no textSymbol has been set, then no labels can be created.
    • parent - The optional parent QObject.

    The expression may be a combination of literal text and attribute values from the feature being labeled. The syntax of the expression is determined by which label expression object is used: ArcadeLabelExpression, SimpleLabelExpression or WebmapLabelExpression.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    [override virtual] LabelDefinition::~LabelDefinition()

    Destructor.

    Esri::ArcGISRuntime::LabelAngle *LabelDefinition::angle() const

    Returns the angular positions and layout directions for labels on or around point feature symbols.

    This optional object specifies how to position a label following the direction of an angle. The angular position may be different for each feature (driven by one or more feature attributes) or constant for all features (specified by a fixed number).

    The placement will still be used to indicate whether offset or centered positioning is required, but the exact position will be overridden by the angle calculated for the feature. After the position has been determined, textLayout and textOrientation are used to specify the layout of the text at that position.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setAngle().

    Esri::ArcGISRuntime::LabelDeconflictionStrategy LabelDefinition::deconflictionStrategy() const

    Returns the strategy for moving labels to avoid overlapping feature, annotation, dimension, or graphic symbols or higher priority labels.

    The default is LabelDeconflictionStrategy::Automatic (which will be interpreted as LabelDeconflictionStrategy::Static, meaning, use preferred location unless it overlaps an obstacle). In 3D LabelDeconflictionStrategy::Static is also selected by default.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setDeconflictionStrategy().

    Esri::ArcGISRuntime::LabelExpression *LabelDefinition::expression() const

    Returns the expression script used to calculate the label text.

    The expression may be a combination of literal text and attribute values from the feature being labeled. The syntax of the expression is determined by which label expression object is used: ArcadeLabelExpression, SimpleLabelExpression, or WebmapLabelExpression.

    A label expression using one scripting language can be replaced by an expression using a different scripting language just by creating an object of the new LabelExpression subclass and assigning it to expression.

    The default value is an empty ArcadeLabelExpression, which will evaluate to an empty text label.

    The expression needs to create a text string that will be used as the label text. The text string can be any legal UTF16 characters and can also include HTML-style formatting tags, for example:

    "Hello <BOL>World</BOL>"

    where the angle-bracketed tags will not appear in the label, but may change the presentation of the text. In the example, the "World" will appear in bold.

    The available tags are:

    • <BOL></BOL> for bold text
    • <UND></UND> for underlined text
    • <ITA></ITA> for italic text
    • <CLR red='256'></CLR> for colored text
    • <FNT name='Arial' size='18'></FNT> for text using a different size or font (if available on client).

    Tags can be upper or lower case, but not a mixture. Tags can be nested e.g. "<ITA>Hello <BOL>World</BOL></ITA>".

    Full documentation of the tag parameters is available at https://pro.arcgis.com/en/pro-app/latest/help/mapping/text/text-formatting-tags.htm.

    Note that not all ArcGIS Pro tags are currently supported in Runtime. The "<CLR>" tag is currently only supported for text in 2D views. Any unsupported tags will be ignored and not written as part of the label text.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setExpression().

    Esri::ArcGISRuntime::LabelOverlapStrategy LabelDefinition::featureBoundaryOverlapStrategy() const

    Returns the strategy for whether other labels are allowed to overlap the boundary of polygon features/graphics being labeled by this LabelDefinition.

    In 3D scenes, labels will be allowed to overlap the boundaries of polygon features.

    The default is LabelOverlapStrategy::Automatic, which will give the same behavior as LabelOverlapStrategy::Allow.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setFeatureBoundaryOverlapStrategy().

    Esri::ArcGISRuntime::LabelOverlapStrategy LabelDefinition::featureInteriorOverlapStrategy() const

    Returns the strategy for whether other labels are allowed to overlap the interior of polygon features being labeled by this LabelDefinition.

    In 3D scenes, labels will be allowed to overlap the boundaries of polygon features.

    The default is LabelOverlapStrategy::Automatic which will give the same behavior as LabelOverlapStrategy::Allow.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setFeatureInteriorOverlapStrategy().

    [static] Esri::ArcGISRuntime::LabelDefinition *LabelDefinition::fromJson(const QString &json, QObject *parent = nullptr)

    Creates this LabelDefinition from its JSON representation.

    Returns a LabelDefinition created using the data in the json parameter and an optional parent.

    See also JsonSerializable.

    bool LabelDefinition::isUseCodedValues() const

    Returns whether the data source should translate domain identifiers into meanings using a CodedValueDomain.

    For any translation to occur, the data source must have one or more CodedValueDomain s set up for the attribute fields. The default value is true, i.e., translation will be done.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    Esri::ArcGISRuntime::LabelOverlapStrategy LabelDefinition::labelOverlapStrategy() const

    Returns the strategy for whether other labels are allowed to overlap labels created by this LabelDefinition.

    In 3D, labels will not be allowed to overlap other labels. Overlapping labels will not be displayed until the user zooms in further so that the labels don't overlap.

    The default is LabelOverlapStrategy::Automatic, which will give the same behavior as LabelOverlapStrategy::Exclude.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setLabelOverlapStrategy().

    Esri::ArcGISRuntime::LabelLineConnection LabelDefinition::lineConnection() const

    Returns the strategy for whether line features with the same label, and matching end vertices, should be joined before sharing a label. 3D line features will be treated as independent features with their own label.

    The default is LabelLineConnection::Automatic, which will be interpreted as LabelLineConnection::MinimizeLabels.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setLineConnection().

    double LabelDefinition::maxScale() const

    Returns the maximum scale at which labels will be visible.

    Labels will only be visible when the viewing scale is smaller than (or equal to) the maxScale. In 3D scenes,the scale range is between individual label and view plane instead of map and view plane.

    For example, if the viewing scale is 1:12000 and the maxScale is 1:10000, then the labels will be visible (because 1/12000 <= 1/10000).

    A maxScale of 0, which is the default, indicates no upper limit on the viewing scale.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setMaxScale().

    double LabelDefinition::minScale() const

    Returns the minimum scale at which labels will be visible.

    In 3D scenes, the scale range is between individual label and view plane instead of map and view plane. Labels will only be visible when the viewing scale is larger than (or equal to) the minScale.

    For example, if the viewing scale is 1:12000 and the minScale is 1:20000, then the labels will be visible (because 1/12000 >= 1/20000). A minScale of 0, which is the default, indicates no lower limit on the viewing scale.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setMinScale().

    Esri::ArcGISRuntime::LabelMultipartStrategy LabelDefinition::multipartStrategy() const

    Returns the strategy for how many labels should be placed on each polyline or polygon (multi-ring) feature.

    The default is LabelMultipartStrategy::Automatic.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setMultipartStrategy().

    QString LabelDefinition::name() const

    Returns text name for the class of labels.

    This name is assigned by the map author to clarify the purpose of this label definition. It is used for display or debugging purposes. If no name is explicitly assigned, then an empty text string is stored.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setName().

    double LabelDefinition::offsetDistance() const

    Returns the distance in points (1/72 inches) that text should be moved away from its features.

    The distance is measured from the point symbol radius or line feature symbology edge. The distance is measured on the screen (i.e., not in the map) in points, comparable to the text font size.

    This can be a negative value, to pull the label closer to the feature if, for example, the average size for a point symbol is overly conservative for the actual graphic shown.

    If no value is set, then 1 point is assumed.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setOffsetDistance().

    Esri::ArcGISRuntime::LabelOverrunStrategy LabelDefinition::overrunStrategy() const

    Returns the strategy for whether a label will be visible at scales where the feature is too small for the label to fit.

    The default is LabelOverrunStrategy::Automatic, which will give different behavior depending on the type of feature that the label might overrun.

    Not supported by 3D scenes.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setOverrunStrategy().

    Esri::ArcGISRuntime::LabelingPlacement LabelDefinition::placement() const

    Returns the preferred position of the text label, with respect to its feature geometry.

    The default is LabelingPlacement::Automatic. The effect of this is the same as one of the following, depending on the type of feature geometry:

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setPlacement().

    double LabelDefinition::priority() const

    Returns which labels are placed first, and can also supplant existing lower-priority labels (e.g., during panning).

    Lower values indicate more important labels; higher values indicate lower priority, i.e.:

    • 0 is the most important
    • 5 is high priority
    • 15 is medium priority

    If set to -1 or not set at all, then default values are used, depending on the geometry types of the features:

    • 12 for point features
    • 15 for line features
    • 18 for polygon features

    This value does not have to be an integer because it is just a continuum of values for comparison. Users can use this to specify that a class of labels should have priority between two other classes with close priorities.

    For example, PreferredRoutes might be given priority 13 to appear ahead of general line feature labels, but after general point feature labels. And HistoricSites might be given priority 12.5 to appear ahead of PreferredRoute labels, but still after general point feature labels.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setPriority().

    double LabelDefinition::removeDuplicatesDistance() const

    Returns a value that controls the duplicate thinning radius in points (1/72 inches).

    The distance is measured on the screen (i.e., not in the map) in points, comparable to the text font size. This value is only used if removeDuplicatesStrategy is enabled. The default value is 0. This indicates that duplicates should be removed from the entire extent.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setRemoveDuplicatesDistance().

    Esri::ArcGISRuntime::LabelRemoveDuplicatesStrategy LabelDefinition::removeDuplicatesStrategy() const

    Returns the strategy for whether labels are removed if other features have the same text label. This can reduce clutter and free up space.

    The default is LabelRemoveDuplicatesStrategy::Automatic, which will be interpreted as LabelRemoveDuplicatesStrategy::None indicating that all labels should be shown if possible.

    The distance within which to look for duplicates is controlled by removeDuplicatesDistance.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setRemoveDuplicatesStrategy().

    double LabelDefinition::repeatDistance() const

    Returns the distance apart in points (1/72 inches) that the repetitions should be.

    This value is only used if repeatStrategy is enabled. The distance is measured on the screen along the line feature. As the user zooms in closer, two repetitions move further apart on the screen, until there is room for a new repetition between them. The default is 216 points, i.e., line labels should be repeated approximately every 3 inches along long features.

    The distance is considered a guide for the approximate label separation and should not be used for precise distance markings.

    A distance of 0 disables label repetition.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setRepeatDistance().

    Esri::ArcGISRuntime::LabelRepeatStrategy LabelDefinition::repeatStrategy() const

    Returns the strategy for whether a label should have multiple copies created and placed along or across the same feature.

    The default is LabelRepeatStrategy::Automatic.

    The frequency of repetition is controlled by the repeatDistance property. In 3D scenes, only one label will be placed per line feature.

    This property is currently only supported for line features, but will be extended to polygons in the future.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setRepeatStrategy().

    void LabelDefinition::setAngle(Esri::ArcGISRuntime::LabelAngle *angle)

    Sets the angle to angle.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also angle.

    void LabelDefinition::setDeconflictionStrategy(Esri::ArcGISRuntime::LabelDeconflictionStrategy deconflictionStrategy)

    Sets the deconflictionStrategy to deconflictionStrategy.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also deconflictionStrategy.

    void LabelDefinition::setExpression(Esri::ArcGISRuntime::LabelExpression *expression)

    Sets the expression to expression.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also expression.

    void LabelDefinition::setFeatureBoundaryOverlapStrategy(Esri::ArcGISRuntime::LabelOverlapStrategy featureBoundaryOverlapStrategy)

    Sets the featureBoundaryOverlapStrategy to featureBoundaryOverlapStrategy.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also featureBoundaryOverlapStrategy.

    void LabelDefinition::setFeatureInteriorOverlapStrategy(Esri::ArcGISRuntime::LabelOverlapStrategy featureInteriorOverlapStrategy)

    Sets the featureInteriorOverlapStrategy to featureInteriorOverlapStrategy.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also featureInteriorOverlapStrategy.

    void LabelDefinition::setLabelOverlapStrategy(Esri::ArcGISRuntime::LabelOverlapStrategy labelOverlapStrategy)

    Sets the labelOverlapStrategy to labelOverlapStrategy.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also labelOverlapStrategy.

    void LabelDefinition::setLineConnection(Esri::ArcGISRuntime::LabelLineConnection lineConnection)

    Sets the lineConnection to lineConnection.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also lineConnection.

    void LabelDefinition::setMaxScale(double maxScale)

    Sets the maxScale to maxScale.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also maxScale.

    void LabelDefinition::setMinScale(double minScale)

    Sets the minScale to minScale.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also minScale.

    void LabelDefinition::setMultipartStrategy(Esri::ArcGISRuntime::LabelMultipartStrategy multipartStrategy)

    Sets the multipartStrategy to multipartStrategy.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also multipartStrategy.

    void LabelDefinition::setName(const QString &name)

    Sets the name to name.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also name.

    void LabelDefinition::setOffsetDistance(double offsetDistance)

    Sets the offsetDistance to offsetDistance.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also offsetDistance.

    void LabelDefinition::setOverrunStrategy(Esri::ArcGISRuntime::LabelOverrunStrategy overrunStrategy)

    Sets the overrunStrategy to overrunStrategy.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also overrunStrategy.

    void LabelDefinition::setPlacement(Esri::ArcGISRuntime::LabelingPlacement placement)

    Sets the placement to placement.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also placement.

    void LabelDefinition::setPriority(double priority)

    Sets the priority to priority.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also priority.

    void LabelDefinition::setRemoveDuplicatesDistance(double removeDuplicatesDistance)

    Sets the removeDuplicatesDistance to removeDuplicatesDistance.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also removeDuplicatesDistance.

    void LabelDefinition::setRemoveDuplicatesStrategy(Esri::ArcGISRuntime::LabelRemoveDuplicatesStrategy removeDuplicatesStrategy)

    Sets the removeDuplicatesStrategy to removeDuplicatesStrategy.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also removeDuplicatesStrategy.

    void LabelDefinition::setRepeatDistance(double repeatDistance)

    Sets the repeatDistance to repeatDistance.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also repeatDistance.

    void LabelDefinition::setRepeatStrategy(Esri::ArcGISRuntime::LabelRepeatStrategy repeatStrategy)

    Sets the repeatStrategy to repeatStrategy.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also repeatStrategy.

    void LabelDefinition::setStackAlignment(Esri::ArcGISRuntime::LabelStackAlignment stackAlignment)

    Sets the stackAlignment to stackAlignment.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also stackAlignment.

    void LabelDefinition::setStackBreakPosition(Esri::ArcGISRuntime::LabelStackBreakPosition stackBreakPosition)

    Sets the stackBreakPosition to stackBreakPosition.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also stackBreakPosition.

    void LabelDefinition::setStackRowLength(double stackRowLength)

    Sets the stackRowLength to stackRowLength.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also stackRowLength.

    void LabelDefinition::setStackStrategy(Esri::ArcGISRuntime::LabelStackStrategy stackStrategy)

    Sets the stackStrategy to stackStrategy.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also stackStrategy.

    void LabelDefinition::setTextLayout(Esri::ArcGISRuntime::LabelTextLayout textLayout)

    Sets the textLayout to textLayout.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also textLayout.

    void LabelDefinition::setTextOrientation(Esri::ArcGISRuntime::LabelTextOrientation textOrientation)

    Sets the textOrientation to textOrientation.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also textOrientation.

    void LabelDefinition::setTextSymbol(Esri::ArcGISRuntime::TextSymbol *textSymbol)

    Sets the textSymbol to textSymbol.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also textSymbol.

    void LabelDefinition::setUseCodedValues(bool useCodedValues)

    Sets the useCodedValues to useCodedValues.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also isUseCodedValues.

    void LabelDefinition::setWhereClause(const QString &whereClause)

    Sets the whereClause to whereClause.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also whereClause.

    Esri::ArcGISRuntime::LabelStackAlignment LabelDefinition::stackAlignment() const

    Returns the strategy for how multi-row (stacked) text should be aligned.

    A multi-row text label can be horizontally aligned on the left, right or at its center. This preference can be specified by the TextSymbol assigned to the LabelDefinition. By using the stackAlignment property, the user can choose to use the TextSymbol::horizontalAlignment property for all labels, or can choose to have the most aesthetic alignment calculated case-by-case for each label depending on its placement position around its feature. This is particularly useful for labels of dense point features, where labels may move above, below, left or right of their point symbol, in order to fit on the display.

    The default value is LabelStackAlignment::Automatic (which will have the same effect on labels as LabelStackAlignment::TextSymbol).

    This property has no effect if stackStrategy is LabelStackStrategy::None.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setStackAlignment().

    Esri::ArcGISRuntime::LabelStackBreakPosition LabelDefinition::stackBreakPosition() const

    Returns the strategy for whether a row of text should be broken before or after it exceeds the ideal length.

    If stacking is turned on, label placement can insert a line break before or after the word that overruns the maximum number of characters per row. Using the LabelStackBreakPosition::Before option means rows will generally be shorter than the stackRowLength (although will overrun for individual words larger than this count).

    The default is LabelStackBreakPosition::Automatic (which will have the same effect on labels as LabelStackBreakPosition::After).

    This property has no effect if stackStrategy is LabelStackStrategy::None.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setStackBreakPosition().

    double LabelDefinition::stackRowLength() const

    Returns a value that limits the number of characters in a row of stacked text.

    This length guides the decision on when to break long text strings into separate rows. The line break will be inserted between words, not in the middle of a word, so rows may be longer or shorter than the ideal. Depending on stackBreakPosition, the break may be inserted before the breaking word, or after.

    The default value is -1, which means to use a default length determined by ArcGIS Runtime (currently 13 characters but may vary with feature-geometry in the future).

    This property has no effect if stackStrategy is LabelStackStrategy::None.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setStackRowLength().

    Esri::ArcGISRuntime::LabelStackSeparatorListModel *LabelDefinition::stackSeparators() const

    Returns the stack separators that should be used for automatic line breaking of label text.

    Each LabelStackSeparator specifies a code point to be looked for in the text. A code point is often thought of as a single character in the text, but may need several chars in a QString to describe it. So each LabelStackSeparator::separator is a QString intended to describe one code point. For example:

    If it is found, then the LabelStackSeparator also specifies whether:

    • the text should always be broken here
    • the separator code point should remain visible
    • the separator code point should appear at the end of one row, or the beginning of the next.

    Three default separators are provided: a comma, a space, and a hyphen. Custom separators can be added, and default separators can be removed if not required.

    Note that a carriage-return (\n) in the label will always be considered a forced separator.

    This property has no effect if stackStrategy is LabelStackStrategy::None.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    Esri::ArcGISRuntime::LabelStackStrategy LabelDefinition::stackStrategy() const

    Returns the strategy for whether the text should be stacked or wrapped, rather than placed as long trailing labels across the map.

    This property controls whether stacking is allowed, not allowed, or should be calculated automatically based on feature type. The default is LabelStackStrategy::Automatic, meaning that stacking will be enabled for point and polygon features and disabled for line features.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setStackStrategy().

    Esri::ArcGISRuntime::LabelTextLayout LabelDefinition::textLayout() const

    Returns the layout of the text, which can be horizontal, straight, or perpendicular, or follow the line feature.

    Optional specification of whether, once the text is positioned, it should be written:

    • horizontally
    • straight (parallel) to the tangent to the line feature
    • straight in line with the point feature positioning angle
    • perpendicular to the tangent or positioning angle
    • following the geometry of the line feature.

    The default is LabelTextLayout::Automatic, which will be interpreted as:

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setTextLayout().

    Esri::ArcGISRuntime::LabelTextOrientation LabelDefinition::textOrientation() const

    Returns the orientation of the text, which can be either angle direction or screen-oriented.

    Optional specification of whether text should follow the placement angle direction even if it means being rendered upside-down, or whether text should be flipped through 180 degrees to keep it screen-oriented. This setting will take effect whenever the feature geometry determines that the text is angled upside-down, or if the map is rotated within the screen to make the text upside-down (with respect to the screen).

    The default is LabelTextOrientation::Automatic, which is interpreted as LabelTextOrientation::Screen.

    Not supported by 3D scenes.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setTextOrientation().

    Esri::ArcGISRuntime::TextSymbol *LabelDefinition::textSymbol() const

    Returns the text symbol, which describes the overall appearance of label text (for example, font and size).

    If no textSymbol has been set, then no labels can be created. If no textSymbol has been set, then no labels can be created.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setTextSymbol().

    [override virtual] QString LabelDefinition::toJson() const

    Reimplements: JsonSerializable::toJson() const.

    Returns this LabelDefinition instance represented as a JSON String.

    See also JsonSerializable.

    [override virtual] QJsonObject LabelDefinition::unknownJson() const

    Reimplements: JsonSerializable::unknownJson() const.

    Gets the unknown JSON of this object.

    See also JsonSerializable.

    [override virtual] QJsonObject LabelDefinition::unsupportedJson() const

    Reimplements: JsonSerializable::unsupportedJson() const.

    Gets the unsupported JSON of this object.

    See also JsonSerializable.

    QString LabelDefinition::whereClause() const

    Returns an SQL where clause expression that limits the set of features for which labels will be generated and placed.

    This is an SQL where clause that can refer to the attributes of the feature e.g.:

    • "" (no limitations)
    • "NAME LIKE 'A%'" (Only label features with NAME attribute values starting with 'A')
    • "(LENGTH > CAPACITY) and (TYPE = 1)" (Only label features whose attributes satisfy the SQL condition).

    The default value is "" - which will allow all features in the data source and extent to be labeled.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setWhereClause().

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