From 4c8ffadf30067c619212ba7f10ac3e8699d041e4 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 2 Mar 2015 14:48:09 +0200 Subject: [PATCH] don't animate negligible touch movements, close #2519 --- src/map/handler/Map.TouchZoom.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/map/handler/Map.TouchZoom.js b/src/map/handler/Map.TouchZoom.js index 49120ddc..bb4ae01c 100644 --- a/src/map/handler/Map.TouchZoom.js +++ b/src/map/handler/Map.TouchZoom.js @@ -80,9 +80,12 @@ L.Map.TouchZoom = L.Handler.extend({ } else { this._center = map.layerPointToLatLng(this._getTargetCenter()); } + this._zoom = map.getScaleZoom(this._scale); - map._animateZoom(this._center, this._zoom); + if (this._scale !== 1 || this._delta.x !== 0 || this._delta.y !== 0) { + map._animateZoom(this._center, this._zoom); + } }, _onTouchEnd: function () {