Finally fixing event sequences.

This commit is contained in:
ahocevar
2012-06-21 17:26:23 +02:00
parent 0a1f8cddd8
commit 81a55eb320
7 changed files with 195 additions and 120 deletions

View File

@@ -20,18 +20,6 @@ ol.control.Navigation = function(opt_autoActivate) {
this.autoActivate_ =
goog.isDef(opt_autoActivate) ? opt_autoActivate : true;
/**
* type {number}
* @private
*/
this.oldX = undefined;
/**
* type {number}
* @private
*/
this.oldY = undefined;
};
goog.inherits(ol.control.Navigation, ol.control.Control);
@@ -54,10 +42,8 @@ ol.control.Navigation.prototype.deactivate = function() {
};
/**
* @param {Event} evt
* @param {ol.event.DragEvent} evt
*/
ol.control.Navigation.prototype.moveMap = function(evt) {
this.getMap().moveByPx(evt.clientX - oldX, evt.clientY - oldY);
oldX = evt.clientX;
oldY = evt.clientY;
this.getMap().moveByPx(evt.dx, evt.dy);
};