From 8c970cc190f8ed6cd4bca56395b29f88b7e9b8bb Mon Sep 17 00:00:00 2001 From: Mourner Date: Wed, 13 Apr 2011 14:52:09 +0300 Subject: [PATCH] should reduce #32 impact a lot --- src/handler/TouchZoom.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/handler/TouchZoom.js b/src/handler/TouchZoom.js index 85bab88c..c72e45e2 100644 --- a/src/handler/TouchZoom.js +++ b/src/handler/TouchZoom.js @@ -16,7 +16,7 @@ L.Handler.TouchZoom = L.Handler.extend({ }, _onTouchStart: function(e) { - if (!e.touches || e.touches.length != 2 || this._animatingZoom) { return; } + if (!e.touches || e.touches.length != 2 || this._map._animatingZoom) { return; } var p1 = this._map.mouseEventToLayerPoint(e.touches[0]), p2 = this._map.mouseEventToLayerPoint(e.touches[1]), @@ -65,10 +65,7 @@ L.Handler.TouchZoom = L.Handler.extend({ }, _onTouchEnd: function(e) { - if (!e.touches || e.touches.length >= 2 || !this._moved) { return; } - - // prevent touchEnd from firing twice - if (!this._zooming) { return; } + if (!this._moved || !this._zooming) { return; } this._zooming = false; var oldZoom = this._map.getZoom(),