Select to view content in your preferred language

How to determine if a dynamic layer is turned on?

805
2
Jump to solution
09-05-2012 03:26 PM
ChrisBradberry
Deactivated User
Hey,

I am using the legend with a template, and I want to be able to tell if one of the layers has been checked on.  It is a Query Layer that needs to be refreshed every 5 minutes.  I don't want to have the timer working while the layer is turned off, but I am having a difficult time figuring out when it is turned on.

Does anybody know how to tell if a layer has been turned on?

Thanks, Chris
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
For a map layer (i.e. a layer directlly attached to a map), you can subscribe to event Layer.PropertyChanged and, in your Handler, react accordingly when the changed property is "Visible".

For a sublayer of a dynamic map service, you can subscribe to VisibilityChanged event that occurs when the visibility of a sublayer changes.

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
For a map layer (i.e. a layer directlly attached to a map), you can subscribe to event Layer.PropertyChanged and, in your Handler, react accordingly when the changed property is "Visible".

For a sublayer of a dynamic map service, you can subscribe to VisibilityChanged event that occurs when the visibility of a sublayer changes.
0 Kudos
ChrisBradberry
Deactivated User
Thanks Dominique, That works perfectly.
0 Kudos