Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
16EAGLE committed Mar 3, 2024
1 parent 14125a7 commit 9804754
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
7 changes: 5 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.

<br>

Expand Down
2 changes: 1 addition & 1 deletion R/get_maptypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -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})
#'
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/helper-vars.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-basemap.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,17 @@ 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){
map_token <- if(s == "mapbox"){
mapbox_token
} else if(s == "osm_thunderforest"){
osmtf_token
} else{
} else if(s == "osm_stamen"){
osmstamen_token
} else {
NULL
}

Expand Down

0 comments on commit 9804754

Please sign in to comment.