react-native-maps-directions icon indicating copy to clipboard operation
react-native-maps-directions copied to clipboard

Duration and distance for waypoints.

Open prathammehta opened this issue 7 years ago • 4 comments

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!

prathammehta avatar Jun 03 '18 08:06 prathammehta

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

why-absystem avatar Jun 10 '18 07:06 why-absystem

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

prathammehta avatar Jun 11 '18 08:06 prathammehta

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.

bramus avatar Oct 17 '18 13:10 bramus

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.

garydevenay avatar May 21 '19 09:05 garydevenay