Remove conditional for polyline layer
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
This commit is contained in:
parent
810e4da85a
commit
d257e67842
1 changed files with 1 additions and 3 deletions
|
@ -335,9 +335,7 @@ OSM.Directions = function (map) {
|
|||
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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue