Pump up your info windows to the max!

Tuesday, November 13, 2007 at 12:18:00 PM

Are your map's info windows bursting with information, barely able to contain it all? Well, let them burst — into maximized info windows. In v2.93, the team has added various options, functions, and events to expand GInfoWindow, letting you mimic the behavior of the Google Maps local search result info windows, which expand to include a wealth of information about particular businesses. By specifying maxContent and maxTitle in GInfoWindowOptions, your info window will automatically be given a maximize button and a (really addictive to watch) maximization animation. The example inlined below shows you how you can use this on map click or marker click, and how you can pass in Strings or DOM nodes to the options:

If you're a power developer, you may be interested in dynamically loading the contents of the maximized info window once clicked (so that you only have to download information in which your users are interested). By listening to the 'maximizeclick' event, we can replace the innerHTML of the maxContent DOM node once GDownloadUrl returns with our data. The example here shows loading the contents of another file (in this case, one of our old blog posts) into the maximized info window.

Start playing around with these examples and let us know if you encounter problems in the Maps API forum. Try not to get too addicted to the maximize animation. ;)