Skip to content

Commit

Permalink
[MAPS3D-1478] Fix layer reordering issue when draping status changes …
Browse files Browse the repository at this point in the history
…(internal-2060)

* Add render test

* Reorder layers for draping
  • Loading branch information
lasselammi authored and mourner committed Dec 18, 2024
1 parent c9c97d8 commit 682e9fc
Show file tree
Hide file tree
Showing 3 changed files with 204 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/terrain/terrain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,9 @@ export class Terrain extends Elevation {
}

_setupDrapedRenderBatches() {
// It's possible that the draping status of a layer has changed, which requires reordering of the layers
this._style.updateDrapeFirstLayers();

const layerIds = this._style.order;
const layerCount = layerIds.length;
if (layerCount === 0) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
{
"version": 8,
"metadata": {
"test": {
"height": 300,
"width": 512,
"allowed": 0.0021,
"operations": [
["setZoom", 12],
["wait"]
]
}
},
"center": [-113.32694547094238, 35.93455626259847],
"zoom": 11,
"pitch": 38,
"bearing": 90,
"terrain": {
"source": "rgbterrain",
"exaggeration": 1.0
},
"sprite": "local://sprites/emerald",
"lights": [
{
"type": "ambient",
"id": "test_ambient",
"properties": {
"color": "rgba(255, 255, 255, 1)",
"intensity": 0.2
}
},
{
"type": "directional",
"id": "test_directional",
"properties": {
"cast-shadows" : true,
"color": "rgba(255, 255, 255, 1)",
"intensity": 0.7
}
}
],
"sources": {
"rgbterrain": {
"type": "raster-dem",
"tiles": [
"local://tiles/{z}-{x}-{y}.terrain.png"
],
"maxzoom": 12,
"tileSize": 256
},
"satellite": {
"type": "raster",
"tiles": [
"local://tiles/{z}-{x}-{y}.satellite.png"
],
"maxzoom": 17,
"tileSize": 256
},
"geojson": {
"type": "geojson",
"lineMetrics": true,
"data": {
"type": "Feature",
"properties": {
"elevation": [10, 400, 100]
},
"geometry": {
"type": "MultiLineString",
"coordinates": [
[
[
-113.35094547094238,
35.91855626259847
],
[
-113.35094547094238,
35.93455626259847
],
[
-113.35094547094238,
35.95055626259847
]
],
[
[
-113.32894547094237,
35.91855626259847
],
[
-113.32494547094238,
35.95055626259847
],
[
-113.32094547094238,
35.91855626259847
]
],
[
[
-113.31294547094238,
35.91855626259847
],
[
-113.31294547094238,
35.95055626259847
],
[
-113.31294547094238,
35.93455626259847
]
]
]
}
}
},
"geojson1": {
"type": "geojson",
"lineMetrics": true,
"data": {
"type": "Feature",
"properties": {
"elevation": [400, 400, 400, 0, 400, 400, 400]
},
"geometry": {
"type": "MultiLineString",
"coordinates": [
[
[
-113.33994547094238,
35.91855626259847
],
[
-113.33994547094238,
35.93455626259847
],
[
-113.33694547094238,
35.95055626259847
]
],
[
[
-113.30294547094238,
35.91855626259847
],
[
-113.30294547094238,
35.95055626259847
],
[
-113.30274547094238,
35.91855626259847
]
]
]
}
}
}
},
"layers": [
{
"id": "raster",
"type": "raster",
"source": "satellite",
"paint": {
"raster-fade-duration": 0
}
},
{
"id": "line",
"type": "line",
"source": "geojson",
"layout": {
"line-join": "round",
"line-z-offset": [
"step",
["zoom"],
0,
11.9,
1
]
},
"paint": {
"line-width": 12,
"line-color": "red"
}
},
{
"id": "line1",
"type": "line",
"source": "geojson1",
"layout": {
"line-join": "none"
},
"paint": {
"line-width": 14,
"line-pattern": "dot"
}
}
]
}

0 comments on commit 682e9fc

Please sign in to comment.