ceramic (version 0.9.5)

plot_tiles: 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)

Value

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

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.

Examples

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

Run the code above in your browser using DataLab