Learn R Programming

TargomoR (version 0.2.0)

tiles: Add Targomo Basemaps to a Leaflet Map

Description

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

Usage

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

Run this code
# NOT RUN {
# 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")
# }
# NOT RUN {
# list Targomo Map Styles
targomoMapStyles()

# }

Run the code above in your browser using DataLab