Create a leaflet map object.
library(leaflet)
## Warning: package 'leaflet' was built under R version 4.0.3
map <- leaflet() %>% addTiles()
Create a marker with a picture of Camp Nou and a link to Barcaโs Homepage
BarcaIcon <- makeIcon(
iconUrl = "https://www.fcbarcelona.com/fcbarcelona/photo/2018/06/07/fde8dc92-66b3-48f3-9996-22008151b267/DanHlskWsAADKM0.jpg",
iconWidth = 30*408/255, iconHeight = 30,
iconAnchorX = 30*408/255/2, iconAnchorY = 30/2
)
Add the marker to the map and display the map.
Barca <- c("<a href= 'https://www.fcbarcelona.com/en/club/facilities/camp-nou' >Camp Nou<br><img src='https://www.fcbarcelona.com/fcbarcelona/photo/2018/06/07/fde8dc92-66b3-48f3-9996-22008151b267/DanHlskWsAADKM0.jpg' width='210' height='132' alt='Foto Corps de Logis' title='Foto Corps de Logi'></a>")
map %>%
addTiles() %>%
addMarkers(lat=41.3809, lng=2.1228, popup = Barca)