Follow us on GitHub

com.google.gwt.maps.client.overlays
Class OverlayView

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.maps.client.mvc.MVCObject<OverlayView>
          extended by com.google.gwt.maps.client.overlays.OverlayView

public class OverlayView
extends MVCObject<OverlayView>

You can implement this class if you want to display custom types of overlay objects on the map. This class extends MVCObject.

See OverlayView API Doc


Constructor Summary
protected OverlayView()
          use newInstance();
 
Method Summary
 void draw()
          Implement this method to draw or update the overlay.
 MapWidget getMapWidget()
          get mapWidget
 MapPanes getPanes()
          Returns the panes in which this OverlayView can be rendered.
 MapCanvasProjection getProjection()
          Returns the MapCanvasProjection object associated with this OverlayView.
static OverlayView newInstance()
          You should inherit from this class by setting your overlay's prototype to new OverlayView.prototype.
 void onAdd()
          Implement this method to initialize the overlay DOM elements.
 void onRemove()
          Implement this method to remove your elements from the DOM.
 void setMap(MapWidget mapWidget)
          Adds the overlay to the map or panorama.
 void setMap(StreetViewPanoramaWidget streetViewPanoramaWdiget)
          Adds the overlay to the map or panorama.
 
Methods inherited from class com.google.gwt.maps.client.mvc.MVCObject
bindTo, bindTo, bindTo, changed, createInstanceOfMVCObject, get, notify, set, setValues, unbind, unbindAll
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OverlayView

protected OverlayView()
use newInstance();

Method Detail

newInstance

public static final OverlayView newInstance()
You should inherit from this class by setting your overlay's prototype to new OverlayView.prototype. You must implement three methods: onAdd(), draw(), and onRemove(). In the add() method, you should create DOM objects and append them as children of the panes. In the draw() method, you should position these elements. In the onRemove() method, you should remove the objects from the DOM. You must call setMap() with a valid Map object to trigger the call to the onAdd() method and setMap(null) in order to trigger the onRemove() method. The setMap() method can be called at the time of construction or at any point afterward when the overlay should be re-shown after removing. The draw() method will then be called whenever a map property changes that could change the position of the element, such as zoom, center, or map type.

Returns:
OverlayView

draw

public final void draw()
Implement this method to draw or update the overlay. This method is called after onAdd() and when the position from projection.fromLatLngToPixel() would return a new value for a given LatLng. This can happen on change of zoom, center, or map type. It is not necessarily called on drag or resize.


getMapWidget

public final MapWidget getMapWidget()
get mapWidget


getPanes

public final MapPanes getPanes()
Returns the panes in which this OverlayView can be rendered. Only available after draw has been called.


getProjection

public final MapCanvasProjection getProjection()
Returns the MapCanvasProjection object associated with this OverlayView. Only available after draw has been called.


onAdd

public final void onAdd()
Implement this method to initialize the overlay DOM elements. This method is called once after setMap() is called with a valid map. At this point, panes and projection will have been initialized.


onRemove

public final void onRemove()
Implement this method to remove your elements from the DOM. This method is called once following a call to setMap(null).


setMap

public final void setMap(MapWidget mapWidget)
Adds the overlay to the map or panorama.

Parameters:
mapWidget -

setMap

public final void setMap(StreetViewPanoramaWidget streetViewPanoramaWdiget)
Adds the overlay to the map or panorama.

Parameters:
streetViewPanoramaWdiget -


Follow us on GitHub

Copyright © 2011-2012 Gone Vertical LLC. All Rights Reserved.