A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-uniquevaluerenderer.html below:

UniqueValueRenderer Class | ArcGIS Maps SDK for Qt

UniqueValueRenderer Class
  • UniqueValueRenderer
  • class Esri::ArcGISRuntime::UniqueValueRenderer

    A unique value renderer symbolizes geoelements with a distinct symbol for each unique data value in an attribute. More...

    Public Functions Detailed Description

    A unique value renderer contains a collection of uniqueValues. Each UniqueValue has a UniqueValue::symbol and a collection of UniqueValue::values to define a value or combination of values.

    This is typically used to visualize categories or data types. For example, you can use a unique value renderer to symbolize zoning designations: yellow for "Residential", purple for "Industrial", and green for both "Forests" and "Open land".

    Example:

    Apply a UniqueValueRenderer to a point feature layer repesenting California cities:

    // Create the unique values for the different cities in California
    auto* uniqueValue1 = new UniqueValue("Los Angeles", "The City of Los Angeles", QVariantList() << "Los Angeles", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Triangle, QColor(Qt::green), 4.0, this), this);
    auto* uniqueValue2 = new UniqueValue("San Francisco", "The City of San Francisco", QVariantList() << "San Francisco", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, QColor(Qt::red), 5.0, this), this);
    auto* uniqueValue3 = new UniqueValue("San Diego", "The City of San Diego", QVariantList() << "San Diego", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Cross, QColor(Qt::blue), 8.0, this), this);
    auto* uniqueValue4 = new UniqueValue("San Jose", "The City of San Jose", QVariantList() << "San Jose", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Diamond, QColor(Qt::yellow), 2.0, this), this);
    
    // Add the unique values to the renderer
    auto* uniqueRenderer = new UniqueValueRenderer("Unknown city", new SimpleMarkerSymbol(this), QStringList() << "CityName", QList<UniqueValue*>() << uniqueValue1 << uniqueValue2 << uniqueValue3 << uniqueValue4, this);
    
    // Create a feature layer and apply the renderer to the layer
    auto* featureTable = new ServiceFeatureTable(serviceUrl, this);
    auto* featureLayer = new FeatureLayer(featureTable, this);
    featureLayer->setRenderer(uniqueRenderer);

    Relevant samples:

    See also UniqueValue and UniqueValueListModel.

    Member Function Documentation [explicit] UniqueValueRenderer::UniqueValueRenderer(QObject *parent = nullptr)

    Creates a new empty unique value renderer.

    UniqueValueRenderer::UniqueValueRenderer(const QString &defaultLabel, Esri::ArcGISRuntime::Symbol *symbol, const QStringList &fieldNames, const QList<Esri::ArcGISRuntime::UniqueValue *> &uniqueValues, QObject *parent = nullptr)

    Creates a new unique value renderer object.

    [override virtual noexcept] UniqueValueRenderer::~UniqueValueRenderer()

    Destructor.

    QString UniqueValueRenderer::defaultLabel() const

    Returns the label used for the default symbol.

    See also setDefaultLabel.

    Esri::ArcGISRuntime::Symbol *UniqueValueRenderer::defaultSymbol() const

    Returns the default symbol for values that don't match any of the unique values.

    See also setDefaultSymbol.

    QStringList UniqueValueRenderer::fieldNames() const

    Returns a list of the field names/attribute keys that the unique values apply to.

    See also setFieldNames.

    void UniqueValueRenderer::setDefaultLabel(const QString &label)

    Sets the default label.

    The default label is used if the graphic or feature's attribute value does not match any of the unique values.

    See also defaultLabel.

    void UniqueValueRenderer::setDefaultSymbol(Esri::ArcGISRuntime::Symbol *symbol)

    Sets the default symbol.

    The default symbol is used if the graphic or feature's attribute value does not match any of the unique values.

    See also defaultSymbol.

    void UniqueValueRenderer::setFieldNames(const QStringList &fieldNames)

    Sets the list of fieldNames used in the renderer.

    The names represent attributes of a graphic or feature that the renderer uses to match values against.

    See also fieldNames.

    Esri::ArcGISRuntime::UniqueValueListModel *UniqueValueRenderer::uniqueValues() const

    Returns a collection of unique values for the renderer as a UniqueValueListModel.

    The UniqueValueListModel contains a list model of all the unique values defined in the renderer.

    See also UniqueValueListModel.


    RetroSearch is an open source project built by @garambo | Open a GitHub Issue

    Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

    HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4