I'm trying to create a sliderInput animation using addWMSTiles in leaflet. However, the display is very choppy when the slider animation option is enabled.
In leaflet.extras there is an 'enableTileCaching' function for caching when adding tiles using 'addTiles', however I'm trying to cache WMS tiles to improve the display of a slider animation which calls WMS tiles for different time steps.
I've had a look at bindCache (Shiny package) and the memoise package, but haven't been able to find a solution for caching WMS tiles in leaflet.
This is my code for adding time step WMS layers, which is inserted within an observeEvent, where a change in the slider value updates the WMS layer.
clearGroup("test") %>% # <- clear earlier displayed layer
baseUrl = UrlWMS,
layers = "precip",
#layerId = "",
group = "test",
attribution = "",
options = WMSTileOptions(format = "image/png", transparent = TRUE,
time = strftime(input$slider, format = "%Y-%m-%dT%H:%M:%SZ", tz = "GMT" ), zIndex = 50)
Any suggestions would be welcome.
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS
other attached packages:
 leaflet.extras_1.0.0 lubridate_220.127.116.11 curl_4.3 RSQLite_2.2.2
 keyring_1.1.0 shinymanager_1.0.300 leafem_0.1.3 leaflet_2.0.3
 shinyBS_0.61 shinyTree_0.2.7 shinyjs_2.0.0 shinydashboardPlus_0.7.5
 shinydashboard_0.7.1 shinyWidgets_0.5.3 shiny_1.6.0