JavaScript
Mapbox
The functions available for MapWeave when used with the Mapbox adapter.
Creates a new MapWeave instance in your webpage using the options specified.
Parameters
Returns
MapWeave
Creates a new layer.
Parameters
-
Layer Defines the layer to be added. The new layer can be one of the following:
Returns
void
Destroys the MapWeave instance. This will remove the MapWeave instance and any adapter specific elements from the DOM and free any allocated resources.
Returns
void
Fits the map to the bounds of all visible layers or to the options specified.
Parameters
Returns
Promise<void>
Animates a transition to a defined point on the map. Retains the current values for any options not specified.
Parameters
Returns
Promise<void>
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
Layer<any, any, any>[]
An array of objects describing the current MapWeave layers.
Detaches an event handler from an event fired by MapWeave. See the Event Handling docs for more information.
Returns
void
Attaches an event handler to an event fired by MapWeave. See the Event Handling docs for more information.
Returns
void
Gets or sets the MapWeave options while preserving any other previously set options.
Parameters
Returns
object
An object containing all the MapWeave options and their current values.
Removes a MapWeave layer.
Parameters
Returns
void
Sets the MapWeave options while resetting any other previously set options to default values.
Parameters
Returns
void
Gets or sets the current MapWeave viewport.
Returns
SizedViewState
The MapWeave sizedViewState object.
accessToken
optional string The Mapbox access token. See the Mapbox Access Tokens docs for more information.
maxZoom
optional number
default: 20 Sets the maximum zoom level, which controls how far the map can zoom in.
pickingRadius
optional number
default: 0 The radius of a circle around the pointer used to detect interactions in pixels.
style
optional string
default: 'mapbox://styles/mapbox/dark-v11' The Mapbox style URL. See the Mapbox Styles API for more information.
viewRotation
optional boolean
default: false Enables view rotation if set to true.