bramus / react-native-maps-directions

Directions Component for `react-native-maps`
MIT License
1.24k stars 197 forks source link

Duration and distance for waypoints. #46

Open prathammehta opened 6 years ago

prathammehta commented 6 years ago

The waypoint feature is awesome! Can you also expose the Duration and distance to each waypoint in the callback for onReady? I believe Google's direction API response already contains that information.

Thanks for a great library!

why-absystem commented 6 years ago

@prathammehta , u can also get duration and distance from result. result.duration result.distance

prathammehta commented 6 years ago

Yup. I know about that. It'll be awesome to be able to get the same information for each waypoint as well.

bramus commented 5 years ago

Passing the original Google Directions response into the onReady callback looks like a good solution, to cater for more advanced/specific use cases.

I'll happily accept a PR that implements this.

garydevenay commented 5 years ago

I have created a pull request which includes a fix for this issue. https://github.com/bramus/react-native-maps-directions/pull/85

This includes each step in a journey, each which has its own individual duration.