Type Alias AllLayoutProperties
"circle-sort-key"?: DataDrivenPropertyValueSpecification<number>;
"fill-sort-key"?: DataDrivenPropertyValueSpecification<number>;
"icon-allow-overlap"?: PropertyValueSpecification<boolean>;
"icon-anchor"?: DataDrivenPropertyValueSpecification<
| "center"
| "left"
| "right"
| "top"
| "bottom"
| "top-left"
| "top-right"
| "bottom-left"
| "bottom-right",
>;
"icon-ignore-placement"?: PropertyValueSpecification<boolean>;
"icon-image"?: DataDrivenPropertyValueSpecification<
ResolvedImageSpecification,
>;
"icon-keep-upright"?: PropertyValueSpecification<boolean>;
"icon-offset"?: DataDrivenPropertyValueSpecification<[number, number]>;
"icon-optional"?: PropertyValueSpecification<boolean>;
"icon-overlap"?: PropertyValueSpecification<
"never"
| "always"
| "cooperative",
>;
"icon-padding"?: DataDrivenPropertyValueSpecification<PaddingSpecification>;
"icon-pitch-alignment"?: PropertyValueSpecification<
"map"
| "viewport"
| "auto",
>;
"icon-rotate"?: DataDrivenPropertyValueSpecification<number>;
"icon-rotation-alignment"?: PropertyValueSpecification<
"map"
| "viewport"
| "auto",
>;
"icon-size"?: DataDrivenPropertyValueSpecification<number>;
"icon-text-fit"?: PropertyValueSpecification<
"none"
| "width"
| "height"
| "both",
>;
"icon-text-fit-padding"?: PropertyValueSpecification<
[number, number, number, number],
>;
"line-cap"?: DataDrivenPropertyValueSpecification<
"butt"
| "round"
| "square",
>;
"line-join"?: DataDrivenPropertyValueSpecification<
"bevel"
| "round"
| "miter",
>;
"line-miter-limit"?: DataDrivenPropertyValueSpecification<number>;
"line-round-limit"?: DataDrivenPropertyValueSpecification<number>;
"line-sort-key"?: DataDrivenPropertyValueSpecification<number>;
"symbol-avoid-edges"?: PropertyValueSpecification<boolean>;
"symbol-placement"?: PropertyValueSpecification<
"point"
| "line"
| "line-center",
>;
"symbol-sort-key"?: DataDrivenPropertyValueSpecification<number>;
"symbol-spacing"?: PropertyValueSpecification<number>;
"symbol-z-order"?: PropertyValueSpecification<
"auto"
| "viewport-y"
| "source",
>;
"text-allow-overlap"?: PropertyValueSpecification<boolean>;
"text-anchor"?: DataDrivenPropertyValueSpecification<
| "center"
| "left"
| "right"
| "top"
| "bottom"
| "top-left"
| "top-right"
| "bottom-left"
| "bottom-right",
>;
"text-field"?: DataDrivenPropertyValueSpecification<FormattedSpecification>;
"text-font"?: DataDrivenPropertyValueSpecification<string[]>;
"text-ignore-placement"?: PropertyValueSpecification<boolean>;
"text-justify"?: DataDrivenPropertyValueSpecification<
"auto"
| "left"
| "center"
| "right",
>;
"text-keep-upright"?: PropertyValueSpecification<boolean>;
"text-letter-spacing"?: DataDrivenPropertyValueSpecification<number>;
"text-line-height"?: PropertyValueSpecification<number>;
"text-max-angle"?: PropertyValueSpecification<number>;
"text-max-width"?: DataDrivenPropertyValueSpecification<number>;
"text-offset"?: DataDrivenPropertyValueSpecification<[number, number]>;
"text-optional"?: PropertyValueSpecification<boolean>;
"text-overlap"?: PropertyValueSpecification<
"never"
| "always"
| "cooperative",
>;
"text-padding"?: PropertyValueSpecification<number>;
"text-pitch-alignment"?: PropertyValueSpecification<
"map"
| "viewport"
| "auto",
>;
"text-radial-offset"?: DataDrivenPropertyValueSpecification<number>;
"text-rotate"?: DataDrivenPropertyValueSpecification<number>;
"text-rotation-alignment"?: PropertyValueSpecification<
"map"
| "viewport"
| "viewport-glyph"
| "auto",
>;
"text-size"?: DataDrivenPropertyValueSpecification<number>;
"text-transform"?: DataDrivenPropertyValueSpecification<
"none"
| "uppercase"
| "lowercase",
>;
"text-variable-anchor"?: PropertyValueSpecification<
(
| "center"
| "left"
| "right"
| "top"
| "bottom"
| "top-left"
| "top-right"
| "bottom-left"
| "bottom-right"
)[],
>;
"text-variable-anchor-offset"?: DataDrivenPropertyValueSpecification<
VariableAnchorOffsetCollectionSpecification,
>;
"text-writing-mode"?: PropertyValueSpecification<
("horizontal" | "vertical")[],
>;
visibility?: VisibilitySpecification;
}
Index
Properties
Properties
Optionalcircle-sort-key
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
Optionalfill-sort-key
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
Optionalicon-allow-overlap
If true, the icon will be visible even if it collides with other previously drawn symbols.
Optionalicon-anchor
| "center"
| "left"
| "right"
| "top"
| "bottom"
| "top-left"
| "top-right"
| "bottom-left"
| "bottom-right",
>
Part of the icon placed closest to the anchor.
Optionalicon-ignore-placement
If true, other symbols can be visible even if they collide with the icon.
Optionalicon-image
Name of image in sprite to use for drawing an image background.
Optionalicon-keep-upright
If true, the icon may be flipped to prevent it from being rendered upside-down.
Optionalicon-offset
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.
Optionalicon-optional
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
Optionalicon-overlap
Allows for control over whether to show an icon when it overlaps other symbols on the map. If icon-overlap is not set, icon-allow-overlap is used instead.
Optionalicon-padding
Size of additional area round the icon bounding box used for detecting symbol collisions.
Optionalicon-pitch-alignment
Orientation of icon when map is pitched.
Optionalicon-rotate
Rotates the icon clockwise.
Optionalicon-rotation-alignment
In combination with symbol-placement, determines the rotation behavior of icons.
Optionalicon-size
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.
Optionalicon-text-fit
Scales the icon to fit around the associated text.
Optionalicon-text-fit-padding
Size of the additional area added to dimensions determined by icon-text-fit, in clockwise order: top, right, bottom, left.
Optionalline-cap
The display of line endings.
Optionalline-join
The display of lines when joining.
Optionalline-miter-limit
Used to automatically convert miter joins to bevel joins for sharp angles.
Optionalline-round-limit
Used to automatically convert round joins to miter joins for shallow angles.
Optionalline-sort-key
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
Optionalsymbol-avoid-edges
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 MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.
Optionalsymbol-placement
Label placement relative to its geometry.
Optionalsymbol-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.
Optionalsymbol-spacing
Distance between two symbol anchors.
Optionalsymbol-z-order
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.
Optionaltext-allow-overlap
If true, the text will be visible even if it collides with other previously drawn symbols.
Optionaltext-anchor
| "center"
| "left"
| "right"
| "top"
| "bottom"
| "top-left"
| "top-right"
| "bottom-left"
| "bottom-right",
>
Part of the text placed closest to the anchor.
Optionaltext-field
Value to use for a text label. If a plain string is provided, it will be treated as a formatted with default/inherited formatting options.
Optionaltext-font
Fonts to use for displaying text. If the glyphs root property is specified, this array is joined together and interpreted as a font stack name. Otherwise, it is interpreted as a cascading fallback list of local font names.
Optionaltext-ignore-placement
If true, other symbols can be visible even if they collide with the text.
Optionaltext-justify
Text justification options.
Optionaltext-keep-upright
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
Optionaltext-letter-spacing
Text tracking amount.
Optionaltext-line-height
Text leading value for multi-line text.
Optionaltext-max-angle
Maximum angle change between adjacent characters.
Optionaltext-max-width
The maximum line width for text wrapping.
Optionaltext-offset
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.
Optionaltext-optional
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
Optionaltext-overlap
Allows for control over whether to show symbol text when it overlaps other symbols on the map. If text-overlap is not set, text-allow-overlap is used instead
Optionaltext-padding
Size of the additional area around the text bounding box used for detecting symbol collisions.
Optionaltext-pitch-alignment
Orientation of text when map is pitched.
Optionaltext-radial-offset
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.
Optionaltext-rotate
Rotates the text clockwise.
Optionaltext-rotation-alignment
"map"
| "viewport"
| "viewport-glyph"
| "auto",
>
In combination with symbol-placement, determines the rotation behavior of the individual glyphs forming the text.
Optionaltext-size
Font size.
Optionaltext-transform
Specifies how to capitalize text, similar to the CSS text-transform property.
Optionaltext-variable-anchor
(
| "center"
| "left"
| "right"
| "top"
| "bottom"
| "top-left"
| "top-right"
| "bottom-left"
| "bottom-right"
)[],
>
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.
Optionaltext-variable-anchor-offset
VariableAnchorOffsetCollectionSpecification,
>
To increase the chance of placing high-priority labels on the map, you can provide an array of text-anchor locations, each paired with an offset value. The renderer will attempt to place the label at each location, in order, before moving on to the next location+offset. Use text-justify: auto to choose justification based on anchor position.
The length of the array must be even, and must alternate between enum and point entries. i.e., each anchor location must be accompanied by a point, and that point defines the offset when the corresponding anchor location is used. Positive offset values indicate right and down, while negative values indicate left and up. Anchor locations may repeat, allowing the renderer to try multiple offsets to try and place a label using the same anchor.
When present, this property takes precedence over text-anchor, text-variable-anchor, text-offset, and text-radial-offset.
{ "text-variable-anchor-offset": ["top", [0, 4], "left", [3,0], "bottom", [1, 1]] }
When the renderer chooses the top anchor, [0, 4] will be used for text-offset; the text will be shifted down by 4 ems.
When the renderer chooses the left anchor, [3, 0] will be used for text-offset; the text will be shifted right by 3 ems.
Optionaltext-writing-mode
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.
Optionalvisibility
Whether this layer is displayed.
Union of all layout properties across all layer types.