PolygonExtrusionLayerOptions interface

Options used when rendering Polygon and MultiPolygon objects in a PolygonExtrusionLayer.

Extends

Properties

base

The height in meters to extrude the base of this layer. This height is relative to the ground. Must be greater or equal to 0 and less than or equal to height. Default 0.

fillColor

The color to fill the polygons with. Ignored if fillPattern is set. Default "#1E90FF".

fillOpacity

A number between 0 and 1 that indicates the opacity at which the fill will be drawn. Default 1.

fillPattern

Name of image in sprite to use for drawing image fills. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).

filter

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

height

The height in meters to extrude this layer. This height is relative to the ground. Must be a number greater or equal to 0. Default 0

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.

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.

translate

The polygons' pixel offset. Values are [x, y] where negatives indicate left and up, respectively. Default [0, 0]

translateAnchor

Specifies the frame of reference for translate.

`"map"`: Polygons are translated relative to the map.

`"viewport"`: Polygons are translated relative to the viewport.

Default: `"map"`
verticalGradient

Specifies if the polygon should have a vertical gradient on the sides of the extrusion. Default: true

visible

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

Property Details

base

The height in meters to extrude the base of this layer. This height is relative to the ground. Must be greater or equal to 0 and less than or equal to height. Default 0.

base?: number | Expression

Property Value

number | Expression

fillColor

The color to fill the polygons with. Ignored if fillPattern is set. Default "#1E90FF".

fillColor?: string | Expression

Property Value

string | Expression

fillOpacity

A number between 0 and 1 that indicates the opacity at which the fill will be drawn. Default 1.

fillOpacity?: number

Property Value

number

fillPattern

Name of image in sprite to use for drawing image fills. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).

fillPattern?: string

Property Value

string

filter

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

filter?: Expression

Property Value

height

The height in meters to extrude this layer. This height is relative to the ground. Must be a number greater or equal to 0. Default 0

height?: 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

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

translate

The polygons' pixel offset. Values are [x, y] where negatives indicate left and up, respectively. Default [0, 0]

translate?: Pixel

Property Value

translateAnchor

Specifies the frame of reference for translate.

`"map"`: Polygons are translated relative to the map.

`"viewport"`: Polygons are translated relative to the viewport.

Default: `"map"`
translateAnchor?: "map" | "viewport"

Property Value

"map" | "viewport"

verticalGradient

Specifies if the polygon should have a vertical gradient on the sides of the extrusion. Default: true

verticalGradient?: boolean

Property Value

boolean

visible

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

visible?: boolean

Property Value

boolean