Shinyapp wont load my tiles.


I am kinda new to R-studio I have only used it on and off for some university work as I'm a history student, not a computer science student.

I am trying to make a shiny app, I have used leaflet but I added my own custom tiles from an old map to overlay onto the OSM map while I also extracted data from a census to add on top. I'm on Windows 10 right now and when I run the app locally on my computer it works perfectly fine and it looks like the photo below.

however, when I press the button upload and upload it successfully I run into problems when I try to open it on shinyapps io I get the following result. I tried in other browsers but they all fail.

It just won't load my tiles even though my tiles are in the same folder as the rest of the files I upload to Shinyapps.

In the console, I can see it won't open my tiles

When I go to the log in shiny app it looks like this

2023-10-19T08:19:16.354266+00:00 shinyapps[9750542]: jsonlite version: 1.8.4
2023-10-19T08:19:16.359130+00:00 shinyapps[9750542]: RJSONIO version: (none)
2023-10-19T08:19:16.364424+00:00 shinyapps[9750542]: htmltools version: 0.5.5
2023-10-19T08:19:16.369382+00:00 shinyapps[9750542]: reticulate version: (none)
2023-10-19T08:19:16.374511+00:00 shinyapps[9750542]: Using pandoc: /opt/connect/ext/pandoc/2.16
2023-10-19T08:19:16.380140+00:00 shinyapps[9750542]:
2023-10-19T08:19:16.384866+00:00 shinyapps[9750542]: Starting R with process ID: '36'
2023-10-19T08:19:16.389724+00:00 shinyapps[9750542]: Shiny application starting ...
2023-10-19T08:19:17.281922+00:00 shinyapps[9750542]:
2023-10-19T08:19:17.287821+00:00 shinyapps[9750542]: Attaching package: ‘shinydashboard’
2023-10-19T08:19:17.292969+00:00 shinyapps[9750542]:
2023-10-19T08:19:17.300047+00:00 shinyapps[9750542]: The following object is masked from ‘package:graphics’:
2023-10-19T08:19:17.307774+00:00 shinyapps[9750542]:
2023-10-19T08:19:17.312544+00:00 shinyapps[9750542]: box
2023-10-19T08:19:17.317672+00:00 shinyapps[9750542]:
2023-10-19T08:19:17.322570+00:00 shinyapps[9750542]:
2023-10-19T08:19:17.327376+00:00 shinyapps[9750542]: Listening on
2023-10-19T08:47:15.292404+00:00 shinyapps[9750542]: Container event from container-8746950: stop
2023-10-22T21:48:28.282167+00:00 shinyapps[9750542]: Container event from container-8746950: start
2023-10-22T21:48:31.281929+00:00 shinyapps[9750542]: Running on host: d9c06a7cdca6
2023-10-22T21:48:31.287573+00:00 shinyapps[9750542]: Running as user: uid=10001(shiny) gid=10001(shiny) groups=10001(shiny)
2023-10-22T21:48:31.292822+00:00 shinyapps[9750542]: Connect version: 2023.09.0
2023-10-22T21:48:31.297968+00:00 shinyapps[9750542]: LANG: C.UTF-8
2023-10-22T21:48:31.303106+00:00 shinyapps[9750542]: Working directory: /srv/connect/apps/Aaby_1901
2023-10-22T21:48:31.308033+00:00 shinyapps[9750542]: Using R 4.1.2
2023-10-22T21:48:31.313101+00:00 shinyapps[9750542]: R.home(): /opt/R/4.1.2/lib/R
2023-10-22T21:48:31.317991+00:00 shinyapps[9750542]: Content will use current R environment
2023-10-22T21:48:31.322956+00:00 shinyapps[9750542]: R_LIBS: (unset)
2023-10-22T21:48:31.328649+00:00 shinyapps[9750542]: .libPaths(): /opt/R/4.1.2/lib/R/library
2023-10-22T21:48:31.333613+00:00 shinyapps[9750542]: shiny version:
2023-10-22T21:48:31.339463+00:00 shinyapps[9750542]: httpuv version: 1.6.9
2023-10-22T21:48:31.344559+00:00 shinyapps[9750542]: rmarkdown version: 2.25
2023-10-22T21:48:31.349439+00:00 shinyapps[9750542]: knitr version: 1.44
2023-10-22T21:48:31.354359+00:00 shinyapps[9750542]: jsonlite version: 1.8.4
2023-10-22T21:48:31.359468+00:00 shinyapps[9750542]: RJSONIO version: (none)
2023-10-22T21:48:31.364620+00:00 shinyapps[9750542]: htmltools version: 0.5.5
2023-10-22T21:48:31.369522+00:00 shinyapps[9750542]: reticulate version: (none)
2023-10-22T21:48:31.374386+00:00 shinyapps[9750542]: Using pandoc: /opt/connect/ext/pandoc/2.16
2023-10-22T21:48:31.379342+00:00 shinyapps[9750542]:
2023-10-22T21:48:31.384377+00:00 shinyapps[9750542]: Starting R with process ID: '35'
2023-10-22T21:48:31.389299+00:00 shinyapps[9750542]: Shiny application starting ...
2023-10-22T21:48:31.394288+00:00 shinyapps[9750542]:
2023-10-22T21:48:31.399164+00:00 shinyapps[9750542]: Attaching package: ‘shinydashboard’
2023-10-22T21:48:31.404084+00:00 shinyapps[9750542]:
2023-10-22T21:48:31.409018+00:00 shinyapps[9750542]: The following object is masked from ‘package:graphics’:
2023-10-22T21:48:31.413994+00:00 shinyapps[9750542]:
2023-10-22T21:48:31.419287+00:00 shinyapps[9750542]: box
2023-10-22T21:48:31.424248+00:00 shinyapps[9750542]:
2023-10-22T21:48:31.429101+00:00 shinyapps[9750542]:
2023-10-22T21:48:31.433866+00:00 shinyapps[9750542]: Listening on

when I upload it to the server it looks like this
my tiles are inside a folder in the folder called www, and yes i have tried with a path called "./www/tiles/" and one called "./tiles/" it doesn't make a difference.

I have tried several things to debug and solve the problem before coming here I looked at several posts, I basically looked up all the posts about tiles on the forum and went through them all. Down below are some of the links I tried to look at, but I still couldn't figure out the damn problem.

I'm assuming the problem is something on the shinyapps side because I tried to make all my paths relative to the application. I even tried to disable the OSM map just to make sure that my tiles weren't underneath the OSM map for some weird reason.

Here is my code for the server part


server <- function(input, output, session) {
output$mymap <- renderLeaflet({
addResourcePath("tiles", "./www/tiles/")
leaflet() %>%
setView(lng = 10.1680, lat = 56.1412, zoom = 12) %>%
group = "OpenStreetMap"
) %>%
urlTemplate = "/tiles/{z}/{x}/{y}.png"
) %>%
addCircleMarkers(lng = as.numeric(KD$Longitude1),
lat = as.numeric(KD$Latitude1),
popup = paste(
"Name: ", SK$navn,
Husstandsnummer: ", SK$Husstands_familienr,
Matrikelnummer: ", SK$Matr_nr_adresse,
Civilstand: ", SK$Civilstand,
Erhverv: ", SK$Erhverv,
Køn: ", SK$køn,
Fødested: ", SK$fødested,
Fødeår: ", SK$fødeaar,
Alder: ", SK$age,
Indtasters kommentar: ", SK$typers_coments),
color = "red",
weight = 10,
radius = 8,
clusterOptions = markerClusterOptions(spiderfyOnMaxZoom = TRUE)
) %>%
position = "bottomleft",
primaryLengthUnit = "meters",
primaryAreaUnit = "sqmeters",
activeColor = "#3D535D",
completedColor = "#7D4479") %>%
#function(el, x) {
#var myMap = this;
#myMap.on('baselayerchange', function (e) {
# myMap.minimap.changeLayer(L.tileLayer.provider(;
#}") %>%
addProviderTiles("Esri.WorldPhysical", group = "Physical") %>%
addProviderTiles("Esri.WorldImagery", group = "Aerial") %>%
addProviderTiles("MtbMap", group = "Geo") %>%
addProviderTiles("OpenRailwayMap", group = "Railway") %>%
baseGroups = c("CartoDB.DarkMatter","Aerial", "Physical","Geo", "Railway"),
options = layersControlOptions(collapsed = TRUE)) %>%
setView(lng = 10.1624878, lat = 56.1458518, zoom = 14) %>%
leaflet.extras::addSearchOSM(options = searchOptions(collapsed = TRUE, minLength = 2)) %>%

shinyApp(ui, server)

I have here a link to my drive where you can find my tiles:

Here is the link to the shiny app itself:

To anyone in the future wondering how to make a similar map, I followed this guide for the coding.

For the QGIS part, I used this link. (good luck it's in Danish)

I really hope that there is a kind person here on the forum who can spot my mistake and show me how to get my app up and running with my tiles because I have been working hard on it for some time.

I hope I have provided enough material so people can try to recreate and upload my tiles to shiny apps in a successful way if not I will gladly provide more information, it is my first time posting here and I'm kinda unsure if I should post all the code or just the part relevant for the server with the tiles.

Thanks for reading all this.