save_webshot: Embedded webshot of leaflet map

View source: R/webshot.R

save_webshotR Documentation

Embedded webshot of leaflet map

Description

Embedded webshot of leaflet map

Usage

save_webshot(
  map,
  path_to_img,
  overwrite = FALSE,
  vwidth = 800,
  vheight = 600,
  cliprect = "viewport",
  ...
)

Arguments

map

A leaflet map object

path_to_img

A path to the image file to save

overwrite

Do you want to clobber any existing file?

vwidth

see webshot

vheight

see webshot

cliprect

see webshot

...

arguments passed to webshot

Value

a path to a PNG file

Examples

## Not run: 
if (require(leaflet)) {
  map <- leaflet() %>%
    addTiles() %>%
    addMarkers(lng = 174.768, lat = -36.852, popup = "The birthplace of R")
  save_webshot(map, tempfile())
}

## End(Not run)

mdsr documentation built on Jan. 6, 2023, 5:12 p.m.