SymbolixAU / mapdeck
1
#' Mapdeck Style
2
#'
3
#' Various styles available to all Mapbox accounts using a valid access token.
4
#' Available styles are listed at
5
#' \url{https://docs.mapbox.com/api/maps/#styles}.
6
#'
7
#' @param style one of streets, outdoors, light, dark, satellite, satellite-streets
8
#'
9
#' @examples
10
#' \donttest{
11
#'
12
#' ## You need a valid access token from Mapbox
13
#' key <- 'abc'
14
#'
15
#' ## set a map style
16
#' mapdeck(token = key, style = mapdeck_style("dark"))
17
#'
18
#' }
19
#'
20
#' @export
21
mapdeck_style <- function(
22
  style = c("dark","light","outdoors","streets","satellite","satellite-streets")
23
) {
24 1
  style <- match.arg(style)
25 1
  return(
26 1
    switch(
27 1
      style
28 1
      , "dark" = "mapbox://styles/mapbox/dark-v10"
29 1
      , "light" = "mapbox://styles/mapbox/light-v10"
30 1
      , "outdoors" = "mapbox://styles/mapbox/outdoors-v11"
31 1
      , "streets" = "mapbox://styles/mapbox/streets-v11"
32 1
      , "satellite" = "mapbox://styles/mapbox/satellite-v9"
33 1
      , "satellite-streets" = "mapbox://styles/mapbox/satellite-streets-v11"
34
    )
35
  )
36
}
37

Read our documentation on viewing source code .

Loading