Open trafficonese opened 3 years ago
Did you also try https://github.com/rstudio/webshot2?
If we expose the option preserveDrawingBuffer
and set it to TRUE the screenshot works with addEasyprint
and screenshot
, but somehow mapshot
doesnt work.
No, I didnt try webshot2 yet.
Indeed, webshot2
also works, even with preserveDrawingBuffer = FALSE
.
That's good news I guess. I've been waiting for RStudio to push webshot2 to CRAN and rewrite mapshot accordingly which currently uses webshot. Until then, a fix using preseveDrawingBuffer
seems like a good move. I'll have a look at changes needed for mapshot over the Christmas break. Thanks for bringing this up
I dont think this is really a
leafgl
error and more a bug of the underlying JS-libraries (webshot, html2canvas, FileSaver?) but taking a screenshot of a map withleafgl
data doesnt display the layer in the resulting image.I tried several approaches to take a screenshot;
mapview::mapshot
,shinyscreenshot::screenshot
andleaflet.extras2::addEasyprint
.Here's a shiny app which tries all those methods: