Open antonioOrtiz opened 2 years ago
Sorry to ask this as it's a question.
No worries! We have a question tag specifically for this. I still need to integrate checking StackOverflow for lrm tags regularly into my routine, so for now it's actually better to ask here for visibility.
You could change the coordinates directly, however, it's probably best to interact directly on the waypoints, since this would also update the instructions. You can do that by either using spliceWaypoints as shown in the example here or using setWaypoints directly
const start = L.latLng(
startingPoints[0]?.highestEl?.latlng?.lat,
startingPoints[0]?.highestEl?.latlng?.lng);
const end = L.latLng(
startingPoints[0]?.lowestEl?.latlng?.lat,
startingPoints[0]?.lowestEl?.latlng?.lng
);
const middle = L.latLng(
startingPoints[0]?.middleEl?.latlng?.lat,
startingPoints[0]?.middleEl?.latlng?.lng
);
const instance = L.Routing.control({
waypoints: [
start,
end,
],
});
instance.setWaypoints([start, middle, end]);
Sorry to ask this as it's a question.
In the docs under IRoute (describes a route through a number of waypoints), there is a property called coordinates
I have a starting and end point:
What I would like to do is:
So how do I add custom Latitude and Longitude between the starting and end waypoints?
Is that indeed what coordinates is for? If so how do you access it?
Thank you in advance!