Color gradient is not showing when mapshot

I created customized legend and it is not showing when I save/mapshot... Please advise

library(leaflet)
library(tidyverse)

html_legend <- "
<div style='display: flex;align-items:center;'>
<span style='padding-right:5px;font-weight:bold;'>0</span>
<grad style='height:10px;width:80px;background:linear-gradient(90deg, #DF0020, #FFE500);'> </grad>
<span style='padding-left:5px;font-weight:bold;'>100</span>
</div>
"
leaflet(options = leafletOptions(minZoom = 0, maxZoom = 18, 
                                      attributionControl=FALSE)) %>% 
  addTiles() %>% 
  addMarkers(lng=174.768, lat=-36.852, popup = "The birthplace of R") %>% 
  addControl(html = html_legend, position = "bottomleft") %>% 
  mapview::mapshot(file = "x.png", remove_controls = NULL)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.