X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/4cf32e0f0043ad73bf8ecd5320ce1ab55e81e386..4baa17511f26d6a1e1cf1bbb343ebc2746b3666d:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 77b247c10..c6295cb10 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -292,7 +292,7 @@ $(document).ready(function () { }); $(document).on("click", "a", function(e) { - if (e.isPropagationStopped()) return; + if (e.isDefaultPrevented() || e.isPropagationStopped()) return; if (this.host === window.location.host && OSM.route(this.pathname + this.search + this.hash)) e.preventDefault(); }); @@ -303,6 +303,10 @@ $(document).ready(function () { $("#describe_location").on("click", function(e) { e.preventDefault(); - OSM.route("/search?query=" + encodeURIComponent(map.getCenter().lat + "," + map.getCenter().lng)); + var precision = zoomPrecision(map.getZoom()); + OSM.route("/search?query=" + encodeURIComponent( + map.getCenter().lat.toFixed(precision) + "," + + map.getCenter().lng.toFixed(precision))); }); + });