Domanda

Using the Google Maps SDK for iOS, is it possible to calculate/retrieve the time for a route from location A to location B that is taken by bike, by car or or walking as it is done in the regular Google Maps app for iOS?

I know that directions can be displayed using a GMSPolyLine using the Google Directions API, now is it possible to calculate the time need to walk all the way along the polyline from A to B?

È stato utile?

Soluzione

The directions API includes a duration in the legs in the response:

https://developers.google.com/maps/documentation/directions/#Legs

These durations will depend on the travel mode (driving, walking, etc) that you specified in the request:

https://developers.google.com/maps/documentation/directions/#TravelModes

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top