Skip To Content ArcGIS for Developers Sign In Dashboard

SymbolStyle Class

class Esri::ArcGISRuntime::SymbolStyle

A mechanism to obtain symbols from a style (*.stylx) file. More...

Header: #include <SymbolStyle>
Since: Esri::ArcGISRuntime 100.0
Inherits: Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::Loadable
Inherited By:

Esri::ArcGISRuntime::DictionarySymbolStyle

This class was introduced in Esri::ArcGISRuntime 100.0.

Public Functions

SymbolStyle(const QString &styleLocation, QObject *parent = nullptr)
virtual ~SymbolStyle() override
Esri::ArcGISRuntime::TaskWatcher defaultSearchParameters()
Esri::ArcGISRuntime::TaskWatcher fetchSymbol(const QStringList &keys)
Esri::ArcGISRuntime::TaskWatcher searchSymbols(const Esri::ArcGISRuntime::SymbolStyleSearchParameters &searchParameters)
QString styleLocation() const
Esri::ArcGISRuntime::SymbolStyleType symbolStyleType() const

Reimplemented Public Functions

virtual void cancelLoad() override
virtual void load() override
virtual Esri::ArcGISRuntime::Error loadError() const override
virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
virtual void retryLoad() override

Signals

void defaultSearchParametersCompleted(QUuid taskId, const Esri::ArcGISRuntime::SymbolStyleSearchParameters &searchParameters)
void doneLoading(Esri::ArcGISRuntime::Error loadError)
void fetchSymbolCompleted(QUuid taskId, Esri::ArcGISRuntime::Symbol *symbol)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
void searchSymbolsCompleted(QUuid taskId, Esri::ArcGISRuntime::SymbolStyleSearchResultListModel *searchResults)

Detailed Description

A style file is a gallery of symbols that are created and maintained with ArcGIS Pro. Style files are typically used to maintain a common set of symbols for use across your organization. Style files contain many layers of symbols, which can be grouped together to create new multi-layer symbols. A SymbolStyle is the class that ArcGIS Runtime uses to access a style file.

To use a SymbolStyle, construct a SymbolStyle by giving the full path to a style file, and search for symbols with searchSymbols. This will search the style file for symbols that match your input parameters. The results can then be used to create new graphics, renderers, symbol swatch images, or composite symbols.

Note: Style files used with SymbolStyle must be ArcGIS Runtime-enabled style files. The style files used in ArcGIS Pro and ArcMap cannot be directly consumed in ArcGIS Runtime. At the time of release of ArcGIS Runtime SDK 100.0, ArcGIS Runtime-enabled style files cannot be created by any released version of ArcGIS Pro. Once a version of Pro is released that can export these style files, this class can be used to consume them.

See also SymbolStyleSearchParameters, SymbolStyleSearchResult, and SymbolStyleSearchResultListModel.

Member Function Documentation

SymbolStyle::SymbolStyle(const QString &styleLocation, QObject *parent = nullptr)

Constructor that takes a styleLocation, with an optional parent.

The styleLocation is the full path to an ArcGIS Runtime-enabled style file, created with ArcGIS Pro.

[signal] void SymbolStyle::defaultSearchParametersCompleted(QUuid taskId, const Esri::ArcGISRuntime::SymbolStyleSearchParameters &searchParameters)

Signal emitted when the defaultSearchParameters asynchronous task has completed.

See also SymbolStyleSearchParameters.

[signal] void SymbolStyle::doneLoading(Esri::ArcGISRuntime::Error loadError)

Signal emitted when this object is done loading.

  • loadError - Details about any error that may have occurred.

Note: If there is a load error it will also be emitted on the errorOccurred signal.

See also Loadable and Object.

[signal] void SymbolStyle::fetchSymbolCompleted(QUuid taskId, Esri::ArcGISRuntime::Symbol *symbol)

Signal emitted when the fetchSymbol asynchronous task has completed.

  • taskId - The task ID of the asynchronous task.
  • symbol - The Symbol requested.

The returned Symbol object has the SymbolStyle as its parent.

See also Returned QObjects Parenting and SymbolStyleSearchParameters.

[signal] void SymbolStyle::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Signal emitted when the load status changes for this object.

See also Loadable.

[signal] void SymbolStyle::searchSymbolsCompleted(QUuid taskId, Esri::ArcGISRuntime::SymbolStyleSearchResultListModel *searchResults)

Signal emitted when the searchSymbols asynchronous task has completed.

The returned SymbolStyleSearchResultListModel object has the SymbolStyle as its parent.

See also Returned QObjects Parenting.

[override virtual] SymbolStyle::~SymbolStyle()

Destructor.

[override virtual] void SymbolStyle::cancelLoad()

Reimplements: Loadable::cancelLoad().

See Loadable.

Esri::ArcGISRuntime::TaskWatcher SymbolStyle::defaultSearchParameters()

Retrieves all of the valid SymbolStyleSearchParameters for the SymbolStyle.

This asynchronous task retrieves all the valid input search parameters in the style file. This means you get all of the possible input values for categories, keys, names, symbolClasses, and tags. This is an expensive task that should be used sparingly. The defaultSearchParametersCompleted signal emits once complete, giving access to pre-populated SymbolStyleSearchParameters.

Esri::ArcGISRuntime::TaskWatcher SymbolStyle::fetchSymbol(const QStringList &keys)

Gets a Symbol, as defined by the input keys.

This function is useful for obtaining a single, multi-layer symbol from the supplied keys. This is commonly used to create symbols and graphics on-the-fly. A common workflow for this would be to first call searchSymbols, which searches for symbols in the style file. This returns a list model of SymbolStyleSearchResults, all of which contain a key. Create a string list of all the keys you want in your resulting symbol, and call fetchSymbol with this string list. This will return a new symbol from all of the individual symbol keys provided.

The fetchSymbolCompleted signal emits once complete, giving access to the resulting symbol.

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

Note: The order of the keys in the string list determines how the output symbol will look. The first key in the string list will be at the bottom of the output symbol.

See also fetchSymbolCompleted.

[override virtual] void SymbolStyle::load()

Reimplements: Loadable::load().

See Loadable.

[override virtual] Esri::ArcGISRuntime::Error SymbolStyle::loadError() const

Reimplements: Loadable::loadError() const.

See Loadable.

[override virtual] Esri::ArcGISRuntime::LoadStatus SymbolStyle::loadStatus() const

Reimplements: Loadable::loadStatus() const.

See Loadable.

[override virtual] void SymbolStyle::retryLoad()

Reimplements: Loadable::retryLoad().

See Loadable.

Esri::ArcGISRuntime::TaskWatcher SymbolStyle::searchSymbols(const Esri::ArcGISRuntime::SymbolStyleSearchParameters &searchParameters)

Searches for symbols using searchParameters.

This asynchronous task searches for symbols in a style file. The input searchParameters define what is searched for. For example, you could search for all symbols that have the tag "airspace" or "forestry". You can also set the match to be strict or not, which will determine if the search uses "=" or "LIKE" for each parameter. The searchSymbolsCompleted signal emits once complete, giving access to a SymbolStyleSearchResultListModel.

Note: To get all available style symbol search results, pass in a default constructed SymbolStyleSearchParameters.

QString SymbolStyle::styleLocation() const

Returns the path of the style (*.stylx) file.

Esri::ArcGISRuntime::SymbolStyleType SymbolStyle::symbolStyleType() const

Gets the type of Symbol Style this object is.


Feedback on this topic?