Why distance matrix api always returning the status “ZERO_RESULTS”?

心不动则不痛 提交于 2019-12-11 02:34:44

问题


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

回答1:


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 :)



来源:https://stackoverflow.com/questions/25684460/why-distance-matrix-api-always-returning-the-status-zero-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!