Open novaknole opened 5 years ago
what buttons do you have on your custom design? from my experience we need to add a custom input such as button or keypress to trigger the layer.editing.enable() as shown in the edit_handler example on the docs. Here's what I do :
// button_edit is variable used to store my edit button object
L.DomEvent.on(button_edit, 'click', function(e) {
drawnItems.eachLayer(function (layer) {
if (layer instanceof L.Polygon){
layer.editing.enable();
}
});
});
How to reproduce
What behaviour I'm expecting and which behaviour I'm seeing
Here is my code
The thing is when I start drawing and finish, sometimes I want to edit it. but it doesn't let me edit it at all. I don't want to use drawcontrols or toolbars, because I only have 2 buttons with my custom designs and this seems to be easier for me. So how do I make editing possible with the above following code?