Closed yonicd closed 3 years ago
Thanks, I missed that one. I updated README to add a link. I've made this for a specific need in my work, and put it here for convenience.
Victor
PS: I had trouble to capture leaflet maps with polygons with html2canvas, will look at your examples
you had a problem in snapper w leaflets?
Yeah, tried with html2canvas
directly, but same issue with {snapper}, try this:
world <- rnaturalearth::ne_countries()
library(shiny)
library(leaflet)
shiny::runGadget(
fluidPage(
leafletOutput('myMap'),
snapper::load_snapper(),
snapper::preview_button(
ui = '#myMap',
opts = snapper::config(
allowTaint = TRUE,
useCORS = TRUE)
),
snapper::snapper_div()
),
server = function(input, output) {
map = leaflet(world) %>%
addTiles() %>%
addPolygons()
output$myMap = renderLeaflet(map)
},
viewer = shiny::browserViewer()
)
PS: seems to be a thing of the moment: https://github.com/daattali/shinyscreenshot
Can you open it as an issue in snapper so i can track it in the repo. Thanks
Thanks, solved. Closing this.
Very nice, seems to duplicate what snapper does.