Leaflet.Editable
Leaflet.Editable copied to clipboard
geoJSON support
this doesn't seem to work
const geo = L.geoJSON(geoJsonObj).addTo(this.map); geo.enableEdit();
I get the error ERROR TypeError: geo.enableEdit is not a function
You need to call enableEdit() on every layer element:
geo.getLayers().forEach(l => l.enableEdit())
If you have a lot of layers, choose to enable editing individually
L.geoJSON(geoJsonObj, {
onEachFeature: function(feature, layer){
layer
.on('dblclick', L.DomEvent.stop)
.on('dblclick', layer.toggleEdit);
}
})
Marker or Point is not dragable.