Class: DrawE-mail This Topic Printable Version Give Us Feedback

Description

Toolbar that supports functionality to draw geometries.

Class hierarchy

esri.toolbars.Draw

Constructor

Constructor Description
esri.toolbars.Draw(map) Creates a new Draw object. A Map is a required parameter.

Properties

Property Type Description
fillSymbol SimpleFillSymbol Symbol to be used when drawing a Polygon or Extent.
lineSymbol SimpleLineSymbol Symbol to be used when drawing a Polyline.
markerSymbol SimpleMarkerSymbol Symbol to be used when drawing a Point or Multipoint.
respectDrawingVertexOrder Boolean When set to false, the geometry is modified to be topologically correct. When set to true, the input geometry is not modified.

Constants

Constant Description
EXTENT Draws an extent box.
FREEHAND_POLYGON Draws a freehand polygon.
FREEHAND_POLYLINE Draws a freehand polyline.
LINE Draws a line.
MULTI_POINT Draws a Multipoint.
POINT Draws a point.
POLYGON Draws a polygon.
POLYLINE Draws a polyline.

Methods

Method Return Value Description
activate(geometryType) none Activates the toolbar for drawing geometries. Activating the toolbar disables map navigation.
deactivate() none Deactivates the toolbar and reactivates map navigation.
setFillSymbol(fillSymbol) none Sets the fill symbol.
setLineSymbol(lineSymbol) none Sets the line symbol.
setMarkerSymbol(markerSymbol) none Sets the marker symbol.
setRespectDrawingVertexOrder(set) none Sets whether the polygon geometry should be modified to be topologically correct.

Events

Event Description
onDrawEnd(geometry) Fires when drawing is complete.
Constructor Detail

esri.toolbars.Draw(map)

Creates a new Draw object. A Map is a required parameter.
Parameters:
<Map> map Required Map the toolbar is associated with.
Properties Detail

<SimpleFillSymbol> fillSymbol

Symbol to be used when drawing a Polygon or Extent.
See also:
setFillSymbol  

<SimpleLineSymbol> lineSymbol

Symbol to be used when drawing a Polyline.
See also:
setLineSymbol  

<SimpleMarkerSymbol> markerSymbol

Symbol to be used when drawing a Point or Multipoint.
See also:
setMarkerSymbol  

<Boolean> respectDrawingVertexOrder

When set to false, the geometry is modified to be topologically correct. When set to true, the input geometry is not modified.
Known values: true | false
Default value: false
Methods Detail

activate(geometryType)

Activates the toolbar for drawing geometries. Activating the toolbar disables map navigation.
Return value: none
Input Parameters:
<String> geometryType Required The type of geometry drawn. See the Constants table for valid values.
See also:
deactivate  

deactivate()

Deactivates the toolbar and reactivates map navigation.
Return value: none
See also:
activate  

setFillSymbol(fillSymbol)

Sets the fill symbol.
Return value: none
Input Parameters:
<FillSymbol> fillSymbol Required The fill symbol.
See also:
fillSymbol  

setLineSymbol(lineSymbol)

Sets the line symbol.
Return value: none
Input Parameters:
<LineSymbol> lineSymbol Required The line symbol.
See also:
lineSymbol  

setMarkerSymbol(markerSymbol)

Sets the marker symbol.
Return value: none
Input Parameters:
<MarkerSymbol> markerSymbol Required The marker symbol.
See also:
markerSymbol  

setRespectDrawingVertexOrder(set)

Sets whether the polygon geometry should be modified to be topologically correct.
Return value: none
Input Parameters:
<Boolean> set Required When set to false, the geometry is modified to be topologically correct. When set to true, the input geometry is not modified.

Events Detail

onDrawEnd(geometry)

Fires when drawing is complete.
Arguments:
<Geometry> geometry Geometry drawn on the client.