Class: DrawTouch

ol.interaction. DrawTouch


new DrawTouch(options)

Interaction DrawTouch :

Parameters:
Name Type Description
options olx.interaction.DrawOptions
  • source {ol.source.Vector | undefined} Destination source for the drawn features.
    • type {ol.geom.GeometryType} Drawing type ('Point', 'LineString', 'Polygon') not ('MultiPoint', 'MultiLineString', 'MultiPolygon' or 'Circle'). Required.
    • tap {boolean} enable on tap, default true Inherited params
  • targetStyle {ol.style.Style|Array<ol.style.Style>} a style to draw the target point, default cross style
  • composite {string} composite operation : difference|multiply|xor|screen|overlay|darken|lighter|lighten|...

Extends

Methods


addPoint()

Add a new Point to the drawing


finishDrawing()

Start drawing and add the sketch feature to the target layer. The ol.interaction.Draw.EventType.DRAWEND event is dispatched before inserting the feature.


getGeometryType()

Get geometry type

Returns:
Type
ol.geom.GeometryType

getPosition()

Get the position of the target

Inherited From:
Returns:
Type
ol.coordinate

removeLastPoint()

Remove last point of the feature currently being drawn.


setActive(active)

Activate or deactivate the interaction.

Parameters:
Name Type Description
active boolean

Active.

Overrides:

setMap(map)

Remove the interaction from its current map, if any, and attach it to a new map, if any. Pass null to just remove the interaction from the current map.

Parameters:
Name Type Description
map ol.Map

Map.

Overrides:

startDrawing()

Start drawing and add the sketch feature to the target layer. The ol.interaction.Draw.EventType.DRAWSTART event is dispatched before inserting the feature.