I'm trying to use observeEvent()
to change the Mapview's x
argument to new data. I'd normally just use clearShapes()
then addPolygons()
, but need the zcol
etc. arguments.
I'd like to do something similar to the following:
server <- function(input, output) {
output$DisplayMap <- renderLeaflet(
mapview(first_data, zcol = coolCol, color = brewer.pal(12, "Set3") %>%
addControl(actionButton("Next", ">"), position = "topright")
)
observeEvent(input$Next, {
output$DisplayMap$x <- next_data # This doesn't work
})
}
I realise there's 2 issues at play (an interface to change the variable and a means to do so), and one of them probably needs React in some form or another