X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/203ba58bab01b7a61cdff8974cbbfe4f7f639cb1..a70b61315c2331c18123a0b36782d6ef6bb3ab3e:/app/assets/javascripts/index.js?ds=sidebyside diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 54ccb88ed..236ed44fc 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -342,9 +342,10 @@ $(document).ready(function () { $(".describe_location").on("click", function(e) { e.preventDefault(); - var precision = OSM.zoomPrecision(map.getZoom()); + var center = map.getCenter().wrap(), + precision = OSM.zoomPrecision(map.getZoom()); OSM.router.route("/search?query=" + encodeURIComponent( - map.getCenter().lat.toFixed(precision) + "," + - map.getCenter().lng.toFixed(precision))); + center.lat.toFixed(precision) + "," + center.lng.toFixed(precision) + )); }); });