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:
parent
7ce94ad0ec
commit
e813a31d7a
1 changed files with 4 additions and 2 deletions
|
@ -8,7 +8,8 @@ OSM.initializeContextMenu = function (map) {
|
||||||
lng = latlng.lng.toFixed(precision);
|
lng = latlng.lng.toFixed(precision);
|
||||||
|
|
||||||
OSM.router.route("/directions?" + querystring.stringify({
|
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);
|
lng = latlng.lng.toFixed(precision);
|
||||||
|
|
||||||
OSM.router.route("/directions?" + querystring.stringify({
|
OSM.router.route("/directions?" + querystring.stringify({
|
||||||
route: $("#route_from").val() + ";" + lat + "," + lng
|
from: $("#route_from").val(),
|
||||||
|
to: lat + "," + lng
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue