Skip to content

When drawing or editing an area, snap it to other areas #55

@bobinush

Description

@bobinush

When you draw an area and create a point(vertex) close to a line/vertex of another area, it should snap to that line/vertex of the other shape. This is so we don't end up with a bunch of minor buffers of 1-3 meters between areas.
The same snapping should happen when you edit the area by dragging a vertex.

The snapping should not happen when moving the entire shape, as snapping only 1 vertex to a line doesn’t add much value when the other vertex on the other end of the line isn’t parallel to the target line. (If you think it makes sense then by all means, add it 😊)

Snapping a line to another line is not something we want (perhaps not even possible?) since it would change the geometry of a shape.

Snapping is possible with the geoman.io library. https://geoman.io/docs/leaflet/options/snapping

Experiment with the snapping distance. 2m sounds like a good number in theory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions