IdentifyTask Returning Scale-Dependent Layers When Outside of Scale Range

Discussion created by abrown31 on Oct 11, 2012
Latest reply on May 1, 2013 by kmacleod

I'm working on my second web mapping application, and I am implementing an identifyTask on a couple point layers that are scale-dependent. At first, the layers are disabled until the user zooms closer to the points. Eventually, the points are re-enabled because the current scale meets the scale criteria. If I turn on one of the n layers and attempt to identify an area around the point, my identifyTask will identify the layer that's turned on and the layers that are turned off. I believe this is a bug of some sort. My code is below:

identifyParams = new esri.tasks.IdentifyParameters();
            identifyParams.tolerance = 3;
            identifyParams.returnGeometry = true;
            identifyParams.layerIds = [1,2,3,4,5,6,7,9];
            identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE;
            identifyParams.geometry = geometry;
            identifyParams.mapExtent = map.extent;
            identifyParams.width = map.width;
            identifyParams.height = map.height;
            identifyTask.execute(identifyParams, function (identifyResults) {

If I were to output identifyResults to the console, it would contain the visible and non-visible layers. As you can see, I specified LAYER_OPTION_VISIBLE, so it should only be identifying layers that are turned on, not the ones that are enabled due to scale dependency! I'm using 3.2compact as my API.