Week 2 Developer Data product exercise

library(leaflet)
library(here)

Map the Boston Area

my_map <- leaflet() %>% 
  addTiles() %>% 
  setView(lng=-71.0589, lat=42.3601 , zoom=12)
my_map

Load MBTA stops data

mbta_stops=here::here("MBTA_GTFS", "stops.txt")
stops = read.csv(mbta_stops)
sample_data <- stops[c(1:500),]

Populate data and add name and City as metadata for user

library(leaflet)
my_map <- leaflet(data = sample_data) %>%
  addTiles() %>%
  addMarkers(lng = sample_data$stop_lon,
             lat = sample_data$stop_lat,
             popup = paste("Name", sample_data$stop_name, "<br>",
                           "City:", sample_data$municipality))

my_map