X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b2fcf003f8e5c928cabf36ae9a01ef393de8874f..9b9e857b726d4a45af5e1b760ac1639cd31f0280:/app/assets/javascripts/osm.js.erb?ds=inline 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) {