LabelDefinition class final

An object that defines the text, appearance, and position of labels for features within a given scale range.

A LabelDefinition describes a class of labels.

A collection of label definitions can be attached to a feature data source (example FeatureLayer). Each LabelDefinition specifies:

  • Which features are covered by the definition, by applying the LabelDefinition.whereClause SQL constraint
  • What text should be displayed, based on the individual feature's attributes and the chosen LabelDefinition.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 LabelDefinition.placement
  • How to move or avoid other labels or features that would overlap each label
Implemented types
Mixed-in types

Constructors

LabelDefinition({required LabelExpression labelExpression, TextSymbol? textSymbol})
Creates a LabelDefinition with the specified LabelExpression and TextSymbol.
factory
LabelDefinition.fromJson(Map<String, dynamic> json)
Creates an instance of this class from JSON of the data type used by jsonDecode.
factory
LabelDefinition.fromJsonString(String jsonString)
Creates an instance of this class from a JSON String.
factory

Properties

angle LabelAngle?
The angular positions and layout directions for labels on or around point feature symbols.
getter/setter pair
deconflictionStrategy LabelDeconflictionStrategy
The strategy for moving labels to avoid overlapping feature, annotation, dimension or graphic symbols or higher priority labels. In 3D LabelDeconflictionStrategy.static is selected by default.
getter/setter pair
expression LabelExpression
The expression script used to calculate the label text.
getter/setter pair
featureBoundaryOverlapStrategy LabelOverlapStrategy
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.
getter/setter pair
featureInteriorOverlapStrategy LabelOverlapStrategy
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.
getter/setter pair
geometryStrategy LabelGeometryStrategy
The strategy for how to use the geometry of the feature when calculating the label position.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
labelOverlapStrategy LabelOverlapStrategy
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.
getter/setter pair
lineConnection LabelLineConnection
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.
getter/setter pair
lineOrientation LabelLineOrientation
The strategy for whether LabelDefinition.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).
getter/setter pair
maxScale double
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.
getter/setter pair
minScale double
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.
getter/setter pair
multipartStrategy LabelMultipartStrategy
The strategy for how many labels should be placed on each polyline or polygon (multi-ring) feature.
getter/setter pair
name String
Text name for the class of labels.
getter/setter pair
offsetDistance double
The distance (in points i.e. 1/72 inches) that text should be moved away from its features.
getter/setter pair
overrunStrategy LabelOverrunStrategy
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.
getter/setter pair
placement LabelingPlacement
The preferred position of the text label, with respect to its feature geometry.
getter/setter pair
priority double
Defines which labels are placed first, and can also supplant existing lower-priority labels (e.g. during panning).
getter/setter pair
removeDuplicatesDistance double
A value that controls the duplicate thinning radius (in points i.e. 1/72 inches).
getter/setter pair
removeDuplicatesStrategy LabelRemoveDuplicatesStrategy
The strategy for whether labels are removed if other features have the same text label. This can reduce clutter and free up space.
getter/setter pair
repeatDistance double
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.
getter/setter pair
repeatStrategy LabelRepeatStrategy
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.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackAlignment LabelStackAlignment
The strategy for how multi-row (stacked) text should be aligned.
getter/setter pair
stackBreakPosition LabelStackBreakPosition
The strategy for whether a row of text should be broken before or after it exceeds the ideal length.
getter/setter pair
stackRowLength double
A value that limits the number of characters in a row of stacked text.
getter/setter pair
stackSeparators List<LabelStackSeparator>
The stack separators that should be used for automatic line breaking of label text.
no setter
stackStrategy LabelStackStrategy
The strategy for whether the text should be stacked or wrapped, rather than placed as long trailing labels across the map.
getter/setter pair
textLayout LabelTextLayout
The layout of the text, which can be either horizontal, straight, perpendicular, or follow the line feature.
getter/setter pair
textOrientation LabelTextOrientation
The orientation of the text, which can be either angle direction or screen-oriented. Not supported by 3D scenes.
getter/setter pair
textSymbol TextSymbol?
The text symbol which describes the overall appearance of label text (e.g. font and size).
getter/setter pair
useCodedValues bool
True if the data source should translate domain identifiers into meanings using a CodedValueDomain, false otherwise.
getter/setter pair
whereClause String
A SQL where clause expression that limits the set of features for which labels will be generated and placed.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Returns a JSON representation of this Object in the data type used by jsonDecode.
inherited
toJsonString() String
Returns a JSON representation of this Object as a String.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited