nqazi

identifytask gives same layer twice

Discussion created by nqazi on Mar 14, 2013
I am using identifytask to find the features on the mouse click event. however i have noticed that some time identifytask  repeats a same layer twice which means two records of the same layer. here is the detail
i publish a map service consisting of 10 layers:
UWWT_OSWTS_SpatialJoin (0)
OSWTS_Catchment_Wx (1)
XY_UWWT_OSWTS_SpatialJoin_Cl (2)
aggregatedXY_500 (3)
aggregatedXY_250 (4)
Roads_Wx_2 (5)
River_seg_clip_Wx (6)
Soil_Subsoils_WX (7)
DTB_Wexford (8)
kerneldensitynhq (9)
hz12fill_hill (10)

i than used following tag in my .mxmlfile to identify the feature on mouse click

<esri:IdentifyTask id="identifyTask"
         concurrency="last"
         url="http://localhost:6080/arcgis/rest/services/WexfordMapLayerMrch2k13/MapServer"/>
private function mapClickHandler(event:MapMouseEvent):void
   {
    var identifyParams:IdentifyParameters = new IdentifyParameters();
    identifyParams.returnGeometry = true;
    identifyParams.tolerance = 3;
    identifyParams.width = myMap.width;
    identifyParams.height = myMap.height;
    identifyParams.geometry = event.mapPoint;
    identifyParams.mapExtent = myMap.extent;
    identifyParams.spatialReference = myMap.spatialReference;
    identifyParams.layerOption="all";
    clickGraphicsLayer.clear();
    clickGraphic = new Graphic(event.mapPoint, clickPtSym);
    clickGraphicsLayer.add(clickGraphic);
    /* for time being i am disabling identify task*/
   
    identifyTask.execute(identifyParams, new AsyncResponder(myResultFunction, myFaultFunction, clickGraphic));
  
}
now when i used following code
  var ii:int=0;
var myres:IdentifyResult
for( ii = 0;ii<results.length;ii++)
{
     
myres=results[ii]
Alert.show("ii:" + ii +"id" + myres.layerId + "nme"+ myres.layerName)
}
It has given me the layer named DTB_Wexford  with id =8 twice in the record set. Any idea what is the problem and its remedy

Outcomes