directions-api-js-client
directions-api-js-client copied to clipboard
Make association of path details to legs easier
If someone wants to know all surface or street name information per "leg" (one leg is between via points) the current process is a bit ugly, see this tutorial.
Good idea. We could introduce a "via point" marker that could be placed between the PathDetails, so that they are separated at this point, like:
["Street A", 0, 10], ["Via Point 1", 10, 10], ["Street A", 10, 20].
Another option would be to add a "leg" PathDetail, that would result in another PathDetail like:
["Leg 1", 0, 10], ["Leg 2", 10, 20]
I meant a purely JS solution without changing the JSON and e.g. create something that helps with separating into legs or is already separated and real JS objects.
For now I documented only the current state without any changes in the API: https://www.graphhopper.com/blog/2019/11/28/routing-api-using-path-details/