Reputation: 293
I run a shiny app on our local server to map different geodata with leaflet. Some datasets I want to map are available as WMS and are loaded with
%>% addWMSTiles()
Other data are stored as SpatialPolygonDataFrame (SPDF) as .rda files locally and are plotted with
%>% addPolygons()
when the app is executed.
When running the app on my local laptop everything works fine - it takes rd. 15-20sec to build up the app, because I plot 18 different WMS and 5 different SPDF.
However, problems arise when I run the app on our server. After some time (during building up) the app suddenly turns grey.
I found out that the slow build up of the app is because of the local SPDF files. However, the local SPDF files have a size of max 1.5 MB.
I wonder if there is a better solution to plot polygons. Is there a recommended format for geo-polygons in shiny / leaflet?
Upvotes: 4
Views: 559
Reputation: 81
I had exactly the same problem. Running local, it works fine, running it on shiny-server, it greys out. See Using many markers with leaflet for my description. Apperantly there is a limit on the nr of polygons that leaflet can handle which is different when using shiny-server. There appears to be no real solution to this execept plotting less polygons. For example by using markerclusters.
Upvotes: 2