Methods
-
module:ol/interaction.defaults(opt_options){module:ol/Collection~Collection.<module:ol/interaction/Interaction~Interaction>}
interaction.js, line 89 -
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
module:ol/interaction/Interactioninstances and insert them into amodule:ol/Collectionin the order you want before creating yourmodule:ol/Map~Mapinstance. The default set of interactions, in sequence, is:module:ol/interaction/DragRotate~DragRotatemodule:ol/interaction/DoubleClickZoom~DoubleClickZoommodule:ol/interaction/DragPan~DragPanmodule:ol/interaction/PinchRotate~PinchRotatemodule:ol/interaction/PinchZoom~PinchZoommodule:ol/interaction/KeyboardPan~KeyboardPanmodule:ol/interaction/KeyboardZoom~KeyboardZoommodule:ol/interaction/MouseWheelZoom~MouseWheelZoommodule:ol/interaction/DragZoom~DragZoom
Name Type Description optionsDefaults options.
Name Type Default Description altShiftDragRotateboolean true Whether Alt-Shift-drag rotate is desired.
onFocusOnlyboolean 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.constrainResolutionboolean false Zoom to the closest integer zoom level after the wheel/trackpad or pinch gesture ends.
doubleClickZoomboolean true Whether double click zoom is desired.
keyboardboolean true Whether keyboard interaction is desired.
mouseWheelZoomboolean true Whether mousewheel zoom is desired.
shiftDragZoomboolean true Whether Shift-drag zoom is desired.
dragPanboolean true Whether drag pan is desired.
pinchRotateboolean true Whether pinch rotate is desired.
pinchZoomboolean true Whether pinch zoom is desired.
zoomDeltanumber Zoom level delta when using keyboard or mousewheel zoom.
zoomDurationnumber Duration of the zoom animation in milliseconds.
Returns:
A collection of interactions to be used with themodule:ol/Map~Mapconstructor'sinteractionsoption.
Type Definitions
-
Properties: