I have a an app that displays a Leaflet map. On my local machine it works perfectly. When I try to publish it to my
shinyapps.io server it publishes successfully. But in the browser it does not display the map and shows the following error in red:
path[1]="/Library/Frameworks/R.framework/Versions/3.3/Resources/library/leaflet/htmlwidgets/lib/leaflet-providers":
No such file or directoryThe error message actually appears in red in my browser (and not in any field that I set up). I upgraded R to 3.3, upgraded RStudio, and reinstalled packages (including leaflet). But I still get this error.
I took the basic Leaflet example and I can run and publish that on
shinyapps.io with no problem..
The provider code that does the map tiles in Leaflet is:
addProviderTiles("Thunderforest.Landscape", group = "Topographical") %>%
addProviderTiles("OpenStreetMap.Mapnik", group = "Road map") %>%
addProviderTiles("Esri.WorldImagery", group = "Satellite") I sent through and changed all cases of addProviderTiles so that they match the Leaflet example:
addProviderTiles("Stamen.TonerLite",
options = providerTileOptions(noWrap = TRUE))I've stripped lots out of my processing. I basically add one GPS trace to the map:
m <- addPolylines(m, data=track, group='Hiking routes', color = color)When I run the published app in the browser I get the same error shown above.
I create the maps in a separate R script and then save the map object. In the server app, I load in the saved object.
It all works fine when I run the app on my local machine. It's only when I run the published app on
shinyapps.io that I have the error message.
This project was modelled on a blog post and earlier I did a version of these maps that I posted at
http://rpubs.com/JohnGoldin/149745 (don't mind the broken camera icons). I thought Shiny was a better way to display the various trips so I converted it to Shiny. The results looks great on my local screen so I hope I can figure out how to publish it.
I have been trying to isolate the problem by throwing things overboard from my existing app. Next I'll start with the Leaflet example app (which I can publish without problem) and start adding things until it breaks.
Any suggestions?