Select to view content in your preferred language

Identify Task with Layer List

623
1
11-18-2011 09:30 AM
ElliotSchwid
Emerging Contributor
I created a map using the legend and toggle service sample. The problem i am having is getting the visible layers to identify. I set up my feature layers with their default visibility as false.

Like so:

var profueltreat2011 = new esri.layers.FeatureLayer("url", { id: 'name',
        mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
        outFields: ["*"],      
        visible:false
        });

After the user toggles the layer to Visible they should be able to identify the feature. I set up the identifyparams as such:

identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE;

but the toggled layers do not identify. I appreciate any help.

Elliot
0 Kudos
1 Reply
Vincent_ZFan
Emerging Contributor
I think you will need to check the layerIds property
where the layer is in the layerIds.

identifyParams.layerIds = [23,25];
0 Kudos