osm_url_load_async | R Documentation |
Load tile URLs
osm_url_load_async(tile, spec, callback = NULL, cache_spec = NULL)
tile |
A 'data.frame()' with columns 'x', 'y', and 'zoom'. |
spec |
An [osm_url_spec()] |
callback |
A function to be run for each tile fetch or NULL to do nothing. The callback is always called with two arguments: the first is the subset of 'tile' for which this URL applies (typically one row but can be more than one in some corner cases); the second is the curl response object whose useful elements are url, status_code, type, and content. |
cache_spec |
An optional [osm_url_spec()] or character vector to be used as the cache. |
'tile', invisibly.
bounds <- wk::rct(
252185, 4815826, 739729, 5210280,
crs = "EPSG:32620"
)
tiles <- osm_tile_covering(bounds, zoom = 5)
osm_url_load_async(
tiles,
osm_url_spec_example(),
function(tile, res) {
str(tile)
str(res)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.