diff --git a/app/dashboard.Rmd b/app/dashboard.Rmd index 7be1b4e..ca93845 100644 --- a/app/dashboard.Rmd +++ b/app/dashboard.Rmd @@ -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,23 +891,25 @@ 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, - popup = ~ name + 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, - popup = ~ name + weight = 1, + popup = ~name ) } })