Search code examples
javascriptgoogle-mapsgoogle-maps-api-3google-geocoder

Google Maps API Geocode failed, status: OVER_QUERY_LIMIT


I apologize if this is a duplicate. But I am still unable to fix this issue. I'm attempting to geocode multiple locations (around 20). I am currently getting Geocode failed, status: OVER_QUERY_LIMIT. I've attempted to set a timeout, from what I've seen on other Stack Overflow questions. However, this does not currently work for me. My geocoding is currently set up as such:

         setTimeout(function geocodeLocations(data) {
                    var geocoder = new google.maps.Geocoder();
                    geocoder.geocode( { 'address': fullAddress }, function(data, status) {
                        if ( status == google.maps.GeocoderStatus.OK ) {
                            var coordinates = data[0].geometry.location;
                            var lat = coordinates.lat();
                            var lng = coordinates.lng();


                            // sets the items in the marker 
                            var markerInfo = {
                                name: name,
                                lat: lat,
                                lng: lng,
                                locationStatus: locationStatus,
                                project: project,
                                date: FormattedDate,
                                storytellerFlag: storytellerFlag,
                                RegistrationLink: RegistrationLink,
                                ID: ID
                            };
                            map.setCenter(markerInfo);
                            createMarker(markerInfo);
                        } else {
                         console.log("Geocode failed, status: " + status);
                        }
                    });
                }, 2000);

Can anyone help me figure out how to allow more than 10 queries to be geocoded?


Solution

  • There is a rate limit. After you hit the limit, you can no longer make requests.