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:
-
OKindicates the response contains a validresult. -
NOT_FOUNDindicates at least one of the locations specified in the requests’s origin, destination, or waypoints could not be geocoded. -
ZERO_RESULTSindicates no route could be found between the origin and destination. -
MAX_WAYPOINTS_EXCEEDEDindicates that too manywaypointss were provided in the request. -
INVALID_REQUESTindicates that the provided request was invalid. -
OVER_QUERY_LIMITindicates the service has received too many requests from your application within the allowed time period. -
REQUEST_DENIEDindicates that the service denied use of the directions service by your application. -
UNKNOWN_ERRORindicates a directions request could not be processed due to a server error. The request may succeed if you try again.
2 Likes