tile_layer: Tile layer

View source: R/tile_layer.R

tile_layerR Documentation

Tile layer

Description

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

Usage

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

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 18, 2022, 9:49 a.m.