Follow us on GitHub

com.google.gwt.maps.client.drawinglib
Class DrawingManager

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

public class DrawingManager
extends MVCObject<DrawingManager>

Allows users to draw markers, polygons, polylines, rectangles, and circles on the map. The DrawingManager's drawing mode defines the type of overlay that will be created by the user. Adds a control to the map, allowing the user to switch drawing mode. This class extends MVCObject.

See DrawingManager API Doc


Constructor Summary
protected DrawingManager()
          use newInstance();
 
Method Summary
 HandlerRegistration addCircleCompleteHandler(CircleCompleteMapHandler handler)
          This event is fired when the user has finished drawing a circle.
 HandlerRegistration addMarkerCompleteHandler(MarkerCompleteMapHandler handler)
          This event is fired when the user has finished drawing a marker.
 HandlerRegistration addOverlayCompleteHandler(OverlayCompleteMapHandler handler)
          This event is fired when the user has finished drawing an overlay of any type.
 HandlerRegistration addPolygonCompleteHandler(PolygonCompleteMapHandler handler)
          This event is fired when the user has finished drawing a polygon.
 HandlerRegistration addPolylineCompleteHandler(PolylineCompleteMapHandler handler)
          This event is fired when the user has finished drawing a polyline.
 HandlerRegistration addRectangleCompleteHandler(RectangleCompleteMapHandler handler)
          This event is fired when the user has finished drawing a rectangle.
 OverlayType getDrawingMode()
          Returns the DrawingManager's drawing mode.
 MapWidget getMap()
          Returns the Map to which the DrawingManager is attached, which is the Map on which the overlays created will be placed.
static DrawingManager newInstance(DrawingManagerOptions options)
          Creates a DrawingManager that allows users to draw overlays on the map, and switch between the type of overlay to be drawn with a drawing control.
 void setDrawingMode(OverlayType drawingMode)
          Changes the DrawingManager's drawing mode, which defines the type of overlay to be added on the map.
 void setMap(MapWidget mapWidget)
          Attaches the DrawingManager object to the specified 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

DrawingManager

protected DrawingManager()
use newInstance();

Method Detail

newInstance

public static final DrawingManager newInstance(DrawingManagerOptions options)
Creates a DrawingManager that allows users to draw overlays on the map, and switch between the type of overlay to be drawn with a drawing control.

Parameters:
options -

getDrawingMode

public final OverlayType getDrawingMode()
Returns the DrawingManager's drawing mode.


setDrawingMode

public final void setDrawingMode(OverlayType drawingMode)
Changes the DrawingManager's drawing mode, which defines the type of overlay to be added on the map. Accepted values are MARKER, POLYGON, POLYLINE, RECTANGLE, CIRCLE, or null. A drawing mode of null means that the user can interact with the map as normal, and clicks do not draw anything.

Parameters:
drawingMode -

setMap

public final void setMap(MapWidget mapWidget)
Attaches the DrawingManager object to the specified Map.

Parameters:
mapWidget -

getMap

public final MapWidget getMap()
Returns the Map to which the DrawingManager is attached, which is the Map on which the overlays created will be placed.


addCircleCompleteHandler

public final HandlerRegistration addCircleCompleteHandler(CircleCompleteMapHandler handler)
This event is fired when the user has finished drawing a circle.

Parameters:
handler -

addMarkerCompleteHandler

public final HandlerRegistration addMarkerCompleteHandler(MarkerCompleteMapHandler handler)
This event is fired when the user has finished drawing a marker.

Parameters:
handler -

addOverlayCompleteHandler

public final HandlerRegistration addOverlayCompleteHandler(OverlayCompleteMapHandler handler)
This event is fired when the user has finished drawing an overlay of any type.

Parameters:
handler -

addPolygonCompleteHandler

public final HandlerRegistration addPolygonCompleteHandler(PolygonCompleteMapHandler handler)
This event is fired when the user has finished drawing a polygon.

Parameters:
handler -

addPolylineCompleteHandler

public final HandlerRegistration addPolylineCompleteHandler(PolylineCompleteMapHandler handler)
This event is fired when the user has finished drawing a polyline.

Parameters:
handler -

addRectangleCompleteHandler

public final HandlerRegistration addRectangleCompleteHandler(RectangleCompleteMapHandler handler)
This event is fired when the user has finished drawing a rectangle.

Parameters:
handler -


Follow us on GitHub

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