LabelingInfo Class

  • LabelingInfo
  • class Esri::ArcGISRuntime::LabelingInfo

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

    Header: #include <LabelingInfo.h>
    Since: Esri::ArcGISRuntime 100.0

    Public Functions

    LabelingInfo()
    LabelingInfo(const Esri::ArcGISRuntime::LabelingInfo &other)
    LabelingInfo(Esri::ArcGISRuntime::LabelingInfo &&other)
    ~LabelingInfo()
    bool isEmpty() const
    bool isUseCodedValues() const
    QString labelExpression() const
    Esri::ArcGISRuntime::LabelingPlacement labelPlacement() const
    double maxScale() const
    double minScale() const
    Esri::ArcGISRuntime::TextSymbol *symbol(QObject *parent = nullptr) const
    QString where() const
    Esri::ArcGISRuntime::LabelingInfo &operator=(const Esri::ArcGISRuntime::LabelingInfo &other)
    Esri::ArcGISRuntime::LabelingInfo &operator=(Esri::ArcGISRuntime::LabelingInfo &&other)

    Detailed Description

    A LabelingInfo describes a class of labels.

    Each LabelingInfo specifies:

    • Which features are covered by the definition, by applying the where SQL constraint
    • What text should be displayed, based on the individual feature's attributes and the labelExpression formula
    • How the text should appear, using the symbol
    • Where the text should appear, with respect to its feature, using the labelPlacement

    LabelingInfo describes a very limited subset of the LabelDefinition properties.

    Member Function Documentation

    LabelingInfo::LabelingInfo()

    Default constructor. Creates an empty LabelingInfo.

    LabelingInfo::LabelingInfo(const Esri::ArcGISRuntime::LabelingInfo &other)

    Copy constructor from other LabelingInfo.

    LabelingInfo::LabelingInfo(Esri::ArcGISRuntime::LabelingInfo &&other)

    Move constructor from other LabelingInfo.

    LabelingInfo::~LabelingInfo()

    Destructor.

    bool LabelingInfo::isEmpty() const

    Returns true if this LabelingInfo is empty.

    bool LabelingInfo::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 values set up for the attribute fields.

    The default value is false i.e. no translation will be done.

    QString LabelingInfo::labelExpression() const

    Returns simple expression describing how to build the text label for a feature, often using attributes of the feature.

    The default is an empty expression and no labels will be produced.

    The Simple expression format is described at https://developers.arcgis.com/documentation/common-data-types/labeling-objects.htm e.g., ""Addr: " CONCAT [Name] CONCAT " Street"" (the outer quotes are not part of the expression, but quotes are needed around the literal text).

    Esri::ArcGISRuntime::LabelingPlacement LabelingInfo::labelPlacement() const

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

    The default depends on the type of feature geometry:

    double LabelingInfo::maxScale() const

    Returns labels will only be visible when the viewing scale is smaller than (or equal to) the maxScale.

    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.

    double LabelingInfo::minScale() const

    Returns 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.

    Esri::ArcGISRuntime::TextSymbol *LabelingInfo::symbol(QObject *parent = nullptr) const

    Returns the text symbol which describes the overall appearance of label text (e.g. font and size).

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

    Note, parent is optional. If no parent is specified then the source from which this LabelingInfo comes from (ArcGISFeatureLayerInfo) takes ownership of the returned symbol.

    QString LabelingInfo::where() const

    Returns limit the set of features for which labels will be generated and placed.

    This is a SQL expression 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 "".

    Esri::ArcGISRuntime::LabelingInfo &LabelingInfo::operator=(const Esri::ArcGISRuntime::LabelingInfo &other)

    Assignment operator from other LabelingInfo.

    Esri::ArcGISRuntime::LabelingInfo &LabelingInfo::operator=(Esri::ArcGISRuntime::LabelingInfo &&other)

    Move operator from other LabelingInfo.

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