mapedit icon indicating copy to clipboard operation
mapedit copied to clipboard

feature request: snap to vertex

Open mdsumner opened this issue 8 years ago • 5 comments

My first enhancement request is for drawing/edit snap-mode, so that we can align segment-based shapes to existing vertices. Snap is illustrated here:

http://makinacorpus.github.io/Leaflet.Snap/

Because we can upload point layers already this will also allow a way to draw exacting shapes if we want that for demonstrations, and more importantly to create simple features layers that are topologically sound as a network.

I'm really interested to explore the igraph connection:

https://gist.github.com/timelyportfolio/94c44959cf73e96a12ee2e194aaaaf2a

and this will be useful for leveraging TopoJSON as well.

mdsumner avatar Feb 02 '17 05:02 mdsumner

Thanks for the link! That was on my mind to research too at some stage. And I agree that this is essential for all sorts of things

tim-salabim avatar Feb 02 '17 19:02 tim-salabim

The new leaflet.pm will be a good option once we get to Leaflet >1.0.

timelyportfolio avatar Feb 03 '17 01:02 timelyportfolio

Yeah nice! https://codeofsumit.github.io/leaflet.pm/

Imagine what editing with live topojson arcs could be like. (I'm going to have to get serious about .js one of these days).

mdsumner avatar Feb 04 '17 12:02 mdsumner

https://github.com/codeofsumit/leaflet.pm has progressed quite a bit since last year. It now also allows for creation/deletion of holes in polygons & splitting of polygons by polygon. In light of @bhaskarvk 's retirement from spatial work, I think we should consider wrapping leaflet.pm in mapedit. With https://github.com/ropensci/lawn we should have access to all (most) truf.js modules and could maybe even provide more tools for feature editing. In any case, I feel that snapping should be the default behaviour when drawing features on a map. @timelyportfolio what are your thoughts on including leaflet.pm?

tim-salabim avatar May 22 '18 09:05 tim-salabim

Also, I haven't found anything in the leaflet.draw documentation on how to enable snapping... I only see the example which only seems to have snapping enabled for the red line.

tim-salabim avatar May 22 '18 11:05 tim-salabim