From 55c35828a84cf09ece032bd0e134670c44574502 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 25 Jul 2012 11:14:21 +0300 Subject: [PATCH] Fix jittery marker movement on pinch-zoom (removed position rounding) --- CHANGELOG.md | 1 + src/layer/Popup.js | 2 +- src/map/Map.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4bb3620..caa9bd11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ Leaflet 0.4 contains several API improvements that allow simpler, jQuery-like sy * Improved zooming so that you don't get a blank map when you zoom in or out twice quickly (by [@danzel](https://github.com/danzel)). [#7](https://github.com/CloudMade/Leaflet/issues/7) [#729](https://github.com/CloudMade/Leaflet/pull/729) * Drag-panning now works even when there are markers in the starting point (helps on maps with lots of markers). [#506](https://github.com/CloudMade/Leaflet/issues/506) * Improved panning performance even more (there are no wasted frames now). + * Improved pinch-zoom performance in mobile Chrome and Firefox. * Improved map performance on window resize. * Replaced box-shadow with border on controls for mobile devices to improve performance. * Slightly improved default popup styling. diff --git a/src/layer/Popup.js b/src/layer/Popup.js index 2577f5e2..442cd1b6 100644 --- a/src/layer/Popup.js +++ b/src/layer/Popup.js @@ -206,7 +206,7 @@ L.Popup = L.Class.extend({ }, _zoomAnimation: function (opt) { - var pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center)._round(); + var pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center); L.DomUtil.setPosition(this._container, pos); }, diff --git a/src/map/Map.js b/src/map/Map.js index 8c63c21b..09b992bc 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -623,7 +623,7 @@ L.Map = L.Class.extend({ _latLngToNewLayerPoint: function (latlng, newZoom, newCenter) { var topLeft = this._getNewTopLeftPoint(newCenter, newZoom).add(this._getMapPanePos()); - return this.project(latlng, newZoom)._subtract(topLeft)._round(); + return this.project(latlng, newZoom)._subtract(topLeft); }, _getCenterLayerPoint: function () {