Class: KeyboardZoom

Mapspace.interaction. KeyboardZoom

Allows the user to zoom the viewer using keyboard + and -. Note that, although this interaction is by default included in viewers, the keys can only be used when browser focus is on the element to which the keyboard events are attached. By default, this is the viewer div, though you can change this with the keyboardEventTarget in ol.Map. document never loses focus but, for any other element, focus will have to be on, and returned to, this element if the keys are to function. See also ol.interaction.KeyboardZoom.


new KeyboardZoom( [opt_options])

Parameters:
Name Type Argument Description
opt_options olx.interaction.KeyboardZoom <optional>

Options.

Source:
mapspace/interaction/keyboardzoom.js

Extends

  • ol.interaction.KeyboardZoom

Methods


<static> handleClick(mapBrowserEvent)

Handles the map browser event if it was a KeyEvent, and decides whether to zoom in or out (depending on whether the key pressed was '+' or '-').

This:
Parameters:
Name Type Description
mapBrowserEvent ol.MapBrowserEvent

Map browser event.

Source:
mapspace/interaction/keyboardzoom.js
Returns:

false to stop event propagation.

Type
boolean