From DynamicMapServiceLayer.visibleLayers disable query on Feature Layer

Discussion created by mkoneya on Apr 26, 2013
I am adding both the feature layer and the map service to a map and setting the mode on the FeatureLayer to  esri.layers.FeatureLayer.MODE_SELECTION.  

The application will have the ability to change the visibile layers for the Map Service.   Based on the visible layers in the Map Service,  I would like to either allow or disallow a query on the feature layer within the Map Service.

How can I determine if the FeatureLayer is visible based on the visibleLayers for the Map Service.