问题描述
我是Google Directions API的新手,我正在尝试获取过去的路线(即今天或将来的任何日期/时间).
I am new to the Google Directions API, and I'm trying to get directions in the past (i.e. not today or any date/time in the future).
我已经在开发人员指南,它表示您无法选择过去的日期/时间.
I have read about the arrival_time
and departure_time
parameters in the Developers Guide, and it says that you cannot choose a past date/time.
但是,通过Web界面,我可以选择一个先前的日期和时间,与让网站默认为当前日期/时间相比,它似乎提供了不同的距离/时间估计.
However, through the web interface, I can choose a prior date and time, and it appears to provide a different distance/time estimate than letting the website default to the current date/time.
这使我相信这是可能的,但是我无法弄清楚如何通过API或通过非API结构化的URL来做到这一点.
This leads me to believe it is possible, but I have cannot figure out how to do it, either through the API or through a non-API structured URL.
任何帮助将不胜感激!
推荐答案
过去无法设置出发时间
. Google的文档指出:
尝试以下路线指示"请求(将 departure_time
设置为 7月10日
,即今天的9天前).
Try the following Directions request (which has departure_time
set to 10 July
, i.e. 9 days ago as of today).
您会看到此错误:
希望这能回答您的问题.
Hope this answers your question.
这篇关于是否有可能获得过去的指示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!