From 657b9dc01860c61a6d24c2e1ea2ee13013cab4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Dub=C3=A9?= Date: Wed, 14 Oct 2015 13:46:30 -0400 Subject: [PATCH] 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. --- externs/olx.js | 4 ++-- src/ol/interaction/interactiondefaults.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index aa31c2c854..020241976b 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -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; diff --git a/src/ol/interaction/interactiondefaults.js b/src/ol/interaction/interactiondefaults.js index f6ad1b188a..93705d54dd 100644 --- a/src/ol/interaction/interactiondefaults.js +++ b/src/ol/interaction/interactiondefaults.js @@ -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;