Skip to content

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

Description

@B-Nilson

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions