enableTileCaching | R Documentation |
Enables caching of tiles locally in browser. See https://github.com/MazeMap/Leaflet.TileLayer.PouchDBCached for details. In addition to invoking this function, you should also pass useCache=TRUE
& crossOrigin=TRUE
in the tileOptions
call and pass that to your addTiles
's options
parameter.
enableTileCaching(map)
map |
The leaflet map |
leaflet() %>%
enableTileCaching() %>%
addTiles(options = tileOptions(useCache = TRUE, crossOrigin = TRUE))
## for more examples see
# browseURL(system.file("examples/TileLayer-Caching.R", package = "leaflet.extras"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.