AGSMutableEnvelope * env2 = nil; if([featureSet.features count]>0) { for (int i=0 ; i<[featureSet.features count]; i++ ) { graphic=[featureSet.features objectAtIndex:i]; if (env2 == nil) { // graphic.geometry.envelope is an AGSEnvelope // We need to derive a new AGSMutableEnvelope from it. env2=[graphic.geometry.envelope mutableCopy]; } else { // This is not the first graphic we've come across, so we'll // extend the working envelope (env2) to include it [env2 unionWithEnvelope:graphic.geometry.envelope]; } // Add the graphic to our graphics layer graphic.symbol=fillSymbol; [self.graphicsProjectQryLayer addGraphic:graphic]; } // env2 will now contain all the graphics we just looped over. // Refresh the graphics layer [self.graphicsProjectQryLayer dataChanged]; }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.