I'm working with Flexviewer 3.1 with mapservices that have quite complex hierarchy with group layers and subgroup layers e.g.:
x Mapservice
--o Group Layer 1
----o Subgroup Layer 1
------o Map Layer 1
------o Map Layer 2
----o Subgroup Layer 2
------o Map Layer 1
------o Map Layer 2
--o Group Layer 2
----o Subgroup Layer 1
etc.
By default only the mapservices are ticked as defined in the config.xml (visible=true). I would want all the layers to be turned off by default (this i can control by the mapservice publishing process), but when user ticks on the checkbox of a subgroup layer or map layer down in the hierarchy, the layer would be visualized on the map. This would require that all the parent layers are ticked off automatically. It would be much more user friendly and create less confusion (users ticking on layers but not seeing them on map).
So the question is: How should I modify the TOC so that the parent layers are automatically turned on when any of their child group layer or map layer check box is ticked?
I guess that it needs to be implemented under src/com/esri/viewer/components/toc/tocClasses/TocMapLayerItem.as but I'm puzzled on how to implement it by code. I searched for some related threads but could not come up with a working solution.
Any help would be much appreciated.
- Joni Kaitaranta
x Mapservice
--o Group Layer 1
----o Subgroup Layer 1
------o Map Layer 1
------o Map Layer 2
----o Subgroup Layer 2
------o Map Layer 1
------o Map Layer 2
--o Group Layer 2
----o Subgroup Layer 1
etc.
By default only the mapservices are ticked as defined in the config.xml (visible=true). I would want all the layers to be turned off by default (this i can control by the mapservice publishing process), but when user ticks on the checkbox of a subgroup layer or map layer down in the hierarchy, the layer would be visualized on the map. This would require that all the parent layers are ticked off automatically. It would be much more user friendly and create less confusion (users ticking on layers but not seeing them on map).
So the question is: How should I modify the TOC so that the parent layers are automatically turned on when any of their child group layer or map layer check box is ticked?
I guess that it needs to be implemented under src/com/esri/viewer/components/toc/tocClasses/TocMapLayerItem.as but I'm puzzled on how to implement it by code. I searched for some related threads but could not come up with a working solution.
Any help would be much appreciated.
- Joni Kaitaranta