Legacy
Mapbox.js is no longer in active development. To learn more about our newer mapping tools see Mapbox GL JS.
You are viewing an older version of Mapbox.js. Check out v3.3.1 for the latest.
DomEvent
Utility functions to work with the DOM events, used by Leaflet internally.
Methods
Method | Returns | Description |
---|---|---|
addListener(
|
this |
Adds a listener fn to the element's DOM event of the specified type. this keyword inside the listener will point to context , or to the element if not specified. |
removeListener(
|
this |
Removes an event listener from the element. |
stopPropagation(
|
this |
Stop the given event from propagation to parent elements. Used inside the listener functions:
|
preventDefault(
|
this |
Prevents the default action of the event from happening (such as following a link in the href of the a element, or doing a POST request with page reload when form is submitted). Use it inside listener functions.
|
stop(
|
this |
Does stopPropagation and preventDefault at the same time. |
disableClickPropagation(
|
this |
Adds stopPropagation to the element's 'click' , 'doubleclick' , 'mousedown' and 'touchstart' events. |
getMousePosition(
|
Point |
Gets normalized mouse position from a DOM event relative to the container or to the whole page if not specified. |
getWheelDelta(
|
Number |
Gets normalized wheel delta from a mousewheel DOM event. |