Class: DrawTouch

ol.interaction. DrawTouch

Interaction DrawTouch : pointer is deferred to the center of the viewport and a target is drawn to materialize this point The interaction modifies map browser event coordinate and pixel properties to force pointer on the viewport center to any interaction that them.


new DrawTouch(options)

Parameters:
Name Type Description
options olx.interaction.DrawOptions
Properties
Name Type Argument Default Description
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 <optional>
true

enable point insertion on tap, default true

style ol.style.Style | Array.<ol.style.Style> <optional>

Drawing style

sketchStyle ol.style.Style | Array.<ol.style.Style> <optional>

Sketch style

targetStyle ol.style.Style | Array.<ol.style.Style> <optional>

a style to draw the target point, default cross style

composite string <optional>

composite operation : difference|multiply|xor|screen|overlay|darken|lighter|lighten|...

Fires:
  • event:drawstart
  • event:drawend
  • event:drawabort

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:
Overrides:
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:

setGeometryType(type)

Set geometry type

Parameters:
Name Type Description
type ol.geom.GeometryType

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: