WebGLLayer class

Enables custom rendering logic with access to the WebGL context of the map.

Extends

Constructors

WebGLLayer(string, WebGLLayerOptions)

Constructs a new WebGLLayer.

Inherited Properties

metadata

A property for associating custom data with the layer.

Methods

getOptions()

Gets the options of the WebGL layer.

setOptions(WebGLLayerOptions)

Sets the options of the WebGL layer.

Inherited Methods

getId()

Gets the id of the layer

getMap()

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

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.

Constructor Details

WebGLLayer(string, WebGLLayerOptions)

Constructs a new WebGLLayer.

new WebGLLayer(id?: string, options?: WebGLLayerOptions)

Parameters

id

string

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

options
WebGLLayerOptions

The options of the WebGL layer.

Inherited Property Details

metadata

A property for associating custom data with the layer.

metadata?: any

Property Value

any

Inherited From Layer.metadata

Method Details

getOptions()

Gets the options of the WebGL layer.

function getOptions(): WebGLLayerOptions

Returns

setOptions(WebGLLayerOptions)

Sets the options of the WebGL layer.

function setOptions(options: WebGLLayerOptions)

Parameters

options
WebGLLayerOptions

The new options of the WebGL layer.

Inherited Method Details

getId()

Gets the id of the layer

function getId(): string

Returns

string

Inherited From Layer.getId

getMap()

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

function getMap(): Map

Returns

Map

Inherited From Layer.getMap

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.

Inherited From Layer.onAdd

onRemove()

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

function onRemove()

Inherited From Layer.onRemove