Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set layer ids from 'ladda tema' to local storage, toggle subLayers visibility #1625

Conversation

Albinahmetaj
Copy link
Contributor

@Albinahmetaj Albinahmetaj commented Mar 18, 2025

I sat with @Hallbergs and discussed some cases regarding this commit. My guess would be that if a user decides to load a 'tema' , the layers that are stored in 'Snabbåtkomst' after the 'tema' has been loaded should be stored in local storage as they currently do when a user uses the 'Lägg till tända lager' function.

Another fix ensures that when loading a 'tema' using a grouplayer the specified sublayers will be toggled.


Bug: right now all sublayers within the grouplayer will be toggeled when loading layers using 'Ladda tema', even if only two of them are specified inside the quickAccessPresets as shown here:

"quickAccessPresets": [layer:[{ "id": "n0ehiv", "visible": true, "subLayers": [ "Motortrafikled", "Gastvag" ], "opacity": 1, "drawOrder": 1000}]]

tema grplayer-fix

olLayer.set("subLayers", visibleSubLayersArray); fixes this inside the LayerSwitcherProvider.js component

Another thing that i notices is that when you load the layers using 'Ladda tema' with a grouplayer, all sublayers are toggled as described above. However, if you manually untoggle the sublayers and then load the 'tema' again, the sublayers remain unchecked, unlike the first time.

Can you take a look at this @karljakoblarsson and test if this solves the issues

@Albinahmetaj Albinahmetaj self-assigned this Mar 18, 2025
@Hallbergs
Copy link
Member

@karljakoblarsson If you have time it would be great if you could do a sanity check on this one!

Copy link
Contributor

@karljakoblarsson karljakoblarsson left a comment

Choose a reason for hiding this comment

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

Looks correct!

@Hallbergs Hallbergs merged commit 8435086 into master Mar 19, 2025
4 checks passed
@Hallbergs Hallbergs deleted the feature/rc1-temafix-loaded-layerIds-localstorage/set-subLayers-visibility branch March 19, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants