PolygonExtrusionLayer class

Renders extruded filled Polygon and MultiPolygon objects on the map.

Extends

Constructors

PolygonExtrusionLayer(string | Source, string, PolygonExtrusionLayerOptions)

Constructs a new PolygonExtrusionLayer.

Properties

metadata

A property for associating custom data with the layer.

Methods

getId()

Gets the id of the layer

getMap()

Gets the map that the layer is currently added to, or null.

getOptions()

Gets the options of the polygon layer.

getSource()

Gets the source provided when creating the layer.

onAdd(Map)

Initialization method for the layer which is called when added to the map.

onRemove()

Method that is called when the layer is removed from the map. Should perform any necessary cleanup for the layer.

setOptions(PolygonExtrusionLayerOptions)

Sets the options of the polygon layer.

Constructor Details

PolygonExtrusionLayer(string | Source, string, PolygonExtrusionLayerOptions)

Constructs a new PolygonExtrusionLayer.

new PolygonExtrusionLayer(source: string | Source, id?: string, options?: PolygonExtrusionLayerOptions)

Parameters

source

string | Source

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

id

string

The id of the layer. If not specified a random one will be generated.

options
PolygonExtrusionLayerOptions

The options of the polygon extrusion layer.

Property Details

metadata

A property for associating custom data with the layer.

metadata?: any

Property Value

any

Method Details

getId()

Gets the id of the layer

function getId()

Returns

string

getMap()

Gets the map that the layer is currently added to, or null.

function getMap()

Returns

Map

getOptions()

Gets the options of the polygon layer.

function getOptions()

Returns

getSource()

Gets the source provided when creating the layer.

function getSource()

Returns

string | Source

onAdd(Map)

Initialization method for the layer which is called when added to the map.

function onAdd(map: Map)

Parameters

map
Map

The map the layer has been added to.

onRemove()

Method that is called when the layer is removed from the map. Should perform any necessary cleanup for the layer.

function onRemove()

setOptions(PolygonExtrusionLayerOptions)

Sets the options of the polygon layer.

function setOptions(options: PolygonExtrusionLayerOptions)

Parameters