Leaflet Draw “Cannot read property 'enable' of undefined” adding control to geoJSON layer

后端 未结 2 1009
南方客
南方客 2020-12-04 02:57

I am trying to use leaflet\'s edit function on polygons that I loaded from my database. When I click on leaflet\'s edit button I get the error
Cannot read property

2条回答
  •  醉酒成梦
    2020-12-04 03:08

    As mentioned by @ghybs Leaflet.Draw doesn't support Groups or MultiPolygons. I needed the same functionality so a few years ago I created Leaflet-Geoman (previously named leaflet.pm) which supports holes, MultiPolygons, GeoJSON and LayerGroups:

    https://github.com/geoman-io/leaflet-geoman

    Hope it helps.

提交回复
热议问题