Skip to main content

Standalone

The MapWeave standalone adapter allows you to use MapWeave without any third party basemap library. It is most commonly used together with a TileLayer.

MapWeave

The functions available for MapWeave when used with the Standalone adapter.

Constructors

new MapWeave(def)

Creates a new MapWeave instance in your webpage using the options specified.

Parameters

def

object

optional

Specifies the container and the values for the MapWeave instance to be created.

container

string | HTMLElement

The id or DOM element that will contain the MapWeave canvas and any overlays.

options

The initial options to be set on the MapWeave instance.

Methods

addLayer(layer)

Creates a new layer.

Parameters

layer

Layer

Defines the layer to be added. The new layer can be one of the following:

Returns
void

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
void

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

layers

Layer<any, any>[]

optional

An array of layers to attach to the adapter.

Returns
Layer<any, any>[]

An array of objects describing the current MapWeave layers.

off(event, handler)

Detaches an event handler from an event fired by MapWeave. See the Event Handling docs for more information.

Parameters

event

string

The name of the event.

handler

Function

The handler function for the event.

Returns
void

on(event, handler)

Attaches an event handler to an event fired by MapWeave. See the Event Handling docs for more information.

Parameters

event

string

The name of the event.

handler

Function

The handler function for the event.

Returns
void

options(options)

Gets or sets the MapWeave options while preserving any other previously set options.

Parameters

options

The MapWeave options to set.

Returns
object

An object containing all the MapWeave options and their current values.

removeLayer(layer)

Removes a MapWeave layer.

Parameters

layer

Layer

Defines the MapWeave layer to be removed.

Returns
void

resetOptions(options)

Sets the MapWeave options while resetting any other previously set options to default values.

Parameters

options

The MapWeave options to set.

Returns
void

view(viewState)

Gets or sets the current MapWeave viewport.

Parameters

viewState

Partial<ViewState>

optional

An object describing the view state.

The MapWeave sizedViewState object.


MapWeaveOptions

Properties

pickingRadius

number

optional

default value

0

The radius of a circle around the pointer used to detect interactions in pixels.

repeat

boolean

optional

default value

true

Enable or disable the repeated tiling of basemaps in the viewport.

viewRotation

boolean

optional

default value

false

Enables view rotation if set to true.