]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/application.js
Add clearer close action, refactor base layer code
[rails.git] / app / assets / javascripts / application.js
index fc426e883551b150652133bbba912dd13fd1411a..f5022683b8050fec55c3c346664e835996c566a0 100644 (file)
@@ -126,13 +126,14 @@ function getShortUrl(map) {
 
 function getUrl(map) {
   var center = map.getCenter(),
-      zoom = map.getZoom();
+      zoom = map.getZoom(),
+      toZoom = zoomPrecision(zoom);
 
   return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ?
           'http://openstreetmap.org/?' : '/?') +
         querystring.stringify({
-            lat: center.lat,
-            lon: center.lng,
+            lat: toZoom(center.lat),
+            lon: toZoom(center.lng),
             zoom: zoom,
             layers: map.getLayersCode()
         });