Skip to content

Add support for pmtiles - #61

Merged
walkerke merged 4 commits into
walkerke:mainfrom
cboettig:main
Jan 7, 2025
Merged

Add support for pmtiles#61
walkerke merged 4 commits into
walkerke:mainfrom
cboettig:main

Conversation

@cboettig

Copy link
Copy Markdown
Contributor

Thanks for this amazing package, really nice work and a very slick implementation! I really appreciate how you've managed to provide a quite native-R feeling interface while also letting us just drop back on list construction to access any edge case abilities in maplibre. Your documentation is impressive as well. 🌐

Here's a small tweak to resolve#8, adding support for PMTiles in the maplibre backend. By adding pmtiles.js, the existing utilities can work with pmtiles in much the same way as the vector tiles already included, e.g.:

maplibre(center=c(-72.9, 41.3), zoom=10) |>
add_fill_layer(
id="redlines",
source=list(type="vector",
url="pmtiles://https://data.source.coop/cboettig/us-boundaries/mappinginequality.pmtiles"),
source_layer="mappinginequality",
fill_color=list("get", "fill")
)

I know that #8 discusses the potential of pmtiles support for mapbox as well, but as this makes no changes to the R code base, I don't think this creates any divergence in the existing API. Thanks for considering this!

@walkerke

Copy link
Copy Markdown
Owner

Thank you, I'll take a look at this!

@walkerke

Copy link
Copy Markdown
Owner

This works great, thank you @cboettig!

@walkerke
walkerke merged commit c19db0e into walkerke:mainJan 7, 2025
@walkerkewalkerke mentioned this pull request Mar 16, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PMTiles source integration?

2 participants

@cboettig@walkerke