Reputation: 1080
the leaflet for R manual states, that labels can be simple text as well as html text. However, if I try to add html to a label, it is not formatted as such:
leaflet(data=tibble(latitude=41.3828939, longitude=2.1774322, label="<b>TEXT</b>")) %>%
addTiles() %>%
addMarkers(label=~label)
Any advice is appreciated. Thanks.
Upvotes: 1
Views: 338
Reputation: 9485
You can try something like this:
library(leaflet)
library(tibble)
library(htmltools)
leaflet(data=tibble(latitude = 41.3828939,
longitude= 2.1774322,
label = HTML("<b>TEXT<br> text</b>"))) %>%
addTiles() %>%
addMarkers(label=~label)
Upvotes: 2