Google direction api request invalid in ios5

旧时模样 提交于 2019-12-10 10:49:52

问题


Here is my request: https://maps.googleapis.com/maps/api/directions/json?origin=49.276951,-123.128559&destination=49.277874,-122.912404&mode=transit&sensor=false The result is: { "routes" : [], "status" : "INVALID_REQUEST" }

It worked before, but it does not work when i used it today. why is that? Note: it works fine when i change it to mode=walking


回答1:


https://maps.googleapis.com/maps/api/directions/json?origin=49.276951,-123.128559&destination=49.261566,-123.138399&mode=transit&sensor=false&departure_time=1346197500

The above request works. We can solve this problem by adding departure_time parameter since Google may updated the direction api and set departure time as a mandatory parameter.




回答2:


The problem here is probably that there is no public transit that can take you from your origin to your destination, thus the invalid request..



来源:https://stackoverflow.com/questions/11656445/google-direction-api-request-invalid-in-ios5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!