diff --git a/common/changes/@itwin/core-frontend/bugfix-overlayTerrain_2022-03-29-12-02.json b/common/changes/@itwin/core-frontend/bugfix-overlayTerrain_2022-03-29-12-02.json new file mode 100644 index 000000000000..4384576bb712 --- /dev/null +++ b/common/changes/@itwin/core-frontend/bugfix-overlayTerrain_2022-03-29-12-02.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/core-frontend", + "comment": "Fix overlay map layers that were displayed at the wrong elevation", + "type": "none" + } + ], + "packageName": "@itwin/core-frontend" +} \ No newline at end of file diff --git a/core/frontend/src/tile/map/MapTileTree.ts b/core/frontend/src/tile/map/MapTileTree.ts index 12fce23b85f1..72bdbe4897bf 100644 --- a/core/frontend/src/tile/map/MapTileTree.ts +++ b/core/frontend/src/tile/map/MapTileTree.ts @@ -423,7 +423,7 @@ class MapTreeSupplier implements TileTreeSupplier { cmp = compareStringsOrUndefined(lhs.maskModelIds, rhs.maskModelIds); if (0 === cmp) { cmp = compareBooleans(lhs.isOverlay, rhs.isOverlay); - if (0 === cmp && !lhs.isOverlay) { + if (0 === cmp) { cmp = compareBooleans(lhs.wantSkirts, rhs.wantSkirts); if (0 === cmp) { cmp = compareBooleans(lhs.wantNormals, rhs.wantNormals); @@ -666,7 +666,7 @@ export class MapTileTreeReference extends TileTreeReference { const id: MapTreeId = { tileUserId: this._tileUserId, - applyTerrain: this.settings.applyTerrain && !this.isOverlay && !this._isDrape, + applyTerrain: this.settings.applyTerrain && !this._isDrape, terrainProviderName: this.settings.terrainSettings.providerName, terrainHeightOrigin: this.settings.terrainSettings.heightOrigin, terrainHeightOriginMode: this.settings.terrainSettings.heightOriginMode,