]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/5089'
authorTom Hughes <tom@compton.nu>
Sun, 18 Aug 2024 10:54:48 +0000 (11:54 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 18 Aug 2024 10:54:48 +0000 (11:54 +0100)
app/assets/javascripts/osm.js.erb

index e429f4479f143dfe2d50622b870d62d60558a263..e08528f845da2b2cee72780d3197720fbc42ab02 100644 (file)
@@ -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) {