Open halset opened 1 year ago
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.
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.
Thanks for the suggestions @bdon, greatly appreciated!
Any updates on pmtiles support?
No updates other than that I have no availability or short term plans to implement PMTiles support.
Perhaps this will be handled by maplibre-native. https://github.com/maplibre/maplibre-native/issues/1978
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?