I am using mapedit in Shiny using the callModule as here
|
selections <- callModule(selectMod, "test-mod", m) |
I want to run some code when a polygon is finished drawing and another code when polygon is deleted. I am using an observeEvent on reactives selections()$finished and selections()$deleted to achieve this. While this works for the first run to catch both events, the selections()$deleted is not NULL subsequently and therefore the corresponding observeEvent is fired even when just a shape is drawn.
Are there specific events tied to the draw/delete buttons in the leafpm edit toolbar? If so, an example usage would be helpful.
If not supported currently, any suggestions on how this can be achieved using for example, shinyjs?
I am using
mapeditin Shiny using thecallModuleas heremapedit/inst/examples/shiny_modules.R
Line 16 in b5bad16
I want to run some code when a polygon is finished drawing and another code when polygon is deleted. I am using an
observeEventon reactivesselections()$finishedandselections()$deletedto achieve this. While this works for the first run to catch both events, theselections()$deletedis not NULL subsequently and therefore the corresponding observeEvent is fired even when just a shape is drawn.Are there specific events tied to the draw/delete buttons in the
leafpmedit toolbar? If so, an example usage would be helpful.If not supported currently, any suggestions on how this can be achieved using for example,
shinyjs?