Re: Toggle layers on and off in Web AppBuilder

6958
13
11-10-2015 08:17 AM
StevenDouglas1
New Contributor III

UPDATED: See bottom of this question:

Since this is its own thread now, I'll go ahead and expand...

I am wondering how you get layers within groups to be toggle-able. The MXD was created to house all these layers within a group instead of having to create an mxd and a service for every single layer.

As you can see, when I create a map in web app builder, the layers are still defaulted to on all the time. Whereas, in another thread we were told there would be the ability to have check boxes for each layer within the group. Obviously when they're on all the time it is not useful as there are going to be >100 individual layers.
web_app_bldr_layer_list_screen.jpg

Is that something that needs to be changed first? If so where?

_______________________________________________________________________________________________________________

Ok, so after some experimenting I seem to have realized something. The above screenshot is of raster layers. However, I've now added some polygons and point files and noticed that those are able to be toggled on and off.

Is the answer that shapefiles can be turned on and off within groups, but raster files cannot? If so, whats up with that? In the meantime I've found customized table of content widgets that should fix the problem, but 1) I'm waiting for my server admin to install WebApp builder developer ed. and 2) Why can't ESRI just make this a default? It seems so simple and useful...

Message was edited by: Steven Douglas

0 Kudos
13 Replies
StevenDouglas1
New Contributor III

Ok, well I guess that answers that question.

I've seen that with the developer edition, there is a widget that can be coded to make layers toggle-able. Do you know if that is also limited by caching as well?

Thank you for your help,

Steven

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Steven,

   Yes is is a limitation of the service itself. A Cached service is a collection of pre-generated tiles (images) of the map service with the default sublayers of the map service turned on or off. Because of that you can not dynamically change the visibility of the sub layers as the tiles are already generated using the default visibility and caching can be a very time consuming and resource intense process.

0 Kudos
StevenDouglas1
New Contributor III

Ok, that makes sense. From what I've read it doesn't seem there are any alternatives are there? Does ESRI support grouping of layers in the layer list, if not will they? I believe I've seen that requested and highly liked in the ideas website. Can you do that in the widget?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Steven,

   Nope it is not a current option. I have been a widget developer (for flex and now JS and WAB) for many years and the reason (in my opinion) that no one has developed this ability is the shear complexity of the code that would be involved. There has been so workaround hacks for this in the Flex world but sometimes even though many people want and request something does not mean it is practical when is comes to coding.

0 Kudos