X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/66039dedb069400298717415e7c9ce4e444bfcdb..1f22b625a045b7ce25a4668f404071aef8ab8b09:/app/assets/javascripts/osm.js.erb diff --git a/app/assets/javascripts/osm.js.erb b/app/assets/javascripts/osm.js.erb index 382e32bdf..bd65182a7 100644 --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@ -165,7 +165,12 @@ OSM = { return hash; }, - zoomPrecision: function (zoom) { + zoomPrecision: function(zoom) { return Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2)); + }, + + locationCookie: function(map) { + var center = map.getCenter().wrap(); + return [center.lng, center.lat, map.getZoom(), map.getLayersCode()].join('|'); } };