Add zoomDuration option to interaction defaults
This commit is contained in:
@@ -293,6 +293,7 @@
|
|||||||
* @property {boolean|undefined} touchRotate Whether touch rotate is desired.
|
* @property {boolean|undefined} touchRotate Whether touch rotate is desired.
|
||||||
* @property {boolean|undefined} touchZoom Whether touch zoom is desired.
|
* @property {boolean|undefined} touchZoom Whether touch zoom is desired.
|
||||||
* @property {number|undefined} zoomDelta Zoom delta.
|
* @property {number|undefined} zoomDelta Zoom delta.
|
||||||
|
* @property {number|undefined} zoomDuration Zoom duration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ ol.interaction.defaults = function(opt_options) {
|
|||||||
options.doubleClickZoom : true;
|
options.doubleClickZoom : true;
|
||||||
if (doubleClickZoom) {
|
if (doubleClickZoom) {
|
||||||
interactions.push(new ol.interaction.DoubleClickZoom({
|
interactions.push(new ol.interaction.DoubleClickZoom({
|
||||||
delta: options.zoomDelta
|
delta: options.zoomDelta,
|
||||||
|
duration: options.zoomDuration
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +67,9 @@ ol.interaction.defaults = function(opt_options) {
|
|||||||
var touchZoom = goog.isDef(options.touchZoom) ?
|
var touchZoom = goog.isDef(options.touchZoom) ?
|
||||||
options.touchZoom : true;
|
options.touchZoom : true;
|
||||||
if (touchZoom) {
|
if (touchZoom) {
|
||||||
interactions.push(new ol.interaction.TouchZoom());
|
interactions.push(new ol.interaction.TouchZoom({
|
||||||
|
duration: options.zoomDuration
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
var dragPan = goog.isDef(options.dragPan) ?
|
var dragPan = goog.isDef(options.dragPan) ?
|
||||||
@@ -82,14 +85,17 @@ ol.interaction.defaults = function(opt_options) {
|
|||||||
if (keyboard) {
|
if (keyboard) {
|
||||||
interactions.push(new ol.interaction.KeyboardPan());
|
interactions.push(new ol.interaction.KeyboardPan());
|
||||||
interactions.push(new ol.interaction.KeyboardZoom({
|
interactions.push(new ol.interaction.KeyboardZoom({
|
||||||
delta: options.zoomDelta
|
delta: options.zoomDelta,
|
||||||
|
duration: options.zoomDuration
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
var mouseWheelZoom = goog.isDef(options.mouseWheelZoom) ?
|
var mouseWheelZoom = goog.isDef(options.mouseWheelZoom) ?
|
||||||
options.mouseWheelZoom : true;
|
options.mouseWheelZoom : true;
|
||||||
if (mouseWheelZoom) {
|
if (mouseWheelZoom) {
|
||||||
interactions.push(new ol.interaction.MouseWheelZoom());
|
interactions.push(new ol.interaction.MouseWheelZoom({
|
||||||
|
duration: options.zoomDuration
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
var shiftDragZoom = goog.isDef(options.shiftDragZoom) ?
|
var shiftDragZoom = goog.isDef(options.shiftDragZoom) ?
|
||||||
|
|||||||
Reference in New Issue
Block a user