Reputation: 574
Is there a way to add the file name on top or bottom of the image displayed by leafpop::addPopupImages()?
I am almost there with:
library(sf)
library(leaflet)
library(leafpop)
pnt = st_as_sf(data.frame(x = 174.764474, y = -36.877245),
coords = c("x", "y"), crs = 4326)
img = system.file("img","Rlogo.png",package="png")
leaflet() %>%
addTiles() %>%
addCircleMarkers(data = pnt, group = "pnt",popup="Rlogo.png") %>%
addPopupImages(img, group = "pnt", tooltip=TRUE)
But the name is on the left margin, which is inconvenient as the files have long names.
Upvotes: 0
Views: 27