First Layer:
leaflet() %>%
addTiles() %>%
setView(lng = -87.6298, lat = 41.87811, zoom = 11)
chi_sf <- st_read("Park_Tax_Districts/Park_Tax_Districts.shp")
chi_sf$AGENCY <- cut(chi_sf$AGENCY, breaks = 3)
pal <- colorFactor("plasma", levels = levels(chi_sf$AGENCY))
chi_sf_tr <- st_transform(chi_sf, crs = '+proj=longlat +datum=WGS84')
Second Layer:
leaflet() %>%
addTiles() %>%
enableMeasurePath() %>%
setView(lng = -87.6298, lat = 41.87811, zoom = 9.5) %>%
addPolygons(data = chi_sf_tr, color = pal(chi_sf_tr$AGENCY), stroke = 1, opacity = 0.8) %>%
addMeasurePathToolbar(options = measurePathOptions(imperial = FALSE,
minPixelDistance = 100,
showDistances = TRUE,
showOnHover = TRUE)) %>%
addControl(html = "<h1>Chicago Park Tax Districts</h1>", position = "topleft")
References:
- Cook County GIS. June 21st, 2019. “Park Tax Districts (2018) within
Cook County”. ShapeFile. Retrieved from Cook
County GIS.