diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index bc5d5bf4c4..9765ed1fd1 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -342,6 +342,8 @@ * desired. Default is `true`. * @property {boolean|undefined} mouseWheelZoom Whether mousewheel zoom is * desired. Default is `true`. + * @property {boolean|undefined} shiftDragZoom Whether Shift-drag zoom is + * desired. Default is `true`. * @property {boolean|undefined} touchPan Whether touch pan is * desired. Default is `true`. * @property {boolean|undefined} touchRotate Whether touch rotate is desired. Default is `true`. diff --git a/src/ol/interaction/interactiondefaults.js b/src/ol/interaction/interactiondefaults.js index b664e24edb..32b4e5569c 100644 --- a/src/ol/interaction/interactiondefaults.js +++ b/src/ol/interaction/interactiondefaults.js @@ -5,6 +5,7 @@ goog.require('ol.Kinetic'); goog.require('ol.interaction.DoubleClickZoom'); goog.require('ol.interaction.DragPan'); goog.require('ol.interaction.DragRotate'); +goog.require('ol.interaction.DragZoom'); goog.require('ol.interaction.KeyboardPan'); goog.require('ol.interaction.KeyboardZoom'); goog.require('ol.interaction.MouseWheelZoom'); @@ -98,6 +99,12 @@ ol.interaction.defaults = function(opt_options) { })); } + var shiftDragZoom = goog.isDef(options.shiftDragZoom) ? + options.shiftDragZoom : true; + if (shiftDragZoom) { + interactions.push(new ol.interaction.DragZoom()); + } + return interactions; };