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

java.lang.Object
  extended by com.google.gwt.maps.client.overlay.Overlay
Direct Known Subclasses:
Overlay.ConcreteOverlay

public abstract class Overlay
extends java.lang.Object

The base class for adding objects at a specific position on top of the map.


Nested Class Summary
static class Overlay.ConcreteOverlay
          This class is used to wrap Overlays written entirely in JavaScript.
 
Field Summary
protected  com.google.gwt.core.client.JavaScriptObject jsoPeer
           
 
Constructor Summary
  Overlay()
           
protected Overlay(com.google.gwt.core.client.JavaScriptObject jsoPeer)
           
 
Method Summary
protected abstract  Overlay copy()
          Returns an uninitialized copy of itself that can be added to the map.
static Overlay createPeer(com.google.gwt.core.client.JavaScriptObject jsoPeer)
          Used to create a new Overlay by wrapping an existing GOverlay object.
static int getZIndex(double latitude)
          Returns a CSS z-index value for a given latitude.
protected abstract  void initialize(MapWidget map)
          Called by the map after the overlay is added to the map using MapWidget.addOverlay(Overlay).
protected abstract  void redraw(boolean force)
          Called by the map when the map display has changed.
protected abstract  void remove()
          Called by the map after the overlay is removed from the map using MapWidget.removeOverlay(Overlay) or MapWidget.clearOverlays().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jsoPeer

protected final com.google.gwt.core.client.JavaScriptObject jsoPeer
Constructor Detail

Overlay

public Overlay()

Overlay

protected Overlay(com.google.gwt.core.client.JavaScriptObject jsoPeer)
Method Detail

createPeer

public static Overlay createPeer(com.google.gwt.core.client.JavaScriptObject jsoPeer)
Used to create a new Overlay by wrapping an existing GOverlay object. This method is invoked by the jsio library.

Parameters:
jsoPeer - GOverlay object to wrap.
Returns:
a new instance of Overlay.

getZIndex

public static int getZIndex(double latitude)
Returns a CSS z-index value for a given latitude. It computes a z index such that overlays further south are on top of overlays further north, thus creating the 3D appearance of marker overlays.

Parameters:
latitude - the latitude to retrieve the marker z-index for.
Returns:
a CSS z-index value

copy

@Exported
protected abstract Overlay copy()
Returns an uninitialized copy of itself that can be added to the map.

Returns:
an uninitialized copy of itself that can be added to the map.

initialize

@Exported
protected abstract void initialize(MapWidget map)
Called by the map after the overlay is added to the map using MapWidget.addOverlay(Overlay). The overlay object can draw itself into the different panes of the map that can be obtained using MapWidget.getPane(com.google.gwt.maps.client.MapPaneType).

Parameters:
map - The map this overlay has been added to.

redraw

@Exported
protected abstract void redraw(boolean force)
Called by the map when the map display has changed.

Parameters:
force - The argument force will be true if the zoom level or the pixel offset of the map view has changed, so that the pixel coordinates need to be recomputed.

remove

@Exported
protected abstract void remove()
Called by the map after the overlay is removed from the map using MapWidget.removeOverlay(Overlay) or MapWidget.clearOverlays(). The overlay must remove itself from the map panes here.