sleep: Prevents accidental map scrolling when scrolling in a...

Description Usage Arguments Examples

Description

Prevents accidental map scrolling when scrolling in a document.

Usage

1
2
3
suspendScroll(map, sleep = TRUE, sleepTime = 750, wakeTime = 750,
  sleepNote = TRUE, hoverToWake = TRUE,
  wakeMessage = "Click or Hover to Wake", sleepOpacity = 0.7)

Arguments

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

Examples

1
2
3
4
leaflet(width = "100%") %>%
  setView(0, 0, 1) %>%
  addTiles() %>%
  suspendScroll()

leaflet.extras documentation built on May 2, 2019, 2:11 a.m.