Select to view content in your preferred language

Sublayer List Problem

891
2
02-11-2011 11:54 AM
ElizabethMiller
Regular Contributor
I have set up a map using the Sublayer List sample. I haven't made any changes to the sample except that my map uses a different ArcGISDynamicMapServiceLayer than the sample. In the service I am using, some layers are visible by default, but not all.

The sublayer list comes in great initially. The layers that are on in the service by default display on the map and their layer checkboxes are checked. But when I turn on one of the other layers (that was not visible initially) that layer appears on the map but all the other layers disappear. Also, the other layers' checkboxes remain checked even though they are gone from the map. If I uncheck their checkboxes and then check them on again, they will turn on.

Has anyone else experienced this? Any ideas on how to get the layer visibility in sync with the sublayer list?
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
It's hard to tell what the problem is, you might need to debug through the code starting from CheckBox Click event handler. Figure out what get's added and removed from visibleLayerList.
0 Kudos
ElizabethMiller
Regular Contributor
I finally figured it out -- I had forgotten to initialize the ArcGISDynamicMapServiceLayer in my map. I included this line in my map and all worked fine.

Initialized="ArcGISDynamicMapServiceLayer_Initialized"


Thank you for the feedback!
0 Kudos