首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无效(Google Directions API)

无效(Google Directions API)
EN

Stack Overflow用户
提问于 2013-03-15 04:21:48
回答 2查看 665关注 0票数 0

为什么我对Google Directions API的HTTP请求无效?

下面是我的HTTP请求的URL:

代码语言:javascript
复制
http://maps.googleapis.com/maps/api/directions/json?origin=(50.8441144,-0.1094412)&desination=(50.861796,-0.083256)&region=uk&sensor=false

JSON响应如下:

代码语言:javascript
复制
{
   "routes" : [],
   "status" : "INVALID_REQUEST"
}

谷歌方向应用编程接口https://developers.google.com/maps/documentation/directions/#DirectionsRequests

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-03-15 04:27:48

您的目的地拼写错误,并且您的坐标编码可能不正确。尝试:

http://maps.googleapis.com/maps/api/directions/json?origin=50.8441144,-0.1094412&destination=50.861796,-0.083256&region=uk&sensor=false

票数 4
EN

Stack Overflow用户

发布于 2013-03-15 04:29:42

您在请求url中输入了一个错误:

代码语言:javascript
复制
http://maps.googleapis.com/maps/api/directions/json?origin=(50.8441144,-0.1094412)&desination=(50.861796,-0.083256)&region=uk&sensor=false

应该是:

代码语言:javascript
复制
http://maps.googleapis.com/maps/api/directions/json?origin=(50.8441144,-0.1094412)&destination=(50.861796,-0.083256)&region=uk&sensor=false

注: des*t*ination。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15419412

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档