3

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" }
Dharma
  • 3,007
  • 3
  • 23
  • 38
Raj
  • 905
  • 1
  • 8
  • 17

2 Answers2

0

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

Arjun Vyas
  • 409
  • 5
  • 14
0

This link is working fine

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

  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/31424156) – Abhishek Dutt Apr 03 '22 at 08:56