if (FALSE) {
library(utils)
m = mapview(breweries)
html_fl = tempfile(fileext = ".html")
png_fl = tempfile(fileext = ".png")
## create standalone .html
mapshot(m, url = html_fl)
browseURL(html_fl)
## create standalone .png; temporary .html is removed automatically unless
## 'remove_url = FALSE' is specified
mapshot(m, file = png_fl)
browseURL(png_fl)
mapshot(m, file = png_fl,
remove_controls = c("homeButton", "layersControl"))
browseURL(png_fl)
## create .html and .png
mapshot(m, url = html_fl, file = png_fl)
browseURL(png_fl)
browseURL(html_fl)
}
if (FALSE) {
library(utils)
m = mapview(breweries)
html_fl = tempfile(fileext = ".html")
png_fl = tempfile(fileext = ".png")
## create standalone .html
mapshot2(m, url = html_fl)
browseURL(html_fl)
## create standalone .png; temporary .html is removed automatically unless
## 'remove_url = FALSE' is specified
mapshot2(m, file = png_fl)
browseURL(png_fl)
mapshot2(m, file = png_fl,
remove_controls = c("homeButton", "layersControl"))
browseURL(png_fl)
## create .html and .png
mapshot2(m, url = html_fl, file = png_fl)
browseURL(png_fl)
browseURL(html_fl)
}
Run the code above in your browser using DataLab