Open a mobile style (.stylx) and read its contents. Combine several symbols from the style into a single multilayer point symbol, then use it to display graphics in the map view.
Use case
You may choose to display individual elements of a dataset like a water infrastructure network (such as valves, nodes, or endpoints) with the same basic shape, but wish to modify characteristics of elements according to some technical specifications. Multilayer symbols lets you add or remove components or modify the colors to create advanced symbol styles.
How to use the sample
Select a symbol and a color from each of the category lists to create an emoji. A preview of the symbol is updated as selections are made. The size of the symbol can be set using the slider. Click the map to create a point graphic using the customized emoji symbol, and click Clear to clear all graphics from the display.
How it works
On startup, read a mobile style file by creating and loading a SymbolStyle.
Get a list of symbols in the style by calling SymbolStyle.searchSymbols.
Display the resulting SymbolStyleSearchResultListModel inside a series of ComboBoxes.
When symbol selections change, create a new MultilayerPointSymbol by passing the keys for the selected symbols into SymbolStyle.fetchSymbolWithKeyList.
Iterate through the symbol layers and color lock all symbol layers except the base layer and update the current symbol preview image by calling Symbol.createSwatch.
Create Graphics symbolized with the current symbol when the user taps the map view.
Relevant API
MultilayerPointSymbol
Symbol.createSwatch
SymbolLayer
SymbolStyle
SymbolStyle.fetchSymbolWithKeyList
SymbolStyle.searchSymbols
SymbolStyleSearchParameters
SymbolStyleSearchResult
SymbolStyleSearchResultListModel
Offline Data
A mobile style file (created using ArcGIS Pro) provides the symbols used by the sample.
The mobile style file used in this sample was created using ArcGIS Pro, and is hosted on ArcGIS Online. It contains symbol layers that can be combined to create emojis.
Additional information
While each of these symbols can be created from scratch, a more convenient workflow is to author them using ArcGIS Pro and store them in a mobile style file (.stylx). The ArcGIS Maps SDK for Qt can read symbols from a mobile style, and you can modify and combine them as needed in your app.
Tags
advanced symbology, mobile style, multilayer, stylx