mapview icon indicating copy to clipboard operation
mapview copied to clipboard

mapshot() fails if package "webshot" is not installed

Open B-Nilson opened this issue 3 weeks ago • 0 comments

This is good when not-interactive, but when run in an interactive session (like in RStudio or Positron) it would be a better UX to prompt the user to install webshot.

Suggest using rlang::check_installed("webshot") instead of requireNamespace("webshot") so the user is prompted to install if in an interactive session.

Here is a reprex:


if (rlang::is_installed("webshot")) {
  stop("webshot is installed, uninstall it before testing")
}
temp_file <- tempfile()
on.exit({unlink(temp_file})

leaflet::leaflet() |>
    mapview::mapshot(file = temp_file, selfcontained = FALSE)

B-Nilson avatar Dec 08 '25 22:12 B-Nilson