The goal of the project is to create a web page using R Markdown that features a map created with Leaflet, and to host the resulting web page on either GitHub Pages, RPubs, or NeoCities.
library(leaflet)
map <- leaflet() %>% addTiles()
Create marker
GGBIcon <- makeIcon(
iconUrl = "https://www.history.com/.image/ar_16:9%2Cc_fill%2Ccs_srgb%2Cfl_progressive%2Cg_faces:center%2Cq_auto:good%2Cw_768/MTY1MTc3MjE0MzExMDgxNTQ1/topic-golden-gate-bridge-gettyimages-177770941.jpg",
iconWidth = 30*408/255, iconHeight = 40,
iconAnchorX = 30*408/255/2, iconAnchorY = 30/2
)
Add the marker to the map and display the map.
GGBPopup <- c("<a href= 'https://www.goldengate.org/' >Golden Gate Bridge <br><img src='https://www.history.com/.image/ar_16:9%2Cc_fill%2Ccs_srgb%2Cfl_progressive%2Cg_faces:center%2Cq_auto:good%2Cw_768/MTY1MTc3MjE0MzExMDgxNTQ1/topic-golden-gate-bridge-gettyimages-177770941.jpg' width='210' height='132' alt='Golden Gate Bridge' title='Golden Gate Bridge'></a>")
map %>%
addTiles() %>%
addMarkers(lat=37.8199, lng=-122.4783, popup = GGBPopup)