I am working on a leaflet heatmap in R. Everything works fine (see image 1), but when I publish it on RPubs, the color gradient of the density function is replaced by a black "cloudy" gradient (see image 2).
I know that this was an issue in other posts, but non of the solutions worked for me (its not the blur, its not different java versions, its not the palette etc). So I am very happy for tipps and tricks how to get that fixed.
Thanks a lot.
This is the simple code I am running (for a better understanding)...
leaflet() %>%
addProviderTiles(providers$Stamen.TerrainBackground, group = "Terrain Background") %>% #etc.
#set bounding box as specified before (look above)
setView(lng = mean.long, lat = mean.lat, zoom = 8) %>%
#add heatmap
addHeatmap(data = wamos.pt, group="Heatmap", lng = ~long, lat = ~lat,
blur = 25, max = 0.25, radius = 19,
gradient = brewer_rev) %>%
#add Polygon (border)
addPolygons(data=CHmap.0, group="Switzerland", color = "black", weight = 4, smoothFactor = 1, opacity = 0.50,
fillOpacity = 0.0, fillColor = NA)
Followed by the results in R an RPubs: enter image description here enter image description here
Greetings, Boris