Closed mikhail349 closed 3 years ago
I'm trying to render route line like this:
onRouteChanged = (route) => { if (this.line) { this.map.removeLayer(this.line); } this.line = L.Routing.line(route); this.line.addTo(this.map); }
It's working, but this line is not draggable to add a new waypoint. What I did wrong?
addWaypoints is true by default, but I also tried to set it this.line = L.Routing.line(route, {addWaypoints: true}); and
addWaypoints
this.line = L.Routing.line(route, {addWaypoints: true});
this.routing = L.Routing.control({ //... lineOptions : { addWaypoints: true } //... }).addTo(this.map);
This helps
this.line.on('linetouched', (e) => { if (e.afterIndex < self.routing.getWaypoints().length - 1) { self.routing._plan.dragNewWaypoint(e); } });
I'm trying to render route line like this:
It's working, but this line is not draggable to add a new waypoint. What I did wrong?
addWaypoints
is true by default, but I also tried to set itthis.line = L.Routing.line(route, {addWaypoints: true});
and