made markers larger in dynamic map

This commit is contained in:
Ben Varick 2024-04-06 21:22:01 -05:00
parent 0c5bd3444a
commit 6fdfaf6b4e
Signed by: ben
SSH Key Fingerprint: SHA256:jWnpFDAcacYM5aPFpYRqlsamlDyKNpSj3jj+k4ojtUo
2 changed files with 23 additions and 23 deletions

File diff suppressed because one or more lines are too long

View File

@ -177,8 +177,8 @@ tag.map.subtitle <- tags$style(HTML("
wisconsin_crash_map <-
leaflet(options = leafletOptions(preferCanvas = TRUE)) %>%
# addControl(title, position = "topleft", className="map-title") %>%
# addControl(subtitle, position = "bottomleft", className="map-subtitle") %>%
# addControl(title, position = "topleft", className="map-title") %>%
# addControl(subtitle, position = "bottomleft", className="map-subtitle") %>%
addProviderTiles(providers$Stadia.AlidadeSmooth) %>%
addMarkers(data = WI_schools,
lng=WI_schools$LON,
@ -187,12 +187,11 @@ wisconsin_crash_map <-
WI_schools$DISTRICT, " School District</br>",
WI_schools$SCHOOLTYPE), htmltools::HTML),
group = "Schools") %>%
groupOptions(group = "Schools", zoomLevels = 13:20) %>%
addCircleMarkers(data = Pedestrian_Crash_Data,
lng=Pedestrian_Crash_Data$longitude,
lat=Pedestrian_Crash_Data$latitude,
fillColor=injury_severity_pal(Pedestrian_Crash_Data$PedestrianInjurySeverity),
radius=3,
radius=4,
stroke=TRUE,
color = "black",
weight = 1,
@ -202,7 +201,6 @@ wisconsin_crash_map <-
"pedestrian age: ", Pedestrian_Crash_Data$PedestrianAge), htmltools::HTML),
group = "Crash Points") %>%
addLegend(position = "bottomleft", labels = injury_severity$InjSevName, colors = injury_severity$color, group = "Crash Points", title = "Injury Severity") %>%
groupOptions(group = "Crash Points", zoomLevels = 10:20) %>%
addCircleMarkers(data = County_Crash_geom,
lng=County_Crash_geom$longitude,
lat=County_Crash_geom$latitude,
@ -225,6 +223,8 @@ wisconsin_crash_map <-
group = "Counties") %>%
addLegend(position = "bottomleft", pal = county_pal, values = County_Crash_geom$CrashesPerPopulation, group = "Counties", title = "Circle size = county population<br><br>Color = Crashes/year</br>(normalized per 100k residents)") %>%
# addLegendSize(position = "bottomright", color = "black", shape = "circle", values = County_Crash_geom$value, group = "Counties", title = "Total crashes") %>%
groupOptions(group = "Schools", zoomLevels = 13:20) %>%
groupOptions(group = "Crash Points", zoomLevels = 10:20) %>%
groupOptions(group ="Counties", zoomLevels = 1:9)
saveWidget(wisconsin_crash_map, file = "figures/dynamic_crash_maps/wisconsin_crash_map.html", selfcontained = TRUE)