Move some touch logic to the handler base class.

This commit is contained in:
Xavier Mamano
2012-02-15 17:55:37 +01:00
parent cd41548c01
commit ee8e892bb4
9 changed files with 130 additions and 111 deletions

View File

@@ -113,12 +113,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
*/
pixelTolerance: 5,
/**
* Property: touch
* {Boolean} Indcates the support of touch events.
*/
touch: false,
/**
* Property: lastTouchPx
* {<OpenLayers.Pixel>} The last pixel used to know the distance between
@@ -216,7 +210,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
this.layer.destroy(false);
}
this.layer = null;
this.touch = false;
return true;
},
@@ -383,18 +376,7 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
* {Boolean} Allow event propagation
*/
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,
dblclick: this.dblclick,
scope: this
});
}
this.startTouch();
this.lastTouchPx = evt.xy;
return this.down(evt);
},