Learn R Programming

ggspatial (version 1.0.2)

annotation_map_tile: Add background OSM tiles

Description

Uses osm.image to add background tiles.

Usage

annotation_map_tile(type = "osm", zoom = NULL, zoomin = -2,
  forcedownload = FALSE, cachedir = NULL, progress = c("text", "none"),
  quiet = TRUE, interpolate = TRUE, data = NULL, mapping = NULL)

GeomMapTile

Arguments

type

The map type

zoom

The zoom level (overrides zoomin)

zoomin

Delta on default zoom

forcedownload

Re-download cached tiles?

cachedir

Specify cache directory

progress

Use progress = "none" to suppress progress and zoom output

quiet

Use quiet = FALSE to see which URLs are downloaded

interpolate

Parameter for raster

data, mapping

Specify data and mapping to use this geom with facets

Value

A ggplot2 layer

Format

An object of class GeomMapTile (inherits from Geom, ggproto, gg) of length 5.

Examples

Run this code
# NOT RUN {
load_longlake_data()

ggplot() +
  annotation_map_tile(zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
  geom_sf(data = longlake_waterdf, fill = NA, col = "grey50")

# }

Run the code above in your browser using DataLab