Namespace: interaction

ol.interaction

Classes

DoubleClickZoom
DragAndDrop
DragAndDropEvent
DragBox
DragPan
DragRotate
DragRotateAndZoom
DragZoom
Draw
DrawEvent
Interaction
KeyboardPan
KeyboardZoom
Modify
MouseWheelZoom
PinchRotate
PinchZoom
Pointer
Select
Snap

Methods

ol.interaction.defaults(opt_options){ol.Collection.<ol.interaction.Interaction>}

src/ol/interaction/interactiondefaults.js, line 42

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

Note that DragZoom renders a box as a vector polygon, so this interaction should be excluded if you want a build with no vector support.

Name Type Description
options

Defaults options.

Name Type Description
altShiftDragRotate boolean | undefined experimental

Whether Alt-Shift-drag rotate is desired. Default is true.

doubleClickZoom boolean | undefined experimental

Whether double click zoom is desired. Default is true.

keyboard boolean | undefined experimental

Whether keyboard interaction is desired. Default is true.

mouseWheelZoom boolean | undefined experimental

Whether mousewheel zoom is desired. Default is true.

shiftDragZoom boolean | undefined experimental

Whether Shift-drag zoom is desired. Default is true.

dragPan boolean | undefined experimental

Whether drag pan is desired. Default is true.

pinchRotate boolean | undefined experimental

Whether pinch rotate is desired. Default is true.

pinchZoom boolean | undefined experimental

Whether pinch zoom is desired. Default is true.

zoomDelta number | undefined experimental

Zoom delta.

zoomDuration number | undefined experimental

Zoom duration.

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

Type Definitions

ol.interaction.DrawGeometryFunctionType() experimental

src/ol/interaction/drawinteraction.js, line 795

Function that takes coordinates and an optional existing geometry as arguments, and returns a geometry. The optional existing geometry is the geometry that is returned when the function is called without a second argument.

ol.interaction.SelectFilterFunction() experimental

src/ol/interaction/selectinteraction.js, line 37

A function that takes an ol.Feature and an ol.layer.Layer and returns true if the feature may be selected or false otherwise.