From: John Firebaugh Date: Tue, 5 Nov 2013 21:27:18 +0000 (-0800) Subject: Use appropriate precision for "Where am I?" X-Git-Tag: live~5634^2~199^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/0f799186abfb97b2d3b056f9bc76996a87aa6fd8?hp=--cc Use appropriate precision for "Where am I?" --- 0f799186abfb97b2d3b056f9bc76996a87aa6fd8 diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index e9e95abfe..a044937fc 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -303,6 +303,9 @@ $(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))); }); });