Class LabelDefinition
Describes an object that defines the text, appearance, and position of labels for features within a given scale range via ArcGIS JSON.
Inheritance
Namespace: Esri.ArcGISRuntime.Mapping
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class LabelDefinition
Remarks
A LabelDefinition describes a class of labels.
A collection of label definitions can be attached to a FeatureLayer, a SubtypeSublayer, a GraphicsOverlay, or an ArcGISMapImageSublayer of a dynamic ArcGISMapImageLayer.
Each LabelDefinition specifies:
- Which features are covered by the definition, by applying the WhereClause SQL constraint.
- What text should be displayed, based on the individual feature's attributes and the chosen Expression formula.
- How the text should appear, using the label definition's TextSymbol.
- Where the text should appear, with respect to its feature, using the Placement.
- How to move or avoid other labels or features that would overlap each label.
Constructors
Name | Description |
---|---|
LabelDefinition(LabelExpression, TextSymbol) | Initializes a new instance of the LabelDefinition class with the specified LabelExpression and TextSymbol. |
Properties
Name | Description |
---|---|
Angle | Gets or sets the LabelAngle that specifies angular positions and layout directions for labels on or around point feature symbols. |
DeconflictionStrategy | Gets or sets the strategy for moving labels to avoid overlapping feature, annotation, dimension or graphic symbols or higher priority labels. In 3D Static is selected by default. |
Expression | Gets or sets the expression script used to calculate the label text. |
FeatureBoundaryOverlapStrategy | Gets or sets the strategy for whether other labels are allowed to overlap the boundary of polygon features/graphics being labeled by this LabelDefinition. In 3D scenes, labels will be allowed to overlap the boundaries of polygon features. |
FeatureInteriorOverlapStrategy | Gets or sets the strategy for whether other labels are allowed to overlap the interior of polygon features/graphics being labeled by this LabelDefinition. In 3D scenes, labels will be allowed to overlap the interiors of polygon features. |
GeometryStrategy | Gets or sets the strategy for how to use the geometry of the feature when calculating the label position. |
LabelOverlapStrategy | Gets or sets the strategy for whether other labels are allowed to overlap labels created by this LabelDefinition. In 3D, labels will not be allowed to overlap other labels. Overlapping labels will not be displayed until the user zooms in further so that the labels don't overlap. |
LineConnection | Gets or sets the strategy for whether line features with the same label, and matching end vertices, should be joined before sharing a label. 3D line features will be treated as independent features with their own label. |
LineOrientation | Gets or sets the strategy for whether Placement above or below a line geometry will be interpreted as above or below on the "screen," or with respect to the "direction" of line's geometry (that is, the digitization order in which the vertices are listed). |
MaxScale | Gets or sets the maximum scale at which labels will be visible. In 3D scenes, the scale range is between individual label and view plane instead of map and view plane. |
MinScale | Gets or sets the minimum scale at which labels will be visible. In 3D scenes, the scale range is between individual label and view plane instead of map and view plane. |
MultipartStrategy | Gets or sets the strategy for how many labels should be placed on each polyline or polygon (multi-ring) feature. |
Name | Gets or sets the text name for the class of labels. |
OffsetDistance | Gets or sets the distance (in points i.e. 1/72 inches) that text should be moved away from its features. |
OverrunStrategy | Gets or sets the strategy for whether a label will be visible at scales where the feature is too small for the label to fit. Not supported by 3D scenes. |
Placement | Gets or sets the preferred position of the text label, with respect to its feature geometry. |
Priority | Gets or sets a number that defines which labels are placed first, and can also supplant existing lower-priority labels (e.g. during panning). |
RemoveDuplicatesDistance | Gets or sets a value that controls the duplicate thinning radius (in points i.e. 1/72 inches). |
RemoveDuplicatesStrategy | Gets or sets the strategy for whether labels are removed if other features have the same text label. This can reduce clutter and free up space. |
RepeatDistance | Gets or sets The distance apart (in points i.e. 1/72 inches) that the repetitions should be. In 3D scenes, only one label will be placed per line feature. |
RepeatStrategy | Gets or sets the strategy for whether a label should have multiple copies created and placed along or across the same feature. In 3D scenes, only label will be placed per line feature. |
StackAlignment | Gets or sets the strategy for how multi-row (stacked) text should be aligned. |
StackBreakPosition | Gets or sets the strategy for whether a row of text should be broken before or after it exceeds the ideal length. |
StackRowLength | Gets or sets a value that limits the number of characters in a row of stacked text. |
StackSeparators | Gets a collection of stack separators that should be used for automatic line breaking of label text. |
StackStrategy | Gets or sets the strategy for whether the text should be stacked or wrapped, rather than placed as long trailing labels across the map. |
TextLayout | Gets or sets the layout of the text, which can be either horizontal, straight, perpendicular, or follow the line feature. |
TextOrientation | Gets or sets the orientation of the text, which can be either angle direction or screen-oriented. Not supported by 3D scenes. |
TextSymbol | Gets or sets text symbol which describes the overall appearance of label text (e.g. font and size). |
UnknownJson | Gets a collection of unknown data from the source JSON. |
UnsupportedJson | Gets a collection of unsupported data from the source JSON. |
UseCodedValues | Gets or sets a value indicating whether the data source should translate domain identifiers into meanings using a CodedValueDomain. |
WhereClause | Gets or sets the SQL WHERE clause expression that limits the set of features for which labels will be generated and placed. |
Methods
Name | Description |
---|---|
FromJson(String) | Creates a label definition from an ArcGIS JSON label representation ( |
ToJson() | Converts this label definition to an ArcGIS JSON label representation ( |
See Also
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.5 |
.NET | 100.13 - 200.5 |
.NET Windows | 100.13 - 200.5 |
.NET Android | 200.0 - 200.5 |
.NET iOS | 200.0 - 200.5 |
.NET Framework | 100.1 - 200.5 |
Xamarin.Android | 100.1 - 100.15 |
Xamarin.iOS | 100.1 - 100.15 |
UWP | 100.1 - 200.5 |