Create a web page using R Markdown that features a map created with Leaflet.
Host your webpage on either GitHub Pages, RPubs, or NeoCities.
Your webpage must contain the date that you created the document, and it must contain a map created with Leaflet. We would love to see you show off your creativity!
Creating a leaflet map object.
library(leaflet)
## Warning: package 'leaflet' was built under R version 4.3.2
map <- leaflet() %>% addTiles()
Create a marker with a picture of Burger King.
bk <- makeIcon(
iconUrl = "https://img.icons8.com/?size=256&id=-_I447X-nNdy&format=png",
iconWidth = 30*408/255, iconHeight = 30,
iconAnchorX = 30*408/255/2, iconAnchorY = 30/2
)
Add the marker to the map and display the map.
map %>%
addTiles() %>%
addMarkers(lat = 28.633222283482553, lng = 77.22116133207751, popup = "Burger King (My Spot)", icon = bk)