Evented
Methods mixed in to other classes for event capabilities.
Methods
Method | |
---|---|
fire | fire(event: string | Event, properties: any) Parameters
Return Value: Evented |
listens | listens(type: string) Parameters
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
Return Value: Evented Removes a previously registered event listener. |
on | on(type: string, listener: Listener) Parameters
Return Value: Evented Adds a listener to a specified event type. |
once | once(type: string, listener: Listener) Parameters
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
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
|
Properties
Name | Type |
---|---|
defaultPrevented | boolean |
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
|
Properties
Name | Type |
---|---|
defaultPrevented | boolean |
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
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
|
Properties
Name | Type |
---|---|
defaultPrevented | boolean |
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 . |