Select polygon by clicking on map, changing item selected via dropdown

Yes, there is. But if I was doing it I would be using {leaflet} directly.

It allows to include a layerId field in your polygons object; value of which will be returned in event$Id of the input$map_shape_click event.

For a working example - it sort of mixes clicks on polygon and points, but these have separate handlers - map_shape_click for polygon and map_marker_click for marker, and so can be easily separated - consider this linked answer Shiny: Using multiple exclusive reactiveValues for filtering dataset

1 Like