Overview

The goal of this assignment is to create an interactive map using Leaflet and R markdown. This map features Maryland State Parks located within Baltimore County. The list of parks are obtained from Maryland Manual Online.

Map of Maryland State Park in Baltimore County

Click on the park icon to see the name of park.

Apendix: R Code

library(leaflet)
##Create a dataframe with park names and coordinates.
BalCoPark <- data.frame(
        park = c("Gunpowder Falls State Park", "Hart-Miller Island State park", "North Point State Battlefield", "North Point State Park", "Patapsco Valley State Park", "Soldiers Delight Natural Environment Area", "Torrey C. Brown Rail Trail"),
        lat = c(39.4625375233694, 39.24857330192922, 39.27908017299375, 39.22765823641033, 39.296030152545, 39.41032294723882, 39.6238280455605),
        lng = c(-76.38901334024011, -76.36096846872375, -76.4862545193073, -76.42154204133068, -76.7908278173083, -76.83889921730285, -76.63101799074371)
)

##Create Icon with State Park Logo
ParkLogo <- "https://dnr.maryland.gov/publiclands/PublishingImages/mcc-park-logo.png"
ParkIcon <- makeIcon(
        iconUrl = ParkLogo,
        iconWidth = 30, iconHeight = 30,
        iconAnchorX = 15, iconAnchorY = 15
)

##Create Map Using leaflet
BalCoPark %>%
        leaflet() %>%
        addTiles() %>%
        addMarkers(icon=ParkIcon, popup=BalCoPark$park)