diff --git a/lib/OpenLayers/Handler/Drag.js b/lib/OpenLayers/Handler/Drag.js index 8bd6e28545..037a88ef19 100644 --- a/lib/OpenLayers/Handler/Drag.js +++ b/lib/OpenLayers/Handler/Drag.js @@ -50,6 +50,13 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, { */ dragging: false, + /** + * Property: touch + * {Boolean} When a touchstart event is fired, touch will be true and all + * mouse related listeners will do nothing. + */ + touch: false, + /** * Property: last * {} The last pixel location of the drag. @@ -336,6 +343,17 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, { * {Boolean} Let the event propagate. */ touchstart: function(evt) { + if (!this.touch) { + this.touch = true; + // unregister mouse listeners + this.map.events.un({ + mousedown: this.mousedown, + mouseup: this.mouseup, + mousemove: this.mousemove, + click: this.click, + scope: this + }); + } return this.dragstart(evt); },