forked from maplibre/maplibre-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
correct coveringTiles when terrain is enabled (maplibre#1300)
* Fixes maplibre#1241 - correct coveringTiles when terrain is enabled * fix lint * Add unit test for calculating min/max elevation (maplibre#1316) * Add unit test for calculating min/max elevation * Use correct method name * Move min/max elevation value calc to Terrain class * Alter Terrain.getMinMaxElevation to take tileID arg * Fix unit tests after merge from main * Fix lint * Add render test for 3D terrain (maplibre#1320) * Add terrain style spec integration test Tests that the root level terrain object must be in the following form: "terrain": { "source": string, "exaggeration": number, "elevationOffset": number } * Add work-in-progress render test for 3D terrain * Fix terrain render test so it passes The original test was failing because there were no terrain tiles available at the zoom being requested. Now it's testing at zoom 13, which means requesting terrain tiles at zoom 12, which are available to the tests. * Update terrain render test to test fix for maplibre#1241 The fix for maplibre#1241, commit 352bc03, ensures that elevationOffset is taken into account when gauging which tiles are required to render 3D terrain. If we add an extreme offset then we have a test that fails on the current main branch but passes after the fix. * Add changelog comment Co-authored-by: Matt Riggott <[email protected]> Co-authored-by: HarelM <[email protected]>
- Loading branch information
1 parent
c9947fd
commit 6fa592c
Showing
10 changed files
with
221 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"height": 256, | ||
"width": 256 | ||
} | ||
}, | ||
"center": [-113.33496, 35.96022], | ||
"zoom": 13, | ||
"pitch": 60, | ||
"sources": { | ||
"terrain": { | ||
"type": "raster-dem", | ||
"tiles": ["local://tiles/{z}-{x}-{y}.terrain.png"], | ||
"maxzoom": 15, | ||
"tileSize": 256 | ||
}, | ||
"satellite": { | ||
"type": "raster", | ||
"tiles": ["local://tiles/{z}-{x}-{y}.satellite.png"], | ||
"maxzoom": 17, | ||
"tileSize": 256 | ||
} | ||
}, | ||
"layers": [ | ||
{ | ||
"id": "background", | ||
"type": "background", | ||
"paint": { | ||
"background-color": "white" | ||
} | ||
}, | ||
{ | ||
"id": "raster", | ||
"type": "raster", | ||
"source": "satellite", | ||
"paint": { | ||
"raster-opacity": 1.0 | ||
} | ||
} | ||
], | ||
"terrain": { | ||
"source": "terrain", | ||
"exaggeration": 2, | ||
"elevationOffset": 2000 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"version": 8, | ||
"sources": { | ||
"terrain": { | ||
"type": "raster-dem", | ||
"tiles": ["local://tiles/{z}-{x}-{y}.terrain.png"], | ||
"maxzoom": 15, | ||
"tileSize": 256 | ||
} | ||
}, | ||
"layers": [], | ||
"terrain": { | ||
"source": 123, | ||
"exaggeration": "2", | ||
"elevationOffset": "50" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
{ | ||
"message": "source: string expected, number found", | ||
"line": 13 | ||
}, | ||
{ | ||
"message": "exaggeration: number expected, string found", | ||
"line": 14 | ||
}, | ||
{ | ||
"message": "elevationOffset: number expected, string found", | ||
"line": 15 | ||
} | ||
] |