# \donttest{
geoJson <- readr::read_file(
"https://rawgit.com/benbalter/dc-maps/master/maps/ward-2012.geojson"
)
leaflet() %>%
addTiles() %>%
setView(-77.0369, 38.9072, 11) %>%
addBootstrapDependency() %>%
enableMeasurePath() %>%
addGeoJSONChoropleth(
geoJson,
valueProperty = "AREASQMI",
scale = c("white", "red"),
mode = "q",
steps = 4,
padding = c(0.2, 0),
labelProperty = "NAME",
popupProperty = propstoHTMLTable(
props = c("NAME", "AREASQMI", "REP_NAME", "WEB_URL", "REP_PHONE", "REP_EMAIL", "REP_OFFICE"),
table.attrs = list(class = "table table-striped table-bordered"),
drop.na = TRUE
),
color = "#ffffff", weight = 1, fillOpacity = 0.7,
highlightOptions = highlightOptions(
weight = 2, color = "#000000",
fillOpacity = 1, opacity = 1,
bringToFront = TRUE, sendToBack = TRUE
),
pathOptions = pathOptions(
showMeasurements = TRUE,
measurementOptions = measurePathOptions(imperial = TRUE)
)
)
# }
Run the code above in your browser using DataLab