Archive for the 'JavaScript' Category



Rails 2 changed the way to_json works on ActiveRecord objects. Prior to Rails 2, to_json returned a hash of hashes — the first level hash had the key ‘attributes’, which in turn had another hash with your field name/values.
With Rails 2, calling to_json on an AR object just gives you a hash of field name/values. […]

DragZoom (previously called GZoom) is my drag-to-zoom custom Google Map control I open-sourced last year. I’m happy to say the code has been incorporated into Google’s own GMaps Utility Library. Thanks to Pamela Fox from Google for doing a lot of work to bring it in. You can now source DragZoom directly off of Google’s […]

Clickable LabeledMarker

Back in January, I demonstrated how to extend GMarker for text-based labels. In the interests of keeping things simple, I ignored any event handling, and just covered the nuts and bolts of how to make a wrapper class in JavaScript, and how to add the basic functionality we wanted.
Well, we had a number of requests […]

Update: Once you’re through with this article, there’s a followup that shows how to also make them clickable.
Many people find the object-oriented aspect of JavaScript to be very confusing. Fortunately, the designers of the Google Maps API have managed to make it extremely accessible—if all you ever did was instantiate their classes and then build […]

UPDATE: A savvy reader Carl Olsen pointed out that it wasn’t actually necessary to check for the infoWindow state and the problem could simply be fixed by a check for an overlay. The post has been updated accordingly. Thanks Carl.

It seems that somewhere along the line something changed with the event handling and the Chapter […]