Change selection from drop down

This commit is contained in:
2025-12-08 19:43:39 +01:00
parent 33a11ff9b7
commit 218567f28e

View File

@@ -131,9 +131,23 @@ server <- function(input, output, session){
updateSelectInput( updateSelectInput(
session, session,
inputId = "drp_stadtteil", inputId = "drp_stadtteil",
choices = sel_stadtteile, choices = sort(sel_stadtteile),
selected = sel_stadtteile[1] selected = selected_stadtteil,
) )
currently_selected_bezirk <<- sel_bezirk
currently_selected_stadtteil <<- selected_stadtteil
update_selection_text(output)
update_selection_table(output)
}
})
observeEvent(input$drp_stadtteil, {
sel_stadtteil <- input$drp_stadtteil
if (sel_stadtteil != "") {
currently_selected_stadtteil <<- sel_stadtteil
update_selection_text(output)
update_selection_table(output)
} }
}) })
@@ -162,7 +176,7 @@ server <- function(input, output, session){
rest_of_name <- get_map_layer_name(clicked_polygon_id) rest_of_name <- get_map_layer_name(clicked_polygon_id)
if (prefix == "bez_") { if (prefix == "bez_") {
currently_selected_bezirk <<- rest_of_name currently_selected_bezirk <<- rest_of_name
currently_selected_stadtteil <<- "Alle" currently_selected_stadtteil <<- paste("Bezirk", rest_of_name)
} }
if(prefix == "std_") { if(prefix == "std_") {
currently_selected_bezirk <<- get_bezirk_by_stadtteil(rest_of_name) currently_selected_bezirk <<- get_bezirk_by_stadtteil(rest_of_name)