ArcGIS Runtime SDK for iOS: AGSDictionarySymbolStyle Class Reference
ArcGIS Runtime SDK for iOS  100.12
AGSDictionarySymbolStyle Class Reference

Description

A dictionary symbol style object containing symbol primitives and rules for generating symbols from attribute values.

An AGSDictionarySymbolStyle is created with 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).

An AGSDictionarySymbolStyle must contain a set of symbol primitives and a rule engine that parses input fields. The AGSDictionarySymbolStyle assembles new symbols based on the input attribute values. AGSDictionarySymbolStyle is often used to render symbols from a military specification (such as Mil2525D or App6B) but can also be used with a custom style.

An AGSDictionarySymbolStyle is used in conjunction with an AGSDictionaryRenderer to symbolize geoelements in a AGSFeatureLayer or AGSGraphicsOverlay.

See also
AGSDictionaryRenderer
Since
100
Inheritance diagram for AGSDictionarySymbolStyle:
AGSSymbolStyle AGSLoadableRemoteResourceBase AGSLoadableBase <AGSRemoteResource> AGSObject <AGSLoadable>

Instance Methods

(void) - cancelLoad
 
(id< AGSCancelable >) - defaultSearchParametersWithCompletion:
 
(void) - doCancelLoading
 
(void) - doStartLoading:
 
(instancetype) - initWithFileURL:
 
(instancetype) - initWithName:
 
(instancetype) - initWithPortalItem:
 
(instancetype) - initWithSpecificationType:
 
(instancetype) - initWithSpecificationType:styleURL:
 
(instancetype) - initWithStyleName:portal:
 
(instancetype) - initWithURL:
 
(void) - loadDidFinishWithError:
 
(void) - loadWithCompletion:
 
(void) - onLoadStatusChanged
 
(void) - retryLoadWithCompletion:
 
(id< AGSCancelable >) - searchSymbolsWithParameters:completion:
 
(id< AGSCancelable >) - symbolForKeys:completion:
 
(id< AGSCancelable >) - symbolWithAttributes:completion:
 

Class Methods

(instancetype) + dictionarySymbolStyleWithFileURL:
 
(instancetype) + dictionarySymbolStyleWithName:
 
(instancetype) + dictionarySymbolStyleWithPortalItem:
 
(instancetype) + dictionarySymbolStyleWithSpecificationType:
 
(instancetype) + dictionarySymbolStyleWithSpecificationType:styleURL:
 
(instancetype) + dictionarySymbolStyleWithURL:
 
(instancetype) + symbolStyleWithName:
 
(instancetype) + symbolStyleWithPortalItem:
 
(instancetype) + symbolStyleWithStyleName:portal:
 
(instancetype) + symbolStyleWithURL:
 

Properties

NSDictionary< NSString *, NSString * > * configurationProperties
 
NSArray< AGSDictionarySymbolStyleConfiguration * > * configurations
 
AGSCredentialcredential
 
NSString * dictionaryName
 
NSError * loadError
 
AGSLoadStatus loadStatus
 
AGSPortalportal
 
AGSPortalItemportalItem
 
AGSRequestConfigurationrequestConfiguration
 
NSString * specificationType
 
NSString * styleName
 
NSArray< NSString * > * symbologyFieldNames
 
NSArray< NSString * > * textFieldNames
 
NSURL * URL
 

Method Documentation

◆ cancelLoad

- (void) cancelLoad
requiredinherited

Cancels loading if it is in progress, otherwise it does nothing. This should be called carefully because other objects could be waiting for loadWithCompletion: or retryLoadWithCompletion: to complete and this will call them all back with the error of NSUserCancelledError

Since
100

◆ defaultSearchParametersWithCompletion:

- (id<AGSCancelable>) defaultSearchParametersWithCompletion: (void(^)(AGSSymbolStyleSearchParameters *__nullable searchParams, NSError *__nullable error))  completion

A convenience method to get properly initialized search parameters for looking up symbols within the .stylx file. The parameters contain all of the possible input values for categories, keys, names, symbolClasses, and tags. This is an expensive task that should be used sparingly. Returns a AGSSymbolStyleSearchParameters 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.

Parameters
completionBlock that is invoked when the operation finishes. The searchParams parameter is populated if the operation completed successfully, otherwise the error parameter is populated.
See also
- searchSymbolsWithParameters:completion:
Since
100

◆ dictionarySymbolStyleWithFileURL:

+ (instancetype) dictionarySymbolStyleWithFileURL: (NSURL *)  fileURL

Creates a new dictionary symbol style object from the style file at the provided location.

Parameters
fileURLThe physical location of the .stylx file.
Since
100.6
Deprecated:
100.10.0. Use dictionarySymbolStyleWithURL: instead.

Provided by category AGSDictionarySymbolStyle(AGSDeprecated).

◆ dictionarySymbolStyleWithName:

+ (instancetype) dictionarySymbolStyleWithName: (NSString *)  name

Creates a new dictionary symbol style object from the name style file within the application bundle or shared documents directory.

Parameters
nameThe name of the stylx file (excluding the .stylx file extension).
Since
100.6

◆ dictionarySymbolStyleWithPortalItem:

+ (instancetype) dictionarySymbolStyleWithPortalItem: (AGSPortalItem *)  portalItem

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

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 initializer if you have a reference to a portal item.

Parameters
portalItemAn AGSPortalItem that contains a dictionary style.
Since
100.10

◆ dictionarySymbolStyleWithSpecificationType:

+ (instancetype) dictionarySymbolStyleWithSpecificationType: (NSString *)  specificationType

Creates a new dictionary symbol style object for a known military standard (such as Mil2525D). This constructor is only valid for use with the older format style files. An AGSErrorCodeCommonInvalidArgument is raised if a newer format (Arcade-based) style is encountered.

Parameters
specificationTypeThe name of supported military standard to use for the dictionary style.
Since
100.0
Deprecated:
100.6.0. The specification definition has been moved from the Runtime source code to an Arcade expression in the style file. These styles no longer reside in a default location and creating an AGSDictionarySymbolStyle from a specification is no longer supported with the new Arcade-based symbol styles.

Provided by category AGSDictionarySymbolStyle(AGSDeprecated).

◆ dictionarySymbolStyleWithSpecificationType:styleURL:

+ (instancetype) dictionarySymbolStyleWithSpecificationType: (NSString *)  specificationType
styleURL: (NSURL *)  styleURL 

Creates a new Symbol dictionary object using the style file identified by the specification type or style location. This constructor is only valid for use with the older format style files. An AGSErrorCodeCommonInvalidArgument is raised if a newer format (Arcade-based) style is encountered.

Parameters
specificationTypeThe name of a supported military standard to use for the dictionary style.
styleURLThe physical location of an older format (non-Arcade based) .stylx file. You must provide the full path (e.g. ../../../mil2525c/mil2525c.stylx).
Since
100.1
Deprecated:
100.6.0. The specification definition has been moved from the Runtime source code to an Arcade expression in the style file. Creating an AGSDictionarySymbolStyle from a specification is no longer supported with the new military symbol styles.

Provided by category AGSDictionarySymbolStyle(AGSDeprecated).

◆ dictionarySymbolStyleWithURL:

+ (instancetype) dictionarySymbolStyleWithURL: (NSURL *)  URL

Creates a new dictionary symbol style object from the style file at the provided location, or using a web style item URL.

Parameters
URLThe physical location of the .stylx file, or the web style item URL.
Since
100.10

◆ doCancelLoading

- (void) doCancelLoading

Never call this method directly. The framework calls this method on a background thread when cancelLoad (AGSLoadable-p) is called. It is meant to be overriden by subclasses. Subclasses should override this method to cancel loading their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly)) at the end passing in an error representing NSUserCancelledError.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ doStartLoading:

- (void) doStartLoading: (BOOL)  retrying

Never call this method directly. The framework calls this method on a background thread when loadWithCompletion: (AGSLoadable-p) or retryLoadWithCompletion: (AGSLoadable-p) is called. It is meant to be overriden by subclasses. Subclasses should override this method to load their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly)) upon completion, passing in the error if any.

Parameters
retryingflag that is true if this method was called from retryLoadWithCompletion: (AGSLoadable-p).
Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ initWithFileURL:

- (instancetype) initWithFileURL: (NSURL *)  fileURL

Creates a new dictionary symbol style object from the style file at the provided location.

Parameters
fileURLThe physical location of the .stylx file.
Since
100.6
Deprecated:
100.10.0. Use initWithURL: instead.

Provided by category AGSDictionarySymbolStyle(AGSDeprecated).

◆ initWithName:

- (instancetype) initWithName: (NSString *)  name

Creates a new dictionary symbol style object from the name style file within the application bundle or shared documents directory.

Parameters
nameThe name of the stylx file (excluding the .stylx file extension).
Since
100.6

Implements AGSSymbolStyle.

◆ initWithPortalItem:

- (instancetype) initWithPortalItem: (AGSPortalItem *)  portalItem

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

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 initializer if you have a reference to a portal item.

Parameters
portalItemAn AGSPortalItem that contains a dictionary style.
Since
100.10

Implements AGSSymbolStyle.

◆ initWithSpecificationType:

- (instancetype) initWithSpecificationType: (NSString *)  specificationType

Creates a new dictionary symbol style object for a known military standard (such as Mil2525D). This constructor is only valid for use with the older format style files. An AGSErrorCodeCommonInvalidArgument is raised if a newer format (Arcade-based) style is encountered.

Parameters
specificationTypeThe name of supported military standard to use for the dictionary style.
Since
100.0
Deprecated:
100.6.0. The specification definition has been moved from the Runtime source code to an Arcade expression in the style file. These styles no longer reside in a default location and creating an AGSDictionarySymbolStyle from a specification is no longer supported with the new Arcade-based symbol styles.

Provided by category AGSDictionarySymbolStyle(AGSDeprecated).

◆ initWithSpecificationType:styleURL:

- (instancetype) initWithSpecificationType: (NSString *)  specificationType
styleURL: (NSURL *)  styleURL 

Creates a new Symbol dictionary object using the style file identified by the specification type or style location. This constructor is only valid for use with the older format style files. An AGSErrorCodeCommonInvalidArgument is raised if a newer format (Arcade-based) style is encountered.

Parameters
specificationTypeThe name of a supported military standard to use for the dictionary style.
styleURLThe physical location of an older format (non-Arcade based) .stylx file. You must provide the full path (e.g. ../../../mil2525c/mil2525c.stylx).
Since
100.1
Deprecated:
100.6.0. The specification definition has been moved from the Runtime source code to an Arcade expression in the style file. Creating an AGSDictionarySymbolStyle from a specification is no longer supported with the new military symbol styles.

Provided by category AGSDictionarySymbolStyle(AGSDeprecated).

◆ initWithStyleName:portal:

- (instancetype) initWithStyleName: (NSString *)  styleName
portal: (nullable AGSPortal *)  portal 

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

Esri provides a set of web symbol styles "out of the box" for localized use with ArcGIS Online and Enterprise. This initializer can be used only while creating a symbol style using the Esri web style's unique name on your portal or arcgis.com. 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.

Parameters
styleNameThe registered Esri symbol style name. It cannot be a custom web style name.
portalA Portal hosting the Esri web style. If nil is passed, ArcGIS online is used as the default portal.
Since
100.10

◆ initWithURL:

- (instancetype) initWithURL: (NSURL *)  URL

Creates a new dictionary symbol style object from the style file at the provided location, or using a web style item URL.

Parameters
URLThe physical location of the .stylx file, or the web style item URL.
Since
100.10

Implements AGSSymbolStyle.

◆ loadDidFinishWithError:

- (void) loadDidFinishWithError: (nullable NSError *)  error

Only subclasses should call this method in doStartLoading: (AGSLoadableBase(ForSubclassEyesOnly)) and doCancelLoading (AGSLoadableBase(ForSubclassEyesOnly)) when done loading or failed to load.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ loadWithCompletion:

- (void) loadWithCompletion: (nullable void(^)(NSError *__nullable error))  completion
requiredinherited

Loads data for the object asynchronously. The completion block is invoked upon completion.

You can call this method any number of times, however only one attempt is made to load the data. If it is already loading, it will just continue to load (i.e. not force a reload). If it has already loaded successfully, the completion block will be invoked right away. If it has already failed to load, the completion block will be invoked right away with error previously encountered. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.

Parameters
completionblock that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load.
Note
The completion block is always invoked on the main thread.
Since
100
See also
- cancelLoad to cancel loading
- retryLoadWithCompletion: to force reload

◆ onLoadStatusChanged

- (void) onLoadStatusChanged

Never call this method directly. The framework calls this method on a background thread when AGSLoadable::loadStatus changes is called. Subclasses can optionally implement this to know when their loading status has changed.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ retryLoadWithCompletion:

- (void) retryLoadWithCompletion: (nullable void(^)(NSError *__nullable error))  completion
requiredinherited

Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:

  1. you didn't have network connectivity earlier when it failed and you want to retry now that you have connectivity
  2. the server was down earlier when it failed and you want to retry
  3. the request is taking too long and you want to cancel it and retry, in which case you will first call cancelLoad and then this method

If the data hasn't started loading, it will start loading. If it is already loading, it will just continue to load. If it has already loaded successfully, calls back right away. If it has already failed to load, tries again. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.

Parameters
completionblock that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load.
Note
The completion block is always invoked on the main thread.
Since
100

◆ searchSymbolsWithParameters:completion:

- (id<AGSCancelable>) searchSymbolsWithParameters: (AGSSymbolStyleSearchParameters *)  searchParameters
completion: (void(^)(NSArray< AGSSymbolStyleSearchResult * > *__nullable searchResults, NSError *__nullable error))  completion 

Returns an array of AGSSymbolStyleSearchResult objects.

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.

Parameters
searchParametersan object of type AGSSymbolStyleSearchParameters.
completionBlock that is invoked when the operation finishes. The searchResults parameter is populated if the operation completed successfully, otherwise the error parameter is populated.
See also
- defaultSearchParametersWithCompletion:
Since
100

◆ symbolForKeys:completion:

- (id<AGSCancelable>) symbolForKeys: (NSArray< NSString * > *)  keys
completion: (void(^)(AGSSymbol *__nullable symbol, NSError *__nullable error))  completion 

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.

Parameters
keysNSArray of strings. It is the list of keys required to obtain a symbol from the style.
completionblock that is invoked with the result
Since
100

◆ symbolStyleWithName:

+ (instancetype) symbolStyleWithName: (NSString *)  name

Initialize a symbol style with the name of a .stylx file that is within the application bundle or shared documents directory.

Parameters
nameof the .stylx file (without the file extension) within the application bundle or shared documents directory.
Returns
a new initialized symbol style
Since
100

◆ symbolStyleWithPortalItem:

+ (instancetype) symbolStyleWithPortalItem: (AGSPortalItem *)  portalItem

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

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 initializer if you have a reference to a portal item.

Parameters
portalItemAn AGSPortalItem that contains a web style.
Since
100.10

◆ symbolStyleWithStyleName:portal:

+ (instancetype) symbolStyleWithStyleName: (NSString *)  styleName
portal: (nullable AGSPortal *)  portal 

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

Esri provides a set of web symbol styles "out of the box" for localized use with ArcGIS Online and Enterprise. This initializer can be used only while creating a symbol style using the Esri web style's unique name on your portal or arcgis.com. 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.

Parameters
styleNameThe registered Esri symbol style name. It cannot be a custom web style name.
portalA Portal hosting the Esri web style. If nil is passed, ArcGIS online is used as the default portal.
Since
100.10

◆ symbolStyleWithURL:

+ (instancetype) symbolStyleWithURL: (NSURL *)  URL

Initialize a symbol style with the specified .stylx file or using web style item URL. For example, https://www.arcgis.com/home/item.html?id=bf27400d167d4c2e8e12c8a46f87afe4 is the URL of the "Basic Shapes" style on ArcGIS Online.

Parameters
URLto a .stylx file on disk or to web style item.
Returns
a new initialized symbol style
Since
100

◆ symbolWithAttributes:completion:

- (id<AGSCancelable>) symbolWithAttributes: (NSDictionary< NSString *, id > *)  attributes
completion: (void(^)(AGSSymbol *__nullable symbol, NSError *__nullable error))  completion 

Creates a symbol based on the provided attributes. 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.

Parameters
attributesused to create the symbol
completionblock that is invoked when the operation completes. The symbol is populated if the operation succeeds, else the error is populated if the operation fails.
Since
100

Property Documentation

◆ configurationProperties

- (NSDictionary<NSString *, NSString *>*) configurationProperties
readwritenonatomiccopy

The NSDictionary of configuration settings and values used by the style. These settings are specific to the rule engine used by the AGSDictionarySymbolStyle.

Since
100.0
Deprecated:
100.6.0. These configuration settings are specific to the older style files and have no effect on the Arcade-based styles.

Provided by category AGSDictionarySymbolStyle(AGSDeprecated).

◆ configurations

- (NSArray<AGSDictionarySymbolStyleConfiguration *>*) configurations
readnonatomiccopy

The collection of configuration settings for the custom dictionary style.

Since
100.6

◆ credential

- (AGSCredential*) credential
readwritenonatomicstronginherited

Security credentials to access the remote resource. Only applicable if the resource is secured.

Since
100

◆ dictionaryName

- (NSString*) dictionaryName
readnonatomiccopy

The name of the custom Arcade-based dictionary style. For older version style files, this is an empty string.

Since
100.6

◆ loadError

- (NSError*) loadError
readnonatomicstronginherited

The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.

Since
100

◆ loadStatus

- (AGSLoadStatus) loadStatus
readrequirednonatomicassigninherited

Status of the load operation.

Since
100

◆ portal

- (AGSPortal*) portal
readnonatomicstronginherited

The portal that hosts the web style identified with AGSSymbolStyle::styleName. This will be nil if the style was identified with a AGSPortalItem or URL or a local .stylx file on disk.

Since
100.10

◆ portalItem

- (AGSPortalItem*) portalItem
readnonatomicstronginherited

The portal item representing the web style.

This is non nil when the AGSSymbolStyle is created using initWithPortalItem: or initWithURL: by providing a web style item.

This will be nil if the style was created or is identified with a local .stylx file on disk.

Since
100.10

◆ requestConfiguration

- (AGSRequestConfiguration*) requestConfiguration
readwritenonatomicstronginherited

The AGSRequestConfiguration object which defines the behavior and policies to use when accessing the remote resource. The default will be nil. If it is nil the [AGSRequestConfiguration globalConfiguration] will be used.

Since
100

◆ specificationType

- (NSString*) specificationType
readnonatomiccopy

The name of the dictionary (.stylx file), such as "Mil2525D".

Since
100.0
Deprecated:
100.6.0. With the new Arcade-based styles, the style specification logic is embedded in the style file itself. Since the logic is not internal to the Runtime code, functionality is not limited to the supported military specifications and can be customized for a variety of uses. Use the AGSDictionarySymbolStyle::dictionaryName property instead.

Provided by category AGSDictionarySymbolStyle(AGSDeprecated).

◆ styleName

- (NSString*) styleName
readnonatomiccopyinherited

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

Since
100.10

◆ symbologyFieldNames

- (NSArray<NSString*>*) symbologyFieldNames
readnonatomiccopy

The string list of attributes used to construct a symbol from the AGSDictionarySymbolStyle. 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.

Since
100.0

◆ textFieldNames

- (NSArray<NSString*>*) textFieldNames
readnonatomiccopy

The string list of attributes used to obtain text values for display with a symbol from the AGSDictionarySymbolStyle. 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.

Since
100.0

◆ URL

- (NSURL*) URL
readrequirednonatomicstronginherited

The URL of the remote resource.

Since
100