Want to display a picture using leaflet package

Hello Users,

I'd like to display a picture (.png) using R with leaflet package. I used the popup argument but the picture does'nt show.

Here's my code :

library(leaflet)
library(magrittr)

leaflet() %>%
  addTiles() %>%
  addCircleMarkers(
    lng         = 15.4521,
    lat         = -4.5637,
    color       = "blue",
    radius      = 10,
    fill        = TRUE,
    popup       = paste("<img src='avatar.png'/>")
  )

There is a good explanation here:

1 Like