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

Layer Control - Add ability to group layers with toggle all layers for each group #230

Closed
jebu75 opened this issue Sep 26, 2014 · 5 comments
Assignees
Milestone

Comments

@jebu75
Copy link
Collaborator

jebu75 commented Sep 26, 2014

It would be useful to group operational layers in the LayerControl widget into groups or sets and have the ability to toggle all layers within the set.

Mockup:

image

@leafyeh7
Copy link

leafyeh7 commented Oct 7, 2014

I also use a lot of layers.

I am thinking instead of listing all the layers of all groups, it would be great to save some space by just showing the layers of the group when the group is selected. The group names itself can be the buttons.

The group names (buttons) can be all at the top of the widget box with another smaller button (or menus) to turn all layers on/off in that group. The color of the button changes to indicate the selected group.

Here's the mockup:
layer_suggest

@jebu75
Copy link
Collaborator Author

jebu75 commented Oct 8, 2014

I like this idea a lot. It would definitely help save space. I think in the short term, @btfou will be adding functionality to turn on layers on or off. I believe the UI controls should be easily styleable by overriding css.

One way to achieve this might be to create a separate widget that uses multiple instances of LayerControl and a stack container controlled by the group buttons. I use a separate instance of LayerControl in one of my widgets and it works very well. The tricky part would be grouping the layers in the config file. If you were to add a group property, it would probably not get passed along in the layerControlInfos a widget can register for.

@btfou
Copy link
Contributor

btfou commented Oct 8, 2014

@leafyeh7 I like the concept, but it would easier to build a widget with controls like your mockup and a dijit/layout/StackContainer (even tabs or accordion) with each pane directly containing a separate LayerControl widget. As it is LayerControl is in testing and bugs are being worked out. Current priorities are supporting more layer types, improving legends and adding i18n.

Not sure if you're aware https://github.com/cmv/cmv-app/tree/LayerControl-1.3.1-patch/viewer/js/gis/dijit/LayerControl has complete docs.

I won't be adding any UI controls for turning all layers on/off but I will be adding two methods for doing so. Any suggestions for enhancements are welcome or submit a PR. :)

@btfou btfou closed this as completed Oct 8, 2014
@tmcgee tmcgee modified the milestones: v1.3.1, v1.4.0 Oct 8, 2014
@btfou
Copy link
Contributor

btfou commented Oct 8, 2014

Reopened. Will close when updated LayerControl is included in a CMV release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants