@mapgear/geoapps > Interactions > StartSketch
Interactions.StartSketch() method
Start sketching of a specified type
Signature:StartSketch(type: DrawGeometryType, options?: SketchOptions): void;
Parameters
Parameter | Type | Description |
---|---|---|
type | DrawGeometryType | Geometry type to draw |
options | SketchOptions | (Optional) Sketch Options |
void
Example
To perform a draw action of a line, and capture the resulting feature, you can use the following code:
map.Interactions.onSketchCompleted.add((feature) => { // The feature is available as feature-parameter }); map.Interactions.StartSketch("linestring");
When the user completes a drawing, the onSketchCompleted-event is activated