Activates the base layer with the given id.
undefined
can be used to hide all base layers.
The associated layer is made visible and all other base layers are hidden.
Returns true if the given layer has been successfully activated.
Adds a new layer to the map.
The new layer is automatically registered with this collection.
By default, the new layer will be shown on top of all normal operational layers.
Use the options
parameter to control the insertion point.
The map model takes ownership of the new layer. This means that the layer will be destroyed if the map model is destroyed.
Optional
options: AddLayerOptionsReturns the currently active base layer.
Returns a list of layers known to this collection. This includes base layers and operational layers. The returned list includes top level layers only. Use () to retrieve (nested) child layers.
Optional
options: LayerRetrievalOptionsReturns all configured base layers.
Returns the items in this collection.
Optional
options: LayerRetrievalOptionsReturns the layer identified by the id
or undefined, if no such layer exists.
Returns a list of layers known to this collection. This includes base layers and operational layers. The returned list includes top level layers only. Use () to retrieve (nested) child layers.
Optional
options: LayerRetrievalOptionsReturns a list of operational layers, starting from the root of the map's layer hierarchy. The returned list includes top level layers only. Use () to retrieve (nested) child layers.
Optional
options: LayerRetrievalOptionsReturns a list of all layers in this collection, including all children (recursively).
Note: This includes base layers by default (see
options.filter
). Use the"base"
or"operational"
short hand values to filter by base layer or operational layers.If the layer hierarchy is deeply nested, this function could potentially be expensive.
Optional
options: Omit<RecursiveRetrievalOptions, "filter"> & {Removes the given top level layer from the map.
The layer can be specified directly (as an object) or by an id.
Returns the layer instance on success, or undefined
if the layer was not found.
The map releases ownership of this layer. The caller can destroy it or store it for later reuse.
Removes a layer identified by the id
from the map.
NOTE: The current implementation only supports removal of top level layers.
This function destroys the layer instance and all its children.
Use removeLayer instead.
Contains the layers known to a MapModel.