I need to add some custom marker legends to my leaflet map. So far, the closest solution I found is this. According to the solution in the link, I need to use the addControl()
function.
First I have to link the custom images in html format. See below:
html_legend <- "<img src='http://leafletjs.com/docs/images/leaf-green.png'
style='width:10px;height:10px;'>green<br/>
<img src='http://leafletjs.com/docs/images/leaf-red.png'
style='width:10px;height:10px;'>red"
I then use the html_legend
as an argument to the addControl()
function:
addMarkers(...)%>%
addControl(html = html_legend, position = "bottomleft")
How can I get the same outcome when using Awesome Icons?