Link to home
Start Free TrialLog in
Avatar of danswill
danswill

asked on

Google Maps API limit

Hello!

I'm building a mapping tool for an internal project and I'm running into some complications. I'm trying to map a couple hundred of properties and I'm only able to map 10 at a time.

How can I increase the maximum results in Google’s geocoding API? Our application sometimes returns 1000 addressed and we want to get the longitude and latitude in a single request. Unfortunately we only get 10 results per request and the rest if showing an over query error.

Here's the code that I'm currently using:
//data = results from a json request - depending on the user input sometimes the query returns more than 10 addresses.
$.each(data, function(i, item) {
        geocoder.geocode( { 'address':item}, function(results, status) {
        //alert(status);
        if (status == google.maps.GeocoderStatus.OK) {
            var coords = results[0].geometry.location

            map.setCenter(results[0].geometry.location);
            marker = new google.maps.Marker({
                position: results[0].geometry.location,
                map: map,
                animation: google.maps.Animation.DROP,
                icon: base_url+'public/assets/img/home-2.png'
            });
        }
        else
        {
            if(status == google.maps.GeocoderStatus.ZERO_RESULTS)
                zeroResults++;

            if(status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT)
                overQuery++;

            if(status == google.maps.GeocoderStatus.REQUEST_DENIED)
                requestDenied++;
            if(status == google.maps.GeocoderStatus.INVALID_REQUEST)
                invalidRequest++;
            error++;
        }
    });

});// end $.each
ASKER CERTIFIED SOLUTION
Avatar of Kimputer
Kimputer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of danswill
danswill

ASKER

Does the paid version of Google Maps API for work have a higher limit per second?
All the info available I posted already. More technical details you can probably get by contacting their sales department, as provided in the link I posted too.