com.google.gwt.maps.client.overlay
Class TrafficOverlay

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.overlay.TrafficOverlay

public final class TrafficOverlay
extends Overlay.ConcreteOverlay

A traffic overlay object displays road traffic information. The traffic overlay will only display traffic information for supported cities. To add a traffic overlay to the map:

  TrafficOverlay traffic = new TrafficOverlay();
  map.addOverlay(traffic);
 


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
 
Constructor Summary
TrafficOverlay()
          Creates a new traffic overlay.
 
Method Summary
 void addTrafficOverlayChangedHandler(TrafficOverlayChangedHandler handler)
          This event is fired when the state of traffic data changes within the current viewport.
 void removeTrafficOverlayHandler(TrafficOverlayChangedHandler handler)
          Removes a single handler of this map previously added with addTrafficOverlayChangedHandler(TrafficOverlayChangedHandler) .
 void setVisible(boolean visible)
          Shows or hides this overlay.
 
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
 

Constructor Detail

TrafficOverlay

public TrafficOverlay()
Creates a new traffic overlay. Use MapWidget.addOverlay(Overlay) to add this overlay to the map.

Method Detail

addTrafficOverlayChangedHandler

public void addTrafficOverlayChangedHandler(TrafficOverlayChangedHandler handler)
This event is fired when the state of traffic data changes within the current viewport. This event may be fired either when moving the map between areas with and without traffic data or when the addition of a TrafficOverlay to the map results in traffic data appearing within the current viewport.

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

removeTrafficOverlayHandler

public void removeTrafficOverlayHandler(TrafficOverlayChangedHandler handler)
Removes a single handler of this map previously added with addTrafficOverlayChangedHandler(TrafficOverlayChangedHandler) .

Parameters:
handler - the handler to remove

setVisible

public void setVisible(boolean visible)
Shows or hides this overlay.

Parameters:
visible - true to show the overlay, false to hide.