From 9e8d20aee49b9506973401b1ec0e4d45769e4e42 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 22 Apr 2013 16:12:09 +0200 Subject: [PATCH] Re-use ol.Kinetic object --- src/ol/interaction/interactiondefaults.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ol/interaction/interactiondefaults.js b/src/ol/interaction/interactiondefaults.js index bc77efbaf4..b2ba3bd2e4 100644 --- a/src/ol/interaction/interactiondefaults.js +++ b/src/ol/interaction/interactiondefaults.js @@ -27,6 +27,8 @@ ol.interaction.defaults = function(opt_options, opt_interactions) { var interactions = new ol.Collection(); + var kinetic = new ol.Kinetic(-0.005, 0.05, 100); + var altShiftDragRotate = goog.isDef(options.altShiftDragRotate) ? options.altShiftDragRotate : true; if (altShiftDragRotate) { @@ -45,7 +47,7 @@ ol.interaction.defaults = function(opt_options, opt_interactions) { options.touchPan : true; if (touchPan) { interactions.push(new ol.interaction.TouchPan({ - kinetic: new ol.Kinetic(-0.005, 0.05, 100) + kinetic: kinetic })); } @@ -65,7 +67,7 @@ ol.interaction.defaults = function(opt_options, opt_interactions) { options.dragPan : true; if (dragPan) { interactions.push(new ol.interaction.DragPan({ - kinetic: new ol.Kinetic(-0.005, 0.05, 100) + kinetic: kinetic })); }