Why distance matrix api always returning the statu

2019-07-17 23:32发布

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条回答
萌系小妹纸
2楼-- · 2019-07-18 00:32

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

查看更多
登录 后发表回答