Prevents accidental map scrolling when scrolling in a document.
Prevents accidental map scrolling when scrolling in a document.
suspendScroll(map, sleep = TRUE, sleepTime = 750, wakeTime = 750, sleepNote = TRUE, hoverToWake = TRUE, wakeMessage = "Click or Hover to Wake", sleepOpacity = 0.7)
map |
The leaflet map |
sleep |
false if you want an unruly map |
sleepTime |
time(ms) until map sleeps on mouseout |
wakeTime |
time(ms) until map wakes on mouseover |
sleepNote |
should the user receive wake instructions? |
hoverToWake |
should hovering wake the map? (non-touch devices only) |
wakeMessage |
a message to inform users about waking the map |
sleepOpacity |
opacity for the sleeping map |
leaflet(width = "100%") %>% setView(0, 0, 1) %>% addTiles() %>% suspendScroll()
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.