A unique value definition for use with a unique value renderer. More...
Header: | #include <UniqueValue.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::JsonSerializable |
This class was introduced in Esri::ArcGISRuntime 100.0.
Public Functions
UniqueValue(const QString &label, const QString &description, const QVariantList &values, Esri::ArcGISRuntime::Symbol *symbol, const QList<Esri::ArcGISRuntime::Symbol *> &alternateSymbols, QObject *parent = nullptr) | |
UniqueValue(const QString &label, const QString &description, const QVariantList &values, Esri::ArcGISRuntime::Symbol *symbol, QObject *parent = nullptr) | |
UniqueValue(QObject *parent = nullptr) | |
virtual | ~UniqueValue() override |
Esri::ArcGISRuntime::SymbolListModel * | alternateSymbols() const |
Esri::ArcGISRuntime::UniqueValue * | clone(QObject *parent = nullptr) const |
QString | description() const |
QString | label() const |
void | setDescription(const QString &description) |
void | setLabel(const QString &label) |
void | setSymbol(Esri::ArcGISRuntime::Symbol *symbol) |
void | setValues(const QVariantList &values) |
Esri::ArcGISRuntime::Symbol * | symbol() const |
QVariantList | values() const |
bool | operator==(const Esri::ArcGISRuntime::UniqueValue *other) const |
Reimplemented Public Functions
virtual QString | toJson() const override |
virtual QJsonObject | unknownJson() const override |
virtual QJsonObject | unsupportedJson() const override |
Static Public Members
Esri::ArcGISRuntime::UniqueValue * | fromJson(const QString &json, QObject *parent = nullptr) |
Detailed Description
A unique value corresponds to a specific value for an attribute field. A list of unique value instances are maintained in the UniqueValueListModel. When the unique value renderer is used to display a layer, the symbol used for a feature is determined by the value in a selected attribute. When the value matches the unique value, the corresponding symbol and label display.
Unique values contain a value and description, as well as the label and symbol to display for features that contain attribute values that match the unique value.
See also UniqueValueRenderer.
Member Function Documentation
UniqueValue::UniqueValue (const QString &label, const QString &description, const QVariantList &values, Esri::ArcGISRuntime::Symbol *symbol, const QList<Esri::ArcGISRuntime::Symbol *> &alternateSymbols , QObject *parent = nullptr)
Creates a new unique value (or unique combination of values) object with alternate symbols.
- label - A label for the unique value. "Residential", for example.
- description - A description of the unique value. "Parcels zoned for residential use", for example.
- values - A QList containing QVariant types that define a unique value or unique combination of values.
- symbol - A symbol used to represent elements with this unique value.
- alternateSymbols - The alternate symbols for the unique value. Only MultilayerSymbol are supported as alternates.
- parent - The optional parent QObject.
A unique value can have alternate symbols to the primary symbol. Alternate symbols allow you to tailor the visualization of unique value at different scales by selecting different symbol for different scales. Alternate symbols are supported only when unique value's primary symbol and other symbols in the alternate symbol list are of type MultilayerSymbol and have SymbolReferenceProperties defining valid min and max scales at which the symbol becomes visible. A renderer will pick only one symbol at a given map scale. If a primary symbol's scale range falls within the map's scale, the primary symbol is used. If not, then symbols in the alternate symbols list are iterated through and the first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to the symbol's minimum scale and greater than the symbol's maximum scale. For more information on scale-based symbol classes and alternate symbols, see the following documentation: https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/scale-based-symbol-classes.htm.
This function was introduced in Esri::ArcGISRuntime 100.13.
UniqueValue::UniqueValue (const QString &label, const QString &description, const QVariantList &values, Esri::ArcGISRuntime::Symbol *symbol, QObject *parent = nullptr)
Constructor that takes a label, description, list of values, and symbol, with an optional parent.
UniqueValue::UniqueValue (QObject *parent = nullptr)
Default constructor with an optional parent.
[override virtual]
UniqueValue::~UniqueValue ()
Destructor.
Esri::ArcGISRuntime::SymbolListModel *UniqueValue::alternateSymbols () const
Returns the alternate symbols for the unique value's primary symbol.
Symbols in this list should be of type MultilayerSymbol and must have SymbolReferenceProperties set with valid minimum and maximum scale at which symbol becomes visible. A renderer will pick only one symbol at a given map scale. If a primary symbol's scale range falls within the map's scale, the primary symbol is used. If not, then symbols in the alternate symbols list are iterated through and the first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to the symbol's minimum scale and greater than symbol's maximum scale.
This function was introduced in Esri::ArcGISRuntime 100.13.
Esri::ArcGISRuntime::UniqueValue *UniqueValue::clone(QObject *parent = nullptr) const
Clones the unique value to a new instance with an optional parent.
Returns a new instance of the unique value.
QString UniqueValue::description() const
Returns the description of the unique value.
"Parcels zoned for residential use", for example.
See also setDescription().
[static]
Esri::ArcGISRuntime::UniqueValue *UniqueValue::fromJson (const QString &json, QObject *parent = nullptr)
Creates and returns a new unique value from the provided json, with an optional parent.
See also JsonSerializable.
QString UniqueValue::label() const
Returns the label for the unique value.
"Residential", for example.
See also setLabel().
void UniqueValue::setDescription (const QString &description)
Sets the description of the unique value.
"Parcels zoned for residential use", for example.
See also description().
void UniqueValue::setLabel (const QString &label)
Sets the label for the unique value.
"Residential", for example.
See also label().
void UniqueValue::setSymbol (Esri::ArcGISRuntime::Symbol *symbol)
Sets the symbol used to represent elements with this unique value.
See also symbol().
void UniqueValue::setValues (const QVariantList &values)
Sets the attribute value or list of values that comprise this unique value.
See also values().
Esri::ArcGISRuntime::Symbol *UniqueValue::symbol() const
Returns the symbol used to represent elements with this unique value.
See also setSymbol().
[override virtual]
QString UniqueValue::toJson () const
Reimplements: JsonSerializable::toJson() const.
Returns this unique value as a JSON representation.
See also JsonSerializable.
[override virtual]
QJsonObject UniqueValue::unknownJson () const
Reimplements: JsonSerializable::unknownJson() const.
Gets the unknown JSON of this object.
See also JsonSerializable.
[override virtual]
QJsonObject UniqueValue::unsupportedJson () const
Reimplements: JsonSerializable::unsupportedJson() const.
Gets the unsupported JSON of this object.
See also JsonSerializable.
QVariantList UniqueValue::values() const
Returns the attribute value or list of values that comprise this unique value.
See also setValues().
bool UniqueValue::operator==(const Esri::ArcGISRuntime::UniqueValue *other) const
Equivalency operator
Returns true
if this object and other are equal.