-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat: enable PMTiles protocol support #16629
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
Conversation
|
I guess I can write about this something in docs, though I don't want to spend time on it if this PR will receive hard no. |
|
Nice! |
This patch enables PMTiles protocol for MapLibre-GL. Protocol allows to fetch tiles from a single file. This drastically simplifies the process to self-host own tiles.
|
@jrasm91 I force pushed to update author (committed under work credentials previously accidentally) and fixed linter issue. Please approve again! |
|
Also want to add that Immich already had transient |
|
Is this patch really necessary? I would expect it to automatically pick up any supported protocol from the style.json |
|
@bo0tzz yes. I also thought that, but it throws error by trying to download file using |
|
Yea, you have to do it like this. Being able to self host the map tiles has been something on my list of things to offer for a while. We want to build in a solution that just lets you click self host and it will download the pmtiles file to the server and manage that part for you too. We would need this bit anyway so happy for this to go in now and the rest come later. |
|
The only thing to be aware of is our styles json isn't built for the latest pmtiles file right now, so there could be some weirdness as it's a newer version than we currently use on the tile server itself. |
|
Unfortunately I tested that patch with Immich app and it works. |
This patch enables PMTiles protocol for MapLibre-GL. Protocol allows to fetch tiles from a single file. This drastically simplifies the process to self-host own tiles.
Description
I don't like that Immich fetches tiles from cloud. After some research I found Protomaps.com project. Basically they build and allow to download entire map as a single file (123 GiB, https://maps.protomaps.com/builds/) and by using HTTP Range browser can read tiles one-by-one instead of downloading entire file. This format allows to self-host tiles very easily. Basically I just downloaded pmtiles and official Immich styles in JSON and replaced this:
By this:
After applying my patch Immich started to understand PMTiles protocol.
How Has This Been Tested?
Screenrecoring with demo
2025-03-06.025550.mp4
Checklist:
src/servicesuses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services)