为什么距离矩阵api总是返回状态“ZERO_RESULTS”? [英] Why distance matrix api always returning the status "ZERO_RESULTS"?

查看:233
本文介绍了为什么距离矩阵api总是返回状态“ZERO_RESULTS”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用距离矩阵api来计算一个源和多个目标之间的距离。来源纬度/经度和目的地纬度/经度是完美的。此外,路线在这些点之间的谷歌地图中存在。但是API总是返回状态ZERO_RESULTS。这个问题的原因是什么以及如何解决。

距离矩阵api的响应如下:

 行:[

{

元素:[

{

status:ZERO_RESULTS

},

{

status:ZERO_RESULTS

},








$ b):}

]}],status:OK}


解决方案

根据Google描述距离矩阵api


https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=Washington,DC&destinations=New+York+City,NY&key= YOUR_API_KEY

可能在代码中存在错误实现
试试这种方式:)


I am using the distance matrix api to calculate the distance between one source and multiple destinations. The source latitude / longitude and destination latitudes / longitudes are perfect. Also the route is existing in Google maps between those points. But the api is always returning the status "ZERO_RESULTS". What is the reason for this issue and how it could be solved.

The response from distance matrix api is as follows :

"rows" : [

 {

  "elements" : [

  {

    "status" : "ZERO_RESULTS"

 },

{

    "status" : "ZERO_RESULTS"

},

.

.

.

.

):  }

] } ],  "status" : "OK" }

解决方案

As per Google Description distance matrix api

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=Washington,DC&destinations=New+York+City,NY&key=YOUR_API_KEY

may be there's something wrong implementation in your code try this way :)

这篇关于为什么距离矩阵api总是返回状态“ZERO_RESULTS”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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