From 98047549f8983b79e0a346211486eb0de46e7bb8 Mon Sep 17 00:00:00 2001 From: 16EAGLE Date: Sun, 3 Mar 2024 20:13:20 +0100 Subject: [PATCH] updated tests --- NEWS.md | 7 +++++-- R/get_maptypes.R | 2 +- tests/testthat/helper-vars.R | 3 +++ tests/testthat/test-basemap.R | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index cd6da30..21ff641 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,15 +1,18 @@ *** ## basemaps 0.0.6 -Minor improvements +Major improvements **Bugs:** -* Fixed an issue with maps appearing blurred/of low resolution when using `basemap_ggplot` or `basemap_gglayer`. Maps should now show up with consistent resolutions across plot/viewing methods. +* Fixing an issue with maps appearing blurred/of low resolution when using `basemap_ggplot` or `basemap_gglayer`. Maps should now show up with consistent resolutions across plot/viewing methods. +* Fixing a bug from upstream causing maps to not get mosaiced correctly +* Fixing `grDevices` display bug when `NA`s are in map imagery **Changes:** * `gg_raster` now accepts `interpolate`, a logical argument to control smoothing of the plotted raster. +* added Stadia Maps support for `osm_stamen` maps: Due to changes by Stamen, you now need a map token from stadiamaps.com (free registration) for Stamen maps.
diff --git a/R/get_maptypes.R b/R/get_maptypes.R index a4b205d..51a16e9 100644 --- a/R/get_maptypes.R +++ b/R/get_maptypes.R @@ -10,7 +10,7 @@ #' #' \code{"osm"}: Open Street Map contributors (\url{https://www.openstreetmap.org/copyright}), Open Topo Map (\url{https://opentopomap.org/}), Martin Tesar (\url{http://mtbmap.cz/}) #' -#' \code{"osm_stamen"}: Stamen (\url{http://maps.stamen.com/}) via Stadia Maps (\url{https://stadiamaps.com/}), Open Street Map contributors (\url{https://www.openstreetmap.org/copyright}) +#' \code{"osm_stamen"}: Stamen (\url{https://maps.stamen.com/}) via Stadia Maps (\url{https://stadiamaps.com/}), Open Street Map contributors (\url{https://www.openstreetmap.org/copyright}) #' #' \code{"osm_thunderforest"}: Thunderforest (\url{https://www.thunderforest.com/}), Open Street Map contributors (\url{https://www.openstreetmap.org/copyright}) #' diff --git a/tests/testthat/helper-vars.R b/tests/testthat/helper-vars.R index f4923b5..f427ee6 100644 --- a/tests/testthat/helper-vars.R +++ b/tests/testthat/helper-vars.R @@ -9,6 +9,9 @@ if(mapbox_token != "") run_mapbox <- TRUE else run_mapbox <- FALSE osmtf_token = Sys.getenv("basemaps_osmtf_token") if(osmtf_token != "") run_osmtf <- TRUE else run_osmtf <- FALSE +osmstamen_token = Sys.getenv("basemaps_osmstamen_token") +if(osmstamen_token != "") run_osmstamen <- TRUE else run_osmstamen <- FALSE + run_esri = as.logical(Sys.getenv("basemaps_run_esri")) if(is.na(run_esri)) run_esri <- FALSE diff --git a/tests/testthat/test-basemap.R b/tests/testthat/test-basemap.R index 8b26a60..144fd0a 100644 --- a/tests/testthat/test-basemap.R +++ b/tests/testthat/test-basemap.R @@ -115,6 +115,7 @@ if(isTRUE(test$maps)){ test_services <- names(get_maptypes()) if(isFALSE(run_mapbox)) test_services <- test_services[test_services != "mapbox"] if(isFALSE(run_osmtf)) test_services <- test_services[test_services != "osm_thunderforest"] + if(isFALSE(run_osmstamen)) test_services <- test_services[test_services != "osm_stamen"] if(isFALSE(run_esri)) test_services <- test_services[test_services != "esri"] catch <- lapply(test_services, function(service) lapply(get_maptypes(service), function(x, s = service){ @@ -122,7 +123,9 @@ if(isTRUE(test$maps)){ mapbox_token } else if(s == "osm_thunderforest"){ osmtf_token - } else{ + } else if(s == "osm_stamen"){ + osmstamen_token + } else { NULL }