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

Feature: List layers in Quick access presets infobox #1601

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

karljakoblarsson
Copy link
Contributor

Screenshot 2025-02-24 at 11 47 37

Show the layers in the Quick Access Preset in the Infobox.

@jacobwod had this idea in: #1596 (comment)

Also add a example QuickAccess Preset to the default map config.

@jacobwod jacobwod self-assigned this Feb 26, 2025
@jacobwod
Copy link
Member

I'm not sure it's working (unless I'm testing it the wrong way).

Here's the relevant portion of my LocalStorage object:

"quickAccessLayers": [
        "1098",
        "rycfnb",
        "948"
    ],
    "layerswitcher": {
        "savedLayers": [
            {
                "layers": [
                    {
                        "id": "1098",
                        "visible": true,
                        "subLayers": [],
                        "opacity": 1,
                        "drawOrder": 133
                    },
                    {
                        "id": "rycfnb",
                        "visible": true,
                        "subLayers": [
                            "befolkning_tatort_1980",
                            "befolkning_tatort_1990",
                            "befolkning_tatort_1995",
                            "befolkning_tatort_2000",
                            "befolkning_tatort_2005",
                            "befolkning_tatort_2010",
                            "befolkning_tatort_2015",
                            "befolkning_tatort_2018",
                            "befolkning_tatort_2020"
                        ],
                        "opacity": 1,
                        "drawOrder": 89
                    },
                    {
                        "id": "948",
                        "visible": true,
                        "subLayers": [],
                        "opacity": 1,
                        "drawOrder": 29
                    },
                    {
                        "id": "774",
                        "visible": true,
                        "subLayers": [],
                        "opacity": 1,
                        "drawOrder": 0
                    }
                ],
                "metadata": {
                    "savedAt": "2025-02-26T06:59:31.724Z",
                    "numberOfLayers": 4,
                    "title": "3 lager",
                    "description": "Lite testlager",
                    "mapName": "Standardkartan"
                }
            }
        ]
    }

As you can see, there are 3 layers in quick access (haven't been removed yet, but it's not really relevant here), plus 1 background layer. This sums up to the numberOfLayers which is correct, 4.

However, I only see this:
Skärmavbild 2025-02-26 kl  08 03 46


An additional problem (which should perhaps be handled in a separate issue?) is the group layer (id rycfnb) does not show its children in the Quick Access portion (but it works well in the regular group, see the screenshot):
image

@karljakoblarsson
Copy link
Contributor Author

I misunderstood. This PR adds it for the "presets" from the config. Not the "user saved preset". I'll add it for that dialog as well.

@karljakoblarsson
Copy link
Contributor Author

An additional problem (which should perhaps be handled in a separate issue?) is the group layer (id rycfnb) does not show its children in the Quick Access portion (but it works well in the regular group, see the screenshot):

Yes, thats a bug! And let's consider it a separate issue.

@karljakoblarsson
Copy link
Contributor Author

Now I added the same list in the "QuickAccess favorites".

However, the code in this PR really needs a big refactoring. And the design could be better.

Since this is an additional feature that was not part of the original plan. So maybe this should be done for a future version and not 4.0. How do you feel about that @jacobwod @Hallbergs

@Hallbergs
Copy link
Member

Since it needs refactoring and potential design updates i don't think we should include it in the 4.0 version. I'll leave the last call for @jacobwod

@jacobwod
Copy link
Member

I feel that if it works in its current state, let's merge it. Refactoring can be done in develop and merged upstream to master in a future release.

@Hallbergs
Copy link
Member

I think that there are some layout changes needed that can be seen when having many layers:
image

@karljakoblarsson
Copy link
Contributor Author

I think that there are some layout changes needed that can be seen when having many layers:

Yep, the design needs some work. I normal bullet list should work better in most cases I think. But I will prfioritize bugs before this.

@karljakoblarsson karljakoblarsson marked this pull request as draft February 27, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants