trafficonese / leaflet.extras

Extra functionality for leaflet R package.
https://trafficonese.github.io/leaflet.extras/
GNU General Public License v3.0
211 stars 74 forks source link

added support for Tangram Vector Tiles #186

Closed trafficonese closed 4 years ago

trafficonese commented 4 years ago

Adds support for Tangram Vector Tiles:

This works currently only in a shinyApp opened in the browser, since a "scene.yaml" file is passed to the underlying Tangram JS. So the "scene.yaml" file has to be in the /www folder of the shinyApp.

I am not sure how it would be possible to use absolute paths to the .yaml file, which are not inside the /www folder. Currently the browser throws those errors with an absolute path:

Not allowed to load local resource:
Tangram v0.20.0 [error]: Scene.load() failed to load

We could maybe use the shiny::addResourcePath() function, if an absolute path is given? But I am not sure if that is an elegant solution or if there is a better way?


I also added an option to load either the minified or full JS-sources of Tangram. With options("leaflet.extras.minified" = FALSE) you get the full version. The default is TRUE.