Open dellisd opened 10 months ago
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
Some earlier discussion: https://github.com/maplibre/maplibre/discussions/318#discussioncomment-6908123
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.