tiles: Add Targomo Basemaps to a Leaflet Map

Description Usage Arguments Value Examples

Description

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

Usage

1
2
3
4
5
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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()

TargomoR documentation built on Dec. 7, 2019, 1:07 a.m.