Skip to content

Change default visibility for unconfigured layers back to true - #2906

Merged
robyngit merged 1 commit into
developfrom
bugfix-2905-default-layer-visibility
Sep 22, 2026
Merged

robyngit merged 1 commit into
developfrom
bugfix-2905-default-layer-visibility

Conversation

@DarianGill

@DarianGill DarianGill commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What:

In #2851 unspecified layer visibility began defaulting to false instead of true. This PR returns us to old behavior which is still documented in the jsdocs which says visible is optional and shall default to true.

Why:

Because the change affected all legacy portals, at least some of which were relying on the unspecified default, and it's unknown how many use cesium maps (and thus how many would require portal map config updates to remedy the issues).

How:

Updated the logic in normalizeLayerVisibility in Map.js to set configuredVisiblity to true if neither it nor visible are set already. The logic is a little convoluted at first glance but I attempted to simplify it with intermediate variables, and the remaining complexity is in place to provide type safety for the config-read values and idempotency should we ever need to re-process normalized data. If you think that's overkill I'm open to simplifying it.

Testing:

Updated the map tests to expect visible instead of invisible.
All 2980 tests pass.
I also changed my test pdg portal to not specify visible for IWP, and when I load the portal from this branch the layer still appears. When Ioad it from the develop branch, it doesn't.

Also updates the logic in normalizeLayerVisibility with intermediate values and comments for better readability and updates the test assumptions to reflect the new default.

Issue: #2905

@robyngit robyngit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you @DarianGill !

@robyngit
robyngit merged commit 2dd883e into develop Sep 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants