]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/application.js
Implement long URL option, toggling, and labeling for share
[rails.git] / app / assets / javascripts / application.js
index a7548e7f9cbff9a7175a431bd0912ae0394aef2e..84305a9618af358d6c69b06f9bd942637ff8c3ff 100644 (file)
@@ -120,6 +120,18 @@ function getShortUrl(map) {
           makeShortCode(map);
 }
 
+function getUrl(map) {
+  var center = map.getCenter(),
+      zoom = map.getZoom();
+  return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ?
+          'http://openstreetmap.org/?' : '/?') +
+        querystring.stringify({
+            lat: center.lat,
+            lon: center.lng,
+            zoom: zoom
+        });
+}
+
 function minZoomAlert() {
     alert(I18n.t("javascripts.site." + name + "_zoom_alert")); return false;
 }