TileLayer class
Renders raster tiled images on top of the map tiles.
- Extends
Constructors
Tile |
Constructs a new TileLayer. |
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 tile 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 tile layer. |
Constructor Details
TileLayer(TileLayerOptions, string)
Constructs a new TileLayer.
new TileLayer(options?: TileLayerOptions, id?: string)
Parameters
- options
- TileLayerOptions
The options for the tile layer.
- id
-
string
The id of the layer. If not specified a random one will be generated.
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()
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(TileLayerOptions)
Sets the options of the tile layer.
function setOptions(options: TileLayerOptions)
Parameters
- options
- TileLayerOptions