I am building a leaflet map within R Studio and I want to place an information icon on the top-left of the map as an easyButton which allows users to click and popup some text information with some hyperlinks. The example text I would like to show is something like this:
Title of paragraph 1
Information about this particular feature.
Title of paragraph 2
Information about a different feature. Here is a link to more info.
Below is a reproducible example of what I have got so far. At present, I have an 'alert' but a simple popup would be preferred, though I have limited knowledge of JavaScript so any help would be greatly appreciated.
library(leaflet)
leaf = leaflet() %>%
addTiles() %>%
addEasyButton(easyButton(
icon = htmltools::span(class = "star", htmltools::HTML("★")),
onClick = JS("function(btn, map){ map.setZoom(1);}")))
leaf %>% addEasyButton(easyButton(
icon = "fa-info-circle", title = "Map Information",
onClick = JS("function(btn, map){ alert('Note: this feature is still in development') }")))