The following is a map showing some of my favorite places for great views after a fun hike.
library(leaflet)
##Create an icon (binoculars)
binocularicon <- makeIcon(
iconUrl = "https://image.flaticon.com/icons/png/512/410/410664.png",
iconWidth = 40, iconHeight = 40,
iconAnchorX = 0, iconAnchorY = 0,
)
## Create Coordinates and Labels
hikingviews = data.frame(
lat = c(36.102419, 35.655263, 36.663230, 36.272670, 36.101798),
lng = c(-81.821796, -83.437442, -83.449088, -82.336139, -82.083851),
labels = c("McRae Peak", "Mt. Leconte", "White Rock", "Buffalo Mtn.", "Grassy Bald")
)
## Put it all together as a leaflet map
m = leaflet(hikingviews) %>%
addTiles() %>%
addMarkers(popup = ~labels, icon = binocularicon)
## Assuming "lng" and "lat" are longitude and latitude, respectively
## Display the map
m