Open emakarov opened 10 years ago
I was able to add new polygons to a Multipolygon shape using the code here: https://github.com/Leaflet/Leaflet.draw/issues/124
Having said that, I can't get Delete or Edit to work now. I'm still slogging through this.
Yeah unfortunately Leaflet.draw does not support editing multipolygons.
Hello, it would be great to have support for multipolygons in Leaflet.Draw. My webapp loads data from a geojson file automatically exported from a QGIS project. All polygons are exported as multipolygon features and I'm not able to edit/delete these data using Leaflet.Draw.
Haven't tried it yet (but about to). Just to let everyone know that Yohan has made the drawing engine behind uMap open source recently. It supports multipolygons and looks like a good api for geojson drawing / editing: https://github.com/yohanboniface/Leaflet.Editable/
+1 on this. MultiPolygon support would be great.
A good place to start would be to use an instance of the handler class that edits the whole FeatureGroup containing drawn items (L.EditToolbar.Edit) and point it to your Multipolygon.
I made a jsfiddle to demonstrate https://jsfiddle.net/Sirenhound/hotuzh7t/
You'd still need to save the shape for cancelling and save the shapeoptions to restyle it after editing, but it's a start.
+1
We just added MultiPolygon support to leaflet.pm. In case it helps adding this feature to leaflet.draw, most of the necessary work to achieve this can be found here: https://github.com/codeofsumit/leaflet.pm/blob/develop/src/js/Edit/L.PM.Edit.Line.js
Please, Multipolygon will save my life!!!! I break the multipolygon in many polygons....
Is there anyone working on this? I am using Leaflet with Flask-Admin / GeoAlchemy to edit some GeoJSON and we need to handle Multipolygon features.
We just added MultiPolygon support to leaflet.pm. In case it helps adding this feature to leaflet.draw, most of the necessary work to achieve this can be found here: https://github.com/codeofsumit/leaflet.pm/blob/develop/src/js/Edit/L.PM.Edit.Line.js
@codeofsumit very nice. What are the main differences between L.Draw and L.PM? I might consider working on a fork of Flask-Admin for the Geoa contrib to move from L.Draw to L.PM!
Is it possible to use this plugin with Leaflet multipolygon?