I am using google.maps.DirectionsService for getting the route between two points. This code was working from past 8 months. However, from past couple of days DirectionService route call is returning OVER_QUERY_LIMIT response status. There are only 6 set of points, out of which only 2 or 3 requests are getting the result, rest are failing. Code is unchanged from past 8 months. Below is the code snippet for reference:
var directionsService = new google.maps.DirectionsService();
var request = {
origin:originLatlng, //This is of type : google.maps.LatLng
destination:destLatlng,
travelMode: google.maps.DirectionsTravelMode.DRIVING,
provideRouteAlternatives: true
};
directionsService.route(request, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
polyline = new google.maps.Polyline({
path: result.routes[0].overview_path,
strokeColor: color1,
strokeOpacity: 0.8,
strokeWeight: 5,
geodesic: true
});
}
}
Almost 6 such simultaneous requests are made to DirectionService. I cannot put sleep in between the requests because, it will increase my application GUI load time.
I have tried the same code from different networks also, still problem persists.
I definitely did not come anywhere close to reaching the 2,500 daily request limit.
What could be the problem here? Please suggest a solution for this.
Any help would be greatly appreciated.
Thanks in advance
Satyapal