Question

I'm making the following call to the google maps api 22 times in my javascript. As I understand the API limits, there is no way I should be going over the limit. I get through the first 11 calls but the last half are returned OVER_QUERY_LIMIT status

geocoder.geocode({"address": "Alpharetta, GA"}, function(results, status) {
        console.log(status);
        if(results!== null){
            var marker = new google.maps.Marker();
            marker.setPosition(results[0].geometry.location);
            marker.setMap(map);
            marker.setTitle("Studio Movie Grill");
            google.maps.event.addListener(marker, 'click', function() {
                window.setTimeout(function() { alert(marker.getTitle()); }, 1000);
            });
            bounds.extend(marker.position);
            map.fitBounds(bounds);
        }
    });
Was it helpful?

Solution

It seems like you may be going over the "# or requests per second" limit. As mentioned in the documentation:

You can exceed the Google Maps API Web Services usage limits by:

  • Sending too many requests per day.
  • requests too fast, i.e. too many requests per second.
  • requests too fast for too long or otherwise abusing the web service.
  • Exceeding other usage limits, e.g. points per request in the Elevation API.

To verify that you are hitting that limit:

Upon receiving a response with status code OVER_QUERY_LIMIT, your application should determine which usage limit has been exceeded. This can be done by pausing for 2 seconds and resending the same request. If status code is still OVER_QUERY_LIMIT, your application is sending too many requests per day. Otherwise, your application is sending too many requests per second.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top