"How can I receive a mouse click event on a marker in a leaflet map in R? I'm using the rstudio/leaflet version https://github.com/rstudio/leaflet and running through shiny.
I'd like to get the value of a marker (e.g., ID) and use that to update a sidebarPanel.
Thanks!"
I'd prefer a solution using the html widget version of the leaflet package (i.e. http://rstudio.github.io/leaflet/)
Yes, I've seen the leaflet-shiny package on github which looks like it can handle mouse events - it also looks older (2013) and less likely to be supported in the future.
If there isn't a solution, within the current html widget version of leaflet, can I just insert some javascript into my app to deal with this?
Many Thanks!
Sam
# session$onFlushed is necessary to delay the drawing of the circles until after the map is created
session$onFlushed(once=T, function(){
map$addCircleMarker(lat = data$LatitudeMeasure, lng = data$LongitudeMeasure, radius = data$radius,
layerId=row.names(data))
})--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/63fff601-07ea-4962-adb0-b364cfd792c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/761f13f9-301d-49c6-b6c2-47d48de99ad8%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/2ec343dd-d62d-4610-b1cc-822fcf8c2431%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/dda8b79d-5ccc-4aa8-95c2-a7ce4248eaef%40googlegroups.com.