Quantcast
Channel: R Shiny: Updating Multiple Dependent Dropdown Menus with Leaflet Map Click - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by YBS for R Shiny: Updating Multiple Dependent Dropdown Menus with Leaflet Map Click

$
0
0

Try this

  # WORKING CORRECTLY: Clicking city on map should update country and city selected   observeEvent(input$map_marker_click, {    if(!is.null(input$map_marker_click)){      updateSelectizeInput(        session, "countrySelected",         selected = cities$country[(cities$lat==input$map_marker_click$lat)&(cities$long==input$map_marker_click$lng)])    }    }, ignoreInit = TRUE)  observe({    if(!is.null(input$map_marker_click)){      req(input$countrySelected)      updateSelectizeInput(        session, "citySelected",         selected = cities$city[(cities$lat==input$map_marker_click$lat)&(cities$long==input$map_marker_click$lng)])    }  })

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>