Cleanup mouse event on touch devices, r=erilem (closes #3215)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11827 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Stéphane Brunner
2011-03-31 09:01:05 +00:00
parent 80ce6e6583
commit 36face3f71
2 changed files with 95 additions and 10 deletions

View File

@@ -219,6 +219,7 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
this.layer.destroy(false);
}
this.layer = null;
this.touch = false;
return true;
},
@@ -385,9 +386,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
* {Boolean} Allow event propagation
*/
mousedown: function(evt) {
if (this.touch) {
return;
}
return this.down(evt);
},
@@ -402,7 +400,18 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
* {Boolean} Allow event propagation
*/
touchstart: function(evt) {
this.touch = true;
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,
dblclick: this.dblclick,
scope: this
});
}
this.lastTouchPx = evt.xy;
return this.down(evt);
},
@@ -418,9 +427,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
* {Boolean} Allow event propagation
*/
mousemove: function(evt) {
if (this.touch) {
return;
}
return this.move(evt);
},
@@ -450,9 +456,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
* {Boolean} Allow event propagation
*/
mouseup: function(evt) {
if (this.touch) {
return;
}
return this.up(evt);
},