Symbol Layer State
The state holder for SymbolLayer's layer properties.
See also
Constructors
Construct an default SymbolLayerState.
Properties
An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The ["feature-state", ...]
expression is not supported in filter expressions. The ["pitch"]
and ["distance-from-center"]
expressions are supported only for filter expressions on the symbol layer.
Defines the transition of iconColorSaturation. Default value: 0. Value range: -1, 1
Defines the transition of iconEmissiveStrength. Default value: 1. Minimum value: 0.
Defines the transition of iconHaloBlur. Default value: 0. Minimum value: 0.
Defines the transition of iconHaloColor. Default value: "rgba(0, 0, 0, 0)".
Defines the transition of iconHaloWidth. Default value: 0. Minimum value: 0.
Defines the transition of iconImageCrossFade. Default value: 0. Value range: 0, 1
Defines the transition of iconOcclusionOpacity. Default value: 0. Value range: 0, 1
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. Default value: 0,0.
Defines the transition of iconOpacity. Default value: 1. Value range: 0, 1
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. Default value: false.
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.
Position symbol on buildings (both fill extrusions and models) rooftops. In order to have minimal impact on performance, this is supported only when fill-extrusion-height
is not zoom-dependent and remains unchanged. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building rooftops. Symbols are sorted by elevation, except in cases when viewport-y
sorting or symbol-sort-key
are applied. Default value: false.
Defines the transition of symbolZOffset. Default value: 0. Minimum value: 0.
Defines the transition of textEmissiveStrength. Default value: 1. Minimum value: 0.
Defines the transition of textHaloBlur. Default value: 0. Minimum value: 0.
Defines the transition of textHaloColor. Default value: "rgba(0, 0, 0, 0)".
Defines the transition of textHaloWidth. Default value: 0. Minimum value: 0.
Defines the transition of textOcclusionOpacity. Default value: 0. Value range: 0, 1
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. Default value: 0,0.
Defines the transition of textOpacity. Default value: 1. Value range: 0, 1
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
.
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. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either 'horizontal', 'vertical' or 'vertical', 'horizontal', the order doesn't affect the placement.