Class: MapBrowserEvent

ol/MapBrowserEvent~MapBrowserEvent


Events emitted as map browser events are instances of this type. See module:ol/Map~Map for which events trigger a map browser event.

Members

The coordinate in view projection corresponding to the original browser event.

dragging{boolean}

Indicates if the map is currently being dragged. Only set for POINTERDRAG and POINTERMOVE events. Default is false.

originalEvent{Event}

The original browser event.

pixel{module:ol/pixel~Pixel}

The map pixel relative to the viewport corresponding to the original browser event.

Methods

preventDefault()

MapBrowserEvent.js, line 63

Prevents the default browser action. See https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault.

stopPropagation()

MapBrowserEvent.js, line 74

Prevents further propagation of the current event. See https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation.

Events

click

MapBrowserEventType.js, line 20

A click with no dragging. A double click will fire two of this.

dblclick

MapBrowserEventType.js, line 27

A true double click, with no dragging.

pointerdrag

MapBrowserEventType.js, line 34

Triggered when a pointer is dragged.

pointermove

MapBrowserEventType.js, line 41

Triggered when a pointer is moved. Note that on touch devices this is triggered when the map is panned, so is not the same as mousemove.

singleclick

MapBrowserEventType.js, line 12

A true single click with no dragging and no double click. Note that this event is delayed by 250 ms to ensure that it is not a double click.