Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

high-DPI support

Aperta
#16 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
json
Ambito
documentation

Direzione di ricerca

Esamina la specifica TileJSON esistente e le aggiunte dpis e {r} proposte nell’issue, quindi analizza come dovrebbe essere gestita la retrocompatibilità per i consumer esistenti. Il lavoro è completo quando sono documentati una rappresentazione concordata per il high-DPI e il comportamento dei template URL, senza lasciare irrisolta la questione della compatibilità.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

v4

TileJSON should have a means of:

  • indicating when a source supports high-DPI versions of base tiles, and at what DPI multipliers (@2x, @4x, etc)
  • specifying how URLs for high-DPI tiles are constructed

Without such a specification, consumers must have hard-coded knowledge of a source's support for high-DPI tiles and typically resort to string munging to generate the appropriate URLs. These are exactly the sort of deficiencies that TileJSON is designed to eliminate.

One approach would be to have an array-valued property that lists supported DPI multipliers and a new interpolation key for tile URL templates. E.g.:

{
  ...
  "dpis": [1, 2, 4],
  "tiles": ["http://example.com/{z}/{x}/{y}{r}.png"]
}

Where it is specified that {r} is replaced with the pixel ratio ⇢ string mapping of 1 ⇢ "", 2 ⇢ "@2x", 4 ⇢ "@4x", and consumers may decide which of the pixel ratio options to use based on device characteristics. Alternatively this mapping could be explicitly supplied:

{
  ...
  "dpis": {
    "1": "",
    "2": "@2x",
    "4": "@4x"
  },
  "tiles": ["http://example.com/{z}/{x}/{y}{r}.png"]
}

These approaches introduce a backward compatibility issue however, in that existing TileJSON consumers will not be prepared to interpolate a new template value and thus cannot consume TileJSON that uses it.

cc @yhahn @mourner @tmcw

Lingua principale
Nessun dato sulla lingua
Stelle
298
Fork
51
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mapbox/tilejson-spec

Tutte le issue di mapbox/tilejson-spec

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.