Fix 'Shift' DragZoom in default interactions, use zoomDuration

This fix allows the DragZoom interaction created in the default
interactions to use the zoom duration defined in the options, if
set.
This commit is contained in:
Alexandre Dubé committed 2015-10-14 13:46:30 -04:00
1 parent a639291ea7
commit 657b9dc018
2 files changed
+5 -3

No files matched your search

+2 -2
View File
@@ -2366,7 +2366,7 @@ olx.interaction.DragRotateOptions.prototype.duration;
/**
* @typedef {{condition: (ol.events.ConditionType|undefined),
* duration: (number|undefined),
* style: ol.style.Style}}
* style: (ol.style.Style|undefined)}}
* @api
*/
olx.interaction.DragZoomOptions;
@@ -2392,7 +2392,7 @@ olx.interaction.DragZoomOptions.prototype.duration;
/**
* Style for the box.
* @type {ol.style.Style}
* @type {ol.style.Style|undefined}
* @api
*/
olx.interaction.DragZoomOptions.prototype.style;
+3 -1
View File
@@ -103,7 +103,9 @@ ol.interaction.defaults = function(opt_options) {
var shiftDragZoom = options.shiftDragZoom !== undefined ?
options.shiftDragZoom : true;
if (shiftDragZoom) {
interactions.push(new ol.interaction.DragZoom());
interactions.push(new ol.interaction.DragZoom({
duration: options.zoomDuration
}));
}
return interactions;