Open ds-jim opened 3 years ago
When trying to use addMarkers dynamically in Shiny the dev version does not work. Installing the cran version fixes this.
the below works with can leaflet, not dev leaflet. `library(shiny) library(leaflet)
ui <- fluidPage( leafletOutput('map') )
server <- function(input, output, session) { output$map <- renderLeaflet({leaflet()%>%addTiles()})
observeEvent(input$map_click, { click = input$map_click leafletProxy('map')%>%addMarkers(lng = click$lng, lat = click$lat) }) }
shinyApp(ui, server)`
Hmmm. This works fine for me. What do you see in your JavaScript console when it fails?
Hope this helps?
Yikes. Can you try the following:
devtools::session_info()
Thanks!
When trying to use addMarkers dynamically in Shiny the dev version does not work. Installing the cran version fixes this.
the below works with can leaflet, not dev leaflet. `library(shiny) library(leaflet)
ui <- fluidPage( leafletOutput('map') )
server <- function(input, output, session) { output$map <- renderLeaflet({leaflet()%>%addTiles()})
observeEvent(input$map_click, { click = input$map_click leafletProxy('map')%>%addMarkers(lng = click$lng, lat = click$lat) }) }
shinyApp(ui, server)`