Layer class
Abstract class for other layer classes to extend.
- Extends
-
EventEmitter<T>
Constructors
Layer(string) |
Properties
metadata | A property for associating custom data with the layer. |
Methods
get |
Gets the id of the layer |
get |
Gets the map that the layer is currently added to, or null. |
get |
Gets the options of the layer. |
on |
Initialization method for the layer which is called when added to the map. |
on |
Method that is called when the layer is removed from the map. Should perform any necessary cleanup for the layer. |
set |
Sets the options of 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()
getOptions()
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(LayerOptions)
Sets the options of the layer.
function setOptions(options: LayerOptions)
Parameters
- options
- LayerOptions
The new options of the layer.