I am trying to delete a Leaflet.draw layer from my database in firestore. I can easily delete it from the database side, but i struggle with connecting the document name with the layer name.
More specifically, i can't seem to get the id of the layer to be deleted/edited. Once i have that i should be able to connect it to the document id
This is what i got currently:
map.on(L.Draw.Event.DELETED, e => {
this.deleteMarkerAnnotation(this.dummyValue)
console.log(e.propagatedFrom.layers.eachLayer(layer => { console.log(layer) }))
})
I get an error: Cannot read property 'layers' of undefined
propagatedFrom is indeed
undefined
. It is not provided on the event objectjust remove
propagatedFrom
and usee.layers
instead.