Skip to content

Commit 6258cd1

Browse files
committed
fix cleanup in mapAdd example when nosuggests TRUE
1 parent 3ca276a commit 6258cd1

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

R/map.R

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ utils::globalVariables(c(
4242
#' ex_dir <- withr::local_tempdir("example_mapAdd_")
4343
#' withr::local_dir(ex_dir)
4444
#'
45+
#' withr::local_options(list(
46+
#' map.tilePath = file.path(ex_dir, "tiles"),
47+
#' map.useParallel = FALSE
48+
#' ))
49+
#'
4550
#' StudyArea <- list(cbind(
4651
#' x = c(-122.98, -116.1, -99.2, -106, -122.98),
4752
#' y = c(59.9, 65.73, 63.58, 54.79, 59.9)
@@ -59,11 +64,6 @@ utils::globalVariables(c(
5964
#' )
6065
#'
6166
#' if (require("SpaDES.tools", quietly = TRUE)) {
62-
#' withr::local_options(list(
63-
#' map.tilePath = file.path(ex_dir, "tiles"),
64-
#' map.useParallel = FALSE
65-
#' ))
66-
#'
6767
#' smallStudyArea <- SpaDES.tools::randomPolygon(studyArea(ml), 1e5)
6868
#' smallStudyArea$ID <- 1L
6969
#' smallStudyArea$shinyLabel <- "zone2"
@@ -178,10 +178,11 @@ utils::globalVariables(c(
178178
#' # postHocAnalysisGroups = "analysisGroup2",
179179
#' # postHocAnalyses = "all")
180180
#'
181-
#' ## cleanup
182-
#' withr::deferred_run()
183181
#' }
184182
#'
183+
#' ## cleanup
184+
#' withr::deferred_run()
185+
#'
185186
mapAdd <- function(obj, map, layerName,
186187
overwrite = getOption("map.overwrite", FALSE), ...) {
187188
UseMethod("mapAdd", obj)

man/mapAdd.Rd

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)