Associate search input with route destination instead of departure
This commit is contained in:
parent
79f5ccca31
commit
e6b0e1ae7e
2 changed files with 3 additions and 3 deletions
|
@ -73,8 +73,8 @@ OSM.Directions = function (map) {
|
|||
|
||||
$(".directions_form .btn-close").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
$(".describe_location").toggle(!endpoints[0].value);
|
||||
$(".search_form input[name='query']").val(endpoints[0].value);
|
||||
$(".describe_location").toggle(!endpoints[1].value);
|
||||
$(".search_form input[name='query']").val(endpoints[1].value);
|
||||
OSM.router.route("/" + OSM.formatHash(map));
|
||||
});
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ OSM.Search = function (map) {
|
|||
e.preventDefault();
|
||||
const query = $(this).closest("form").find("input[name=query]").val();
|
||||
let search = "";
|
||||
if (query) search = "?" + new URLSearchParams({ from: query });
|
||||
if (query) search = "?" + new URLSearchParams({ to: query });
|
||||
OSM.router.route("/directions" + search + OSM.formatHash(map));
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue