Select to view content in your preferred language

Programmatically turning on a layer from the TOC menu

2007
2
08-16-2012 09:37 AM
by Anonymous User
Not applicable
Hello,
I want to programatically turn on a layer from the TOC menu when a widget is clicked.  How would I do that?  Please help.

Thanks,
Ray
Tags (2)
0 Kudos
2 Replies
AnthonyGiles
Honored Contributor
Ray,

This thread may provide some pointers:

http://forums.arcgis.com/threads/20965-LiveMapsWidget-doesn-t-follow-changes

Regards

Anthony
0 Kudos
by Anonymous User
Not applicable
Anthony,
Thanks for the link to that post.  I do have a question. How does he know what layer to make visible?  Is the "Major Roads" a layer in his TOC menu? Would I just pass a string name of the layer to that event listener?

SiteContainer.dispatchEvent(new AppEvent(AppEvent.PROGRAMATIC_LAYER_VISIBILITY_CHANGED, false, false, "Major Roads"));


Thanks,
Ray
0 Kudos