Merge pull request #4272 from adube/fix-interactiondefaults-zoomduration
Allow the DragZoom interaction created in defaults to use zoomDuration option.
This commit is contained in:
+2
-2
@@ -2366,7 +2366,7 @@ olx.interaction.DragRotateOptions.prototype.duration;
|
|||||||
/**
|
/**
|
||||||
* @typedef {{condition: (ol.events.ConditionType|undefined),
|
* @typedef {{condition: (ol.events.ConditionType|undefined),
|
||||||
* duration: (number|undefined),
|
* duration: (number|undefined),
|
||||||
* style: ol.style.Style}}
|
* style: (ol.style.Style|undefined)}}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
olx.interaction.DragZoomOptions;
|
olx.interaction.DragZoomOptions;
|
||||||
@@ -2392,7 +2392,7 @@ olx.interaction.DragZoomOptions.prototype.duration;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for the box.
|
* Style for the box.
|
||||||
* @type {ol.style.Style}
|
* @type {ol.style.Style|undefined}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
olx.interaction.DragZoomOptions.prototype.style;
|
olx.interaction.DragZoomOptions.prototype.style;
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ ol.interaction.defaults = function(opt_options) {
|
|||||||
var shiftDragZoom = options.shiftDragZoom !== undefined ?
|
var shiftDragZoom = options.shiftDragZoom !== undefined ?
|
||||||
options.shiftDragZoom : true;
|
options.shiftDragZoom : true;
|
||||||
if (shiftDragZoom) {
|
if (shiftDragZoom) {
|
||||||
interactions.push(new ol.interaction.DragZoom());
|
interactions.push(new ol.interaction.DragZoom({
|
||||||
|
duration: options.zoomDuration
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
return interactions;
|
return interactions;
|
||||||
|
|||||||
Reference in New Issue
Block a user