Make context menu use from/to for directions

This ensures that the router will try to geocode the values rather
than assuming that they are latitude/longitude pairs.

Fixes #1684
This commit is contained in:
Tom Hughes 2017-11-19 19:49:39 +00:00
parent 7ce94ad0ec
commit e813a31d7a

View file

@ -8,7 +8,8 @@ OSM.initializeContextMenu = function (map) {
lng = latlng.lng.toFixed(precision);
OSM.router.route("/directions?" + querystring.stringify({
route: lat + "," + lng + ";" + $("#route_to").val()
from: lat + "," + lng,
to: $("#route_to").val()
}));
}
});
@ -22,7 +23,8 @@ OSM.initializeContextMenu = function (map) {
lng = latlng.lng.toFixed(precision);
OSM.router.route("/directions?" + querystring.stringify({
route: $("#route_from").val() + ";" + lat + "," + lng
from: $("#route_from").val(),
to: lat + "," + lng
}));
}
});