Select to view content in your preferred language

Group layers in the layerlist widget

20819
42
02-14-2017 09:18 AM
Labels (1)
GilbertoMatos
Frequent Contributor

Hello!

I need to create layer grouping within the layerlist widget. I am using version 2.2 of the web appbuilder.

When we created the layers on the server as mapserver, the created groups were respected by the layerlist widget, however, because we needed specific resources, we had to switch to featurelayer and put them as dynamic layers, and with that, the layerlist widget no longer mattered the groups.

Is there any way to do this even manually?

Note: I thought of something like this. Return the layers exactly in the order in which I need to group, and within the assembly loop of the treeview, create a parent node and go adding the layers as children, until the last one or be necessary to create another parent node in the treeview. Can I do this? I just do not know how to proceed, what points to change, etc.



Thank you!
Gilberto.

42 Replies
mapsrock
New Contributor

Thank you for sharing this, it's amazing and what everybody wanted for so long time.
i just have one issue with the move layer up and down inside the group, the layer disappears from the list, have u updated this widget after that and why don't you publish it to the custom widgets list ?

DawitKidane1
Occasional Contributor

I am surprised why the layers disappear from the list. It has not happened to me...and may be to do with ESRI layer drawing order? What is your JS API version?

0 Kudos
JeremeChandler
New Contributor

Nice work here @DawitKidane1 . Thank you for sharing your code! This has been needed for quite a while now.

0 Kudos