Class: MobileDraw

ngeo.interaction.MobileDraw

Interaction for drawing feature geometries from a mobile device using the center of the map view as entry for points added.

Supports:

  • point
  • line string

Constructor

new MobileDraw(options)

Parameters:
Name Type Description
options ngeox.interaction.MobileDrawOptions

Options

Fires:
  • ol.interaction.Draw.event:Event

Extends

Methods

addToDrawing()

Add current sketch point to sketch feature if the latter exists, else create it.

clearDrawing()

Clear the drawing

finishDrawing()

Finish drawing. If there's a sketch point, it's added first.

getDirty()

Return whether the interaction is currently dirty. It is if the sketch feature has its geometry last coordinate set to the center without the use of the addToDrawing method.

Returns:
boolean

true if the interaction is dirty, false otherwise.

getDrawing()

Return whether the interaction is currently drawing.

Returns:
boolean

true if the interaction is drawing, false otherwise.

getFeature()

Returns the current sketch feature.

Returns:
?ol.Feature

The sketch feature, or null if none.

getValid()

Return whether the interaction as a valid sketch feature, i.e. its geometry is valid.

Returns:
boolean

true if the interaction has a valid sketch feature, false otherwise.

setMap()