Closed PK0207 closed 2 years ago
You'll want to check out Inputs/Events in Leaflet for R - Using Leaflet with Shiny, eg input$map1_shape_click
and capture with observe, eg for superzip-example (code):
# When map is clicked, show a popup with city info
observe({
leafletProxy("map") %>% clearPopups()
event <- input$map_shape_click
if (is.null(event))
return()
isolate({
showZipcodePopup(event$id, event$lat, event$lng)
})
})
Hey @bbest ! Leaflet currently records station line and number and is able to display it on a pop-up window when clicked. We would like to record them as inputs. We currently use a dropdown menu to select line ID which is slow and unintuitive.