]> git.openstreetmap.org Git - rails.git/commitdiff
Make context menu use from/to for directions
authorTom Hughes <tom@compton.nu>
Sun, 19 Nov 2017 19:49:39 +0000 (19:49 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 19 Nov 2017 19:49:39 +0000 (19:49 +0000)
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

index 148ccf908441b99cc23a62da95e81c21c55484df..1ee703e604579d01444a880ec12d7e5f26dcc9be 100644 (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
       }));
     }
   });