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

Provide option to create mutual exclusive layers #1265

Closed
MarkusKonk opened this issue Oct 26, 2022 · 11 comments
Closed

Provide option to create mutual exclusive layers #1265

MarkusKonk opened this issue Oct 26, 2022 · 11 comments

Comments

@MarkusKonk
Copy link

If a LayerGroup contains several layers, it might happen that some of the layers should not be visible in combination with the other layers of the same group (and layers in the sub-group). Creators of a layer should be able to configure it in a way that that it is "mutual exclusive".

This means that if a user clicks on the layer to make it visible, the other layers are made invisible automaically.
There are two options to implement this feature:
Option 1 (preferred): Since this is an optional configuration for layer creators, this might be a good enhancement of the core.
Option 2: Implement a plugin to extend the TOC component.

@gannebamm
Copy link

@giohappy @allyoucanmap please take a look at the options

@giohappy
Copy link

@MarkusKonk @gannebamm here I guess you want a configuration at the group level (not per layer) to make the nodes under the group mutually exclusive. Something typical in many tree components, including the TOC in QGIS. Is it right?

This is something that will probably need to touch the core, and should itself be implemented inside the core. I don't think a plugin would be enough. I anticipate that it won't probably be that easy, but I think working with/inside the core is the way to go.

@gannebamm
Copy link

@giohappy yes on a group level. @MarkusKonk please give some insight about the current state of this task.

@MarkusKonk
Copy link
Author

MarkusKonk commented Nov 25, 2022

We made some progress regarding this issue as discussed with @gannebamm. However, we had to make some more or less minor changes to the MapStore2 and Client core.

  • you can find the plugin here.
  • we added an exclusiveLayer property to the LayerUtils and MapUtils component.
  • The dropdown for making a layergroup exclusive/non-exclusive is implemented in the GeneralSettings component. (I just noticed that we forgot to add internationalisation, still to be done.)

@allyoucanmap
Copy link
Collaborator

@tdipisa @giohappy next mapstore version 2024.01.00 will include the mutually exclusive groups so as soon as we align the MapStore submodule to 2024.01.xx we will get this feature.

see here the behavoiur on MapStore

preview-toc-actions.mp4

@ridoo
Copy link

ridoo commented Apr 4, 2024

@allyoucanmap it seems the option is always available to the map user. Is this also a configuration option the person who creates that map -- at least to choose what is the default for a layer? The intention I have in mind is, that the map creator may want to visualize the layers in one group mutual exclusive, while not exclusive for another group.

/cc @gannebamm

@allyoucanmap
Copy link
Collaborator

allyoucanmap commented Apr 4, 2024

@allyoucanmap it seems the option is always available to the map user. Is this also a configuration option the person who creates that map -- at least to choose what is the default for a layer? The intention I have in mind is, that the map creator may want to visualize the layers in one group mutual exclusive, while not exclusive for another group.

@ridoo We introduced an options to group level called nodesMutuallyExclusive that is included in the map configuration so after saving it the state is persisted. if nodesMutuallyExclusive is true all the children nodes at the first level will become mutually exclusive and they will change the icon to a radio button style, some examples:

here new york is mutually exclusive while other are normal groups

image

you can have the exclusive group inside a nested group, here annotation group is mutually exclusive

image

this option can be activated to a specific group level and in this other example you can see that the new your group is mutually exclusive while the nested annotation group is normal. As you can see the context menu allows you to change a specific group at any level

image

@gannebamm
Copy link

@allyoucanmap I think the upstream implementation follows the same logic as ours. You can take a look at it here: https://geonode-demo.thuenen.de/catalogue/#/map/24

Each group (or subgroup) can be set as mutually exclusive. We also changed the button from 'eye' to 'radio button'. The state is saved.

@allyoucanmap
Copy link
Collaborator

@allyoucanmap I think the upstream implementation follows the same logic as ours. You can take a look at it here: https://geonode-demo.thuenen.de/catalogue/#/map/24

@gannebamm I tried to import the map you shared in the latest mapstore version. The logic of mutally exclusive applies to all the first children including groups, like this one

group-mutually-exclusive.mp4

@gannebamm
Copy link

gannebamm commented Jun 6, 2024

next mapstore version 2024.01.00 will include the mutually exclusive groups so as soon as we align the MapStore submodule to 2024.01.xx we will get this feature.

With above merged into 4.3.x this is now available and I did a quick test. Took me a while to understand that right-click is now an option 🚀

This seems to work quite well and is saved as state for the group. See working demo here: https://development.demo.geonode.org/catalogue/#/map/593

I think we can close this.

@ridoo
Copy link

ridoo commented Jun 6, 2024

I feel free to close this one then

@ridoo ridoo closed this as completed Jun 6, 2024
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

No branches or pull requests

5 participants