Directions request failed due to ZERO_RESULTS goole maps API

I am trying to show the distance between two points in maps. but i am facing this error direction request failed due to ZERO_RESULTS. Help please

For anyone who lands here…

ZERO_RESULTS means no route could be found between your two points.
Check if you have set Sensor location mocks on the Chrome developer tools to override resulting in a location which cannot be determined using geolocation…
Or else geolocation is not able to determine your current location.

Status Codes code for the directions renderer object

The "status" field within the Directions response object contains the status of the request, and may contain debugging information to help you track down why the Directions service failed. The "status" field may contain the following values:

  • OK indicates the response contains a valid result .
  • NOT_FOUND indicates at least one of the locations specified in the requests’s origin, destination, or waypoints could not be geocoded.
  • ZERO_RESULTS indicates no route could be found between the origin and destination.
  • MAX_WAYPOINTS_EXCEEDED indicates that too many waypoints s were provided in the request.
  • INVALID_REQUEST indicates that the provided request was invalid.
  • OVER_QUERY_LIMIT indicates the service has received too many requests from your application within the allowed time period.
  • REQUEST_DENIED indicates that the service denied use of the directions service by your application.
  • UNKNOWN_ERROR indicates a directions request could not be processed due to a server error. The request may succeed if you try again.
2 Likes