Class: UserDrawing

UserDrawing(options)

new UserDrawing(options)

For user drawings, which includes lines and/or a polygon

Parameters:
Name Type Description
options Object

Object with the following properties:

Properties
Name Type Attributes Default Description
terria Terria

The Terria instance.

messageHeader String <optional>
'Draw on Map'

Heading for the dialog which pops up when in user drawing mode

allowPolygon Bool <optional>
true

Let the user click on first point to close loop

onPointClicked PointClickedCallback <optional>

Way to subscribe to point clicks

onPointMoved PointMovedCallback <optional>

Way to subscribe to point moves

onCleanUp CleanUpCallback <optional>

Way to add own cleanup

onMakeDialogMessage MakeDialogMessageCallback <optional>

Way to customise dialog message

Source:

Members

allowPolygon :Bool

If true, user can click on first point to close the line, turning it into a polygon.

Type:
  • Bool
Default Value:
  • true
Source:

closeLoop :Bool

Whether the first and last point in the user drawing are the same

Type:
  • Bool
Source:

inDrawMode :Bool

Whether to interpret user clicks as drawing

Type:
  • Bool
Source:

messageHeader :String

Text that appears at the top of the dialog when drawmode is active.

Type:
  • String
Default Value:
  • 'Draw on Map'
Source:

onCleanUp :CleanUpCallback

Callback that occurs on clean up, i.e. when drawing is done or cancelled.

Type:
Default Value:
  • undefined
Source:

onMakeDialogMessage :MakeDialogMessageCallback

Callback that occurs when the dialog is redrawn, to add additional information to dialog.

Type:
Default Value:
  • undefined
Source:

onPointClicked :PointClickedCallback

Callback that occurs when point is clicked (may be added or removed). Function takes a CustomDataSource which is a list of PointEntities.

Type:
Default Value:
  • undefined
Source:

onPointMoved :PointMovedCallback

Callback that occurs when point is moved. Function takes a CustomDataSource which is a list of PointEntities.

Type:
Default Value:
  • undefined
Source:

otherEntities :CustomDataSource

Storage for line that connects the points, and polygon if the first and last point are the same

Type:
Source:

pointEntities :CustomDataSource

Storage for points that will be drawn

Type:
Source:

polygon :Entity

Polygon that will be drawn if the user drawing is a closed shape

Type:
  • Entity
Source:

terria :Terria

Instance of Terria

Type:
Default Value:
  • undefined
Source:

(inner) svgDataDeclare

SVG element for point drawn when user clicks. http://stackoverflow.com/questions/24869733/how-to-draw-custom-dynamic-billboards-in-cesium-js

Source:

Methods

enterDrawMode()

Start interpreting user clicks as placing or removing points.

Source: