Hi all,
I fixed the group layers toggle issue.
Added below if condition before "for loop" in "accumVisibleLayers()" funtion of "TocMapLayerItem.as". and it's working fine for me.
if(item.visible)
{
}
------------------------------------------------
file path : src\com.esri.viewer\components\toc\tocClasses\TocMapLayerItem.as
below is the modified function
private function accumVisibleLayers(item:TocItem, accum:Array, useLayerInfoName:Boolean = false):void
{
if (item.isGroupLayer())
{
// Don't include group layer IDs/names in the visible layer list, since the ArcGIS REST API
// implicitly turns on all child layers when the group layer is visible. This goes
// counter to what most users have come to expect from apps, e.g. ArcMap.
//Added by Kiran to fix the group layers toggle issue
if(item.visible)
{
for each (var child:TocItem in item.children)
{
accumVisibleLayers(child, accum, useLayerInfoName);
}
}
}
else
{ // Leaf layer
if (item.visible)
{
if (item is TocLayerInfoItem)
{
var layer:TocLayerInfoItem = TocLayerInfoItem(item);
accum.push(useLayerInfoName ? layer.layerInfo.name : layer.layerInfo.id);
}
}
}
}
---------------------------------------------------------------------
Thanks & Regards,
Kiran M