是否有可能获得过去的指示? [英] Is it possible to get directions in the past?

查看:62
本文介绍了是否有可能获得过去的指示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是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的文档指出:

delay_time必须设置为当前时间或未来.它不能是过去的.

尝试以下路线指示"请求(将 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).

https://directionsdebug.firebaseapp.com/?origin=California%2C%20USA&destination=Las%20Vegas%2C%20NV%2C%20USA&mode=driving&departure_time=1562766180

您会看到此错误:

由于INVALID_REQUEST,路线请求失败-出发时间为在过去.交通信息仅适用于将来和当前时间.

Directions request failed due to INVALID_REQUEST - departure_time is in the past. Traffic information is only available for future and current times.

希望这能回答您的问题.

Hope this answers your question.

这篇关于是否有可能获得过去的指示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆