Brett, Try this function replacement.//identify features
private function identifyFeatures():void
{
var identifyParams : IdentifyParameters = new IdentifyParameters();
identifyParams.returnGeometry = false;
identifyParams.tolerance = identifyTolerance;
identifyParams.geometry = identifyPoint;
identifyParams.width = map.width;
identifyParams.height = map.height;
identifyParams.mapExtent = map.extent;
identifyParams.spatialReference = map.spatialReference;
for (var i:Number = map.layerIds.length -1; i >= 0; i--)
{
identifyParams.layerOption = identifyLayerOption;
identifyParams.layerIds = null
var layer:Layer = map.getLayer(map.layerIds);
var url:String;
if (layer.visible)
{
if (layer is ArcGISDynamicMapServiceLayer)
{
var dynamicLayer:ArcGISDynamicMapServiceLayer = layer as ArcGISDynamicMapServiceLayer;
url = dynamicLayer.url;
if(identifyLayerOption == "visible")
{
identifyParams.layerIds = dynamicLayer.visibleLayers.source;
identifyParams.layerOption = "all";
if(dynamicLayer.visible == false)
url="";
}
//This is the new code
//Change Parcel Data to the map service name of yours you want to use
//and change 67,68 to the layer numbers of yours
//in the else url=""; is what makes it ignore all other map services
//if there name is not (in my example) Parcel Data.
if (layer.id == "Parcel Data")
{
identifyParams.layerIds = [67,68];
} else {
identifyParams.layerIds = null;
url="";
}
}
else if (layer is ArcGISTiledMapServiceLayer)
{
var tiledLayer:ArcGISTiledMapServiceLayer = layer as ArcGISTiledMapServiceLayer;
url = tiledLayer.url;
if(identifyLayerOption == "visible")
{
if(tiledLayer.visible == false)
url="";
}
}
if(url)
{
var identifyTask:IdentifyTask = new IdentifyTask(url);
identifyTask.addEventListener(IdentifyEvent.IDENTIFY_COMPLETE, onResult);
identifyTask.addEventListener(FaultEvent.FAULT, onFault);
identifyTask.execute(identifyParams);
showMessage(loadingLabel, true);
showStateResults(null);
}
}
}
}