Class: Split

ol.interaction. Split


new Split(options)

Interaction split interaction for splitting feature geometry

Parameters:
Name Type Description
options olx.interaction.SplitOptions

source {ol.source.Vector|Array{ol.source.Vector}} a list of source to split (configured with useSpatialIndex set to true)

- features {ol.Collection.<ol.Feature>} collection of feature to split
- snapDistance {integer} distance (in px) to snap to an object, default 25px
- cursor {string|undefined} cursor name to display when hovering an objet
- filter {function|undefined} a filter that takes a feature and return true if it can be clipped, default always split.
- featureStyle {ol.style.Style | Array<ol.style.Style> | false | undefined} Style for the selected features, choose false if you don't want feature selection. By default the default edit style is used.
- sketchStyle {ol.style.Style | Array<ol.style.Style> | undefined} Style for the sektch features.
- tolerance {function|undefined} Distance between the calculated intersection and a vertex on the source geometry below which the existing vertex will be used for the split.  Default is 1e-10.
Fires:
  • beforesplit, aftersplit,event: pointermove

Extends

  • ol.interaction.Interaction

Methods


getNearestCoord(pt, coords)

Get nearest coordinate in a list

Parameters:
Name Type Description
pt ol.coordinate

the point to find nearest

coords Array.<ol.coordinate>

list of coordinates

Returns:

the nearest coordinate in the list

Type
ol.coordinate

handleDownEvent(evt)

Parameters:
Name Type Description
evt ol.MapBrowserEvent

Map browser event.

Returns:

true to start the drag sequence.

Type
boolean

handleMoveEvent(evt)

Parameters:
Name Type Description
evt ol.MapBrowserEvent

Event.


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.