mirror of
https://github.com/dylanbenzi/hurricane_normalization_app.git
synced 2026-07-30 05:08:57 +00:00
modify growth map name and layer rendering
This commit is contained in:
+12
-8
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user