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 #1978

Open
dellisd opened this issue Dec 19, 2023 · 3 comments · May be fixed by #2882
Open

PMTiles support #1978

dellisd opened this issue Dec 19, 2023 · 3 comments · May be fixed by #2882

Comments

@dellisd
Copy link

dellisd commented Dec 19, 2023

Is your feature request related to a problem? Please describe.
PMTiles are becoming an increasingly popular way of hosting map tile data because of its relative ease in setting up and maintaining it. maplibre-gl-js supports PMTiles sources through its support for adding custom sources/protocols.

Describe the solution you'd like
Support for the PMTiles format in maplibre-native, i.e. adding a pmtiles:// source to a map.

Describe alternatives you've considered
This feature request focuses on PMTiles, but the approach taken in maplibre-gl-js was to add a way to implement any arbitrary source format which definitely offers more flexibility. It's unclear how feasible that is here though since maplibre-native's source implementations are written in C++ which isn't easily pluggable.

@acalcutt
Copy link
Collaborator

acalcutt commented Dec 19, 2023

In tileserver-gl, which uses the node version of maplibre-native, I recently added pmtiles support using a customized request response
https://github.com/maptiler/tileserver-gl/blob/master/src/serve_rendered.js#L884-L977 . This was based around the pmtiles npm package ( https://github.com/maptiler/tileserver-gl/blob/master/src/pmtiles_adapter.js )

At the time of doing this I had some discussion with @tdcosta100 about the possibility of making it a supported protocol like you are asking here. He was saying

If you are able to code C++, you can make a new provider that can read PMTiles, just like MBTiles File Provider (https://github.com/maplibre/maplibre-native/blob/main/platform/default/src/mbgl/storage/mbtiles_file_source.cpp), then make it available as default file source (https://github.com/maplibre/maplibre-native/blob/main/platform/default/src/mbgl/storage/file_source_manager.cpp), and make the main resource loader use it too (https://github.com/maplibre/maplibre-native/blob/main/platform/default/src/mbgl/storage/main_resource_loader.cpp).

I was thinking if someone had the c++ knowledge, maybe some code from the pmtiles adapter c++ code could be used
https://github.com/protomaps/PMTiles/tree/main/cpp

@louwers louwers added the enhancement New feature or request label Dec 19, 2023
@louwers
Copy link
Collaborator

louwers commented Dec 19, 2023

Some earlier discussion: maplibre/maplibre#318 (comment)

@tdcosta100 tdcosta100 linked a pull request Sep 30, 2024 that will close this issue
@louwers louwers removed the enhancement New feature or request label Nov 26, 2024
@louwers louwers linked a pull request Nov 26, 2024 that will close this issue
@louwers
Copy link
Collaborator

louwers commented Nov 26, 2024

Note we have an open PR now: #2882

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

Successfully merging a pull request may close this issue.

3 participants