Select to view content in your preferred language

Group layers in the layerlist widget

20609
42
02-14-2017 09:18 AM
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
DougBrowning
MVP Esteemed Contributor

Had 2.11 and kept getting an error.  Tried 2.12 and still getting this error

fail to import app. { message: 'Fail to import. The theme used by the app is in a newer version. 

Using Jewelry Box theme 

Is there a newer version or what am I missing?  I see your post here Fail to import App, Theme is newer   But that was some time ago.  Prob same issue though.

Any ideas when they match up again?  Is there a early adopter maybe?

Have to say it blows my mind there is not a checkbox to start those things collapsed or not.  Every other software I have ever used has had it.  If anyone is listening can it get added?  Seems simple enough.  Just the only thing holding us back from a big launch.

Thanks

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Doug,


   I believe that online is version 2.13 and WAB Dev is still at 2.12. You will have to wait for 2.13 Developer version to be released.

0 Kudos
DougBrowning
MVP Esteemed Contributor

We did test this on a new app just to see and your code works perfectly.  Not sure if we will go through a start over and a custom build just for that at this point.  But we plan to use it in the future.  Thanks!

Hopefully it will be added to the config soon.

0 Kudos
CAMBIOSPUOS
New Contributor

Hi! you have to group and create a cascade  of layers in desktop, after that you can publish your layers as a service, finally you upload your service in your app.

0 Kudos
AndyWells
Frequent Contributor

I want this to work, but it never does. In ArcMap (or even in ArcGIS Pro) I have a group layer, with my two layers in that group. I upload the service, and in ArcGIS Online Content, it shows up as one service. But when you add that service to a map, it loads the individual layers separately, and not in a group. How were you able to get it to work? 

0 Kudos
by Anonymous User
Not applicable

Andy, it sounds like you are adding them at the sublayer level perhaps?  If you add yourserver/Parcels/MapServer/0 if you have let's say a dozen layers in a Parcel service... and 0 is the first layer, the Parcels, then it adds as a featureLayer.  If you add yourserver/Parcels/Mapserver it will add the group, as a dynamic layer.  Are you following?  You want to stop the link at /Mapserver  so copy up to that point, and leave out the number at the end.  

I think it would be useful to allow adding sublayers as a dynamic layer (now called map image layer) to AGOL. This is perhaps coming when they allow for grouping layers in webmaps and moving them. That would allow us to recombine several differeny sublayers from multiple map services in to a new 'group' for example.

0 Kudos
DavidForbuss1
Frequent Contributor

I'm getting this a request constantly from my end users.  They need to be able to turn multiple layers on/off at once, and they'd like the layers organized into groups because just having one big list of them is too cluttered.

DawitKidane1
Occasional Contributor

Hi David,

I have a custom widget and it might do what you wanted. I guess I should be able to attach a zip file here. It is attached to this thread.

Thanks,

Dawit

0 Kudos
DawitKidane1
Occasional Contributor

@LayerList grouping of layersHi all,

Try this custom widget for grouping layers in layerlist. In settings assign group name to each layer or leave it blank and it will be assigned to "Default" group. Let me know how I can help. Group layers in the layerlist widgetEditing LayerList widget to include multiple Groups/Divs of layers

FelixciaBlanchard1
Emerging Contributor

This is great thank you! I was able to use this widget for "micro" grouping in combination with the below link method used for "macro" grouping:

Spring Clean Your Web Apps With Group Layer Lists in Web AppBuilder — Cloudpoint Geographics Inc.