Good Morning,
Can anyone point me to the location where I can add code that if a sublayer is turned on the Group Layer is also turned on in the LayerList?
Thanks
My solution was to have all the group layers on from the start, whether a sublayer is turned on, or not. Then the user doesn't have to worry about it.
I think this would be a helpful enhancement as well. Not only for WAB but for AGOL too.
Speaking of enhancements, I would like the ability to set a group layer as expanded showing the sublayers on startup. Or if someone knows how to code this? For some of my users, they are only aware of the checkbox, but take awhile to realize clicking on the group name itself will expand the group.
Agree that this should be in WAB and AGOL. Sometimes external map services have a lot of group layers.
Here is where I'm starting to look at this possibility in the map service layer info.
_setTopLayerVisible: function(visible) {
this.originOperLayer.layerObject.setVisibility(visible);
this._visible = visible;
},
I am doing the inverse (after select the main group all child are set visible to true. It works but the TOC and the map are not updated until the application refresh.
See my code:
if (evt.ctrlKey) {
if (ckSelect.checked && layerInfo.newSubLayers.length > 0) {
for (var i = 0; i < layerInfo.newSubLayers.length; i++) {
var layer = layerInfo.newSubLayers;
layer._visible = true;
}
}
}
Could someone give me some idea?