Companion
Static variables and methods.
Properties
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.
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.
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.
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.
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.
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.
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.
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
.
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.
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.