new Draw(options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Options.
|
Fires:
-
DrawEvent
-
change
(module:ol/events/Event~Event) - Generic change event. Triggered when the revision counter is increased. -
change:active
(module:ol/Object.ObjectEvent) -
propertychange
(module:ol/Object.ObjectEvent) - Triggered when a property is changed.
Extends
Observable Properties
Name | Type | Settable | ol/Object.ObjectEvent type | Description |
---|---|---|---|---|
active |
boolean | yes | change:active |
|
Methods
-
extend(feature)
interaction/Draw.js, line 905 -
Extend an existing geometry by adding additional points. This only works on features with
LineString
geometries, where the interaction will extend lines by adding points to the end of the coordinates array.Name Type Description feature
module:ol/Feature~Feature Feature to be extended.
-
finishDrawing()
interaction/Draw.js, line 842 -
Stop drawing and add the sketch feature to the target layer. The
module:ol/interaction/Draw~DrawEventType.DRAWEND
event is dispatched before inserting the feature. -
Get the overlay layer that this interaction renders sketch features to.
Returns:
Overlay layer.
-
Handles the
map browser event
and may call into other functions, if event sequences like e.g. 'drag' or 'down-up' etc. are detected. -
removeLastPoint()
interaction/Draw.js, line 806 -
Remove last point of the feature currently being drawn.