问题
I am currently trying to figure out if there is a way to calculate what is the best time to leave by in order to reach my destination using google maps api.
example: San Francisco -> Menlo Park ArrivalTime: 12pm CurrentTime: 11:00am Leave by time: 11:30am
Currently distancematrix api seems to fit my needs; however, setting the arrival time or departure time does not give a response with when to leave.
So I am wondering, if I am missing something or is there another api within google that can be used.
Thank You
回答1:
It is not implemented in the Google Maps API yet. There is a feature request in Google issue tracker that is tracked in the
https://issuetracker.google.com/issues/35829984
Currently the feature request has 28 stars, however it looks like Google didn't set high priority on this task. I would suggest starring a feature request to add your vote and subscribe to further notifications.
Hopefully one day Google will implement this feature.
回答2:
In the API, setting arrival time only works for public transit, not fit driving. You could still calculate it by using a guess and check method if it's a desperate need and you're willing to burn additional API calls.
来源:https://stackoverflow.com/questions/52630550/google-map-leave-by-time