'Background tiles are not loaded in saved interactive html maps from leaflet in R
I am creating interactive html maps with leaflet in R and save them as html files with SaveWidget.
It worked fine for months but now the background open street map tiles are no longer shown in the web browser but are still shown in the Viewer panel in Rstudio.
See code example below which produces grey maps in all of my browsers (and on colleagues' computers) but works in the Viewer of Rstudio. It appears that the backourgn tiels from OSM are not loaded in the browser.
What happened and how to fix it?
library(maps)
library(mapview)
library(leaflegend)
library(htmlwidgets)
m <- leaflet() %>% setView(lng = -71.0589, lat = 42.3601, zoom = 12)
m %>% addTiles()
saveWidget(m, "my_map.html", selfcontained = FALSE)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
