tile_layer: Tile layer

Description Usage Arguments See Also Examples

View source: R/tile_layer.R

Description

Add a tile layer to a d3-carto-map.

Usage

1
2
tile_layer(carto, provider = c("stamen", "mapbox"), path = "toner-lite",
  label = "Tiles", visible = TRUE)

Arguments

carto

The map created by cartographer().

provider

The name of the provider of the map tiles. d3-carto-map currently supports stamen and mapbox.

path

The string that identifies the type of tiles from the provider. Stamen's free tile options include these:

  • toner

  • toner-lite

  • toner-hybrid

  • toner-background

  • terrain

  • terrain-background

  • watercolor

Tile options from Mapbox take the form of user.id, for example, examples.map-zr0njcqy. See some example Mapbox tiles.

label

The label for this layer on the layer selector.

visible

Should the layer be initially visible?

See Also

cartographer

Examples

1
2
3
4
5
6
7
8
cartographer(region = "Africa") %>%
  tile_layer() %>%
  tile_layer(provider = "mapbox", path = "mapbox.world-bright",
             label = "World Bright") %>%
  tile_layer(provider = "mapbox", path = "mapbox.natural-earth-1",
             label = "Natural Earth") %>%
  tile_layer(provider = "mapbox", path = "mapbox.geography-class",
             label = "Geography")

ropensci/cartographer documentation built on May 27, 2019, 2:24 p.m.