Google Maps integration via jQuery

Re: [Pixels & Beats] Google Maps integration via jQuery

By Chris - November 23, 2010

I did a little digging. It's the Geocoder.

gMap is using the Google Geocoding API to resolve addresses and Google's service isn't returning valid positions for all the addresses requested, (only the first few.) gMap doesn't have any error checking to make sure a proper position was returned.

Google says:

"As a general best practice, it is not recommended to use GClientGeocoder functions in a loop. Developers that have multiple addresses to geocode should probably use our HTTP Geocoder instead."

gMap is using the GClientGeocoder functions in a loop.

Also, Google says of their Geocoding API:

"Use of the Google Geocoding API is subject to a query limit of 2,500 geolocation requests per day. (User of Google Maps API Premier may perform up to 100,000 requests per day.) This limit is enforced to prevent abuse and/or repurposing of the Geocoding API, and this limit may be changed in the future without notice. Additionally, we enforce a request rate limit to prevent abuse of the service."

I'm pretty sure that's what's happening: gMap is making too many requests in too short of a time and Google's geocoding service starts failing.

I think the simplest solution is to geocode addresses on the server-side. Your markers will display immediately and you won't have to worry about query limits. We have a plugin in development which does exactly that. I'm going to finish it up and release it as soon as possible — hopefully tomorrow! I'll post here when it's ready.

P.S. The good news is that you should be able to keep using gMap. :)
All the best,
Chris

Re: [chris] Google Maps integration via jQuery

Chris - you're a champion! Thanks!
Cheers,

Tim (toledoh.com.au)
WoW! You are like the Cavalry charging in just when we thought it was all over ;)

I am waiting to go ahead with my first stage of the go live on the website so this is fantastic news. I'll stay tuned!

Paul

Re: [Pixels & Beats] Google Maps integration via jQuery

I really don't want to sound like I am hounding you Chris . . . . . . but any idea when the plugin may be released? [;)]

I am happy to beta test. Especially when my MD is asking when the site is going live lol.

Kind Regards

Paul

Re: [Pixels & Beats] Google Maps integration via jQuery

Hi Chris,

You are right... changing the fields to lat/long works a treat!
Cheers,

Tim (toledoh.com.au)

By Chris - November 29, 2010

Hi folks,

We've just released our Geocoder plugin, which has been in development for a while now! It'll automatically get lat/lng coordinates for you.

More information on the plugin is available here:

http://www.interactivetools.com/forum/gforum.cgi?post=84902

Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Google Maps integration via jQuery

Sold!

Thanks Chris :)