Get static map tiles based on a spatial object. Maps can be fetched from various open map servers.
This function is a implementation of the javascript plugin leaflet-providersESP v1.2.0
esp_getTiles(
x,
type = "IDErioja",
zoom = NULL,
crop = TRUE,
res = 512,
bbox_expand = 0.05,
transparent = TRUE,
mask = FALSE,
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE
)
An sf
object.
Name of the provider. See leaflet.providersESP.df.
the zoom level. If NULL
, it is determined automatically
(see getTiles
). Only valid for WMTS.
TRUE if results should be cropped to the specified x extent, FALSE otherwise. If x is an sf object with one POINT, crop is set to FALSE.
Resolution (in pixels) of the final tile. Only valid for WMS.
A numeric value that indicates the expansion percentage
of the bounding box of x
.
Logical. Provides transparent background, if supported.
Depends on the selected provider on type
.
TRUE
if the result should be masked to x
.
See esp_get_nuts
A RasterBrick is returned.
Results of esp_getTiles
could be plotted using
tilesLayer
For a complete list of providers see leaflet.providersESP.df.
Most WMS/WMTS providers provide tiles on EPSG:3857. In case that the tile
looks deformed, try projecting first x
:
x <- sf::st_transform(x,3857)
Tiles are cached under the path cache_dir/[type]
leaflet.providersESP.df, addProviderEspTiles, getTiles, tilesLayer.