Rene Saarsoo
Rene Saarsoo

Reputation: 13937

Google Maps geocoding query limit difference between v2 and v3

When I perform client side geocoding requests in v2, I'm able to do quite a lot of requests in a row with 200ms intervals. But in v3 I have to increase the interval to 2 seconds in order to avoid the OVER_QUERY_LIMIT error. This means in Maps v3 my geocoding will be much-much slower.

This kind of difference between Maps API v2 and v3 seems really strange to me. Has anyone else also experienced this problem or is it just me? Is there any way to use the v2 geocoder while the rest of the page uses v3?

PS. I'm mostly concerned with reverse geocoding (latlng->address), which is even slower than the normal geocoding.

Upvotes: 0

Views: 1658

Answers (1)

Kasper Vesth
Kasper Vesth

Reputation: 4113

What I did in my application was doing as many as I could as fast as I could. Whenever I hit the OVER_QUERY_LIMIT I would let my thread sleep for 5 seconds and then try again. This worked great. I did some tries to find out how many it could handle and it seems that 10 queries in a short time is the limit. Then you have to wait a bit.

I don't think it is possible to use both API's since you would have to include both .js files, and there are bound to be some things that have the same name and that would result in behavior you can't really predict.

One thing I can say though is that it seems you are doing something wrong if you have to do it all client-side. Is it not an option for you to store the locations in a database or something and then only make the lookups whenever something new comes?

Upvotes: 2

Related Questions