Skip to main content

@mapgear/geoapps > Interactions > StartSketch

Interactions.StartSketch() method

Start sketching of a specified type

Signature:
StartSketch(type: DrawGeometryType, options?: SketchOptions): void;

Parameters

ParameterTypeDescription
typeDrawGeometryTypeGeometry type to draw
optionsSketchOptions(Optional) Sketch Options
Returns:

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