watergis / mapbox-gl-valhalla

This module adds a control which can integrate with valhalla api.
https://watergis.github.io/mapbox-gl-valhalla/
MIT License
10 stars 4 forks source link

add routing function #3

Open JinIgarashi opened 3 years ago

JinIgarashi commented 3 years ago

add routing feature between A and B by using Optimized Route API offered by Valhalla.

https://valhalla.readthedocs.io/en/latest/api/optimized/api-reference/

JinIgarashi commented 3 years ago

I think it should use turn by turn api instead of optimized route api.

https://valhalla.readthedocs.io/en/latest/api/turn-by-turn/overview/

JinIgarashi commented 3 years ago

Optimized Route API

https://valhalla.readthedocs.io/en/latest/api/optimized/api-reference/

https://valhalla.water-gis.com/optimized_route?json={"locations":[{"lat":-1.9640622280311106,"lon":30.094690817468404},{"lat":-1.9655084099187405,"lon":30.114985788328795}],"costing":"pedestrian","directions_options":{"units":"kilometers"}}

turn by turn api

https://valhalla.readthedocs.io/en/latest/api/turn-by-turn/overview/

https://valhalla.water-gis.com/route?json={"locations":[{"lat":-1.9640622280311106,"lon":30.094690817468404},{"lat":-1.9655084099187405,"lon":30.114985788328795}],"costing":"pedestrian","costing_options":{"auto":{"country_crossing_penalty":2000}},"units":"kilometers","id":"my_work_route"}

How to decode shape

https://valhalla.readthedocs.io/en/latest/decoding/