Add line breaks to hover text with leaflet?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Add line breaks to hover text with leaflet?



I am trying to create a small box with hover text that has multiple lines and certain words bold. I try adding 'n' or '
' separator but it just ends up printing them as characters between my words. I also tried doing


cat(paste(area, status, num, sep = "n"))



but that just caused problems when I was trying implement it on my map.



I want my text to look like:


Area
**Status:** status
num



Right now this is what I have:


cd_full <- cd_full%>%
mutate(hover = paste(area, paste("Status:", status), num, sep = "n")

leaflet() %>%
addPolygons(data = subset(cd_full, color == "green"), opacity= 2, weight=2, color = "Green" , group = "Green",
label = ~hover, highlightOptions = list(bringToFront = TRUE)) %>%
addPolygons(data = subset(cd_full, color == "yellow" ), opacity=.5, weight=.4, color = "Yellow",
label = ~hover, group = "yellow")



but it all just ends up on the same line. Thanks









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS