Leaflet.contextmenu
Leaflet.contextmenu copied to clipboard
bindContextMenu and relatedTarget
Hi, I have bound a menu to layers in a geoJSON onEachFeature but the related target comes back as undefined:
layer.bindContextMenu({
contextmenu: true,
contextmenuInheritItems: false,
contextmenuItems: [{
text: "Edit",
callback: function(e) {
console.log(e.relatedTarget)
}
}
]
})
I'm also struggling with how to reference the items with a setDisabled() call. Is this repository still supported? Understand if not.