SymbolLayer class Null safety

An icon or a text label.

Inheritance

Constructors

SymbolLayer({required dynamic id, dynamic visibility, dynamic minZoom, dynamic maxZoom, required String sourceId, String? sourceLayer, bool? iconAllowOverlap, IconAnchor? iconAnchor, bool? iconIgnorePlacement, String? iconImage, bool? iconKeepUpright, List<double?>? iconOffset, bool? iconOptional, double? iconPadding, IconPitchAlignment? iconPitchAlignment, double? iconRotate, IconRotationAlignment? iconRotationAlignment, double? iconSize, IconTextFit? iconTextFit, List<double?>? iconTextFitPadding, bool? symbolAvoidEdges, SymbolPlacement? symbolPlacement, double? symbolSortKey, double? symbolSpacing, SymbolZOrder? symbolZOrder, bool? textAllowOverlap, TextAnchor? textAnchor, List<String?>? textFont, bool? textIgnorePlacement, TextJustify? textJustify, bool? textKeepUpright, double? textLetterSpacing, double? textLineHeight, double? textMaxAngle, double? textMaxWidth, List<double?>? textOffset, bool? textOptional, double? textPadding, TextPitchAlignment? textPitchAlignment, double? textRadialOffset, double? textRotate, TextRotationAlignment? textRotationAlignment, double? textSize, TextTransform? textTransform, List<String?>? textVariableAnchor, List<String?>? textWritingMode, int? iconColor, double? iconHaloBlur, int? iconHaloColor, double? iconHaloWidth, double? iconOpacity, List<double?>? iconTranslate, IconTranslateAnchor? iconTranslateAnchor, int? textColor, double? textHaloBlur, int? textHaloColor, double? textHaloWidth, double? textOpacity, List<double?>? textTranslate, TextTranslateAnchor? textTranslateAnchor})

Properties

hashCode int
The hash code for this object.
read-onlyinherited
iconAllowOverlap bool?
If true, the icon will be visible even if it collides with other previously drawn symbols.
read / write
iconAnchor IconAnchor?
Part of the icon placed closest to the anchor.
read / write
iconColor int?
The color of the icon. This can only be used with sdf icons.
read / write
iconHaloBlur double?
Fade out the halo towards the outside.
read / write
iconHaloColor int?
The color of the icon's halo. Icon halos can only be used with SDF icons.
read / write
iconHaloWidth double?
Distance of halo to the icon outline.
read / write
iconIgnorePlacement bool?
If true, other symbols can be visible even if they collide with the icon.
read / write
iconImage String?
Name of image in sprite to use for drawing an image background.
read / write
iconKeepUpright bool?
If true, the icon may be flipped to prevent it from being rendered upside-down.
read / write
iconOffset List<double?>?
Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of icon-size to obtain the final offset in pixels. When combined with icon-rotate the offset will be as if the rotated direction was up.
read / write
iconOpacity double?
The opacity at which the icon will be drawn.
read / write
iconOptional bool?
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
read / write
iconPadding double?
Size of the additional area around the icon bounding box used for detecting symbol collisions.
read / write
iconPitchAlignment IconPitchAlignment?
Orientation of icon when map is pitched.
read / write
iconRotate double?
Rotates the icon clockwise.
read / write
iconRotationAlignment IconRotationAlignment?
In combination with symbol-placement, determines the rotation behavior of icons.
read / write
iconSize double?
Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by icon-size. 1 is the original size; 3 triples the size of the image.
read / write
iconTextFit IconTextFit?
Scales the icon to fit around the associated text.
read / write
iconTextFitPadding List<double?>?
Size of the additional area added to dimensions determined by icon-text-fit, in clockwise order: top, right, bottom, left.
read / write
iconTranslate List<double?>?
Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
read / write
iconTranslateAnchor IconTranslateAnchor?
Controls the frame of reference for icon-translate.
read / write
id String
The ID of the Layer.
read / writeinherited
maxZoom double?
The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
read / writeinherited
minZoom double?
The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
read / writeinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
sourceId String
The id of the source.
read / write
sourceLayer String?
A source layer is an individual layer of data within a vector source. A vector source can have multiple source layers.
read / write
symbolAvoidEdges bool?
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.
read / write
symbolPlacement SymbolPlacement?
Label placement relative to its geometry.
read / write
symbolSortKey double?
Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When icon-allow-overlap or text-allow-overlap is false, features with a lower sort key will have priority during placement. When icon-allow-overlap or text-allow-overlap is set to true, features with a higher sort key will overlap over features with a lower sort key.
read / write
symbolSpacing double?
Distance between two symbol anchors.
read / write
symbolZOrder SymbolZOrder?
Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use symbol-sort-key.
read / write
textAllowOverlap bool?
If true, the text will be visible even if it collides with other previously drawn symbols.
read / write
textAnchor TextAnchor?
Part of the text placed closest to the anchor.
read / write
textColor int?
The color with which the text will be drawn.
read / write
textFont List<String?>?
Font stack to use for displaying text.
read / write
textHaloBlur double?
The halo's fadeout distance towards the outside.
read / write
textHaloColor int?
The color of the text's halo, which helps it stand out from backgrounds.
read / write
textHaloWidth double?
Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.
read / write
textIgnorePlacement bool?
If true, other symbols can be visible even if they collide with the text.
read / write
textJustify TextJustify?
Text justification options.
read / write
textKeepUpright bool?
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
read / write
textLetterSpacing double?
Text tracking amount.
read / write
textLineHeight double?
Text leading value for multi-line text.
read / write
textMaxAngle double?
Maximum angle change between adjacent characters.
read / write
textMaxWidth double?
The maximum line width for text wrapping.
read / write
textOffset List<double?>?
Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.
read / write
textOpacity double?
The opacity at which the text will be drawn.
read / write
textOptional bool?
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
read / write
textPadding double?
Size of the additional area around the text bounding box used for detecting symbol collisions.
read / write
textPitchAlignment TextPitchAlignment?
Orientation of text when map is pitched.
read / write
textRadialOffset double?
Radial offset of text, in the direction of the symbol's anchor. Useful in combination with text-variable-anchor, which defaults to using the two-dimensional text-offset if present.
read / write
textRotate double?
Rotates the text clockwise.
read / write
textRotationAlignment TextRotationAlignment?
In combination with symbol-placement, determines the rotation behavior of the individual glyphs forming the text.
read / write
textSize double?
Font size.
read / write
textTransform TextTransform?
Specifies how to capitalize text, similar to the CSS text-transform property.
read / write
textTranslate List<double?>?
Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
read / write
textTranslateAnchor TextTranslateAnchor?
Controls the frame of reference for text-translate.
read / write
textVariableAnchor List<String?>?
To increase the chance of placing high-priority labels on the map, you can provide an array of text-anchor locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use text-justify: auto to choose justification based on anchor position. To apply an offset, use the text-radial-offset or the two-dimensional text-offset.
read / write
textWritingMode List<String?>?
The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.
read / write
visibility Visibility?
The visibility of the layer.
read / writeinherited

Methods

getType() String
Get the type of current layer as a String.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

decode(String properties) SymbolLayer