layout: default title: Label parent: Core Classes —
dymaptic.GeoBlazor.Core
dymaptic.GeoBlazor.Core.Components.Layers
Label Class
Defines label expressions, symbols, scale ranges, label priorities, and label placement options for labels on a
layer. See the Labeling guide for more information about labeling.
ArcGIS Maps SDK for JavaScript
public class Label : dymaptic.GeoBlazor.Core.Components.Layers.LayerObject
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 LayerObject 🡒 Label
Constructors
Label() Constructor
Parameterless constructor for use as a Blazor component.
public Label();
Label(Nullable, string, LabelExpressionInfo) Constructor
Constructor for generating in code.
public Label(System.Nullable<dymaptic.GeoBlazor.Core.Components.Layers.LabelPlacement> labelPlacement=null, string? labelExpression=null, dymaptic.GeoBlazor.Core.Components.Layers.LabelExpressionInfo? labelExpressionInfo=null);
Parameters
labelPlacement
System.Nullable<LabelPlacement>
The position of the label.
labelExpression
System.String
Defines the labels for a MapImageLayer.
labelExpressionInfo
LabelExpressionInfo
Defines the labels for a FeatureLayer.
Properties
Label.DeconflictionStrategy Property
Defines how labels should be placed relative to one another. By default, labels have a static deconfliction strategy, meaning labels that overlap are dropped to make them easier to read.
In some cases where few labels overlap, it may be preferable to turn off label deconfliction with the none option. It is also advisable to turn off deconfliction when labeling clusters with a count of features in the center of the cluster.
public System.Nullable<dymaptic.GeoBlazor.Core.Components.Layers.DeconflictionStrategy> DeconflictionStrategy { get; set; }
Property Value
System.Nullable<DeconflictionStrategy>
Remarks
Currently, this property only applies to FeatureLayer, CSVLayer, and StreamLayer in 2D MapViews.
Label.LabelExpression Property
Defines the labels for a MapImageLayer.
public string? LabelExpression { get; set; }
Property Value
Remarks
MapImageLayer not yet implemented in GeoBlazor
Label.LabelExpressionInfo Property
Defines the labels for a FeatureLayer.
public dymaptic.GeoBlazor.Core.Components.Layers.LabelExpressionInfo? LabelExpressionInfo { get; set; }
Property Value
Label.LabelPlacement Property
The position of the label.
public System.Nullable<dymaptic.GeoBlazor.Core.Components.Layers.LabelPlacement> LabelPlacement { get; set; }
Property Value
System.Nullable<LabelPlacement>
Label.LabelPosition Property
Specifies the orientation of the label position of a polyline label. If “curved”, this means the characters follow the curve of the polyline, while “parallel” means the characters will always be straight, and the orientation will be based on the angle of the polyline’s curve at the label’s position.
Default Value: curved
public System.Nullable<dymaptic.GeoBlazor.Core.Components.Layers.LabelPosition> LabelPosition { get; set; }
Property Value
System.Nullable<LabelPosition>
Remarks
Currently, this property only applies to Polyline FeatureLayer and CSVLayer in 2D MapViews.
Currently, this property cannot be saved as part of a WebMap.
Label.MaxScale Property
The maximum scale (most zoomed in) at which labels are visible in the view. A value of 0 means the label’s visibility does not have a maximum scale. The maxScale value should always be smaller than the minScale value, and greater than or equal to the service specification.
Default Value:0
public System.Nullable<double> MaxScale { get; set; }
Property Value
System.Nullable<System.Double>
Label.MinScale Property
The minimum scale (most zoomed out) at which labels are visible in the view. A value of 0 means the label’s visibility does not have a minimum scale. The minScale value should always be larger than the maxScale value, and less than or equal to the service specification.
public System.Nullable<double> MinScale { get; set; }
Property Value
System.Nullable<System.Double>
Label.RepeatLabel Property
Indicates whether or not to repeat the label along the polyline feature. If true, the label will be repeated according to the repeatLabelDistance. If false, the label will display once per polyline segment.
public System.Nullable<bool> RepeatLabel { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Currently, this property only applies to Polyline FeatureLayer and CSVLayer in 2D MapViews.
Label.RepeatLabelDistance Property
The size in points of the distance between labels on a polyline. This value may be autocast with a string expressing size in points or pixels (e.g. 100, or “64pt”, or “128px”). The repeatLabel property must be true for this property to be honored.
public dymaptic.GeoBlazor.Core.Objects.Dimension? RepeatLabelDistance { get; set; }
Property Value
Remarks
Currently, this property only applies to Polyline FeatureLayer and CSVLayer in 2D MapViews.
Label.UseCodedValues Property
Indicates whether to use domain names if the fields in the labelExpression or labelExpressionInfo have domains.
public System.Nullable<bool> UseCodedValues { get; set; }
Property Value
System.Nullable<System.Boolean>
Label.Where Property
A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to true based on this expression will be labeled.
Default Value:null
public string? Where { get; set; }
Property Value
Methods
Label.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.
Label.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.