Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions R/screenshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
#' @param filename Character string. The output file path. Defaults to
#' `"map.png"`. If the filename does not end in `.png`, the extension is
#' appended automatically.
#' @param width Integer. The width of the map viewport in pixels.
#' @param height Integer. The height of the map viewport in pixels.
#' @param width Integer. The width of the map viewport in pixels. Always
#' overrides any `width` configured when the map widget was created.
#' @param height Integer. The height of the map viewport in pixels. Always
#' overrides any `height` configured when the map widget was created.
#' @param include_legend Logical. Include the legend in the output? Default
#' `TRUE`.
#' @param hide_controls Logical. Hide navigation and other interactive controls?
Expand Down Expand Up @@ -86,6 +88,10 @@ save_map <- function(
}
map$x$additional_params$preserveDrawingBuffer <- TRUE

# Always override widget dimensions used by saveWidget()
map$width <- as.integer(width) |> paste0("px")
map$height <- as.integer(height) |> paste0("px")
Comment thread
danielvartan marked this conversation as resolved.

# Save widget to temp directory
tmp_dir <- tempfile("mapgl_")
dir.create(tmp_dir)
Expand Down
6 changes: 4 additions & 2 deletions man/print_map.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/save_map.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading