You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using popupGraph to include popups in a Leaflet object by passing a list of other Leaflet objects to generate an HTML file. Below is a reproducible example.
Everything works perfectly in my local R environment, but when I open the HTML file in a browser, it cannot find the Leaflet objects stored in the temporary folder. See https://emods.es/leafpop_problem.html
Do you have any suggestions on how I can embed the Leaflet objects as popups so that they are included in the final HTML output?
title: "leafpop"
author: ""
output: html_document
library(leaflet)
library(leafpop)
library(dplyr)
cities <- data.frame(
city = c("Sevilla", "Cartagena", "Valencia"),
lat = c(37.389092, 37.625683, 39.469907),
lon = c(-5.984459, -1.001400, -0.376288)
)
mymap <- list()
for (i in 1:3){
mymap[[i]] <- leaflet() %>%
addTiles() %>%
setView(lng = cities[i,3], lat = cities[i,2], zoom = 16)
}
leaflet() %>%
addTiles() %>%
addMarkers(data=cities,~lon ,~lat,
popup = ~popupGraph(mymap))
The text was updated successfully, but these errors were encountered:
Thanks, this has been on my plate for a long time. For technical reasons from the htmlwidgets package, the way this is currently implemented means the popup htmls are saved to a location one level above where the map html is saved. If you keep this structure wherever you want to host this map, the popups should work as expected.
I have been meaning to provide a proper method that will embed the popups in the map html, but haven't found much time (and frankly forgot about it). I hope to get this working soon, as I already have a scaffold for it
I think I have the same issue trying to use popups from leafpop inside a Shiny app? The output is an html and the popup images are not rendered, even though they are when creating the leaflet map outside the Shiny function.
I am using popupGraph to include popups in a Leaflet object by passing a list of other Leaflet objects to generate an HTML file. Below is a reproducible example.
Everything works perfectly in my local R environment, but when I open the HTML file in a browser, it cannot find the Leaflet objects stored in the temporary folder. See https://emods.es/leafpop_problem.html
Do you have any suggestions on how I can embed the Leaflet objects as popups so that they are included in the final HTML output?
title: "leafpop"
author: ""
output: html_document
The text was updated successfully, but these errors were encountered: