-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Click events for leafpm editToolbar buttons #112
Comments
@chintanp I see what you are saying. Isolating events is I think impossible using the reactiveValue inside the
Note: I tried every iteration that I could to properly isolate and none seemed to work. Code ExaminationIn lines we set up a |
@chintanp another option would be to track changes manually with
|
I ended up implementing something similar, using set(paste0("deleted", session$token), selections()$deleted$edit_id) when the first time delete happens, and check in an For subsequent deletes, I use set(paste0("deleted", session$token), dplyr::last(selections()$deleted$edit_id)) to do a similar check. It is hacky and I do not feel good about it, as The |
@chintanp thanks for the report. I'd like to allow the isolation, but I think the change would require a breaking API change, so I'll leave this open to see if anyone expresses interest or proposes other solutions. |
@timelyportfolio another (maybe associated) useful feature would be the ability to programmatically toggle the toolbar button states. For example, the issue #113 can be avoided if I can say only allow the "delete" button to be clickable when there are "drawn/editable" features on the map, and then become dormant as soon as all the "drawn/editable" features have been deleted. |
I am using
mapedit
in Shiny using thecallModule
as 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
observeEvent
on reactivesselections()$finished
andselections()$deleted
to achieve this. While this works for the first run to catch both events, theselections()$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
?The text was updated successfully, but these errors were encountered: