Module: ol/interaction

ol/interaction


Methods

module:ol/interaction~defaults(opt_options){module:ol/Collection~Collection.<module:ol/interaction/Interaction~Interaction>}

interaction.js, line 85

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/Interaction~Interaction instances and insert them into a module:ol/Collection~Collection in the order you want before creating your module:ol/Map~Map instance. The default set of interactions, in sequence, is:

Name Type Description
options module:ol/interaction/Interaction~DefaultsOptions

Defaults options.

Returns:
A collection of interactions to be used with the module:ol/Map~Map constructor's interactions option.

Type Definitions

DefaultsOptions{Object}

Properties:
Name Type Argument Default Description
altShiftDragRotate boolean <optional>
true

Whether Alt-Shift-drag rotate is desired.

constrainResolution boolean <optional>
false

Zoom to the closest integer zoom level after the wheel/trackpad or pinch gesture ends.

doubleClickZoom boolean <optional>
true

Whether double click zoom is desired.

keyboard boolean <optional>
true

Whether keyboard interaction is desired.

mouseWheelZoom boolean <optional>
true

Whether mousewheel zoom is desired.

shiftDragZoom boolean <optional>
true

Whether Shift-drag zoom is desired.

dragPan boolean <optional>
true

Whether drag pan is desired.

pinchRotate boolean <optional>
true

Whether pinch rotate is desired.

pinchZoom boolean <optional>
true

Whether pinch zoom is desired.

zoomDelta number <optional>

Zoom level delta when using keyboard or mousewheel zoom.

zoomDuration number <optional>

Duration of the zoom animation in milliseconds.