How can i use values of  infosymbol or result of clickGraphic?

544
0
05-06-2014 02:42 PM
PabloCamacho
New Contributor
Help!
I have an application and i do queries with clickGraphic, i want use the results (values, attributes) of this. How can i do it?
protected function h_identifica(event:MapMouseEvent):void{
    if(banderaidentifica == 1)
    {
     clickGraphicsLayer.clear();
     cursorManager.setBusyCursor();
    
     var identifyParams:IdentifyParameters = new IdentifyParameters();
     identifyParams.returnGeometry = true;
     identifyParams.tolerance = 1;
     identifyParams.width = map.width;
     identifyParams.height = map.height;
     identifyParams.geometry = event.mapPoint;
     identifyParams.mapExtent = map.extent;
     identifyParams.spatialReference = map.spatialReference;
     identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_VISIBLE;
    
    
    
     if(eolica120_pot1.visible == true)
     {
      identifyTask.url = "http://" + ip + "/arcgis/rest/services/INER/VESTAS_WPOWER/MapServer";
      identifyParams.layerIds = [29];
     }
    
     /*if(eolica_pot1.visible == false && eolica120_pot1.visible == false){
      identifyTask.url = "http://" + ip + "/ArcGIS/rest/services/INER/LIMITES/MapServer";
      identifyParams.layerIds = [0];
     }*/
    
     var clickGraphic:Graphic = new Graphic(event.mapPoint, clickPtSym);
     //var temporal:Graphic = new Graphic(event.mapPoint, clickPtSym);
    
    
     clickGraphicsLayer.add(clickGraphic);
    
     //identifyestados.execute(identifyParams,new AsyncResponder(myResultFunction, myFaultFunction, temporal));
     identifyTask.execute(identifyParams, new AsyncResponder(myResultFunction2, myFaultFunction, clickGraphic));
    
    }
   }
  
  
  
   private function myResultFunction2(results:Array, clickGraphic:Graphic):void ///Recurso
   {
    if (results && results.length > 0)
    {
    
     var result:IdentifyResult = results[0];
     var resultGraphic:Graphic = result.feature;
     resultGraphic.symbol = smsIdentify;
     resultsArray.push(resultGraphic.attributes);
     clickGraphic.symbol = new InfoSymbol();
     clickGraphic.attributes = resultGraphic.attributes;
    
     cursorManager.removeBusyCursor();
    
    }
   }
  
  
  
  
   private function myFaultFunction(error:Object, clickGraphic:Graphic = null):void
   {
    Alert.show(String(error), "Identify Error");
   }
Tags (2)
0 Kudos
0 Replies