Symbol

sealed class Symbol : JsonSerializable

A symbol defines the appearance of features and graphics that are displayed in a GeoView. Symbol is the base class for a number of different symbols, such as MarkerSymbol, LineSymbol, FillSymbol abd MultilayerSymbol, which are sub-classes for more specialized symbols.

You can specify the symbology of a single graphic using Graphic.symbol. Alternatively, you can create a Renderer that contains a collection of symbols and rules. Each rule determines which symbol is applied to a graphic or feature depending on its attribute values. To symbolize graphics, apply a renderer to the GraphicsOverlay, and to symbolize features, apply the renderer to FeatureLayer.

There are two models for defining symbols in your map: simple and advanced (multilayer). In general, simple symbols are single-layer symbols that provide basic representations, such as marker, line, fill, text, or picture. Advanced symbols are composed of one or several layers that can be defined individually and combined to create complex representations.

These are described as follows:

  • Simple symbols follow the web map specification and you work with them through the simple symbol classes. These are also the symbols you get from web maps or from feature services when advanced symbology is turned off. Simple symbols can be created for points (MarkerSymbol), lines (LineSymbol), and polygons (FillSymbol). Each of the simple symbol types provides an enumeration of predefined styles that can be applied to the symbol.

  • Advanced symbols, accessed through multilayer symbol classes, follow the ArcGIS Pro symbol model. These symbols come from feature services (that use advanced symbology), mobile style files, the dictionary renderer, and mobile map packages. You can also build your own advanced symbols for points, lines, and polygons.

Simple symbology is the symbology of the web map. When authoring maps in ArcGIS Pro as web maps, your multilayer symbols will be converted to simple symbols. In general, point symbols are converted to picture marker symbols optimized for the web, and line and polygon symbols are simplified while representing the original symbol as closely as possible. If you are authoring a feature service from ArcGIS Pro or ArcGIS Desktop, however, both the original symbols and the simplified symbols are stored. This allows clients that support advanced symbols to render the features as originally symbolized, while those that do not support advanced symbols (such as ArcGIS Online Map Viewer) can use the simple symbols for display. Having both sets of symbols allows you to retain the advanced symbology where available and still share the feature service as widely as possible.

If your app works primarily with web maps that you want to look the same throughout the platform, your app should use the simple symbols API. Otherwise, make sure your users understand that advanced symbols render slightly differently on clients that don't support advanced symbology.

If your maps are used only with this API and ArcGIS Pro, you can use advanced symbols exclusively. When rendered by this API, advanced symbols are vectorized. This allows them to scale better on devices with high resolution screens.

You can set LoadSettings.useAdvancedSymbology to control whether the map uses advanced symbols (when available) or always renders with simple symbols.

A swatch is an image that is used to display this symbol. Properties of a swatch include:

  • Height, length of image from bottom to top side.

  • Width, length of image from left to right side.

  • Dots Per Inch (dpi), the resolution of the image.

  • Color, interior color of the image.

  • Geometry, shape of the image.

Depending on the Geometry of a Graphic or Feature different types of symbols will be used.

Since

200.1.0

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun clone(): Symbol

Clones the Symbol.

Link copied to clipboard
suspend fun createSwatch(screenScale: Float, width: Float? = null, height: Float? = null, backgroundColor: Color = Color.transparent): Result<BitmapDrawable>

Creates a swatch of the symbol. This method will scale the symbol up or down in order to fit it in to the desired width and height of the swatch.

suspend fun createSwatch(screenScale: Float, width: Float, height: Float, geometry: Geometry, backgroundColor: Color = Color.transparent): Result<BitmapDrawable>

Creates a swatch of the symbol.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int

Inherited functions

Link copied to clipboard
open override fun toJson(): String

Convert an object to JSON string.