SymbolLayerOptions interface

Options used when rendering geometries in a SymbolLayer.

Extends

Properties

filter

An expression specifying conditions on source features. Only features that match the filter are displayed.

iconOptions

Options used to customize the icons of the symbols.

lineSpacing

Distance in pixels between two symbol anchors along a line. Must be greater or equal to 1. Default 250.

maxZoom

An integer specifying the maximum zoom level to render the layer at. This value is exclusive, i.e. the layer will be visible at maxZoom > zoom >= minZoom. Default 24.

minZoom

An integer specifying the minimum zoom level to render the layer at. This value is inclusive, i.e. the layer will be visible at maxZoom > zoom >= minZoom. Default 0.

placement

Specifies the label placement relative to its geometry.

`"point"`: The label is placed at the point where the geometry is located.

`"line"`: The label is placed along the line of the geometry. Can only be used on LineString and Polygon geometries.

Default `"point"`.
source

The id or instance of a data source which the layer will render.

sourceLayer

Required when the source of the layer is a VectorTileSource. A vector source can have multiple layers within it, this identifies which one to render in this layer. Prohibited for all other types of sources.

textOptions

Options used to customize the text of the symbols.

visible

Specifies if the layer is visible or not. Default true.

Property Details

filter

An expression specifying conditions on source features. Only features that match the filter are displayed.

filter?: Expression

Property Value

iconOptions

Options used to customize the icons of the symbols.

iconOptions?: IconOptions

Property Value

lineSpacing

Distance in pixels between two symbol anchors along a line. Must be greater or equal to 1. Default 250.

lineSpacing?: number | Expression

Property Value

number | Expression

maxZoom

An integer specifying the maximum zoom level to render the layer at. This value is exclusive, i.e. the layer will be visible at maxZoom > zoom >= minZoom. Default 24.

maxZoom?: number

Property Value

number

minZoom

An integer specifying the minimum zoom level to render the layer at. This value is inclusive, i.e. the layer will be visible at maxZoom > zoom >= minZoom. Default 0.

minZoom?: number

Property Value

number

placement

Specifies the label placement relative to its geometry.

`"point"`: The label is placed at the point where the geometry is located.

`"line"`: The label is placed along the line of the geometry. Can only be used on LineString and Polygon geometries.

Default `"point"`.
placement?: "point" | "line"

Property Value

"point" | "line"

source

The id or instance of a data source which the layer will render.

source?: string | Source

Property Value

string | Source

sourceLayer

Required when the source of the layer is a VectorTileSource. A vector source can have multiple layers within it, this identifies which one to render in this layer. Prohibited for all other types of sources.

sourceLayer?: string

Property Value

string

textOptions

Options used to customize the text of the symbols.

textOptions?: TextOptions

Property Value

visible

Specifies if the layer is visible or not. Default true.

visible?: boolean

Property Value

boolean