com.google.gwt.maps.client
Class InfoWindow

java.lang.Object
  extended by com.google.gwt.maps.client.overlay.Overlay
      extended by com.google.gwt.maps.client.overlay.Overlay.ConcreteOverlay
          extended by com.google.gwt.maps.client.InfoWindow

public final class InfoWindow
extends Overlay.ConcreteOverlay

Each map within the Google Maps API may show a single "info window" of type InfoWindow, which displays HTML content in a floating window above the map. The info window looks a little like a comic-book word balloon; it has a content area and a tapered stem, where the tip of the stem is at a specified point on the map. You can see the info window in action by clicking a marker in Google Maps.

See Also:
MapWidget.getInfoWindow()

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.maps.client.overlay.Overlay
Overlay.ConcreteOverlay
 
Field Summary
 
Fields inherited from class com.google.gwt.maps.client.overlay.Overlay
jsoPeer
 
Method Summary
 void addInfoWindowCloseClickHandler(InfoWindowCloseClickHandler handler)
          This event is fired when the info window close button is clicked.
 void addInfoWindowMaximizeClickHandler(InfoWindowMaximizeClickHandler handler)
          Signals that the info window is about to be maximized.
 void addInfoWindowMaximizeEndHandler(InfoWindowMaximizeEndHandler handler)
          Signals that the info window is about to be maximized.
 void addInfoWindowRestoreClickHandler(InfoWindowRestoreClickHandler handler)
          Signals that the info window is about to be restored to the non-maximized state.
 void addInfoWindowRestoreEndHandler(InfoWindowRestoreEndHandler handler)
          Signals that the info window has completed the restore operation to the non-maximized state.
 void close()
          Closes the info window.
 com.google.gwt.user.client.Element[] getContentContainers()
          Returns the array of Elements that hold the content of the tabs of this info window.
 Size getPixelOffset()
          Returns the offset, in pixels, of the tip of the info window from the point on the map at whose geographical coordinates the info window is anchored.
 LatLng getPoint()
          Returns the geographical point at which the info window is anchored.
 int getSelectedTab()
          Returns the index, starting at 0, of the current selected tab.
 boolean isVisible()
          Returns true if the info window is visible.
 void maximize()
          Maximizes the infowindow.
 void open(LatLng point, InfoWindowContent content)
          Opens the info window at the given point with the given content.
 void open(Marker marker, InfoWindowContent content)
          Create a new info window on a Marker.
 void removeInfoWindowCloseClickHandler(InfoWindowCloseClickHandler handler)
          Removes a single handler of this map previously added with addInfoWindowCloseClickHandler(InfoWindowCloseClickHandler) .
 void removeInfoWindowMaximizeClickHandler(InfoWindowMaximizeClickHandler handler)
          Removes a single handler of this map previously added with addInfoWindowMaximizeClickHandler(InfoWindowMaximizeClickHandler) .
 void removeInfoWindowMaximizeEndHandler(InfoWindowMaximizeEndHandler handler)
          Removes a single handler of this map previously added with addInfoWindowMaximizeEndHandler(InfoWindowMaximizeEndHandler) .
 void removeInfoWindowRestoreClickHandler(InfoWindowRestoreClickHandler handler)
          Removes a single handler of this map previously added with addInfoWindowRestoreClickHandler(InfoWindowRestoreClickHandler) .
 void removeInfoWindowRestoreEndHandler(InfoWindowRestoreEndHandler handler)
          Removes a single handler of this map previously added with addInfoWindowRestoreEndHandler(InfoWindowRestoreEndHandler) .
 void restore()
          Restores the info window to its default (non-maximized) state.
 void selectTab(int index)
          Selects the tab with the given index.
 void setMaximizeEnabled(boolean enabled)
          Enables or disables maximization of the info window.
 void setVisible(boolean visible)
          Shows or hides the info window.
 
Methods inherited from class com.google.gwt.maps.client.overlay.Overlay.ConcreteOverlay
copy, initialize, redraw, remove
 
Methods inherited from class com.google.gwt.maps.client.overlay.Overlay
getZIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addInfoWindowCloseClickHandler

public void addInfoWindowCloseClickHandler(InfoWindowCloseClickHandler handler)
This event is fired when the info window close button is clicked. An event handler for this event can implement to close the info window, by calling the close() method.

Parameters:
handler - the handler to call when this event fires.

addInfoWindowMaximizeClickHandler

public void addInfoWindowMaximizeClickHandler(InfoWindowMaximizeClickHandler handler)
Signals that the info window is about to be maximized.

Parameters:
handler - the handler to call when this event fires.

addInfoWindowMaximizeEndHandler

public void addInfoWindowMaximizeEndHandler(InfoWindowMaximizeEndHandler handler)
Signals that the info window is about to be maximized.

Parameters:
handler - the handler to call when this event fires.

addInfoWindowRestoreClickHandler

public void addInfoWindowRestoreClickHandler(InfoWindowRestoreClickHandler handler)
Signals that the info window is about to be restored to the non-maximized state.

Parameters:
handler - the handler to call when this event fires.

addInfoWindowRestoreEndHandler

public void addInfoWindowRestoreEndHandler(InfoWindowRestoreEndHandler handler)
Signals that the info window has completed the restore operation to the non-maximized state.

Parameters:
handler - the handler to call when this event fires.

close

public void close()
Closes the info window.


getContentContainers

public com.google.gwt.user.client.Element[] getContentContainers()
Returns the array of Elements that hold the content of the tabs of this info window.

Returns:
the Elements that hold the content of the tabs of this info window

getPixelOffset

public Size getPixelOffset()
Returns the offset, in pixels, of the tip of the info window from the point on the map at whose geographical coordinates the info window is anchored.

Returns:
the offset of the info window

getPoint

public LatLng getPoint()
Returns the geographical point at which the info window is anchored. The tip of the window points to this point on the map, modulo the pixel offset.


getSelectedTab

public int getSelectedTab()
Returns the index, starting at 0, of the current selected tab.

Returns:
the index of the selected tab

isVisible

public boolean isVisible()
Returns true if the info window is visible.

Returns:
true if the info window is visible

maximize

public void maximize()
Maximizes the infowindow. The infowindow must have been opened with maxContent or maxTitle options, and it must not have had its maximization disabled through setMaximizeEnabled(boolean)


open

public void open(LatLng point,
                 InfoWindowContent content)
Opens the info window at the given point with the given content. If an info window is already open on the map.

Parameters:
point - position to use as the origin of the Info Window.
content - An object that is filled with the content to display in the InfoWindow.

open

public void open(Marker marker,
                 InfoWindowContent content)
Create a new info window on a Marker.

Parameters:
marker - Marker to open window over.
content - An object that is filled with the content to display in the InfoWindow.

removeInfoWindowCloseClickHandler

public void removeInfoWindowCloseClickHandler(InfoWindowCloseClickHandler handler)
Removes a single handler of this map previously added with addInfoWindowCloseClickHandler(InfoWindowCloseClickHandler) .

Parameters:
handler - the handler to remove

removeInfoWindowMaximizeClickHandler

public void removeInfoWindowMaximizeClickHandler(InfoWindowMaximizeClickHandler handler)
Removes a single handler of this map previously added with addInfoWindowMaximizeClickHandler(InfoWindowMaximizeClickHandler) .

Parameters:
handler - the handler to remove

removeInfoWindowMaximizeEndHandler

public void removeInfoWindowMaximizeEndHandler(InfoWindowMaximizeEndHandler handler)
Removes a single handler of this map previously added with addInfoWindowMaximizeEndHandler(InfoWindowMaximizeEndHandler) .

Parameters:
handler - the handler to remove

removeInfoWindowRestoreClickHandler

public void removeInfoWindowRestoreClickHandler(InfoWindowRestoreClickHandler handler)
Removes a single handler of this map previously added with addInfoWindowRestoreClickHandler(InfoWindowRestoreClickHandler) .

Parameters:
handler - the handler to remove

removeInfoWindowRestoreEndHandler

public void removeInfoWindowRestoreEndHandler(InfoWindowRestoreEndHandler handler)
Removes a single handler of this map previously added with addInfoWindowRestoreEndHandler(InfoWindowRestoreEndHandler) .

Parameters:
handler - the handler to remove

restore

public void restore()
Restores the info window to its default (non-maximized) state. The InfoWindow must have been opened with maxContent or maxTitle options


selectTab

public void selectTab(int index)
Selects the tab with the given index. This has the same effect as clicking on the corresponding tab.

Parameters:
index - the index of the tab to select

setMaximizeEnabled

public void setMaximizeEnabled(boolean enabled)
Enables or disables maximization of the info window. A maximizable info window expands to fill most of the map with contents specified via the maxContent and maxTitle properties of GInfoWindowOptions. The info window must have been opened with maxContent or maxTitle options in order for this function to have any effect. An info window opened with maxContent or maxTitle will have maximization enabled by default. Note that if the info window is currently opened and this method is set to disable maximizing, this function will remove the maximize button but will not restore the window to its minimized state.


setVisible

public void setVisible(boolean visible)
Shows or hides the info window.

Parameters:
visible - pass true to show the info window, false to hide.