Implement distance-based tile LOD (#4057)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
Nathan Olson
2026-02-21 03:38:10 -08:00
committed by GitHub
parent 8e0dc86956
commit 7fe58506c4
45 changed files with 650 additions and 86 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -0,0 +1,38 @@
{
"version": 8,
"metadata": {
"test": {
"maxPitch": 85,
"operations": [
["wait"]
]
}
},
"center": [
13.418056,
52.499167
],
"bearing": 30,
"pitch": 72,
"zoom": 16,
"sources": {
"satellite": {
"type": "raster",
"tiles": [
"https://demotiles.maplibre.org/debug-tiles/number/{z}.png"
],
"maxzoom": 22,
"tileSize": 256
}
},
"layers": [
{
"id": "raster",
"type": "raster",
"source": "satellite",
"paint": {
"raster-fade-duration": 0
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -0,0 +1,40 @@
{
"version": 8,
"metadata": {
"test": {
"maxPitch": 85,
"operations": [
["setTileLodMode", "distance"],
["setTileLodPitchThreshold", 62],
["wait"]
]
}
},
"center": [
13.418056,
52.499167
],
"bearing": 30,
"pitch": 61,
"zoom": 16,
"sources": {
"satellite": {
"type": "raster",
"tiles": [
"https://demotiles.maplibre.org/debug-tiles/number/{z}.png"
],
"maxzoom": 22,
"tileSize": 256
}
},
"layers": [
{
"id": "raster",
"type": "raster",
"source": "satellite",
"paint": {
"raster-fade-duration": 0
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -0,0 +1,40 @@
{
"version": 8,
"metadata": {
"test": {
"maxPitch": 85,
"operations": [
["setTileLodMode", "distance"],
["setTileLodScale", 3],
["wait"]
]
}
},
"center": [
13.418056,
52.499167
],
"bearing": 30,
"pitch": 72,
"zoom": 16,
"sources": {
"satellite": {
"type": "raster",
"tiles": [
"https://demotiles.maplibre.org/debug-tiles/number/{z}.png"
],
"maxzoom": 22,
"tileSize": 256
}
},
"layers": [
{
"id": "raster",
"type": "raster",
"source": "satellite",
"paint": {
"raster-fade-duration": 0
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -0,0 +1,39 @@
{
"version": 8,
"metadata": {
"test": {
"maxPitch": 85,
"operations": [
["setTileLodMode", "distance"],
["wait"]
]
}
},
"center": [
13.418056,
52.499167
],
"bearing": 30,
"pitch": 72,
"zoom": 16,
"sources": {
"satellite": {
"type": "raster",
"tiles": [
"https://demotiles.maplibre.org/debug-tiles/number/{z}.png"
],
"maxzoom": 22,
"tileSize": 256
}
},
"layers": [
{
"id": "raster",
"type": "raster",
"source": "satellite",
"paint": {
"raster-fade-duration": 0
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -0,0 +1,39 @@
{
"version": 8,
"metadata": {
"test": {
"maxPitch": 85,
"operations": [
["setTileLodMinRadius", 1],
["wait"]
]
}
},
"center": [
13.418056,
52.499167
],
"bearing": 30,
"pitch": 72,
"zoom": 16,
"sources": {
"satellite": {
"type": "raster",
"tiles": [
"https://demotiles.maplibre.org/debug-tiles/number/{z}.png"
],
"maxzoom": 22,
"tileSize": 256
}
},
"layers": [
{
"id": "raster",
"type": "raster",
"source": "satellite",
"paint": {
"raster-fade-duration": 0
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -0,0 +1,39 @@
{
"version": 8,
"metadata": {
"test": {
"maxPitch": 85,
"operations": [
["setTileLodPitchThreshold", 62],
["wait"]
]
}
},
"center": [
13.418056,
52.499167
],
"bearing": 30,
"pitch": 61,
"zoom": 16,
"sources": {
"satellite": {
"type": "raster",
"tiles": [
"https://demotiles.maplibre.org/debug-tiles/number/{z}.png"
],
"maxzoom": 22,
"tileSize": 256
}
},
"layers": [
{
"id": "raster",
"type": "raster",
"source": "satellite",
"paint": {
"raster-fade-duration": 0
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -0,0 +1,39 @@
{
"version": 8,
"metadata": {
"test": {
"maxPitch": 85,
"operations": [
["setTileLodScale", 3],
["wait"]
]
}
},
"center": [
13.418056,
52.499167
],
"bearing": 30,
"pitch": 72,
"zoom": 16,
"sources": {
"satellite": {
"type": "raster",
"tiles": [
"https://demotiles.maplibre.org/debug-tiles/number/{z}.png"
],
"maxzoom": 22,
"tileSize": 256
}
},
"layers": [
{
"id": "raster",
"type": "raster",
"source": "satellite",
"paint": {
"raster-fade-duration": 0
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -0,0 +1,39 @@
{
"version": 8,
"metadata": {
"test": {
"maxPitch": 85,
"operations": [
["setTileLodZoomShift", 2],
["wait"]
]
}
},
"center": [
13.418056,
52.499167
],
"bearing": 30,
"pitch": 72,
"zoom": 16,
"sources": {
"satellite": {
"type": "raster",
"tiles": [
"https://demotiles.maplibre.org/debug-tiles/number/{z}.png"
],
"maxzoom": 22,
"tileSize": 256
}
},
"layers": [
{
"id": "raster",
"type": "raster",
"source": "satellite",
"paint": {
"raster-fade-duration": 0
}
}
]
}