Learn R Programming

cartography (version 1.0)

tilesLayer: Plot Tiles from Open Map Servers

Description

Plot tiles from open map servers.

Usage

tilesLayer(x, add = FALSE)

Arguments

x
an OpenStreetMap object; the getTiles function outputs these objects.
add
whether to add the layer to an existing plot (TRUE) or not (FALSE).

See Also

getTiles

Examples

Run this code
data("nuts2006")
# Download the tiles, nuts0.spdf extent
EuropeStamen <- getTiles(spdf = nuts0.spdf, type = "stamen-watercolor")
class(EuropeStamen)
# Plot the tiles
tilesLayer(EuropeStamen)
# Plot countries
plot(nuts0.spdf, add=TRUE)
# Map tiles sources
mtext(text = "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",
      side = 1, adj = 0, cex = 0.7, font = 3)

Run the code above in your browser using DataLab