modify growth map name and layer rendering

This commit is contained in:
2025-12-26 19:14:13 -05:00
parent 4ca728714a
commit 2fd4cf305b
+12 -8
View File
@@ -852,21 +852,23 @@ output$growth_map <- renderLeaflet({
map <- map %>%
addPolygons(
data = growth_county_year,
group = "counties",
fillColor = "red",
color = "red",
fillOpacity = ~population_opacity,
weight = 2,
popup = ~paste(name)
weight = 1,
popup = ~name
)
} else {
map <- map %>%
addPolygons(
data = growth_county_year,
group = "counties",
fillColor = "blue",
color = "blue",
fillOpacity = ~housing_opacity,
weight = 2,
popup = ~paste(name)
weight = 1,
popup = ~name
)
}
@@ -889,22 +891,24 @@ observe({
if (input$growth_map_metric == "Population") {
leafletProxy("growth_map", data = growth_county_year) %>%
clearShapes() %>%
clearGroup("counties") %>%
addPolygons(
group = "counties",
fillColor = "red",
color = "red",
fillOpacity = ~population_opacity,
weight = 2,
weight = 1,
popup = ~name
)
} else {
leafletProxy("growth_map", data = growth_county_year) %>%
clearShapes() %>%
clearGroup("counties") %>%
addPolygons(
group = "counties",
fillColor = "blue",
color = "blue",
fillOpacity = ~housing_opacity,
weight = 2,
weight = 1,
popup = ~name
)
}