Repository navigation
Change default visibility for unconfigured layers back to true - #2906
Merged
Merged
Conversation
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
approved these changes
Sep 22, 2026
robyngit
left a comment
Member
There was a problem hiding this comment.
Great, thank you @DarianGill !
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.