fix: set layer ids from 'ladda tema' to local storage, toggle subLayers visibility #1625
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.
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}]]
olLayer.set("subLayers", visibleSubLayersArray);
fixes this inside the LayerSwitcherProvider.js componentAnother 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