only track events when "pointerdown" event was received, because on native android browser wrong move events are sent with no "pointerdown" event

This commit is contained in:
tsauerwein
2014-02-10 12:58:50 +01:00
parent c4c1eb7d45
commit a31cc3f18c
2 changed files with 11 additions and 4 deletions
+4 -2
View File
@@ -130,6 +130,7 @@ ol.MapBrowserEventHandler = function(map) {
* @private
*/
this.activePointers_ = 0;
this.trackedTouches_ = {};
/**
* @type {ol.pointer.PointerEventHandler}
@@ -206,10 +207,11 @@ ol.MapBrowserEventHandler.prototype.updateActivePointers_ =
if (event.type == ol.MapBrowserEvent.EventType.POINTERUP ||
event.type == ol.MapBrowserEvent.EventType.POINTERCANCEL) {
this.activePointers_--;
delete this.trackedTouches_[event.pointerId];
} else if (event.type == ol.MapBrowserEvent.EventType.POINTERDOWN) {
this.activePointers_++;
this.trackedTouches_[event.pointerId] = true;
}
this.activePointers_ = goog.object.getCount(this.trackedTouches_);
};