Re-use ol.Kinetic object
This commit is contained in:
@@ -27,6 +27,8 @@ ol.interaction.defaults = function(opt_options, opt_interactions) {
|
|||||||
|
|
||||||
var interactions = new ol.Collection();
|
var interactions = new ol.Collection();
|
||||||
|
|
||||||
|
var kinetic = new ol.Kinetic(-0.005, 0.05, 100);
|
||||||
|
|
||||||
var altShiftDragRotate = goog.isDef(options.altShiftDragRotate) ?
|
var altShiftDragRotate = goog.isDef(options.altShiftDragRotate) ?
|
||||||
options.altShiftDragRotate : true;
|
options.altShiftDragRotate : true;
|
||||||
if (altShiftDragRotate) {
|
if (altShiftDragRotate) {
|
||||||
@@ -45,7 +47,7 @@ ol.interaction.defaults = function(opt_options, opt_interactions) {
|
|||||||
options.touchPan : true;
|
options.touchPan : true;
|
||||||
if (touchPan) {
|
if (touchPan) {
|
||||||
interactions.push(new ol.interaction.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;
|
options.dragPan : true;
|
||||||
if (dragPan) {
|
if (dragPan) {
|
||||||
interactions.push(new ol.interaction.DragPan({
|
interactions.push(new ol.interaction.DragPan({
|
||||||
kinetic: new ol.Kinetic(-0.005, 0.05, 100)
|
kinetic: kinetic
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user