plot_tiles: Plot slippy map tiles

View source: R/georeference.R

plot_tilesR Documentation

Plot slippy map tiles

Description

Create a new plot of tile rectangles, or add to an existing plot.

Usage

plot_tiles(
  x,
  ...,
  add = FALSE,
  label = TRUE,
  cex = 0.6,
  add_coast = TRUE,
  include_zoom = TRUE
)

tiles_to_polygon(x)

Arguments

x

tiles as create by ceramic_tiles()

...

arguments passed to graphics::rect()

add

add to an existing plot?

label

include text label?

cex

relative size of text label if drawn (see text())

add_coast

include a basic coastline on the plot?

include_zoom

include zoom level with text label if drawn?

Details

The extent ('xmin', 'xmax', 'ymin', 'ymax') is used directly to draw the tiles so must be in the native Mercator coordinate system used by most tile servers.

Value

plot_tiles() is called for its side-effect, a plot, and returns NULL invisibly. tiles_to_polygon returns a wk rct vector

Examples

if (!is.null(get_api_key())) {
  get_tiles_zoom(zoom = 1)
  tiles <- ceramic_tiles(zoom = 1)
  plot_tiles(tiles)
}

ceramic documentation built on June 22, 2024, 12:19 p.m.