2

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?

user3498115
  • 55
  • 1
  • 8
  • This [solution](https://stackoverflow.com/questions/47064921/leaflet-legend-for-addawesomemarkers-function-with-icons) may help. I tried it out and it works. – Juliana Gómez Mar 04 '20 at 15:40

0 Answers0