Only dispatch touchmove events after a touchstart
This commit is contained in:
@@ -312,10 +312,16 @@ ol.MapBrowserEventHandler.prototype.handleTouchStart_ = function(browserEvent) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.MapBrowserEventHandler.prototype.handleTouchMove_ = function(browserEvent) {
|
ol.MapBrowserEventHandler.prototype.handleTouchMove_ = function(browserEvent) {
|
||||||
this.dragged_ = true;
|
if (this.down_) {
|
||||||
var newEvent = new ol.MapBrowserEvent(
|
// 'touchmove' events are dispatched only when this.down_ is set
|
||||||
ol.MapBrowserEvent.EventType.TOUCHMOVE, this.map_, browserEvent);
|
// (set after a touch start) to prevent unwanted events when the
|
||||||
this.dispatchEvent(newEvent);
|
// 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);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user