Leaflet/shiny: cannot draw reactive polygons

和自甴很熟 提交于 2019-12-05 21:33:49

fix:

firstly i changed;

pols <- eventReactive(input$countryInput,{cont[substr(cont@data$code,1,1)==substr(input$countryInput,1,1),]})

to;

pols <- reactive({cont.sim[substr(cont.sim@data$gssCode,1,1)==substr(input$countryInput,1,1),]

and the 'addPolygons line was missing the open/close brackets after the variable name 'pols'

addPolygons(data = pols)

becomes

addPolygons(data = pols())
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!