Module: ol/events/condition

ol/events/condition


Members

module:ol/events/condition.altKeyOnly

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

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.penOnly

Return true if the event originates from a digital pen.

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 https://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 an input, select, or textarea element and no contenteditable attribute is set or inherited, false otherwise.

module:ol/events/condition.touchOnly

Return true if the event originates from a touchable device.

Type Definitions

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