Closed leungi closed 3 years ago
I am currently working on a solution (addPopupIframes
/addPopupWidgets
) that should make this possible. I hope to have this working soon.
So, after ages (sorry!) here's a solution that works. Some things to note:
addPopupIframes
needs a file or url be passed to source
selfcontained = FALSE
(otherwise bg tiles of popup map don't show)Still an unexported function, as I am still not happy with the general implementation.
library(leaflet)
library(leafpop)
library(sp)
pop_map = leaflet() %>%
addProviderTiles(
"Esri.WorldImagery"
) %>%
addMarkers(
data = breweries91[1, ]
, popup = popupTable(breweries91[1, ])
)
fl = tempfile(fileext = ".html")
htmlwidgets::saveWidget(
pop_map
, file = fl
)
pop_nested = leaflet() %>%
addTiles(group = "OSM") %>%
addCircleMarkers(
data = breweries91[1, ]
, group = "brew1"
) %>%
leafpop:::addPopupIframes(
source = fl
, group = "brew1"
)
htmlwidgets::saveWidget(
pop_nested
, '/home/timpanse/Downloads/pop_nested.html'
, selfcontained = FALSE
)
Closing this. If there are other requests like this one, please open a new issue.
No worries; thanks for the update 🙏
Tested it and looks promising; we have a solution for now 🙌
This is taken from the package example.
The resulting
html
doesn't load the content inpopupGraph()
. Is there a way to embed, say, via anembed
argument inpopupGraph()
.