Events

The different types of events that SDK JS can raise.

You can also find additional event documentation for: Map, Marker, Popup, and GeolocationControl.

Evented

Methods mixed in to other classes for event capabilities.

Methods

MapMouseEvent

MapMouseEvent is the event type for mouse-related map events.

Extends Event.

Example

Methods

MapTouchEvent

MapTouchEvent is the event type for touch-related map events.

Extends Event.

Methods

MapLibreZoomEvent

A MapLibreZoomEvent is the event type for the boxzoom-related map events emitted by the BoxZoomHandler.

Properties

originalEvent(MouseEvent): The DOM event that triggered the boxzoom event. Can be a MouseEvent or KeyboardEvent
type(string): The type of boxzoom event. One of boxzoomstart , boxzoomend or boxzoomcancel
target(Map): The Map instance that triggerred the event

MapDataEvent

A MapDataEvent object is emitted with the Map.event:data and Map.event:dataloading events. Possible values for dataTypes are:

  • 'source': The non-tile data associated with any source
  • 'style': The style used by the map

Example

Properties

type(string): The event type.
dataType(string): The type of data that has changed. One of 'source' , 'style' .
isSourceLoaded(boolean?): True if the event has a dataType of source and the source has no outstanding network requests.
source(Object?): The style spec representation of the source if the event has a dataType of source .
sourceDataType(string?): Included if the event has a dataType of source and the event signals that internal data has been received or changed. Possible values are metadata , content and visibility .
tile(Object?): The tile being loaded or changed, if the event has a dataType of source and the event is related to loading of a tile.
coord(Coordinates?): The coordinate of the tile if the event has a dataType of source and the event is related to loading of a tile.

MapWheelEvent

MapWheelEvent is the event type for the wheel map event.

Extends Object.

Methods

MapProjectionEvent

Supporting type to add validation to another style related type.

Type declaration

newProjection? ProjectionSpecification Specifies the name of the new projection. Additionally includes 'globe-mercator' to describe globe that has internally switched to mercator.
Reference documentation of MapTiler SDK JS, an extension of MapLibre GL JS