Module: ol/interaction/Snap

ol/interaction/Snap


Classes

Snap

Type Definitions

Options{Object}

Properties:
Name Type Argument Default Description
features module:ol/Collection~Collection.<module:ol/Feature~Feature> <optional>

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

edge boolean <optional>
true

Snap to edges.

vertex boolean <optional>
true

Snap to vertices.

pixelTolerance number <optional>
10

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

source module:ol/source/Vector~VectorSource <optional>

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

Result{Object}

Properties:
Name Type Description
snapped boolean

Snapped.

vertex module:ol/coordinate~Coordinate | null

Vertex.

vertexPixel module:ol/pixel~Pixel | null

VertexPixel.

SegmentData{Object}

Properties:
Name Type Description
feature module:ol/Feature~Feature

Feature.

segment Array.<module:ol/coordinate~Coordinate>

Segment.