Leaflet / Leaflet.draw

Vector drawing and editing plugin for Leaflet
https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html
MIT License
1.97k stars 992 forks source link

Multipolygon #268

Open emakarov opened 10 years ago

emakarov commented 10 years ago

Is it possible to use this plugin with Leaflet multipolygon?

Pro777 commented 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.

jacobtoye commented 10 years ago

Yeah unfortunately Leaflet.draw does not support editing multipolygons.

jbogdani commented 10 years ago

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.

joaoponceleao commented 10 years ago

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/

kespindler commented 9 years ago

+1 on this. MultiPolygon support would be great.

SirenHound commented 8 years ago

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.

mikila85 commented 7 years ago

+1

codeofsumit commented 6 years ago

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

LuizGC commented 6 years ago

Please, Multipolygon will save my life!!!! I break the multipolygon in many polygons....

MeTaNoV commented 5 years ago

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.

MeTaNoV commented 5 years ago

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!

codeofsumit commented 5 years ago

@MeTaNoV I haven't used leaflet.draw in years so I don't think I'm qualified to answer that. You can read through the features here and check out the demo on geoman.io