Fix singleclick and doubleclick on windows Surface

This commit is contained in:
Olivier Terral
2013-11-01 16:22:09 +01:00
parent 7fb7a472b7
commit d0b0d0470b
+12 -4
View File
@@ -322,10 +322,18 @@ ol.MapBrowserEventHandler.prototype.handlePointerDown_ =
*/ */
ol.MapBrowserEventHandler.prototype.handlePointerMove_ = ol.MapBrowserEventHandler.prototype.handlePointerMove_ =
function(browserEvent) { function(browserEvent) {
this.dragged_ = true; // Fix IE10 on windows Surface : When you tap the tablet, it triggers
var newEvent = new ol.MapBrowserEvent( // multiple pointermove events between pointerdown and pointerup with
ol.MapBrowserEvent.EventType.TOUCHMOVE, this.map_, browserEvent); // the exact same coordinates of the pointerdown event. To avoid a
this.dispatchEvent(newEvent); // 'false' touchmove event to be dispatched , we test if the pointermove
// event has different coordinates.
if (browserEvent.clientX != this.down_.clientX ||
browserEvent.clientY != this.down_.clientY) {
this.dragged_ = true;
var newEvent = new ol.MapBrowserEvent(
ol.MapBrowserEvent.EventType.TOUCHMOVE, this.map_, browserEvent);
this.dispatchEvent(newEvent);
}
}; };