This function wraps round leaflet::addTiles to provide access to the Targomo basemaps.

addTargomoTiles(
  map,
  style = "basic",
  api_key = Sys.getenv("TARGOMO_API_KEY"),
  layerId = NULL,
  group = NULL,
  ...
)

targomoMapStyles()

Arguments

map

A leaflet map

style

A valid Targomo Map Style - see targomoMapStyles()

api_key

Your Targomo API key - defaults to the TARGOMO_API_KEY ennvironment variable

layerId

The layer id to pass to leaflet::addTiles

group

The layer group to pass to leaflet::addTiles

...

Further options to pass to leaflet::addTiles e.g. options

Value

The leaflet map with the requested map tiles

Examples

# \donttest{ # load leaflet package library(leaflet) # add basic style to map leaflet() %>% addTargomoTiles(style = "basic") # add dark blue style to map (without labels) leaflet() %>% addTargomoTiles(style = "darkblue-nolabels") # } # list Targomo Map Styles targomoMapStyles()
#> [1] "basic" "bright" "dark" #> [4] "dark-nolabels" "darkblue" "darkblue-nolabels" #> [7] "gray" "gray-nolabels" "light" #> [10] "light-nolabels" "lightblue" "toner"