Google Maps API Tutorial© 2006, 2007, 2008, 2009 Mike Williams |
Translate this page: |
Tabbed Info WindowsThe API makes it easy to use tabbed info windows.Here's a simple example Here's a more complicated example in which each info window has a different number of tabs. The map.openInfoWindowTabs(), map.openInfoWindowTabsHtml(), marker.openInfoWindowTabs() and marker.openInfoWindowTabsHtml() methods allow tabbed info windows to be created. All the tab switching is done for you by the API. To use openInfoWindowTabsHtml() to create a tabbed window, you need to pass it an array of GInfoWindowTab() objects. One such object for each tab.
The GInfoWindowTab() constructor is: new GInfoWindowTab(label, contents, onClick) You can have as many tabs as you like, but if you have more than two the graphics fall apart if the info window isn't wide enough. Make the info window wider by using a style "width:XXXpx" in the GInfoWindow() contents. The width needs to be at least 88 pixels per tab. Potential Pitfalls
|