get-tiles-constrained | R Documentation |
Get tiles by zoom, by overall dimension, or by buffer on a single point.
get_tiles_zoom(x, zoom = 0, ..., format = "png")
get_tiles_dim(x, dim = c(512, 512), ..., format = "png")
get_tiles_buffer(x, buffer = NULL, ..., max_tiles = 9, format = "png")
x |
a spatial object with an extent |
zoom |
desired zoom for tiles, use with caution - cannot be unset in |
... |
passed to |
format |
defaults to "png", also available is "jpg" |
dim |
for |
buffer |
width in metres to extend around the location, ignored if 'x' is a spatial object with extent |
max_tiles |
maximum number of tiles - if |
Each function expects an extent in longitude latitude or a spatial object with extent as the first argument.
get_tiles_zoom()
requires a zoom value, defaulting to 0
get_tiles_dim()
requires a dim value, default to c(512, 512)
, a set of 4 tiles
get_tiles_buffer()
requires a single location (longitude, latitude) and a buffer in metres
A list with files downloaded in character vector, a data frame of the tile indices, the zoom level used and the extent in xmin,xmax,ymin,ymax form.
get_tiles
if (!is.null(get_api_key())) {
ex <- ext(146, 147, -43, -42)
tile_infoz <- get_tiles_zoom(ex, zoom = 1)
tile_infod <- get_tiles_dim(ex, dim = c(256, 256))
tile_infob <- get_tiles_buffer(cbind(146.5, -42.5), buffer = 5000)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.