3

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?

4

1 回答 1

3

路线 API 在响应中包含一段持续时间:

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

这些持续时间将取决于您在请求中指定的出行模式(驾驶、步行等):

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

于 2014-03-12T00:49:05.977 回答