From e813a31d7a7d6f2fe7944543dd2a65f899c36dc5 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 19 Nov 2017 19:49:39 +0000 Subject: [PATCH 1/1] 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 --- app/assets/javascripts/index/contextmenu.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 })); } }); -- 2.43.2