Skip To Content ArcGIS for Developers Sign In Dashboard

DictionarySymbolStyle Class

(Esri::ArcGISRuntime::DictionarySymbolStyle)

A type of SymbolStyle that is used to obtain unique symbols from a given specification, such as MIL-STD-2525D (mil2525d). More...

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

Public Functions

~DictionarySymbolStyle()
QList<DictionarySymbolStyleConfiguration *> configurations() const
QString dictionaryName() const
TaskWatcher fetchSymbol(const QVariantMap &keys)
QStringList symbologyFieldNames() const
QStringList textFieldNames() const

Static Public Members

DictionarySymbolStyle *createFromFile(const QString &styleFilePath, QObject *parent = nullptr)
  • 10 static public members inherited from QObject

Additional Inherited Members

Detailed Description

A type of SymbolStyle that is used to obtain unique symbols from a given specification, such as MIL-STD-2525D (mil2525d).

Note: Use this class if you want to obtain, search for, and create renderers for military symbology standards like MIL-STD-2525D. Use SymbolStyle if you simply want to obtain and search for symbols in a style file.

A DictionarySymbolStyle is made up of a *.stylx file (a SQLite database from ArcGIS Pro), which contains the symbol primitives for a given symbology specification (such as mil2525d), as well as a rule engine that parses input fields. The DictionarySymbolStyle assembles new symbols from the input attributes, and can also apply geometry manipulations to the symbols in the case of multipoint geometries.

A DictionarySymbolStyle can be used in conjunction with a DictionaryRenderer, which can be applied to a FeatureLayer or GraphicsOverlay. In addition, the DictionarySymbolStyle can be used by itself. When used by itself, the DictionarySymbolStyle supports two key workflows. The first is to find a symbol with provided attributes values. This is done by creating a QVariantMap of field names and attribute values (as determined by the associated specification), and passing those into fetchSymbol, which returns a new symbol. In this case, the key is the name of the specification field (e.g. "symbolset" in the case of mil2525d), and the value is value you want associated with that field (e.g "Atmospheric"). You might use this symbol to create a new Graphic.

You can also use a standalone DictionarySymbolStyle to search for symbol primitives. Symbol primitives are the individual symbols that make up more complex and advanced multilayer military symbols. This is achieved using searchSymbols. You could create a symbol picker app that searches for all symbols that have the tag "maritime" in it. The search results contain symbols which you could then either use as they are or extract from them different individual symbols to create a new composite symbol.

The currently supported military standards include the following:

Military standardSpecification type stringAssociated style file
MIL-STD-2525B (change 2)mil2525c_b2mil2525c_b2.stylx
MIL-STD-2525Cmil2525c_b2mil2525c_b2.stylx
MIL-STD-2525Dmil2525dmil2525d.stylx

Use the above information in the DictionarySymbolStyle constructor to create a new DictionarySymbolStyle of a given specification.

Note: MIL-STD-2525B (change 2) and MIL-STD-2525C use the same specification type string and style file for their constructor. By default, MIL-STD-2525C will be used. To force the DictionarySymbolStyle to use MIL-STD-2525B (change 2), you must set the following configurationProperties:

QMap<QString, QString> configProperties;
configProperties["legacy_standard"] = "mil2525bc2";

Please consult each standard's specification for details on the standard itself.

Example:

Create a DictionarySymbolStyle with the mil2525d specification:

const QString specType = QStringLiteral("mil2525d");
const QString stylePath = m_dataPath + "/styles/arcade_style/mil2525d.stylx";
DictionarySymbolStyle* dictionarySymbolStyle = DictionarySymbolStyle::createFromFile(stylePath, this);

See also DictionaryRenderer, SymbolStyleSearchParameters, and SymbolStyleSearchResult.

Member Function Documentation

DictionarySymbolStyle::~DictionarySymbolStyle()

Destructor.

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

Returns the configuration settings from the custom dictionary style.

This function was introduced in Esri::ArcGISRuntime 100.6.

[static] 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.

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.


Feedback on this topic?