Only dispatch touchmove events after a touchstart

This commit is contained in:
Frederic Junod
2013-08-28 12:16:40 +02:00
parent 77f6b4ff59
commit f994c4f8a1

View File

@@ -312,10 +312,16 @@ ol.MapBrowserEventHandler.prototype.handleTouchStart_ = function(browserEvent) {
* @private
*/
ol.MapBrowserEventHandler.prototype.handleTouchMove_ = function(browserEvent) {
this.dragged_ = true;
var newEvent = new ol.MapBrowserEvent(
ol.MapBrowserEvent.EventType.TOUCHMOVE, this.map_, browserEvent);
this.dispatchEvent(newEvent);
if (this.down_) {
// 'touchmove' events are dispatched only when this.down_ is set
// (set after a touch start) to prevent unwanted events when the
// mouse hover the page. This only happens with the IE pointer
// event system.
this.dragged_ = true;
var newEvent = new ol.MapBrowserEvent(
ol.MapBrowserEvent.EventType.TOUCHMOVE, this.map_, browserEvent);
this.dispatchEvent(newEvent);
}
};