I have an application with a huge layer tree structure. A user starts by selecting a location and then the relevant layers are added to the map and the user can browse the TOC to toggle them.
I would like the user to view the TOC from the Layer List widget or the Map Switcher widget, however neither will initialize when configData.opLayers is empty. As a result the uninitialized TOC will never show my new layers. So, how can I initialize the TOC in the Map Switcher and Layer List plugins?
Note: Adding an operationallayer in config.xml will initialize both, but that's not ideal.
Aw, play nice! That did work well though, I hadn't considered excluding my only layer. That causes the TOCs to initialize and display a blank menu. I just wish I had a bit more control and with that in mind I have two suggestions for ESRI.
1. Always initialize the TOC and have a configurable default message for when it's blank. -or- 2. Allow the TOC to be initialized on request.