Skip to content

Commit

Permalink
Fix visiblity state of model map layers (backport #6615) [release/4.5…
Browse files Browse the repository at this point in the history
….x] (#6630)

Co-authored-by: Michel D'Astous <mdastous-bentley@users.noreply.github.com>
  • Loading branch information
mergify[bot] and mdastous-bentley committed Apr 16, 2024
1 parent 2810947 commit 72c8f7c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-frontend",
"comment": "Fix an issue preventing model map layer from being hidden",
"type": "none"
}
],
"packageName": "@itwin/core-frontend"
}
8 changes: 6 additions & 2 deletions core/frontend/src/tile/map/MapTileTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1001,9 +1001,13 @@ export class MapTileTreeReference extends TileTreeReference {

for (; treeIndex < this._layerTrees.length; treeIndex++) {
const layerTreeRef = this._layerTrees[treeIndex];
const hasValidTileTree = layerTreeRef && TileTreeLoadStatus.NotFound !== layerTreeRef.treeOwner.loadStatus;
const isImageryMapLayer = layerTreeRef instanceof ImageryMapLayerTreeReference;
const isLayerVisible = (isImageryMapLayer || (!isImageryMapLayer && layerTreeRef?.layerSettings.visible));
// Load tile tree for each configured layer.
// Note: Non-visible layer are also added to allow proper tile tree scale range visibility reporting.
if (layerTreeRef && TileTreeLoadStatus.NotFound !== layerTreeRef.treeOwner.loadStatus
// Note: Non-visible imagery layer are always added to allow proper tile tree scale range visibility reporting.
if (hasValidTileTree
&& isLayerVisible
&& !layerTreeRef.layerSettings.allSubLayersInvisible) {
const layerTree = layerTreeRef.treeOwner.load();
if (layerTree !== undefined) {
Expand Down

0 comments on commit 72c8f7c

Please sign in to comment.