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 clear()
          Invokes this.setMap()
 void close()
          Invokes this.setMap()
static OverlayView newInstance(MapWidget mapWidget, OverlayViewOnDrawHandler onDrawHandler, OverlayViewOnAddHandler onAddDandler, OverlayViewOnRemoveHandler onRemoveHandler)
          You should inherit from this class by setting your overlay's prototype to new OverlayView.prototype.
 void setMap(MapWidget mapWidget)
          set Map
 
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(MapWidget mapWidget,
                                            OverlayViewOnDrawHandler onDrawHandler,
                                            OverlayViewOnAddHandler onAddDandler,
                                            OverlayViewOnRemoveHandler onRemoveHandler)
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. 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. 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(): Implement this method to remove your elements from the DOM. This method is called once following a call to setMap(null).

Returns:
OverlayView

setMap

public final void setMap(MapWidget mapWidget)
set Map

Parameters:
mapWidget -

close

public final void close()
Invokes this.setMap()


clear

public final void clear()
Invokes this.setMap()



Copyright © 2011-2013 GWT Maps API V3. All Rights Reserved.