Functions
-
import {defaults} from 'ol/interaction/defaults';Set of interactions included in maps by default. Specific interactions can be excluded by setting the appropriate option to false in the constructor options, but the order of the interactions is fixed. If you want to specify a different order for interactions, you will need to create your own
Interactioninstances and insert them into aCollectionin the order you want before creating yourMapinstance. Changing the order can be of interest if the event propagation needs to be stopped at a point. The default set of interactions, in sequence, is:DragRotateDoubleClickZoomDragPanPinchRotatePinchZoomKeyboardPanKeyboardZoomMouseWheelZoomDragZoomName Type Description altShiftDragRotateboolean (defaults to true) Whether Alt-Shift-drag rotate is desired.
onFocusOnlyboolean (defaults to false) Interact only when the map has the focus. This affects the
MouseWheelZoomandDragPaninteractions and is useful when page scroll is desired for maps that do not have the browser's focus.doubleClickZoomboolean (defaults to true) Whether double click zoom is desired.
keyboardboolean (defaults to true) Whether keyboard interaction is desired.
mouseWheelZoomboolean (defaults to true) Whether mousewheel zoom is desired.
shiftDragZoomboolean (defaults to true) Whether Shift-drag zoom is desired.
dragPanboolean (defaults to true) Whether drag pan is desired.
pinchRotateboolean (defaults to true) Whether pinch rotate is desired.
pinchZoomboolean (defaults to true) Whether pinch zoom is desired.
zoomDeltanumber | undefined Zoom level delta when using keyboard or double click zoom.
zoomDurationnumber | undefined Duration of the zoom animation in milliseconds.
Returns:
A collection of interactions to be used with theMapconstructor'sinteractionsoption.
Type Definitions
-
DefaultsOptions{Object}
-
Properties:
Name Type Description altShiftDragRotateboolean
(defaults to true)Whether Alt-Shift-drag rotate is desired.
onFocusOnlyboolean
(defaults to false)Interact only when the map has the focus. This affects the
MouseWheelZoomandDragPaninteractions and is useful when page scroll is desired for maps that do not have the browser's focus.doubleClickZoomboolean
(defaults to true)Whether double click zoom is desired.
keyboardboolean
(defaults to true)Whether keyboard interaction is desired.
mouseWheelZoomboolean
(defaults to true)Whether mousewheel zoom is desired.
shiftDragZoomboolean
(defaults to true)Whether Shift-drag zoom is desired.
dragPanboolean
(defaults to true)Whether drag pan is desired.
pinchRotateboolean
(defaults to true)Whether pinch rotate is desired.
pinchZoomboolean
(defaults to true)Whether pinch zoom is desired.
zoomDeltanumber | undefined Zoom level delta when using keyboard or double click zoom.
zoomDurationnumber | undefined Duration of the zoom animation in milliseconds.