@@ -280,24 +280,37 @@ function(input, output, session) {
280
280
rvs $ map_rehab
281
281
})
282
282
283
- observeEvent(list (input $ rehab_layer_selection , input $ rehab_towns_checkbox ), {
283
+ observeEvent(list (input $ rehab_layer_selection , input $ rehab_markers_checkbox ), {
284
284
rehab_base_groups <- c(" None" , names(rehab_tiers ))
285
285
rehab_towns_groups <- paste0(" towns_" , rehab_base_groups )
286
+ rehab_centre_groups <- paste0(" centres_" , names(rehab_tiers ))
286
287
287
288
hide_base_groups <- rehab_base_groups [rehab_base_groups != input $ rehab_layer_selection ]
288
289
show_base_group <- input $ rehab_layer_selection
289
290
290
291
hide_centre_groups <- paste0(" centres_" , hide_base_groups )
291
292
show_centre_group <- paste0(" centres_" , show_base_group )
292
293
293
- if (is.null( input $ rehab_towns_checkbox ) ) {
294
+ if (! " Towns " %in% input $ rehab_markers_checkbox ) {
294
295
show_towns_group <- c()
295
296
hide_towns_groups <- rehab_towns_groups
296
297
} else {
297
298
show_towns_group <- rehab_towns_groups [which(rehab_base_groups == show_base_group )]
298
299
hide_towns_groups <- rehab_towns_groups [rehab_towns_groups != show_towns_group ]
299
300
}
300
301
302
+ if (! " Centres" %in% input $ rehab_markers_checkbox ) {
303
+ show_centre_group <- c()
304
+ hide_centre_groups <- rehab_centre_groups
305
+ } else {
306
+ if (show_base_group == " None" ) {
307
+ show_centre_group <- c()
308
+ } else {
309
+ show_centre_group <- rehab_centre_groups [which(names(rehab_tiers ) == show_base_group )]
310
+ }
311
+ hide_centre_groups <- rehab_centre_groups [! rehab_centre_groups %in% show_centre_group ]
312
+ }
313
+
301
314
show_ids <- c(show_base_group , show_centre_group , show_towns_group )
302
315
hide_ids <- c(hide_base_groups , hide_centre_groups , hide_towns_groups )
303
316
0 commit comments