AnsweredAssumed Answered

Cannot display graphics on graphicslayer that are returned by AGSQueryTask query

Question asked by oguzhantopsakal on Oct 12, 2012
Latest reply on Oct 12, 2012 by njarecha-esristaff
I spent quite some time on this but could not figure out. Help is much appreciated..

I query a feature map as follows:

   self.queryTask = [AGSQueryTask queryTaskWithURL:featureURL];     self.queryTask.delegate = self;         AGSQuery *query = [AGSQuery query];     query.where = @"OBJECTID <= 100";     query.outFields = [NSArray arrayWithObject:@"*"];     query.returnGeometry = YES;     [self.queryTask executeWithQuery:query];


Everything works fine so far and I get response for 100 objects and add them to the graphicsLayer. graphic.geometry is not null.

- (void)queryTask:(AGSQueryTask *)queryTask operation:(NSOperation *)op didExecuteWithFeatureSetResult:(AGSFeatureSet *)featureSet {             [self.graphicsLayer removeAllGraphics];  for (AGSGraphic *graphic in featureSet.features) {                 graphic.visible = YES;   [self.graphicsLayer addGraphic:graphic];  }  [self.graphicsLayer dataChanged]; }



HOWEVER, I cannot see anything on the map. (I also tried the above code without removeAllGraphics)

The following code in another method works fine to add nodes on the map:
 AGSGraphic* myGraphic =[AGSGraphic graphicWithGeometry:myMarkerPoint              symbol:myMarkerSymbol             attributes:nodeDict            infoTemplateDelegate:template];       //Add the graphic to the Graphics layer  [self.graphicsLayer addGraphic:myGraphic];


Any ideas about what could be going wrong?

Thanks!

Outcomes