所有谷歌地图使用mode = transit的方向Web服务API请求返回INVALID_REQUEST [英] ALL google maps Directions web service API requests with mode=transit return INVALID_REQUEST

查看:305
本文介绍了所有谷歌地图使用mode = transit的方向Web服务API请求返回INVALID_REQUEST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是几个网址,用于返回步行或驾车的结果,但不包括过境(即,更改模式为步行或驾驶,并且您会看到结果)

a href =http://maps.googleapis.com/maps/api/directions/json?origin=EC3N4AB&destination=EC4M8AD&sensor=false&mode=transit =nofollow> http:// maps。 googleapis.com/maps/api/directions/json?origin=EC3N4AB&destination=EC4M8AD&sensor=false&mode=transit



http://地图.googleapis.com / maps / api / directions / json?origin = Toledo& destination = Madrid& region = es& sensor = false& mode = transit

我不能用mode = transit获得单个响应。请注意,第二个URL直接来自API文档



其他人注意到同样的事情?

对不起。它不是全球性的东西



例如,这不起作用:
http://maps.googleapis.com/maps/api/directions/json?origin=san+francisco& ; destination = seattle& sensor = false& mode = transit

但是,这也是:
http://maps.googleapis。 com / maps / api / directions / json?origin = san + francisco& destination = seattle& sensor = false& mode = transit& departure_time = 1343376768 p

它不是全球性问题。谷歌将departure_time或arrival_time作为必填字段。这是他们的API的最近更改。



感谢您的帮助


Here are a few URLs that return results with walking or driving but not with transit (i.e., change mode to walking or driving and you will see results)

http://maps.googleapis.com/maps/api/directions/json?origin=EC3N4AB&destination=EC4M8AD&sensor=false&mode=transit

http://maps.googleapis.com/maps/api/directions/json?origin=Toledo&destination=Madrid&region=es&sensor=false&mode=transit

I cant get a single response with mode=transit. Notice that the second URL is straight from API documentation

Anyone else noticing the same thing?

解决方案

Sorry. Its not the global thing

E.g, this doesnt work: http://maps.googleapis.com/maps/api/directions/json?origin=san+francisco&destination=seattle&sensor=false&mode=transit

But, this does again: http://maps.googleapis.com/maps/api/directions/json?origin=san+francisco&destination=seattle&sensor=false&mode=transit&departure_time=1343376768

Its not the global issue. Its that google made departure_time or arrival_time as a mandatory field. This is a recent change to their API.

Thanks for all your help

这篇关于所有谷歌地图使用mode = transit的方向Web服务API请求返回INVALID_REQUEST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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