如何使用Google API查找'期限'使用Lat和Lon

时间:2017-06-24 15:20:39

标签: url google-maps-api-3

我使用以下示例尝试了Google API:https://maps.googleapis.com/maps/api/directions/json?origin=75+9th+Ave+New+York,+NY&destination=MetLife+Stadium+1+MetLife+Stadium+Dr+East+Rutherford,+NJ+07073&departure_time=1541202457&traffic_model=best_guess

它工作正常,但需要使用Lat和Lon而不是真实的Start和End地址做同样的例子。 像上面这样做但使用Lat和Lon的例子是什么?

感谢。

1 个答案:

答案 0 :(得分:0)

显然我最初测试时没有正确的Lat和Lon从谷歌返回错误。这是有效的:

https://maps.googleapis.com/maps/api/directions/json?
origin=40.741963,-74.004915&
destination=40.812840,-74.074209&
departure_time=1541202457&
traffic_model=best_guess