Leaflet.Editable
Leaflet.Editable copied to clipboard
Feature Request: Add Ability to Split and Join Polylines
Specifically, the ability to:
- Select any vertex on a Polyline and split it at the selected vertex into two Polylines, and
- Drag one Polyline until one of its terminal vertices overlaps another Polyline's terminal vertex, and have the two Polylines be joined into a single Polyline.
These features would be immensely useful to me.
Thank you!
- Select any vertex on a Polyline and split it at the selected vertex into two Polylines
map.on('vertex:click', function (e) {
e.vertex.split();
});
- Drag one Polyline until one of its terminal vertices overlaps another Polyline's terminal vertex, and have the two Polylines be joined into a single Polyline.
See https://github.com/umap-project/Leaflet.Storage/blob/master/src/js/leaflet.storage.features.js#L889 for inspiration. It may worth cleaning and adding into Leaflet.Editable at some point, yep.