-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
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))
Metadata
Metadata
Assignees
Labels
No labels