MapLibre
MapWeave
The functions available for MapWeave when used with the MapLibre adapter.
Constructors
new MapWeave(def)
Creates a new MapWeave instance in your webpage using the options specified.
Parameters
The initial options to be set on the MapWeave instance.
Accessors
Methods
addLayer(layer)
Creates a new layer.
Parameters
Defines the layer to be added. The new layer can be one of the following:
Returns
destroy()
Destroys the MapWeave instance. This will remove the MapWeave instance and any adapter specific elements from the DOM and free any allocated resources.
Returns
layers(layers)
Gets or sets the current MapWeave layers. If used as a setter, the layers will be rendered in the order that they are specified in the array, and any existing layers not present in the array will be removed.
Parameters
Returns
off(event, handler)
Detaches an event handler from an event fired by MapWeave. See the Event Handling docs for more information.
Parameters
Returns
on(event, handler)
Attaches an event handler to an event fired by MapWeave. See the Event Handling docs for more information.
Parameters
Returns
options(options)
Gets or sets the MapWeave options while preserving any other previously set options.
Parameters
The MapWeave options to set.
Returns
An object containing all the MapWeave options and their current values.
resetOptions(options)
Sets the MapWeave options while resetting any other previously set options to default values.
Parameters
The MapWeave options to set.
An array of objects describing the current MapWeave layers.