Is there any way to project raster/images as animation onto Leaflet?
In R raster package we can animate raster layers with: animate(rasters)
. And you can save it as GIF with:saveGIF(animate(rasters))
.
But how do we project the GIF onto a leaflet?
My workaround is to create PNG files
saveWidget(m, "temp.html")
webshot("temp.html", file = "filename.png"), cliprect = "viewport")
and creating a GIF:
im.convert(png_files, output = "output.gif")
I am sure there are a lot of other workarounds to do this with Javascript and CSS but I was wondering if it is possible to do it in R without manipulating Javascript and still have that dynamic map with raster animations.
I was directed to create a new question for this from this question which is a little bit different: Create a gif from a series of Leaflet maps in R