From: Tom Hughes Date: Sun, 19 Nov 2017 19:49:39 +0000 (+0000) Subject: Make context menu use from/to for directions X-Git-Tag: live~3262 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/e813a31d7a7d6f2fe7944543dd2a65f899c36dc5?hp=7ce94ad0ec09715b6dc7268db4f5ec3e94906185 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 --- diff --git a/app/assets/javascripts/index/contextmenu.js b/app/assets/javascripts/index/contextmenu.js index 148ccf908..1ee703e60 100644 --- a/app/assets/javascripts/index/contextmenu.js +++ b/app/assets/javascripts/index/contextmenu.js @@ -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 })); } });