Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
16EAGLE committed Nov 22, 2024
1 parent 9359d4c commit a3daa60
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ importFrom(terra,rast)
importFrom(terra,writeRaster)
importFrom(utils,head)
importFrom(utils,installed.packages)
importFrom(utils,read.csv)
importFrom(utils,write.csv)
17 changes: 11 additions & 6 deletions R/defaults.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ reset_defaults <- function(){
#'
#' @param map_service character.
#' \itemize{
#' \item{for \code{get_maptypes()}:}{ optional, either \code{"osm"}, \code{"osm_stamen"}, \code{"osm_stadia"}, \code{"osm_thunderforest"}, \code{"carto"}, \code{"mapbox"}, \code{"esri"} or \code{"maptiler"}. Otherwise, a list of map types for both services is returned.}
#' \item{for \code{add_maptypes()}:}{ character, name of map service the map type to add belongs to}
#' \item for \code{get_maptypes()}: optional, either \code{"osm"}, \code{"osm_stamen"}, \code{"osm_stadia"}, \code{"osm_thunderforest"}, \code{"carto"}, \code{"mapbox"}, \code{"esri"} or \code{"maptiler"}. Otherwise, a list of map types for both services is returned.
#' \item for \code{add_maptypes()}: character, name of map service the map type to add belongs to
#' }
#'
#' @param as_df logical, whether to return a data.frame instead of a list (defaults to \code{FALSE})
Expand Down Expand Up @@ -124,14 +124,17 @@ reset_defaults <- function(){
#' get_maptypes(as_df = TRUE, url_cols = TRUE)
#'
#' # add a custom map service and type yourself:
#' add_maptypes(map_service = "someservice", map_type = "terrain", url_endpoint = "https://tile.someservice.org")
#' add_maptypes(
#' map_service = "someservice", map_type = "terrain",
#' url_endpoint = "https://tile.someservice.org")
#'
#' # control further aspects of a custom map service and type:
#' add_maptypes(
#' map_service = "someservice", map_type = "terrain", url_endpoint = "https://tile.someservice.org",
#' url_xy = "xy", # defining the order in which this service expects tile x and y subscripts
#' map_service = "someservice", map_type = "terrain",
#' url_endpoint = "https://tile.someservice.org",
#' url_xy = "xy", # order in which this service expects tile x and y id
#' url_file_format = ".png",
#' url_map_token = "?authtoken=", # some services expect query parameters for transmitting an auth token
#' url_map_token = "?authtoken=", # query params for auth token
#' auth_error_code = 401,
#' url_website = "https://someservice.org"
#' )
Expand Down Expand Up @@ -207,6 +210,7 @@ add_maptypes <- function(map_service, map_type, url_endpoint, url_xy = "xy", url
}

#' @rdname maptypes
#' @importFrom utils write.csv
#' @export
save_maptypes <- function(file){
mt <- get_maptypes(as_df = T, url_cols = T)
Expand All @@ -216,6 +220,7 @@ save_maptypes <- function(file){


#' @rdname maptypes
#' @importFrom utils read.csv
#' @export
load_maptypes <- function(file){
mt <- read.csv(file)
Expand Down
15 changes: 9 additions & 6 deletions man/maptypes.Rd

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

0 comments on commit a3daa60

Please sign in to comment.