I currently have a leaflet implementation that uses L.Routing.OSRMv1
, and it allows me to get a route, modify it on the fly with waypoints, and then save it as a trip. This works fine, current implementation looks like that :
var control = L.Routing.control({
routeWhileDragging: true,
plan: plan,
show: true,
router: L.Routing.osrmv1({serviceUrl: routerurl, profile: 'train', useHints: false})
});
Now, I would like to implement editing of already saved trips. So basically, I would like to to bypass the initial routing by feeding my saved path instead, and keep being able to move start and end points.
I thought about replacing this._selectedRoute.coordinates
with my saved path, but it seems hacky and suboptimal.
Is this possible to do in a better way ?