SymbolStyle Class

  • SymbolStyle
  • class Esri::ArcGISRuntime::SymbolStyle

    Creates a new symbol style object using the registered style name of the Esri web style on the portal. More...

    Header: #include <SymbolStyle.h>
    Since: Esri::ArcGISRuntime 100.10
    Inherits: Esri::ArcGISRuntime::Object, Esri::ArcGISRuntime::Loadable, and Esri::ArcGISRuntime::RemoteResource
    Inherited By:

    Esri::ArcGISRuntime::DictionarySymbolStyle

    This class was introduced in Esri::ArcGISRuntime 100.10.

    Public Functions

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

    Reimplemented Public Functions

    virtual void cancelLoad() override
    virtual Esri::ArcGISRuntime::Credential *credential() const override
    virtual void load() override
    virtual Esri::ArcGISRuntime::Error loadError() const override
    virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
    virtual Esri::ArcGISRuntime::RequestConfiguration requestConfiguration() const override
    virtual void retryLoad() override
    virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
    virtual QUrl url() const 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)

    Static Public Members

    Esri::ArcGISRuntime::SymbolStyle *createSymbolStyleFromUrl(const QUrl &webStyleUrl, QObject *parent = nullptr)

    Detailed Description

    • styleName - The registered Esri symbol style name. The styleName cannot be a custom web style name.
    • portal - A Portal hosting the Esri web style. If nullptr is passed, ArcGIS online is used as the default portal.
    • parent - The optional parent QObject.

    Esri provides a set of web symbol styles "out of the box" for localized use with ArcGIS Online and Enterprise. Users can use this constructor only if you are creating a symbol style using the Esri web style's unique name on your portal or arcgis.com. If nullptr is passed for portal parameter, ArcGIS online is used as the default portal. An overview of esri web styles and symbols currently in production is available for 3D and 2D.

    Tip: Click on the symbol icon to find its associated style name.

    Esri registered style names can also be found in the json of symbol web style. As an example see item json for EsriThematicShapesStyle hosted on ArcGIS Online.

    See also DictionarySymbolStyle.

    Member Function Documentation

    SymbolStyle::SymbolStyle(const QString &styleName, Esri::ArcGISRuntime::Portal *portal, QObject *parent = nullptr)

    Creates a new symbol style object using the unique registered name for the web style on the portal.

    • styleName - The registered symbol style name on the portal.
    • portal - The portal that contains the web style. If nullptr is passed, ArcGIS online is used as the default portal.
    • parent - The optional parent QObject.

    Use this constructor to create a symbol style using the web style's unique name on the portal. If nullptr is passed, ArcGIS online is used as the default portal. Esri provides a set of webstyles "out of the box" for localized use with ArcGIS Online and Enterprise. An overview of styles and symbols currently in production is available for 3D and 2D. Tip: Click on the symbol icon to find its associated style name. A registered style name can also be found as a json item of the symbols style using "http://<server>/portal/sharing/rest/content/items/<style_itemid>?f=pjson" URL and replacing server and style_itemid with your info. See item json for EsriThematicShapesStyle hosted on ArcGIS Online.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    SymbolStyle::SymbolStyle(Esri::ArcGISRuntime::PortalItem *portalItem, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

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

    • portalItem - A PortalItem that contains a web style.
    • credential - The credential used to access the remote resource.
    • 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.13.

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

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

    • portalItem - A PortalItem that contains a web 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.

    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.

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

    Returns a new symbol style object using web style item URL.

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

    A symbol style using style item's URL. For example, https://www.arcgis.com/home/item.html?id=bf27400d167d4c2e8e12c8a46f87afe4 is the URL of the "Basic Shapes" style on ArcGIS Online.".

    This function was introduced in Esri::ArcGISRuntime 100.10.

    [override virtual] Esri::ArcGISRuntime::Credential *SymbolStyle::credential() const

    Reimplements: RemoteResource::credential() const.

    Returns security credentials to access the remote resource.

    Only applicable if the resource is secured.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    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.

    Esri::ArcGISRuntime::Portal *SymbolStyle::portal() const

    Returns the portal that hosts the web style identified with styleName. This will be nullptr if the style was identified with a PortalItem, URL, or a local .stylx file on disk.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    Esri::ArcGISRuntime::PortalItem *SymbolStyle::portalItem() const

    Returns the portal item that contains the web style. This will be nullptr if the style was identified with a URL, a style name, or a local .stylx file on disk.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    [override virtual] Esri::ArcGISRuntime::RequestConfiguration SymbolStyle::requestConfiguration() const

    Reimplements: RemoteResource::requestConfiguration() const.

    Returns the RequestConfiguration used to customize the request to this RemoteResource.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    See also setRequestConfiguration().

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

    [override virtual] void SymbolStyle::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration)

    Reimplements: RemoteResource::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration).

    Sets the RequestConfiguration, which is used to customize the request to this RemoteResource, to requestConfiguration.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    See also requestConfiguration().

    QString SymbolStyle::styleLocation() const

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

    QString SymbolStyle::styleName() const

    Returns the name of the web style. This will be empty if the style was identified with a URL, or a PortalItem, or a local .stylx file on disk.

    This function was introduced in Esri::ArcGISRuntime 100.10.

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

    Gets the type of Symbol Style this object is.

    [override virtual] QUrl SymbolStyle::url() const

    Reimplements: RemoteResource::url() const.

    Returns the URL of the web style.

    This will be empty if the style was identified with a PortalItem, style name, or a local .stylx file on disk.

    This function was introduced in Esri::ArcGISRuntime 100.10.

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