Closed
Description
If you click "redraw" in this shiny app, then try to select markers, they are not highlighted, and I receive Uncaught TypeError: Cannot read property 'layer' of undefined
library(leaflet)
library(crosstalk)
library(shiny)
qd <- SharedData$new(quakes)
ui <- fluidPage(
actionButton("redraw", "Redraw:"),
leafletOutput("map")
)
server <- function(input, output, session) {
output$map <- renderLeaflet({
leaflet(qd) %>%
addTiles() %>%
addCircles(group = "foo")
})
observeEvent(input$redraw, {
leafletProxy("map", session) %>%
clearGroup("foo") %>%
addMarkers(data = qd)
})
}
shinyApp(ui, server)
Metadata
Assignees
Labels
No labels