addEasyprint: Add easyPrint Plugin

View source: R/easyprint.R

addEasyprintR Documentation

Add easyPrint Plugin

Description

Add a control, which allows to print or export a map as .PNG.

Usage

addEasyprint(map, options = easyprintOptions())

Arguments

map

a map widget object created from leaflet

options

A named list of options. See easyprintOptions

Value

A leaflet map object

References

https://github.com/rowanwins/leaflet-easyPrint

See Also

Other EasyPrint Functions: easyprintMap(), easyprintOptions(), removeEasyprint()

Examples

library(leaflet)
leaflet() %>%
  addTiles() %>%
  addEasyprint(options = easyprintOptions(
    title = "Print map",
    position = "bottomleft",
    exportOnly = TRUE
  ))

## Custom pixel size (e.g. high-res PNG in a Quarto/HTML document):
leaflet() %>%
  addTiles() %>%
  addEasyprint(options = easyprintOptions(
    title = "Save map to PNG",
    exportOnly = TRUE,
    filename = "map",
    tileWait = 1000,
    sizeModes = list(
      "CurrentSize",
      list(scale = 3, name = "3x current view")
    )
  ))

leaflet.extras2 documentation built on Sept. 10, 2026, 1:11 a.m.