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

    Public Functions

    DictionarySymbolStyle(Esri::ArcGISRuntime::PortalItem *portalItem, QObject *parent = nullptr)
    virtual ~DictionarySymbolStyle() override
    QList<Esri::ArcGISRuntime::DictionarySymbolStyleConfiguration *> configurations() const
    QString dictionaryName() const
    QFuture<Esri::ArcGISRuntime::Symbol *> fetchSymbolAsync(const QVariantMap &attributes, QObject *parent = nullptr)
    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 either from a style file on disk (an SQLite database with a .stylx extension, created with ArcGIS Pro) or from a dictionary style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a dictionary web style).

    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.

    Esri builds and maintains some dictionary web styles according to the US and NATO military symbol specifications. These desktop and web styles are hosted online and are publicly available. Refer to the ArcGIS Online Dictionary Symbology Styles group for the latest versions of the styles available.

    See also DictionaryRenderer.

    Member Function Documentation

    [explicit, since Esri::ArcGISRuntime 100.10] 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.

    [since Esri::ArcGISRuntime 100.6] 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, since Esri::ArcGISRuntime 100.10] 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, since Esri::ArcGISRuntime 100.6] 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.

    [since 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.

    [since Esri::ArcGISRuntime 200.3] QFuture<Esri::ArcGISRuntime::Symbol *> DictionarySymbolStyle::fetchSymbolAsync(const QVariantMap &attributes, QObject *parent = nullptr)

    Asynchronously returns a symbol based on the provided attributes.

    • attributes - a QVariantMap of QString type key and QVariant value. It is a key value pair for the attributes required to obtain symbol from the rule engine associated to dictionary symbol style.
    • parent - The optional parent QObject

    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 40, "modifier1" is "Incident Qualifier : Accident", "echelon" is "Army", 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. If the DictionarySymbolStyle is not loaded then initiating this task will start the load cycle.

    This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.3.

    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.