Revert "Remove DragZoom from default interactions"

This reverts commit c2330b9786.
This commit is contained in:
Antoine Abt
2014-01-02 14:43:01 +01:00
parent 1142d55565
commit 39cf993b39
2 changed files with 9 additions and 0 deletions

View File

@@ -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`.

View File

@@ -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;
};