<< Click to Display Table of Contents >>

 

new sg.Draw (map)

 

 

Description

Create a draw object.

 

 

Position

Draw.js

 

 

Parameters

 

Parameter

Type

Description

map

MapBase

target MapBase.

 

 

Constants

 

Constant

Description

CIRCLE

Draw a circle. Click to add a circle center, and drag mouse to control circle radius. Click again to draw.

DOWN_ARROW

Draw a down arrow. Click to add a down arrow, and drag mouse to control size. Click again to draw.

ELLIPSE

Draw a ellipse. Click to add a ellipse center, and drag to control major and minor axis. Click again to draw.

EXTENT

Draw an extent box. Click to add a box, and drag mouse to control width and height. Click again to draw.

FREEHAND_POLYGON

Draw a freehand polygon. Click and drag mouse to draw.

FREEHAND_LINESTRING

Draw a freehand line. Click and drag mouse to draw.

LEFT_ARROW

Draw a left arrow. Click to add a left arrow, and drag mouse to control size. Click again to draw.

LINE

Draw a line. Click to add vertexes, and double click to add the last vertex.

MULTI_POINT

Draw multiple points. Click to add points, and double click to add the last point.

POINT

Draw a point. Click to add one point.

POLYGON

Draw a polygon. Click to add vertexes, and double click to add the last vertex.

LINESTRING

Draw a line. Click to add vertexes, and double click to add the last vertex.

RECTANGLE

Draw a rectangle. Click to add a rectangle, and drag mouse to control width and height. Click again to draw.

RIGHT_ARROW

Draw a right arrow. Click to add a right arrow, and drag mouse to control size. Click again to draw.

TRIANGLE

Draw a triangle. Click to add triangle center, and drag mouse to control size. Click again to draw.

UP_ARROW

Draw a up arrow. Click to add a up arrow, and drag mouse to control size. Click again to draw.

ARROW

Draw an arrow. Click to add an arrow, and drag mouse to control size and direction. Click again to draw.

tooltipOffset

Offset of the tool tip in pixels.

 

 

Methods

 

Method

Type

Description

active(geometryType,options)

geometryType:Number

options:Object

Activate drawing tool. Use optoins.showToolTips to decide whether to show tool tips or not.

Name

Type

Description

geometryType

Number


options

Object

Name

Type

Description

showToolTips

Boolean

To show the tool tips or not.

True:Show

False:Hide

deactivate()


Deactivate drawing tool.

setFillSymbol(fillSymbol)


Define polygon or extent symbol.

setLineSymbol(lineSymbol)

sg.symbols.FillSymbol

Define polyline symbol.

setMarkerSymbol(markerSymbol)

sg.symbols.LineSymbol        

Define point or multipoint symbol.

setTooltipContent(content)

sg.symbols.MarkerSymbol

define tool tip content.

finishDrawing()

String

Finishes drawing, and trigger the draw-end event.

tooltipOffset

Object

set object

Name

Type

Description

x

Number

x offset

y

Number

y offset

 

 

Events

 

Event

Description

draw-end

Called when deactivate draw tool.

 

 


©2015 Supergeo Technologies Inc.