The goal of this assignment is to create a web page using R Markdown that features a map created with Leaflet. The webpage should be hosted on either Github Pages, RPubs, or NeoCities. The webpage must also contain the date when the document was created.
library(leaflet)
map <- leaflet() %>% addTiles()
Create a marker with a picture of Taj Mahal and a link to its homepage
TajMahalIcon<-makeIcon(
iconUrl="https://www.tajmahal.org.uk/gifs/taj-mahal.jpeg",
iconWidth = 30*408/255, iconHeight = 30,
iconAnchorX = 30*408/255/2, iconAnchorY = 30/2
)
Add the marker to the map and display the map.
TajMahalPopup <- c("<a href= 'https://www.tajmahal.org.uk/' >Taj Mahal<br><img src='https://www.tajmahal.org.uk/gifs/taj-mahal.jpeg width='210' height='132' title='TajMahal'></a>")
#map %>%
leaflet() %>%
addTiles() %>%
addMarkers(lat=27.173253, lng=78.042111, popup = TajMahalPopup)