Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Added hole editing support to polygons with holes. #146

wants to merge 2 commits into


None yet
9 participants

WillFM commented Jun 4, 2013

No description provided.

@WillFM WillFM referenced this pull request Jun 4, 2013


Edit polygons with holes #90

winsento commented May 8, 2014


can anyone explain me how to draw holes inside polygon using leaflet draw?


ddproxy commented Mar 7, 2016

Need to add documentation for this @WillFM

@ddproxy ddproxy added the feature label Mar 7, 2016

WillFM commented Mar 7, 2016

@ddproxy, Ohh gosh, I wrote this almost 3 years ago. I'm not sure it really needed documentation. Previously if you had a polygon with holes, it wouldn't allow you to edit the hole inside the polygon, all this did was add the editing vertices, so you could manipulate the hole as well. I've not used leaflet in some time now. the issue this was addressing may have already been resolved by Leaflet?


ddproxy commented Mar 7, 2016

I see, I'll double check that it works properly now. If not, this PR may still apply ;)


kragoth commented Jan 23, 2017 edited

I had to get hole editing working for my project. This pull request was very instrumental in helping me get it working. Thanks @WillFM.

I have not put together a pull request or updated this branch yet as this took me nearly 2 days to get everything working and I really need to get my work finished!

But, I did all my changes in jsfiddle so you can see them here.

This was working with:
leaflet 1.0.2
leaflet.draw 0.4.9
leaflet.snap (no version info in file, see jsfiddle)

I didn't have to change a lot from this pull request but, I did make a few changes.
This has not been tested against leaflet 0.7.

Something that should be done but, I haven't done it yet is, when editing a hole it should not allow you drag the point outside the outer ring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment