Module: ol/interaction/Snap

ol/interaction/Snap


Classes

Snap

Type Definitions

Options{Object}

Properties:
Name Type Description
features Collection<Feature> | undefined

Snap to these features. Either this option or source should be provided.

edge boolean
(defaults to true)

Snap to edges.

vertex boolean
(defaults to true)

Snap to vertices.

pixelTolerance number
(defaults to 10)

Pixel tolerance for considering the pointer close enough to a segment or vertex for snapping.

source VectorSource | undefined

Snap to features from this source. Either this option or features should be provided

Result{Object}

Properties:
Name Type Description
vertex Coordinate | null

Vertex.

vertexPixel Pixel | null

VertexPixel.

feature Feature | null

Feature.

segment Array<Coordinate> | null

Segment, or null if snapped to a vertex.

SegmentData{Object}

Properties:
Name Type Description
feature Feature

Feature.

segment Array<Coordinate>

Segment.