Google方向API请求在ios5中无效 [英] Google direction api request invalid in ios5

查看:106
本文介绍了Google方向API请求在ios5中无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的要求:
https://maps.googleapis.com/maps/api/directions/json?origin=49.276951,-123.128559&destination=49.277874,-122.912404&mode = transit& sensor = false
结果是:
{
routes:[],
status:INVALID_REQUEST
}

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" }

以前有用,但今天我用它时不起作用。这是为什么?
注意:当我将其更改为mode = walking时,它可以正常工作

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

推荐答案

https ?://maps.googleapis.com/maps/api/directions/json原点= 49.276951,-123.128559&安培;目的地= 49.261566,-123.138399&安培;模式=中转&安培;传感器=假安培; DEPARTURE_TIME = 1346197500

上述请求有效。我们可以通过添加departure_time参数来解决此问题,因为Google可能会更新方向api并将出发时间设置为强制性参数。

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.

这篇关于Google方向API请求在ios5中无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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