This interactive web page was created with R Markdown and Leaflet on November 16, 2026. It shows four famous landmarks around the world, with popups, marker clustering, and a choice of map styles.
# Data frame of locations
locations <- data.frame(
name = c("Eiffel Tower", "Statue of Liberty", "Sydney Opera House", "Colosseum"),
lat = c(48.8584, 40.6892, -33.8568, 41.8902),
lng = c(2.2945, -74.0445, 151.2153, 12.4922),
popup = c(
"<b>Eiffel Tower</b><br>Paris, France",
"<b>Statue of Liberty</b><br>New York, USA",
"<b>Sydney Opera House</b><br>Sydney, Australia",
"<b>Colosseum</b><br>Rome, Italy"
)
)
# Interactive map
locations %>%
leaflet() %>%
addTiles(group = "OpenStreetMap") %>%
addProviderTiles(providers$CartoDB.Positron, group = "CartoDB Positron") %>%
addProviderTiles(providers$Esri.WorldImagery, group = "Satellite") %>%
addMarkers(
lng = ~lng, lat = ~lat,
popup = ~popup, label = ~name,
clusterOptions = markerClusterOptions()
) %>%
addLayersControl(
baseGroups = c("OpenStreetMap", "CartoDB Positron", "Satellite"),
options = layersControlOptions(collapsed = FALSE)
) %>%
addMiniMap(toggleDisplay = TRUE, tiles = providers$CartoDB.Positron)