I found some code that shows the map and calculate the travel time by Driving. Is it possible to find the travel time 开发者_如何学编程using transit (e.g. BUS) ? The code that I found was using google.maps.DirectionsTravelMode.DRIVING , I looked into the API and only DRIVING, BICYCLING and WALKING were available.
Thanks in advance!
unfortunately, Google Maps only supports static route computation. When I talk about satic it means that the system considers only the route and the average speeds, which are fixed, to determine travel time.
Taking buses into account would require a comprehensive knowledge of bus lines, stops and timetables. It's not impossible to do, but it is really hard. Just for an example, the estimated bus travel time must take into account the waiting time for the next bus at the stop, and it must have then knowledge of timetables too! (not only lines and speeds).
The same applies merging bus and underground (where available).
I hope believe that, in the future, Google Maps will be able to provide these information too.
精彩评论