Leaflet polygons change style upon choosing location from a Shiny dropdown menu

心不动则不痛 提交于 2019-12-06 15:57:12

Figured it out! In my observeEvent, I defined my selected polygon by the click$id rather than the input$location, which is why it didn't react to my drop-down menu selection. So instead of:

 #define click point as corresponding polygon
      selected <- countries[countries@data$sovereignt == click$id,]

I needed to use:

 #define dropdown selection as corresponding polygon
      selected <- countries[countries@data$sovereignt == input$location,]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!