R: Add title to sheet map

I would like to add a title to the entire map (different from the name of the legend: addLegend (..., title = ", ...): called" title ", I mean the overlay component of the map, which (unlike the overlay image ) . what the name of the card would look like

Is this an option in the RStudio leaflet for R?

leafletR has an argument title = "", but it updates the title of the webpage: it does not add the title to the map.

+4
source share
1 answer

You must provide a reproducible example. But using addControl, you can try:

 library(leaflet)
 library(htmlwidgets)
 library(htmltools)

 rr <- tags$div(
   HTML('<a href="https://cran.r-project.org/"> <img border="0" alt="ImageTitle" src="/PathToImage/ImageR.jpeg" width="300" height="100"> </a>')
 )  

 map_leaflet <- leaflet() %>%
   addTiles() %>%
   addMarkers(50, 50) %>%
   addControl(rr, position = "bottomleft")

 saveWidget(map_leaflet, file="testing.html")

test.html, , ( ) . , . , !

+4

Source: https://habr.com/ru/post/1694360/


All Articles