When a user searches for a route and one is not found the polyline
layer is removed - if they then change the mode of transportation the
event listener will not reroute if there is no polyline layer.
This commit removes the conditional that prevents the routing code from
re-running after the polyline has been removed.
Fixes #3050
Closes #3055
select.on("change", function (e) {
chosenEngine = engines[e.target.selectedIndex];
$.cookie("_osm_directions_engine", chosenEngine.id, { expires: expiry, path: "/" });
- if (map.hasLayer(polyline)) {
- getRoute(true, true);
- }
+ getRoute(true, true);
});
$(".directions_form").on("submit", function (e) {