Text Symbol
Defines how text is displayed using characteristics such as font, size, color, and position. To display text in a com.arcgismaps.mapping.view.MapView or com.arcgismaps.mapping.view.SceneView, create a TextSymbol. Specify whether a string or attribute value is displayed by the TextSymbol.text. Define the appearance and position of the text using TextSymbol.color, TextSymbol.size, TextSymbol.fontStyle, or TextSymbol.verticalAlignment, for example. Position the text by applying it to a com.arcgismaps.mapping.view.Graphic based on any type of geometry - point, multipoint, polyline, or polygon. Add the graphic to the com.arcgismaps.mapping.view.GraphicsOverlay.graphics collection and add the com.arcgismaps.mapping.view.GraphicsOverlay to the com.arcgismaps.mapping.view.MapView or com.arcgismaps.mapping.view.SceneView collection of graphics overlays.
TextSymbol is also used to define the appearance of layer and grid based labels:
Layers such as com.arcgismaps.mapping.layers.FeatureLayer, com.arcgismaps.mapping.layers.ArcGISSceneLayer, or com.arcgismaps.mapping.layers.DynamicEntityLayer contain label definitions that specify how labels are displayed. You can use com.arcgismaps.mapping.labeling.LabelDefinition.textSymbol to define a label appearance within a scale range. To display these labels, add a collection of these label definitions to a layer.
com.arcgismaps.mapping.view.MapView can display a coordinate system grid with specific label styles at different resolutions. You can define the appearance of these labels using com.arcgismaps.mapping.view.Grid.setTextSymbol.
Since
200.1.0
See also
Constructors
Creates a text symbol with default values. The default values are:
Creates a text symbol with the given size, text, and color along with the horizontal and vertical alignment relative to the mid-point of this symbol.
Properties
The color for the text symbol background. The default value is transparent.
The type of font decoration for the text symbol. The default value is FontDecoration.None. FontDecoration.None if an error occurs.
The font family of the text symbol. This can be as specific as 'arial' or as generic as 'sans-serif', for example.
The font style of the text symbol. The default value is FontStyle.Normal. Returns FontStyle.Normal if an error occurs.
The font weight of the text symbol. Font weight describes how thick or thin characters in text are displayed. The default value is FontWeight.Normal. Returns FontWeight.Normal if an error occurs.
The horizontal alignment of the text symbol relative to the symbol's mid-point location. The default value is HorizontalAlignment.Center. Returns HorizontalAlignment.Center if an error occurs.
If kerning needs to be enabled. It is disabled by default. Determines whether to adjust the spacing between characters in the text string.
The color for the text symbol outline.
The width of the text symbol outline in device-independent pixels (DIPs). The default value is 0.0.
The vertical alignment of the text symbol relative to the symbol's mid-point location. The default value is VerticalAlignment.Middle. Returns VerticalAlignment.Middle if an error occurs.
Inherited properties
The angle (in degrees) that the marker symbol is rotated by. The marker symbol can be rotated relative to the map or the screen, depending on the MarkerSymbol.angleAlignment.
Indicates whether the marker symbol is rotated relative to the screen or map. If the value is SymbolAngleAlignment.Map, the marker symbol is rotated relative to the map and will be affected by the map's rotation. If the value is SymbolAngleAlignment.Screen, the marker symbol is rotated relative to the user's screen and is unaffected by the map's rotation.
The callout leader's X offset relative to the marker symbol.
The callout leader's Y offset relative to the marker symbol.
Functions
Inherited functions
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.
Creates a swatch of the symbol.