Layer class

Abstract class for other layer classes to extend.

Extends

Constructors

Layer(string)

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.

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

Layer(string)

new Layer(id?: string)

Parameters

id

string

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(): string

Returns

string

getMap()

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

function getMap(): Map

Returns

Map

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()