TextSymbol QML Type
Defines how text is displayed using characteristics such as font, size, color, and position. More...
Import Statement: | import Esri.ArcGISRuntime |
Since: | Esri.ArcGISRuntime 100.0 |
Inherits: |
- List of all members, including inherited members
- TextSymbol is part of QML Type List.
Properties
- backgroundColor : color
- color : color
- fontDecoration : Enums.FontDecoration
- fontFamily : string
- fontStyle : Enums.FontStyle
- fontWeight : Enums.FontWeight
- haloColor : color
- haloWidth : real
- horizontalAlignment : Enums.HorizontalAlignment
- kerningEnabled : bool
- outlineColor : color
- outlineWidth : real
- size : real
- text : string
- verticalAlignment : Enums.VerticalAlignment
Signals
- backgroundColorChanged()
- colorChanged()
- fontDecorationChanged()
- fontFamilyChanged()
- fontStyleChanged()
- fontWeightChanged()
- haloColorChanged()
- haloWidthChanged()
- horizontalAlignmentChanged()
- kerningEnabledChanged()
- outlineColorChanged()
- outlineWidthChanged()
- sizeChanged()
- textChanged()
- verticalAlignmentChanged()
Methods
- bool equals(TextSymbol other)
Detailed Description
To display text in a MapView or SceneView, create a TextSymbol. Specify whether a string or attribute value is displayed by the text. Define the appearance and position of the text using color, size, fontStyle, or verticalAlignment, for example. Position the text by applying it to a Graphic based on any type of geometry - point, multipoint, polyline, or polygon. Add the graphic to the GraphicsOverlay::graphics collection and add the GraphicsOverlay to the MapView or SceneView collection of graphics overlays.
TextSymbol is also used to define the appearance of layer and grid based labels:
- Layers such as FeatureLayer, ArcGISSceneLayer, or DynamicEntityLayer contain label definitions that specify how labels are displayed. You can use 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.
- MapView can display a coordinate system grid with specific label styles at different resolutions. You can define the appearance of these labels using ArcGISGrid::setTextSymbol.
Example:
Create a TextSymbol and apply it to a Graphic:
var textSymbol = ArcGISRuntimeEnvironment.createObject("TextSymbol", { color: "black", text: "Redlands", size: 12.0, horizontalAlignment: Enums.HorizontalAlignmentRight, verticalAlignment: Enums.VerticalAlignmentMiddle }); var point = ArcGISRuntimeEnvironment.createObject("Point", {x: -117, y: 34}); var graphic = ArcGISRuntimeEnvironment.createObject("Graphic", {geometry: point, symbol: textSymbol});
See also JsonSerializable and Symbol.
Property Documentation
backgroundColor : color |
The color for the text symbol background.
The default value is transparent.
color : color |
The color of the text.
The default value is black.
fontDecoration : Enums.FontDecoration |
The font decoration of the text.
The default value is Enums.FontDecorationNone.
fontFamily : string |
The font family for the text.
This can be as specific as 'arial' or as generic as 'sans-serif', for example.
fontStyle : Enums.FontStyle |
fontWeight : Enums.FontWeight |
The font weight for the text.
Font weight describes how thick or thin characters in text are displayed. The default value is Enums.FontWeightNormal.
haloColor : color |
The color of the halo.
The default value is transparent.
haloWidth : real |
The width of the halo in device independent pixels (DIPs).
The default value is 0.0
.
horizontalAlignment : Enums.HorizontalAlignment |
The horizontal alignment for the text.
Returns HorizontalAlignment::Center if an error occurs.
See also Enums.HorizontalAlignment.
kerningEnabled : bool |
Whether kerning (visual adjustments to the spacing between characters in the text) is enabled.
Determines whether to adjust the spacing between characters in the text string.
The default value is false
.
outlineColor : color |
The color of the outline.
outlineWidth : real |
The width of the outline in device independent pixels (DIPs).
The default value is 0.0
.
size : real |
The size of the text in device independent pixels (DIPs).
The default value is 8.0
.
text : string |
The text to display for the symbol.
The default value is an empty string.
verticalAlignment : Enums.VerticalAlignment |
The vertical alignment for the text.
Returns Enums.VerticalAlignmentMiddle if an error occurs.
See also Enums.VerticalAlignment.
Signal Documentation
backgroundColorChanged() |
Emitted when the backgroundColor property changes.
Note: The corresponding handler is onBackgroundColorChanged
.
colorChanged() |
Emitted when the color property changes.
Note: The corresponding handler is onColorChanged
.
fontDecorationChanged() |
Emitted when the fontDecoration property changes.
Note: The corresponding handler is onFontDecorationChanged
.
fontFamilyChanged() |
Emitted when the fontFamily property changes.
Note: The corresponding handler is onFontFamilyChanged
.
fontStyleChanged() |
Emitted when the fontStyle property changes.
Note: The corresponding handler is onFontStyleChanged
.
fontWeightChanged() |
Emitted when the fontWeight property changes.
Note: The corresponding handler is onFontWeightChanged
.
haloColorChanged() |
Emitted when the haloColor property changes.
Note: The corresponding handler is onHaloColorChanged
.
haloWidthChanged() |
Emitted when the haloWidth property changes.
Note: The corresponding handler is onHaloWidthChanged
.
horizontalAlignmentChanged() |
Emitted when the horizontalAlignment property changes.
Note: The corresponding handler is onHorizontalAlignmentChanged
.
kerningEnabledChanged() |
Emitted when the kerningEnabled property changes.
Note: The corresponding handler is onKerningEnabledChanged
.
outlineColorChanged() |
Emitted when the outlineColor property changes.
Note: The corresponding handler is onOutlineColorChanged
.
outlineWidthChanged() |
Emitted when the outlineWidth property changes.
Note: The corresponding handler is onOutlineWidthChanged
.
sizeChanged() |
Emitted when the size property changes.
Note: The corresponding handler is onSizeChanged
.
textChanged() |
Emitted when the text property changes.
Note: The corresponding handler is onTextChanged
.
verticalAlignmentChanged() |
Emitted when the verticalAlignment property changes.
Note: The corresponding handler is onVerticalAlignmentChanged
.
Method Documentation
|
Compares two TextSymbols for equality.
Returns whether this instance and other are equivalent.
This method was introduced in Esri.ArcGISRuntime 200.1.