fix up issue with Sencha Touch example not handling double tap to zoom in, r=elemoine (closes #3079)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11226 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2011-02-22 11:21:20 +00:00
parent f67bcaa033
commit 98a6c1754d
2 changed files with 48 additions and 0 deletions

View File

@@ -96,6 +96,12 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, {
*/
last: null,
/**
* Property: touch
* {Boolean} Are we on a touch enabled device? Default is false.
*/
touch: false,
/**
* Property: rightclickTimerId
* {Number} The id of the right mouse timeout waiting to clear the
@@ -148,6 +154,7 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, {
* {Boolean} Continue propagating this event.
*/
touchstart: function(evt) {
this.touch = true;
this.down = evt;
this.last = null;
return true;
@@ -279,6 +286,10 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, {
* {Boolean} Continue propagating this event.
*/
click: function(evt) {
// Sencha Touch emulates click events, see ticket 3079 for more info
if (this.touch === true && evt.type === "click") {
return !this.stopSingle;
}
if(this.passesTolerance(evt)) {
if(this.timerId != null) {
// already received a click