DictionarySymbolStyle Class

  • DictionarySymbolStyle
  • class Esri::ArcGISRuntime::DictionarySymbolStyle

    A dictionary symbol style object containing symbol primitives and rules for generating symbols from attribute values. More...

    Header: #include <DictionarySymbolStyle.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::SymbolStyle

    This class was introduced in Esri::ArcGISRuntime 100.0.

    Public Functions

    DictionarySymbolStyle(Esri::ArcGISRuntime::PortalItem *portalItem, QObject *parent = nullptr)
    virtual ~DictionarySymbolStyle() override
    QList<Esri::ArcGISRuntime::DictionarySymbolStyleConfiguration *> configurations() const
    QString dictionaryName() const
    Esri::ArcGISRuntime::TaskWatcher fetchSymbol(const QVariantMap &keys)
    QStringList symbologyFieldNames() const
    QStringList textFieldNames() const

    Static Public Members

    Esri::ArcGISRuntime::DictionarySymbolStyle *createDictionarySymbolStyleFromUrl(const QUrl &webStyleUrl, QObject *parent = nullptr)
    Esri::ArcGISRuntime::DictionarySymbolStyle *createFromFile(const QString &styleFilePath, QObject *parent = nullptr)

    Detailed Description

    A DictionarySymbolStyle is created from a style file located on disk (an SQLite database with a .stylx extension, created with ArcGIS Pro), a dictionary style file hosted on ArcGIS Online, or a dictionary web style accessed from an ArcGIS Enterprise portal.

    A DictionarySymbolStyle must contain a set of symbol primitives and a rule engine that parses input fields. The DictionarySymbolStyle assembles new symbols based on the input attribute values. DictionarySymbolStyle is often used to render symbols from a military specification (such as Mil2525D or App6B), but can also be used with a custom style.

    A DictionarySymbolStyle is used in conjunction with a DictionaryRenderer to symbolize geoelements in a FeatureLayer or GraphicsOverlay.

    See also DictionaryRenderer.

    Member Function Documentation

    DictionarySymbolStyle::DictionarySymbolStyle(Esri::ArcGISRuntime::PortalItem *portalItem, QObject *parent = nullptr)

    Creates a new dictionary symbol style object from a portal item. The portal item must contain a dictionary style.

    • portalItem - A PortalItem that contains a dictionary style.
    • parent - The optional parent QObject.

    If you have the item id of a style file, you can search the portal to find the item using its item id. Use this constructor if you have a reference to a portal item.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    [override virtual] DictionarySymbolStyle::~DictionarySymbolStyle()

    Destructor.

    QList<Esri::ArcGISRuntime::DictionarySymbolStyleConfiguration *> DictionarySymbolStyle::configurations() const

    Returns the configuration settings from the custom dictionary style.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    [static] Esri::ArcGISRuntime::DictionarySymbolStyle *DictionarySymbolStyle::createDictionarySymbolStyleFromUrl(const QUrl &webStyleUrl, QObject *parent = nullptr)

    Returns a new dictionary symbol style object using web style item Url.

    • webStyleUrl - URL of the dictionary web style item.
    • parent - The optional parent QObject.

    A dictionary symbol style using style item's URL.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    [static] Esri::ArcGISRuntime::DictionarySymbolStyle *DictionarySymbolStyle::createFromFile(const QString &styleFilePath, QObject *parent = nullptr)

    Creates a new dictionary symbol style object from the style file provided in styleFilePath.

    • styleFilePath - the path to the style file.
    • parent - the parent object (optional).

    Only valid for use with the newer format (Arcade-based) style files.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    QString DictionarySymbolStyle::dictionaryName() const

    Returns the name of the custom Arcade-based dictionary style.

    Returns an empty string for style files created with any version of ArcGIS Pro that is older than 2.4.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    Esri::ArcGISRuntime::TaskWatcher DictionarySymbolStyle::fetchSymbol(const QVariantMap &keys)

    Returns a Symbol, as defined by the input keys.

    This function is useful for obtaining a single, multi-layer symbol from supplied attributes. This is commonly used to create symbols and graphics on-the-fly. For example, with mil2525d, you may want to obtain a symbol where "symbolset" is 01 ("air"), "entity" is 110100 ("Military (Air) : Fixed-Wing"), "identity" is 3 ("friend"), and so on. All of these key/value pairs can be used to obtain the specific symbol that you need. Once you have that symbol, you can apply it to a Graphic or Renderer, obtain its swatch image, or serialize to JSON. The fetchSymbolCompleted signal emits once complete, giving access to the resulting symbol.

    If the DictionarySymbolStyle is not loaded then starting this task will start the load cycle.

    Note: For mil2525d, symbolset, entity, and identity fields are required to create a symbol. This information, along with the range of valid inputs can be found on the Military Features Data GitHub page.

    See also fetchSymbolCompleted.

    QStringList DictionarySymbolStyle::symbologyFieldNames() const

    Returns the string list of attributes used to construct a symbol from the DictionarySymbolStyle.

    For example, mil2525d would include "identity", "symbolset", "symbolentity", and "modifier1", among many others. The newer Arcade-based styles define such attributes within the .stylx file as a JSON string.

    QStringList DictionarySymbolStyle::textFieldNames() const

    Returns the string list of attributes used to obtain text values for display with a symbol from a DictionarySymbolStyle.

    For example, mil2525d would include "combateffectiveness", "credibility", "reliability", and "staffcomment", among many others. The newer Arcade-based styles define such attributes within the .stylx file as a JSON string.

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