Force coordinates into range for "Where am I" queries

Fixes #753
This commit is contained in:
Tom Hughes 2014-06-15 11:08:25 +01:00
parent 5a830b2845
commit 6e45410103

View file

@ -334,9 +334,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)
));
});
});