Skip to content
Permalink
Browse files
Fixed shading for leafletproxy
  • Loading branch information
lius21 committed Aug 1, 2022
1 parent e068819 commit fce73fe39211954b9e46ef8234c76612c471189e
Showing 1 changed file with 6 additions and 4 deletions.
10 app.R
@@ -730,14 +730,15 @@ server <- function(input, output, session) {
observeEvent(c(input$state, input$district, input$distance), {
leafletProxy('reservoir_map', session) %>%
# Clear substations and range circle upon update
clearGroup(group = list('substations', 'range')) %>%
clearGroup(group = list('substations', 'range', 'census_tract')) %>%
# Census tract shading within the selected congressional district
addPolygons(
data = current_district(),
fillColor = ~dist_pal()(Lowmod_pct), # color of census tract shading
color = 'black', # color of census tract borders
fillOpacity = 0.75, # opacity of shading
weight = 0.75 # width of census tract border
fillOpacity = 0.7, # opacity of shading
weight = 0.75, # width of census tract border
group = 'census_tract'
) %>%
# Substation range circle
addCircles(
@@ -755,7 +756,8 @@ server <- function(input, output, session) {
data = cd_data(),
weight = 2,
fillOpacity = 0,
color = 'green'
color = 'green',
group = 'outline'
) %>%
# Reservoirs
addCircleMarkers(

0 comments on commit fce73fe

Please sign in to comment.