A unique value definition for use with a unique value renderer. More...
Header | #include <Unique |
Since | Esri |
Inherits | Esri |
Public Functions
Unique | |
Unique | |
(since Esri | Unique |
virtual | ~ |
(since Esri Esri | alternate |
Esri | clone( |
Q | description() const |
Q | label() const |
void | set |
void | set |
void | set |
void | set |
Esri | symbol() const |
Q | values() const |
(since Esri bool | operator!=(const Esri |
bool | operator==(const Esri |
Reimplemented Public Functions
virtual Q | to |
(deprecated) virtual Q | unknown |
(deprecated) virtual Q | unsupported |
Static Public Members
Esri | from |
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.
Relevant samples:
- Apply unique values with alternate symbols: Apply a unique value with alternate symbols at different scales.
- Create symbol styles from web styles: Create symbol styles from a style file hosted on a portal.
- Unique value renderer: Render features in a layer using a distinct symbol for each unique attribute value.
See also UniqueValueRenderer.
Member Function Documentation
[explicit]
UniqueValue::UniqueValue (QObject *parent = nullptr)
Creates a new unique value object.
- parent - The optional parent QObject.
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.
[since Esri::ArcGISRuntime 100.13]
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 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.
[override virtual noexcept]
UniqueValue::~UniqueValue ()
Destructor.
[since Esri::ArcGISRuntime 100.13]
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 to label.
See also label.
void UniqueValue::setSymbol (Esri::ArcGISRuntime::Symbol *symbol)
Sets the symbol to symbol.
See also symbol.
void UniqueValue::setValues (const QVariantList &values)
Sets the values to values.
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.
QVariantList UniqueValue::values() const
Returns a QList containing QVariant types that define a unique value or unique combination of values.
See also setValues().
[since Esri::ArcGISRuntime 200.2]
bool UniqueValue::operator!=(const Esri::ArcGISRuntime::UniqueValue *other) const
Inequality operator. Returns true
if this object and other are not equal.
This function was introduced in Esri::ArcGISRuntime 200.2.
See also UniqueValue::operator==.
bool UniqueValue::operator==(const Esri::ArcGISRuntime::UniqueValue *other) const
Tests and returns true
if this object is equal to a second UniqueValue object.
- other - The second unique value to test if equivalent.