Closed micahwilhelm closed 4 months ago
I think it works as expected. You need to add some content to a shiny-app, so you can/have to scroll over the map. The scroll will not get trapped immediately from leaflet. But you will trigger the zoom, when you put the cursor on the map and then scroll.
library(shiny)
library(leaflet)
library(leaflet.extras)
ui <- fluidPage(
HTML(rep(as.character(tags$br()), 30)),
leafletOutput("map"),
HTML(rep(as.character(tags$br()), 40)),
)
server <- function(input, output, session) {
output$map <- renderLeaflet({
leaflet() %>%
addTiles() %>%
suspendScroll(hoverToWake = FALSE,
wakeTime = 2000,
wakeMessage = "Click to Wake")
})
}
shinyApp(ui, server)
Example: leaflet(width = "100%") %>% setView(0, 0, 1) %>% addTiles() %>% suspendScroll(hoverToWake = FALSE)
See original issue comment here: https://github.com/rstudio/leaflet/issues/464#issuecomment-535424913