Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMTiles support #98

Open
halset opened this issue Jan 12, 2023 · 6 comments
Open

PMTiles support #98

halset opened this issue Jan 12, 2023 · 6 comments

Comments

@halset
Copy link

halset commented Jan 12, 2023

It would be very nice to have support for PMTiles directly in mbgl-renderer with pmtiles://-urls. Should this wait for maplibre-support for mbgl-renderer og just be a new way to handle this new url scheme in the javascript part?

@brendan-ward
Copy link
Collaborator

This is a good idea for the long term (short term we need #95 first), thank you for the suggestion.

I'm not yet familiar enough with PMTiles to know quite how this would be implemented. I imagine support is coming at some point to maplibre-gl-native but I don't think it is there yet (correct me if I'm wrong). It may be that we register it to the NodeJS bindings like any other tileset, but then we have to add the extra logic to resolve individually addressed tiles to HTTP range requests against a PMTiles dataset (if I understand correctly). We'd have to fetch some metadata at the outset for each PMTiles to be able to do that resolving.

@bdon
Copy link

bdon commented Feb 7, 2023

This might be possible without migrating to MapLibre - it's not clear for me that there's a pathway to add addProtocol-like functionality which exists in GL JS, as Native lacks arbitrary runtime extension points from what I understand.

But you may be able to adapt https://github.com/consbio/mbgl-renderer/blob/master/src/render.js#L250 to use the Browser/Node PMTiles decoder: https://github.com/protomaps/PMTiles/tree/main/js - this handles resolving Z/X/Y to ranges, maintaining an LRU cache of those intermediate parts, and decompressing responses.

@brendan-ward
Copy link
Collaborator

Thanks for the suggestions @bdon, greatly appreciated!

@jeffreysfridge
Copy link

Any updates on pmtiles support?

@brendan-ward
Copy link
Collaborator

No updates other than that I have no availability or short term plans to implement PMTiles support.

@halset
Copy link
Author

halset commented Jan 19, 2024

Perhaps this will be handled by maplibre-native. maplibre/maplibre-native#1978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants