How to render custom map tiles created with gdal2tiles in Leaflet for R?

。_饼干妹妹 提交于 2019-11-29 15:52:24

Figured it out. You have to use a "www" folder inside your Shiny directory. So in the question, I just had the folder "Tiles" and all of the tiled folders listed inside of it (0 - 7). Instead, move the Tiles folder inside a www directory (in my example, they are further moved into a folder called "map").

So instead of the above structure Tiles > x, it needs to be www > map > Tiles > x

leaflet() %>%
    addTiles(urlTemplate = "map/Tiles/{z}/{x}/{y}.png",
             option = tileOptions(tms = T, minZoom = 5, maxZoom = 9))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!