Repository navigation
#521 codebase extended to support vector basemaps - #523
gmatosferreira wants to merge 1 commit into
Conversation
|
Thanks for this PR! How would you feel about providing the proposed vector tile support as a stand-alone package? I am quite happy with using the Stadia.* basemaps as replacements for Carto*. I do like the support for vector tiles though! However, attaching the JS dependencies on the fly from a CDN is not optimal, as I think quarto (and possibly markdown) will complain. Have you tested running this in a quarto document? Ideally, we should ship the dependencies with the package. Also, have you tested with maplibre > v6? There might be problems as they've changed their release pattern. |
|
Hey, @tim-salabim! No, I haven't performed such a thorough batch of test cases. I get your concerns and considering them, I agree that it makes sense go proceed with this vector tiles support in a new package (with a native support instead of this workarounds). However, I currently don't have the availability to proceed with this project. I'll close this PR for now and let's hope that eventually in the near future someone takes over this gap in the R maps. 🙂 |
|
Thanks for the feedback. I have a long-term plan to replace the leaflet based mapview with a modern, maplibre/deck.gl based version. |
I have extended the codebase to support vector tiles. Since the upstream change was not welcome at leaflet-extras/leaflet-providers#705, I have implemented the support for MapLibre GL vector tile basemaps by extending
basemapto a named vector that, in addition toleaflet::providersraster tiles, now supports custom vector tiles urls.For this, I have adapted R/options.R to set
OpenFreeMap.PositronandOpenFreeMap.Darkas default (left all the other raster layers) and implemented the vector support at R/leafletControls.R, via R/vectorTiles.R, which validates the vector tiles URLs, their syntax and attaches the necessary script dependencies to the map HTML generated, throughhtmlwidgets::onRenderhook. Minor changes have been performed on other scripts, to assure compatibility. Below is an example script that I used to test and validate these changes.