# NOT RUN {
library(sf)
library(maptiles)
nc <- st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
nc_osm <- get_tiles(nc, crop = TRUE, zoom = 6)
plot_tiles(nc_osm)
# Download esri tiles
fullserver <- paste("https://server.arcgisonline.com/ArcGIS/rest/services",
"Specialty/DeLorme_World_Base_Map/MapServer",
"tile/{z}/{y}/{x}.jpg",
sep = "/")
esri <- list(
src = 'esri',
q = fullserver,
sub = NA,
cit = 'Tiles: Esri; Copyright: 2012 DeLorme'
)
nc_ESRI <- get_tiles(x = nc, provider = esri, crop = TRUE,
verbose = TRUE, zoom = 6)
# Plot the tiles
plot_tiles(nc_ESRI)
txt <- esri$cit
mtext(text = txt, side = 1, adj = 0, cex = .9, font = 3)
# }
Run the code above in your browser using DataLab