Type Definitions
-
olx.interaction.DefaultsOptions{Object}
-
Interactions for the map. Default is
truefor all options.Properties:
Name Type Argument Description altShiftDragRotateboolean | undefined <optional>
Whether Alt-Shift-drag rotate is desired. Default is
true.constrainResolutionboolean | undefined <optional>
Zoom to the closest integer zoom level after the wheel/trackpad or pinch gesture ends. Default is
false.doubleClickZoomboolean | undefined <optional>
Whether double click zoom is desired. Default is
true.keyboardboolean | undefined <optional>
Whether keyboard interaction is desired. Default is
true.mouseWheelZoomboolean | undefined <optional>
Whether mousewheel zoom is desired. Default is
true.shiftDragZoomboolean | undefined <optional>
Whether Shift-drag zoom is desired. Default is
true.dragPanboolean | undefined <optional>
Whether drag pan is desired. Default is
true.pinchRotateboolean | undefined <optional>
Whether pinch rotate is desired. Default is
true.pinchZoomboolean | undefined <optional>
Whether pinch zoom is desired. Default is
true.zoomDeltanumber | undefined <optional>
Zoom delta.
zoomDurationnumber | undefined <optional>
Zoom duration.
-
olx.interaction.DoubleClickZoomOptions{Object}
-
Properties:
Name Type Argument Description durationnumber | undefined <optional>
Animation duration in milliseconds. Default is
250.deltanumber | undefined <optional>
The zoom delta applied on each double click, default is
1. -
olx.interaction.DragAndDropOptions{Object}
-
Properties:
Name Type Argument Description formatConstructorsArray.<function(new:ol.format.Feature)> | undefined <optional>
Format constructors.
sourceol.source.Vector | undefined <optional>
Optional vector source where features will be added. If a source is provided all existing features will be removed and new features will be added when they are dropped on the target. If you want to add features to a vector source without removing the existing features (append only), instead of providing the source option listen for the "addfeatures" event.
projectionol.ProjectionLike Target projection. By default, the map's view's projection is used.
targetElement | undefined <optional>
The element that is used as the drop target, default is the viewport element.
-
olx.interaction.DragBoxOptions{Object}
-
Properties:
Name Type Argument Description classNamestring | undefined <optional>
CSS class name for styling the box. The default is
ol-dragbox.conditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. Default isol.events.condition.always.minAreanumber | undefined <optional>
The minimum area of the box in pixel, this value is used by the default
boxEndConditionfunction. Default is64.boxEndConditionol.DragBoxEndConditionType | undefined <optional>
A function that takes a
ol.MapBrowserEventand twool.Pixels to indicate whether aboxendevent should be fired. Default istrueif the area of the box is bigger than theminAreaoption. -
olx.interaction.DragPanOptions{Object}
-
Properties:
Name Type Argument Description conditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. Default isol.events.condition.noModifierKeys.kineticol.Kinetic | undefined <optional>
Kinetic inertia to apply to the pan.
-
olx.interaction.DragRotateAndZoomOptions{Object}
-
Properties:
Name Type Argument Description conditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. Default isol.events.condition.shiftKeyOnly.durationnumber | undefined <optional>
Animation duration in milliseconds. Default is
400. -
olx.interaction.DragRotateOptions{Object}
-
Properties:
Name Type Argument Description conditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. Default isol.events.condition.altShiftKeysOnly.durationnumber | undefined <optional>
Animation duration in milliseconds. Default is
250. -
olx.interaction.DragZoomOptions{Object}
-
Properties:
Name Type Argument Description classNamestring | undefined <optional>
CSS class name for styling the box. The default is
ol-dragzoom.conditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. Default isol.events.condition.shiftKeyOnly.durationnumber | undefined <optional>
Animation duration in milliseconds. Default is
200.outboolean | undefined <optional>
Use interaction for zooming out. Default is
false. -
olx.interaction.DrawOptions{Object}
-
Properties:
Name Type Argument Description clickTolerancenumber | undefined <optional>
The maximum distance in pixels between "down" and "up" for a "up" event to be considered a "click" event and actually add a point/vertex to the geometry being drawn. Default is 6 pixels. That value was chosen for the draw interaction to behave correctly on mouse as well as on touch devices.
featuresol.Collection.<ol.Feature> | undefined <optional>
Destination collection for the drawn features.
sourceol.source.Vector | undefined <optional>
Destination source for the drawn features.
snapTolerancenumber | undefined <optional>
Pixel distance for snapping to the drawing finish. Default is
12.typeol.geom.GeometryType | string Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint', 'MultiLineString', 'MultiPolygon' or 'Circle'). Required.
stopClickboolean | undefined <optional>
Stop click, singleclick, and doubleclick events from firing during drawing. Default is
false.maxPointsnumber | undefined <optional>
The number of points that can be drawn before a polygon ring or line string is finished. The default is no restriction.
minPointsnumber | undefined <optional>
The number of points that must be drawn before a polygon ring or line string can be finished. Default is
3for polygon rings and2for line strings.finishConditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether the drawing can be finished.styleol.style.Style | Array.<ol.style.Style> | ol.StyleFunction | undefined <optional>
Style for sketch features.
geometryFunctionol.DrawGeometryFunctionType | undefined <optional>
Function that is called when a geometry's coordinates are updated.
geometryNamestring | undefined <optional>
Geometry name to use for features created by the draw interaction.
conditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. By defaultol.events.condition.noModifierKeys, i.e. a click, adds a vertex or deactivates freehand drawing.freehandboolean | undefined <optional>
Operate in freehand mode for lines, polygons, and circles. This makes the interaction always operate in freehand mode and takes precedence over any
freehandConditionoption.freehandConditionol.EventsConditionType | undefined <optional>
Condition that activates freehand drawing for lines and polygons. This function takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. The default isol.events.condition.shiftKeyOnly, meaning that the Shift key activates freehand drawing.wrapXboolean | undefined <optional>
Wrap the world horizontally on the sketch overlay. Default is
false. -
olx.interaction.ExtentOptions{Object}
-
Properties:
Name Type Argument Description extentol.Extent | undefined <optional>
Initial extent. Defaults to no initial extent
boxStyleol.style.Style | Array.<ol.style.Style> | ol.StyleFunction | undefined <optional>
Style for the drawn extent box. Defaults to ol.style.Style.createDefaultEditing()[ol.geom.GeometryType.POLYGON]
pixelTolerancenumber | undefined <optional>
Pixel tolerance for considering the pointer close enough to a segment or vertex for editing. Default is
10.pointerStyleol.style.Style | Array.<ol.style.Style> | ol.StyleFunction | undefined <optional>
Style for the cursor used to draw the extent. Defaults to ol.style.Style.createDefaultEditing()[ol.geom.GeometryType.POINT]
wrapXboolean | undefined <optional>
Wrap the drawn extent across multiple maps in the X direction? Only affects visuals, not functionality. Defaults to false.
-
olx.interaction.InteractionOptions{Object}
-
Object literal with config options for interactions.
Properties:
Name Type Description handleEventfunction Method called by the map to notify the interaction that a browser event was dispatched to the map. If the function returns a falsy value, propagation of the event to other interactions in the map's interactions chain will be prevented (this includes functions with no explicit return). See https://developer.mozilla.org/en-US/docs/Glossary/Falsy Required.
-
olx.interaction.KeyboardPanOptions{Object}
-
Properties:
Name Type Argument Description conditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. Default isol.events.condition.noModifierKeysandol.events.condition.targetNotEditable.durationnumber | undefined <optional>
Animation duration in milliseconds. Default is
100.pixelDeltanumber | undefined <optional>
Pixel The amount to pan on each key press. Default is
128pixels. -
olx.interaction.KeyboardZoomOptions{Object}
-
Properties:
Name Type Argument Description durationnumber | undefined <optional>
Animation duration in milliseconds. Default is
100.conditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. Default isol.events.condition.targetNotEditable.deltanumber | undefined <optional>
The amount to zoom on each key press. Default is
1. -
olx.interaction.ModifyOptions{Object}
-
Properties:
Name Type Argument Description conditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event will be considered to add or move a vertex to the sketch. Default isol.events.condition.primaryAction.deleteConditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. By default,ol.events.condition.singleClickwithol.events.condition.altKeyOnlyresults in a vertex deletion.insertVertexConditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether a new vertex can be added to the sketch features. Default isol.events.condition.alwayspixelTolerancenumber | undefined <optional>
Pixel tolerance for considering the pointer close enough to a segment or vertex for editing. Default is
10.styleol.style.Style | Array.<ol.style.Style> | ol.StyleFunction | undefined <optional>
Style used for the features being modified. By default the default edit style is used (see
ol.style).sourceol.source.Vector | undefined <optional>
The vector source with features to modify. If a vector source is not provided, a feature collection must be provided with the features option.
featuresol.Collection.<ol.Feature> | undefined <optional>
The features the interaction works on. If a feature collection is not provided, a vector source must be provided with the source option.
wrapXboolean | undefined <optional>
Wrap the world horizontally on the sketch overlay. Default is
false. -
olx.interaction.MouseWheelZoomOptions{Object}
-
Properties:
Name Type Argument Description durationnumber | undefined <optional>
Animation duration in milliseconds. Default is
250.timeoutnumber | undefined <optional>
Mouse wheel timeout duration in milliseconds. Default is
80.constrainResolutionboolean | undefined <optional>
When using a trackpad or magic mouse, zoom to the closest integer zoom level after the scroll gesture ends. Default is
false.useAnchorboolean | undefined <optional>
Enable zooming using the mouse's location as the anchor. Default is
true. When set to false, zooming in and out will zoom to the center of the screen instead of zooming on the mouse's location. -
olx.interaction.PinchRotateOptions{Object}
-
Properties:
Name Type Argument Description durationnumber | undefined <optional>
The duration of the animation in milliseconds. Default is
250.thresholdnumber | undefined <optional>
Minimal angle in radians to start a rotation. Default is
0.3. -
olx.interaction.PinchZoomOptions{Object}
-
Properties:
Name Type Argument Description durationnumber | undefined <optional>
Animation duration in milliseconds. Default is
400.constrainResolutionboolean | undefined <optional>
Zoom to the closest integer zoom level after the pinch gesture ends. Default is
false. -
olx.interaction.PointerOptions{Object}
-
Properties:
Name Type Argument Description handleDownEventfunction | undefined <optional>
Function handling "down" events. If the function returns
truethen a drag sequence is started.handleDragEventfunction | undefined <optional>
Function handling "drag" events. This function is called on "move" events during a drag sequence.
handleEventfunction | undefined <optional>
Method called by the map to notify the interaction that a browser event was dispatched to the map. The function may return
falseto prevent the propagation of the event to other interactions in the map's interactions chain.handleMoveEventfunction | undefined <optional>
Function handling "move" events. This function is called on "move" events, also during a drag sequence (so during a drag sequence both the
handleDragEventfunction and this function are called).handleUpEventfunction | undefined <optional>
Function handling "up" events. If the function returns
falsethen the current drag sequence is stopped. -
olx.interaction.SelectOptions{Object}
-
Properties:
Name Type Argument Description addConditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. By default, this isol.events.condition.never. Use this if you want to use different events for add and remove instead oftoggle.conditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. This is the event for the selected features as a whole. By default, this isol.events.condition.singleClick. Clicking on a feature selects that feature and removes any that were in the selection. Clicking outside any feature removes all from the selection. Seetoggle,add,removeoptions for adding/removing extra features to/ from the selection.layersundefined | Array.<ol.layer.Layer> | function <optional>
A list of layers from which features should be selected. Alternatively, a filter function can be provided. The function will be called for each layer in the map and should return
truefor layers that you want to be selectable. If the option is absent, all visible layers will be considered selectable.styleol.style.Style | Array.<ol.style.Style> | ol.StyleFunction | undefined <optional>
Style for the selected features. By default the default edit style is used (see
ol.style).removeConditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. By default, this isol.events.condition.never. Use this if you want to use different events for add and remove instead oftoggle.toggleConditionol.EventsConditionType | undefined <optional>
A function that takes an
ol.MapBrowserEventand returns a boolean to indicate whether that event should be handled. This is in addition to theconditionevent. By default,ol.events.condition.shiftKeyOnly, i.e. pressingshiftas well as theconditionevent, adds that feature to the current selection if it is not currently selected, and removes it if it is. Seeaddandremoveif you want to use different events instead of a toggle.multiboolean | undefined <optional>
A boolean that determines if the default behaviour should select only single features or all (overlapping) features at the clicked map position. Default is false i.e single select
featuresol.Collection.<ol.Feature> | undefined <optional>
Collection where the interaction will place selected features. Optional. If not set the interaction will create a collection. In any case the collection used by the interaction is returned by
ol.interaction.Select#getFeatures.filterol.SelectFilterFunction | undefined <optional>
A function that takes an
ol.Featureand anol.layer.Layerand returnstrueif the feature may be selected orfalseotherwise.wrapXboolean | undefined <optional>
Wrap the world horizontally on the selection overlay. Default is
true.hitTolerancenumber | undefined <optional>
Hit-detection tolerance. Pixels inside the radius around the given position will be checked for features. This only works for the canvas renderer and not for WebGL. Default is
0. -
olx.interaction.SnapOptions{Object}
-
Options for snap
Properties:
Name Type Argument Description featuresol.Collection.<ol.Feature> | undefined <optional>
Snap to these features. Either this option or source should be provided.
edgeboolean | undefined <optional>
Snap to edges. Default is
true.vertexboolean | undefined <optional>
Snap to vertices. Default is
true.pixelTolerancenumber | undefined <optional>
Pixel tolerance for considering the pointer close enough to a segment or vertex for snapping. Default is
10pixels.sourceol.source.Vector | undefined <optional>
Snap to features from this source. Either this option or features should be provided
-
olx.interaction.TranslateOptions{Object}
-
Properties:
Name Type Argument Description featuresol.Collection.<ol.Feature> | undefined <optional>
Only features contained in this collection will be able to be translated. If not specified, all features on the map will be able to be translated.
layersundefined | Array.<ol.layer.Layer> | function <optional>
A list of layers from which features should be translated. Alternatively, a filter function can be provided. The function will be called for each layer in the map and should return
truefor layers that you want to be translatable. If the option is absent, all visible layers will be considered translatable.hitTolerancenumber | undefined <optional>
Hit-detection tolerance. Pixels inside the radius around the given position will be checked for features. This only works for the canvas renderer and not for WebGL. Default is
0.
OpenLayers