0

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

下面是我的 HTTP 请求的 URL:

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

JSON响应如下:

{
   "routes" : [],
   "status" : "INVALID_REQUEST"
}

谷歌路线 API https://developers.google.com/maps/documentation/directions/#DirectionsRequests

4

2 回答 2

4

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

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

于 2013-03-14T20:27:48.180 回答
0

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

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

应该:

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。

于 2013-03-14T20:29:42.093 回答