Skip to content

Commit

Permalink
should reduce #32 impact a lot
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Apr 13, 2011
1 parent 47ada8f commit 8c970cc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/handler/TouchZoom.js
Expand Up @@ -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]),
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 8c970cc

Please sign in to comment.