在 R 传单包中添加空白图例?
adding blank legend in R leaflet package?
有没有什么方法可以使用 R 传单包向传单地图添加仅带有标题的 'blank' 图例?我希望使用空白图例来模仿地图标题。
您可以使用 addControl()
参数添加图例并传递 html 段落 tags$p
即一串文本(此处为粗体,tags$b
)
library(leaflet)
library(htmltools)
my_title <- tags$p(tags$style("p {color: red; font-size:22px}"),
tags$b("My_beautiful_title_goes here"))
my_map <- leaflet() %>%
addTiles() %>%
setView(10.533, 45.822, zoom = 11) %>%
addControl(my_title, position = "bottomright" )
my_map
有没有什么方法可以使用 R 传单包向传单地图添加仅带有标题的 'blank' 图例?我希望使用空白图例来模仿地图标题。
您可以使用 addControl()
参数添加图例并传递 html 段落 tags$p
即一串文本(此处为粗体,tags$b
)
library(leaflet)
library(htmltools)
my_title <- tags$p(tags$style("p {color: red; font-size:22px}"),
tags$b("My_beautiful_title_goes here"))
my_map <- leaflet() %>%
addTiles() %>%
setView(10.533, 45.822, zoom = 11) %>%
addControl(my_title, position = "bottomright" )
my_map