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. |
icon |
Options used to customize the icons of the symbols. |
line |
Distance in pixels between two symbol anchors along a line. Must be greater or equal to 1.
Default |
max |
An integer specifying the maximum zoom level to render the layer at.
This value is exclusive, i.e. the layer will be visible at |
min |
An integer specifying the minimum zoom level to render the layer at.
This value is inclusive, i.e. the layer will be visible at |
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. `"line-center"`: The label is placed at the center of 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. |
source |
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. |
text |
Options used to customize the text of the symbols. |
visible | Specifies if the layer is visible or not.
Default |
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
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
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
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.
`"line-center"`: The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries
Default `"point"`.placement?: "point" | "line" | "line-center"
Property Value
source
The id or instance of a data source which the layer will render.
source?: string | Source
Property Value
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
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