Class: DrawHole

ol.interaction. DrawHole


new DrawHole(options, Style)

Interaction to draw holes in a polygon. It fires a drawstart, drawend event when drawing the hole and a modifystart, modifyend event before and after inserting the hole in the feature geometry.

Parameters:
Name Type Description
options olx.interaction.DrawHoleOptions

extend olx.interaction.DrawOptions

Properties
Name Type Description
layers Array.<ol.layer.Vector> | function | undefined

A list of layers from which polygons should be selected. Alternatively, a filter function can be provided. default: all visible layers

Style ol.style.Style | Array.<ol.style.Style> | StyleFunction | undefined

for the selected features, default: default edit style

Fires:
  • event:drawstart
  • event:drawend
  • event:modifystart
  • event:modifyend

Extends

  • ol.interaction.Interaction

Methods


getPolygon()

Get the current polygon to hole

Returns:
Type
ol.Feature

removeLastPoint()

Remove last point of the feature currently being drawn (test if points to remove before).


setActive(b)

Activate/deactivate the interaction

Parameters:
Name Type Description
b boolean

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.