-(void) DoneAssociatingFeatures { NSNumber *numberSketch = [NSNumber numberWithInteger:[self.activeFeatureLayer objectIdForFeature:GraphictoEdit]]; for (AGSGraphic *graphic in self.activeFeatureLayer.graphics) { NSNumber *number = [NSNumber numberWithInteger:[self.activeFeatureLayer objectIdForFeature:graphic]]; AGSGeometryEngine *geometryEngine = [AGSGeometryEngine defaultGeometryEngine]; if ([geometryEngine geometry:self.editGeometrySketchGraphicsLayer.geometry withinGeometry:graphic.geometry]) { if ([numberSketch isEqualToNumber:number]){} else { for (id key in graphic.allAttributes) { if (![key isEqual: @"OBJECTID"]) { id value = [graphic.allAttributes objectForKey:key]; NSLog(@"Graphic Value %@",value); [self.popupVC.currentPopup.graphic setAttribute:value forKey:key]; } } } } } [self presentModalViewController:self.popupVC animated:YES]; self.mapView.touchDelegate = self; [self.editGeometrySketchGraphicsLayer clear]; }
-(void) popupsContainer:(id<AGSPopupsContainer>)popupsContainer didFinishEditingGraphicForPopup:(AGSPopup *)popup { [self.bezierImageView removeFromSuperview]; self.activeFeatureLayer = (AGSFeatureLayer*) popup.featureLayer; popup.graphic.geometry = [[AGSGeometryEngine defaultGeometryEngine]simplifyGeometry:popup.graphic.geometry]; popup.graphic.geometry = [[AGSGeometryEngine defaultGeometryEngine]normalizeCentralMeridianOfGeometry:popup.graphic.geometry]; int oid = [self.activeFeatureLayer objectIdForFeature:popup.graphic]; if(oid >0) { //Has valid oid and is only updated on server [self.activeFeatureLayer updateFeatures:[NSArray arrayWithObject:popup.graphic]]; } else { // does not have valid oid and is add as a new feature [self.activeFeatureLayer addFeatures:[NSArray arrayWithObject:popup.graphic]]; } if (AppDelagate.ActiveProject != nil) { if ([popup.graphic.geometry isEqual:AppDelagate.ActiveProject.geometry]) { AppDelagate.ActiveProject.allAttributes = popup.graphic.allAttributes; } } [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; }
Solved! Go to Solution.