Protocol: add `encoding: "mlt"` to the TileJSON for MLT archives
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 15/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- api
Direzione di ricerca
The change belongs where Protocol builds TileJSON: the type: "json" path of tilev4 and getTileJson, both of which read the archive header. Set encoding from header.tileType (TileType.Mlt gives "mlt", otherwise "mvt") in both places, then check that MVT output is unchanged. This already has an open linked pull request (#693), so review that work rather than starting a new change.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I am migrating our PMTiles from MVT to MLT by switching from tippecanoe to manby, to take advantage of the smaller file sizes.
I noticed that I have to do additional work to pass the encoding on to MapLibre, like you did for the viewer in #647. The header already has tileType: 6, but the TileJSON that Protocol returns has no encoding, so MapLibre decodes the tiles as MVT.
Could Protocol add encoding to the TileJSON based on the tile type, so apps don't have to set it themselves?
Details by Claude
Written by Claude Opus 5.5 (effort: medium);
Problem
For an archive with tile type 6 (MLT), MapLibre GL JS decodes the tiles as MVT unless the source sets
encoding: "mlt".Protocolreads the header, but the TileJSON it returns fortype: "json"has noencoding, with or withoutmetadata: true(getTileJson). So every app has to read the header itself and set the encoding on each source. Apps that load MVT and MLT archives side by side need this per file.Proposal
Add
encodingto the TileJSON in both thetype: "json"path oftilev4and ingetTileJson:encoding: header.tileType === TileType.Mlt ? "mlt" : "mvt"MapLibre GL JS reads
encodingfrom the TileJSON (load_tilejson.ts), and anencodingset on the source still wins. Existing MVT setups are unaffected.
encodingis a source property in the MapLibre style spec, not part of TileJSON 3.0.0. MapLibre still expects it in the TileJSON for MLT sources (maplibre/maplibre-gl-js#6882, the demotiles do the same).Workaround we use today
A wrapper around
protocol.tilev4that addsencodingto the TileJSON after reading the header viaprotocol.get(url).getHeader().
Update: There is now https://github.com/protomaps/PMTiles/pull/693
- Lingua principale
- TypeScript
- Stelle
- 3.3k
- Fork
- 218
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di protomaps/PMTiles
-
Support for Leaflet 2xAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Viewer: archive URLs containing "=" are truncated when read from the hashForse già presa @nu11waredev l’ha presa 16 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di protomaps/PMTiles
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
review-followup
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
griffinwork40/agent-afk#5387 ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
CodeManufactoryLLC/Code60#358 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
android:plan ios:plan main:plan packages:learn
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno