From: Tom Hughes Date: Sun, 18 Aug 2024 10:54:48 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/5089' X-Git-Tag: live~289 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/a11c02122d3d9e17cdf4b9852254501e62767b59?hp=cfaae9eadd794d646950421c8d21a6fe356e727f Merge remote-tracking branch 'upstream/pull/5089' --- diff --git a/app/assets/javascripts/osm.js.erb b/app/assets/javascripts/osm.js.erb index e429f4479..e08528f84 100644 --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@ -204,7 +204,9 @@ OSM = { }, zoomPrecision: function(zoom) { - return Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2)); + var pixels = Math.pow(2, 8 + zoom); + var degrees = 180; + return Math.ceil(Math.log10(pixels / degrees)); }, locationCookie: function(map) {