layout: default title: TextSymbol parent: Core Classes —
dymaptic.GeoBlazor.Core
dymaptic.GeoBlazor.Core.Components.Symbols
TextSymbol Class
Text symbols are used to define the graphic for displaying labels on a FeatureLayer, CSVLayer, Sublayer, and
StreamLayer in a 2D MapView. Text symbols can also be used to define the symbol property of Graphic if the geometry
type is Point or Multipoint. With this class, you may alter the color, font, halo, and other properties of the
label graphic.
ArcGIS Maps SDK for JavaScript
public class TextSymbol : dymaptic.GeoBlazor.Core.Components.Symbols.Symbol
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 Symbol 🡒 TextSymbol
Constructors
TextSymbol() Constructor
Parameterless constructor for use as a razor component
public TextSymbol();
TextSymbol(string, MapColor, MapColor, Dimension, MapFont, Nullable, MapColor, MapColor, Nullable, Nullable, Nullable, Nullable, Dimension, Nullable, Nullable, Dimension, Dimension) Constructor
Constructor for use in code
public TextSymbol(string text, dymaptic.GeoBlazor.Core.Objects.MapColor? color=null, dymaptic.GeoBlazor.Core.Objects.MapColor? haloColor=null, dymaptic.GeoBlazor.Core.Objects.Dimension? haloSize=null, dymaptic.GeoBlazor.Core.Components.Symbols.MapFont? font=null, System.Nullable<double> angle=null, dymaptic.GeoBlazor.Core.Objects.MapColor? backgroundColor=null, dymaptic.GeoBlazor.Core.Objects.MapColor? borderLineColor=null, System.Nullable<double> borderLineSize=null, System.Nullable<dymaptic.GeoBlazor.Core.Components.Symbols.HorizontalAlignment> horizontalAlignment=null, System.Nullable<bool> kerning=null, System.Nullable<double> lineHeight=null, dymaptic.GeoBlazor.Core.Objects.Dimension? lineWidth=null, System.Nullable<bool> rotated=null, System.Nullable<dymaptic.GeoBlazor.Core.Components.Symbols.VerticalAlignment> verticalAlignment=null, dymaptic.GeoBlazor.Core.Objects.Dimension? xOffset=null, dymaptic.GeoBlazor.Core.Objects.Dimension? yOffset=null);
Parameters
text
System.String
The text string to display in the view.
color
MapColor
The color of the symbol.
haloColor
MapColor
The color of the text symbol’s halo.
haloSize
Dimension
The size in points of the text symbol’s halo.
font
MapFont
The MapFont used to style the text.
angle
System.Nullable<System.Double>
The angle of the text. 0 is horizontal and the angle moves clockwise.
backgroundColor
MapColor
The background color of the label’s bounding box.
borderLineColor
MapColor
The border color of the label’s bounding box.
borderLineSize
System.Nullable<System.Double>
The border size or width of the label’s bounding box.
horizontalAlignment
System.Nullable<HorizontalAlignment>
Adjusts the horizontal alignment of the text in multi-lines. Default value is Center.
kerning
System.Nullable<System.Boolean>
Determines whether to adjust the spacing between characters in the text string. Default value is true.
lineHeight
System.Nullable<System.Double>
The height of the space between each line of text. Only applies to multiline text.
lineWidth
Dimension
The maximum length in points for each line of text. This value is a string expressing size in points or pixels (e.g.
rotated
System.Nullable<System.Boolean>
Determines whether every character in the text string is rotated. Default value is false.
verticalAlignment
System.Nullable<VerticalAlignment>
Adjusts the vertical alignment of the text. Default value is Baseline.
xOffset
Dimension
The offset on the x-axis in points. This value is a string expressing size in points or pixels (e.g. “12px”, “12pt”),
yOffset
Dimension
The offset on the y-axis in points. This value is a string expressing size in points or pixels (e.g. “12px”, “12pt”),
Properties
TextSymbol.Angle Property
The angle of the text. 0 is horizontal and the angle moves clockwise.
public System.Nullable<double> Angle { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
This property is currently not supported in 3D SceneViews.
TextSymbol.BackgroundColor Property
The background color of the label’s bounding box.
public dymaptic.GeoBlazor.Core.Objects.MapColor? BackgroundColor { get; set; }
Property Value
Remarks
This property is currently not supported when labelling a FeatureLayer polyline with a “curved” labelPosition.
TextSymbol.BorderLineColor Property
The border color of the label’s bounding box.
public dymaptic.GeoBlazor.Core.Objects.MapColor? BorderLineColor { get; set; }
Property Value
Remarks
This property is currently not supported when labelling a FeatureLayer polyline with a “curved” labelPosition.
TextSymbol.BorderLineSize Property
The border size or width of the label’s bounding box.
public System.Nullable<double> BorderLineSize { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
This property is currently not supported when labelling a FeatureLayer polyline with a “curved” labelPosition.
TextSymbol.Font Property
The MapFont used to style the text.
public dymaptic.GeoBlazor.Core.Components.Symbols.MapFont? Font { get; set; }
Property Value
TextSymbol.HaloColor Property
The color of the text symbol’s halo.
public dymaptic.GeoBlazor.Core.Objects.MapColor? HaloColor { get; set; }
Property Value
TextSymbol.HaloSize Property
The size in points of the text symbol’s halo.
public dymaptic.GeoBlazor.Core.Objects.Dimension? HaloSize { get; set; }
Property Value
Remarks
Known Limitations
- Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers.
- Halo size should not be 1/4 larger than the text size. For example, if your text size is 12, the halo size should not be larger than 3.
TextSymbol.HorizontalAlignment Property
Adjusts the horizontal alignment of the text in multi-lines. Default value is Center.
public System.Nullable<dymaptic.GeoBlazor.Core.Components.Symbols.HorizontalAlignment> HorizontalAlignment { get; set; }
Property Value
System.Nullable<HorizontalAlignment>
Remarks
This property only applies when TextSymbol is not used for labeling purposes. The horizontalAlignment for labels is inferred from the labelPlacement value.
TextSymbol.Kerning Property
Determines whether to adjust the spacing between characters in the text string. Default value is true.
public System.Nullable<bool> Kerning { get; set; }
Property Value
System.Nullable<System.Boolean>
TextSymbol.LineHeight Property
The height of the space between each line of text. Only applies to multiline text.
This property can be considered as a multiplier of the default value of 1.0 (e.g. a value of 2.0 will be two times the height of the default height). The range of possible values is: 0.1 - 4.0. If a value of 0 is specified, the default value of 1.0 will be used.
Default Value: 1.0
public System.Nullable<double> LineHeight { get; set; }
Property Value
System.Nullable<System.Double>
TextSymbol.LineWidth Property
The maximum length in points for each line of text. This value is a string expressing size in points or pixels (e.g. “12px”, “12pt”), which defaults to points.
The default value is 192 points. The range of possible values is: 32px - 512px.
If text extends farther than the lineWidth value, then the line will break at the whitespace before the text that extends past the limit if possible, and a new line will be created.
public dymaptic.GeoBlazor.Core.Objects.Dimension? LineWidth { get; set; }
Property Value
Remarks
Known Limitations:
- This property is currently not supported in 3D SceneViews.
- The default value is subject to change in future releases.
TextSymbol.Rotated Property
Determines whether every character in the text string is rotated. Default value is false.
public System.Nullable<bool> Rotated { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
This property is currently not supported in 3D SceneViews.
TextSymbol.Text Property
The text string to display in the view.
public string? Text { get; set; }
Property Value
TextSymbol.Type Property
The symbol type
public override string Type { get; }
Property Value
TextSymbol.VerticalAlignment Property
Adjusts the vertical alignment of the text. Default value is Baseline.
public System.Nullable<dymaptic.GeoBlazor.Core.Components.Symbols.VerticalAlignment> VerticalAlignment { get; set; }
Property Value
System.Nullable<VerticalAlignment>
Remarks
This property only applies when TextSymbol is not used for labeling purposes. The verticalAlignment for labels is inferred from the labelPlacement value.
TextSymbol.XOffset Property
The offset on the x-axis in points. This value is a string expressing size in points or pixels (e.g. “12px”, “12pt”), which defaults to points.
public dymaptic.GeoBlazor.Core.Objects.Dimension? XOffset { get; set; }
Property Value
Remarks
This property is currently not supported in 3D SceneViews.
TextSymbol.YOffset Property
The offset on the y-axis in points. This value is a string expressing size in points or pixels (e.g. “12px”, “12pt”), which defaults to points.
public dymaptic.GeoBlazor.Core.Objects.Dimension? YOffset { get; set; }
Property Value
Remarks
This property is currently not supported in 3D SceneViews.
Methods
TextSymbol.RegisterChildComponent(MapComponent) Method
Called from dymaptic.GeoBlazor.Core.Components.MapComponent.OnInitializedAsync to “Register” the current component with it’s parent.
public override System.Threading.Tasks.Task RegisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);
Parameters
child
MapComponent
The calling, child component to register
Returns
Exceptions
InvalidChildElementException
Throws if the current child is not a valid sub-component to the parent.
Remarks
This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method. If you see no other way to register a child component, please open an issue on GitHub.
TextSymbol.UnregisterChildComponent(MapComponent) Method
Undoes the “Registration” of a child with its parent.
public override System.Threading.Tasks.Task UnregisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);
Parameters
child
MapComponent
The child to unregister
Returns
Remarks
This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method.