I am working on a project in React and making use of the leaflet and leaflet.draw libraries.
I would like to replicate the functionality of the Save and Cancel buttons in a dialog box.
What I have: Current Save and Cancel Buttons
Q1. What I want: Save and Cancel Buttons in a Dialog Box
So, OK and Cancel in the dialog box should be equivalent to Save and Cancel in the toolbar options respectively.
The idea is that, after I click on the delete button in the toolbar, I click on a polygon to be deleted. Then a dialog box appears asking me to confirm my request.
Q2. For such a dialog box to appear, which event should I use here? Will map.on(draw:deletestart work)?
If I click on OK, the polygon should then be deleted.
Else, when I click on Cancel, the polygon should stay as it was.
Please let me know if anything is not clear or any extra information is required.
Many thanks in advance!