Create a leaflet map object.
library(leaflet)
## Warning: package 'leaflet' was built under R version 4.0.2
map <- leaflet() %>% addTiles()
Create a marker with a picture of IIT Delhi Main Building and a link to its homepage.
IITDIcon <- makeIcon(
iconUrl = "http://chemistry.iitd.ac.in/images/IITD-mainbuilding.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.
IITDPopup <- c("<a href= 'http://www.iitd.ac.in/' >IIT Delhi Main Building<br><img src='http://chemistry.iitd.ac.in/images/IITD-mainbuilding.jpg' width='210' height='132' alt='Foto Corps de Logis' title='Foto Corps de Logi'></a>")
map %>%
addTiles() %>%
addMarkers(lat=28.543680, lng=77.198692, popup = IITDPopup)