Class: DragRotate


import DragRotate from 'ol/interaction/DragRotate';

Allows the user to rotate the map by clicking and dragging on the map, normally combined with an module:ol/events/condition that limits it to when the alt and shift keys are held down.

This interaction is only supported for mouse devices.

new DragRotate(opt_options)

interaction/DragRotate.js, line 31
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~altShiftKeysOnly.

duration number 250

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.