0

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

Boombardeiro
  • 105
  • 8
  • sorry, the bounding box was created in lines not displayed here but used in the "setView" argument and the "enter image description" tags were not properly named. first one is the one it looks inside in RStudio, second one is how it looks on RPubs. – Boombardeiro Jan 31 '20 at 10:58

1 Answers1

0

After some time I found the "problem" and I will post it here for anybody with similar issues. It was the browser. I used "Brave" browser and get the result as described above, but when I use Safari or Chrome, the issue is gone. As simple as the solution (i assume that my Brave browser is lacking of some installations), as annoying it was. Hope I could help anybody.

Boombardeiro
  • 105
  • 8