Module: ol/events/condition

ol/events/condition


Members

module:ol/events/condition.altShiftKeysOnly

Return true if only the alt-key and shift-key is pressed, false otherwise (e.g. when additionally the platform-modifier-key is pressed).

module:ol/events/condition.always

Return always true.

module:ol/events/condition.click

Return true if the event is a click event, false otherwise.

module:ol/events/condition.doubleClick

Return true if the event is a map dblclick event, false otherwise.

module:ol/events/condition.focus

Return true if the map has the focus. This condition requires a map target element with a tabindex attribute, e.g. <div id="map" tabindex="1">.

module:ol/events/condition.mouseOnly

Return true if the event originates from a mouse device.

module:ol/events/condition.never

Return always false.

module:ol/events/condition.noModifierKeys

Return true if no modifier key (alt-, shift- or platform-modifier-key) is pressed.

module:ol/events/condition.platformModifierKeyOnly

Return true if only the platform-modifier-key (the meta-key on Mac, ctrl-key otherwise) is pressed, false otherwise (e.g. when additionally the shift-key is pressed).

module:ol/events/condition.pointerMove

Return true if the browser event is a pointermove event, false otherwise.

module:ol/events/condition.primaryAction

Return true if the event originates from a primary pointer in contact with the surface or if the left mouse button is pressed. See http://www.w3.org/TR/pointerevents/#button-states.

module:ol/events/condition.shiftKeyOnly

Return true if only the shift-key is pressed, false otherwise (e.g. when additionally the alt-key is pressed).

module:ol/events/condition.singleClick

Return true if the event is a map singleclick event, false otherwise.

module:ol/events/condition.targetNotEditable

Return true if the target element is not editable, i.e. not a <input>-, <select>- or <textarea>-element, false otherwise.

Methods

altKeyOnly(mapBrowserEvent){boolean}

events/condition.js, line 26

Return true if only the alt-key is pressed, false otherwise (e.g. when additionally the shift-key is pressed).

Name Type Description
mapBrowserEvent module:ol/MapBrowserEvent~MapBrowserEvent

Map browser event.

Returns:
True if only the alt key is pressed.

Type Definitions

Condition()

events/condition.js, line 10

A function that takes an module:ol/MapBrowserEvent and returns a {boolean}. If the condition is met, true should be returned.