Class: DragRotateAndZoom


import DragRotateAndZoom from 'ol/interaction/DragRotateAndZoom';

Allows the user to zoom and rotate the map by clicking and dragging on the map. By default, this interaction is limited to when the shift key is held down.

This interaction is only supported for mouse devices.

And this interaction is not included in the default interactions.

new DragRotateAndZoom(opt_options)

interaction/DragRotateAndZoom.js, line 32
Name Type Description


Name Type Default Description
condition module:ol/events/condition~Condition

A function that takes an module:ol/MapBrowserEvent~MapBrowserEvent and returns a boolean to indicate whether that event should be handled. Default is module:ol/events/condition~shiftKeyOnly.

duration number 400

Animation duration in milliseconds.



Observable Properties

Name Type Settable ol/Object.ObjectEvent type Description
active boolean yes change:active

true if the interaction is active, false otherwise.


handleEvent() inherited

interaction/Pointer.js, line 120

Handles the map browser event and may call into other functions, if event sequences like e.g. 'drag' or 'down-up' etc. are detected.