SymbolStyle

sealed class SymbolStyle : Loadable

A symbol style object. A SymbolStyle is created either from a style file on disk (an SQLite database with a .stylx extension, created with ArcGIS Pro) or from a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style).

When used by itself, the symbol style supports two key workflows. One is to return a symbol based on a provided set of key values. Since each symbol in the style has a key that uniquely identifies it, you can pass an array of keys into SymbolStyle.getSymbol to return a new Symbol built from the individual symbols represented by those keys. You might use this symbol to create a new com.arcgismaps.mapping.view.Graphic.

The other common workflow is to use a standalone symbol style to search for symbol primitives. Symbol primitives are the individual symbols that compose more complex symbols. This is achieved using SymbolStyle.searchSymbols. You could create a symbol picker app, for example, that searches for all symbols in the style that have the tag "maritime" in it. The search results contain symbols that you could use directly. You could also extract their individual symbol components to create a new multilayer symbol.

Since

200.1.0

See also

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The portal that hosts the web style identified with SymbolStyle.styleName. This will be null if the style was identified with a PortalItem or Uri or a local .stylx file on disk.

Link copied to clipboard

The portal item representing the web style. The PortalItem will be set when SymbolStyle is created using SymbolStyle.SymbolStyle or SymbolStyle.createWithUrl. This will be null if the style was created using SymbolStyle.SymbolStyle or is identified with a local .stylx file on disk.

Link copied to clipboard

The location of the .stylx file on disk. This will be empty if the style was hosted on a portal (also referred to as a web style).

Link copied to clipboard

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.

Link copied to clipboard
val url: String?

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

Inherited properties

Link copied to clipboard
open override val loadStatus: StateFlow<LoadStatus>

The load status.

Functions

Link copied to clipboard

Returns a Symbol Style Search Parameters object providing all available search parameters from the database. This asynchronous task retrieves all the valid input search parameters for a style. 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.

Link copied to clipboard
suspend fun getSymbol(keys: Iterable<String>): Result<Symbol>

Asynchronously returns a symbol based on the provided list of keys. This function is useful for obtaining a single, multi-layer symbol from supplied keys. This is commonly used to create symbols and graphics on-the-fly. For example, assume XYZ style has a symbol with key "abc" which is the central symbol and another symbol with key "pqr", which could be the modifier/echelon placed at some offset from central geometry. So if you provide these two keys as attributes then symbol style will find and assemble a symbol accordingly. Once you have that symbol, you can apply it to a Graphic or Renderer, obtain its swatch image, or serialize to JSON. If the Symbol style is not loaded then starting this task will start the load cycle.

Link copied to clipboard

Returns a collection of Symbol Style Search Result object. This asynchronous task searches for symbol primitives in the symbol style. The input searchParameters define what is searched for. For example, you could search for all symbols that have the tag "airspace". You can also set the match to be strict or not, which will determine if the search uses "=" or "LIKE" for each parameter.

Inherited functions

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
open suspend override fun load(): Result<Unit>

Loads the metadata for the object.

Link copied to clipboard
open suspend override fun retryLoad(): Result<Unit>

Loads or retries loading metadata for the object.