Tabbed Max Content

This library provides a max info window UI that's similar to the info window UI for local business results on Google Maps. It lets a developer pass in an array of content that will be rendered in tabs in the maximized state of an info window.

For a description and examples of how to use this library, check out the how-to.

class GMap2

These are new methods added to the Google Maps API's GMap2 class.

Methods

Methods Return Value Description
getTabbedMaxContent() TabbedMaxContent Returns the TabbedMaxContent for currently opened info window.
openMaxContentTabs(latlng:GLatLng, minNode:Node, summaryNode:Node, tabs:MaxContentTab[], opt_maxOptions:MaxContentOptions) None Opens an info window with maximizable content at the given latlng. The infowindow displays the content in the minNode in the minimized state, and then displays the content in the summaryNode along with the array of tabs in the maximized state. Additional options can be sent in opt_maxOptions.
openMaxContentTabsHtml(latlng:GLatLng, minHtml:String, summaryHtml:String, tabs:MaxContentTab[], opt_maxOptions:MaxContentOptions) None Opens an info window with maximizable content at the given latlng. The infowindow displays the content in the minHtml in the minimized state, and then displays the content in the summaryHtml along with the array of tabs in the maximized state. Additional options can be sent in opt_maxOptions.

class GMarker

These are new methods added to Google Maps API's GMarker class.

Methods

Methods Return Value Description
openMaxContentTabs(map:GMap2, minNode:Node, summaryNode:Node, tabs:MaxContentTab[], opt_maxOptions:MaxContentOptions) None Opens an info window with maximizable content above the marker. The infowindow displays the content in the minNode in the minimized state, and then displays the content in the summaryNode along with the array of tabs in the maximized state. Additional options can be sent in opt_maxOptions.
openMaxContentTabsHtml(map:GMap2, minHtml:String, summaryHtml:String, tabs:MaxContentTab[], opt_maxOptions:MaxContentOptions) None Opens an info window with maximizable content above the marker. The infowindow displays the content in the minHtml in the minimized state, and then displays the content in the summaryHtml along with the array of tabs in the maximized state. Additional options can be sent in opt_maxOptions.

class MaxContentOptions

This class extends GInfoWindowOptions. Instances of this class are used in the opts_maxOption argument to methods openMaxContentTabs(), openMaxContentTabsHtml(). Note, GInfoWindowOptions.maxContent can not be specified. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.

Properties

Properties Type Description
maximized Boolean Specifies if the window should be opened in the maximized state by default. The default value is false.
maxTitle String|Node Specifies the title to be shown when the infowindow is maximized. The default value is "".
selectedTab Number|String Selects the tab with the given index or name by default when the info window is first maximized. The default value is 0.
style Object The object that holds a set of css styles for the maximized content. It has the following properties: tabOn, tabOff, tabBar, tabLeft, tabRight, content . Each property is a css object such as {backgroundColor: 'gray', opacity: 0.2}.

class MaxContentTab

This class represents a tab in the maximized info window. An array of instances of this class can be passed in as the tabs argument to the methods openMaxContentTabs*() etc. This class is similar to the GInfoWindowTab class in the core API.

Constructor

Constructor Description
MaxContentTab(label:String, content:Node|String) Creates a content tab data structure that can be passed in the tabs argument in the openMaxContentTabs*() methods.

Methods

Methods Return Value Description
getContentNode() Node Returns the content of the tab.
getLabel() String Returns the label of the tab.

class TabbedMaxContent

This class represent the max content in the info window. There is no public constructor for this class. If needed, it can be accessed via GMap2.getTabbedMaxContent().

Methods

Methods Return Value Description
checkResize() None Adjust sizes of tabs to fit inside the maximized info window. This method is automatically called on GInfoWindow's 'maximizeend' event. However, there may be cases where additional content is loaded in after that event, and an additional resize is needed.
getTab(identifier:Number|String) MaxContentTab Return the MaxContentTab at the given index or label.
selectTab(identifier:Number|String) None Select a tab using the given index or label.

Events

Events Arguments Description
selecttab selected:MaxContentTab This event is fired after a tab is selected, passing the selected MaxContentTab into the callback.