Evented

Methods mixed in to other classes for event capabilities.

Methods

Method
fire

fire(event: string | Event, properties: any)


Parameters


  1. event: string | Event
  2. properties: any

Return Value: Evented


listens

listens(type: string)


Parameters


  1. type: string

Return Value: any


Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.
off

off(type: string, listener: Listener)


Parameters


  1. type: string
  2. listener: Listener

Return Value: Evented


Removes a previously registered event listener.
on

on(type: string, listener: Listener)


Parameters


  1. type: string
  2. listener: Listener

Return Value: Evented


Adds a listener to a specified event type.
once

once(type: string, listener: Listener)


Parameters


  1. type: string
  2. listener: Listener

Return Value: Evented


Adds a listener that will be called only once to a specified event type.

The listener will be called first time the event fires after the listener is registered.
setEventedParent

setEventedParent(parent: Evented, data: any)


Parameters


  1. parent: Evented
  2. data: any

Return Value: Evented


Bubble all events fired by this instance of Evented to this parent instance of Evented.

MapMouseEvent

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

Constructor

Name
MapMouseEvent

new MapMouseEvent(type: string, map: Map, originalEvent: MouseEvent, data: any)


Parameters


  1. type: string
  2. map: Map
  3. originalEvent: MouseEvent
  4. data: any

Properties

NameType
defaultPreventedboolean

Methods

Method
preventDefault

preventDefault()



Return Value: void


Prevents subsequent default processing of the event by the map.

Calling this method will prevent the following default map behaviors:

* On mousedown events, the behavior of DragPanHandler
* On mousedown events, the behavior of DragRotateHandler
* On mousedown events, the behavior of BoxZoomHandler
* On dblclick events, the behavior of DoubleClickZoomHandler

Example

// The

MapTouchEvent

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

Constructor

Name
MapTouchEvent

new MapTouchEvent(type: string, map: Map, originalEvent: TouchEvent)


Parameters


  1. type: string
  2. map: Map
  3. originalEvent: TouchEvent

Properties

NameType
defaultPreventedboolean

Methods

Method
preventDefault

preventDefault()



Return Value: void


Prevents subsequent default processing of the event by the map.

Calling this method will prevent the following default map behaviors:

* On touchstart events, the behavior of DragPanHandler
* On touchstart events, the behavior of TouchZoomRotateHandler

Interface MapDataEvent

A MapDataEvent object is emitted with the Map.event
and Map.event events. Possible values for
dataType s are:

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

Properties

Name
dataType

Type: string


sourceDataType

Type: MapSourceDataType


type

Type: string


MapWheelEvent

MapWheelEvent is the event type for the wheel map event.

Constructor

Name
MapWheelEvent

new MapWheelEvent(type: string, map: Map, originalEvent: WheelEvent)


Parameters


  1. type: string
  2. map: Map
  3. originalEvent: WheelEvent

Properties

NameType
defaultPreventedboolean

Methods

Method
preventDefault

preventDefault()



Return Value: void


Prevents subsequent default processing of the event by the map.

Calling this method will prevent the the behavior of ScrollZoomHandler .

© 2024 NextBillion.ai all rights reserved.