Thanks to Code for America for sharing the GeoJSON on their Github page.
library(leaflet)
library(magrittr)
stoon <- geojsonio::geojson_read("https://raw.githubusercontent.com/codeforamerica/click_that_hood/master/public/data/saskatoon.geojson",
what = "sp")
labels <- sprintf("<strong>%s</strong>",
stoon$name) %>%
lapply(htmltools::HTML)
stoon %>%
leaflet %>%
addTiles %>%
addPolygons(
fillColor = 'blue',
weight = 2,
opacity = 1,
color = "white",
dashArray = "3",
fillOpacity = 0.7,
highlight = highlightOptions(
weight = 5,
color = "#666",
dashArray = "",
fillOpacity = 0.7,
bringToFront = TRUE),
label = labels,
labelOptions = labelOptions(
style = list("font-weight" = "normal", padding = "3px 8px"),
textsize = "15px",
direction = "auto"))
montreal <- geojsonio::geojson_read("https://raw.githubusercontent.com/codeforamerica/click_that_hood/master/public/data/montreal.geojson",
what = "sp")
labels <- sprintf("<strong>%s</strong>",
montreal$name) %>%
lapply(htmltools::HTML)
montreal %>%
leaflet %>%
addTiles %>%
addPolygons(
fillColor = 'blue',
weight = 2,
opacity = 1,
color = "white",
dashArray = "3",
fillOpacity = 0.7,
highlight = highlightOptions(
weight = 5,
color = "#666",
dashArray = "",
fillOpacity = 0.7,
bringToFront = TRUE),
label = labels,
labelOptions = labelOptions(
style = list("font-weight" = "normal", padding = "3px 8px"),
textsize = "15px",
direction = "auto"))