Hi,Does anyone have any (and I mean any) implementation for this method:- (UIView*) customViewForGraphic: (AGSGraphic *) graphicscreenPoint: (CGPoint) screenmapPoint: (AGSPoint *) mapPoint.I am interested in either or both the programmatical or NIB-file based implementation as a guide. I could not find any example on the entire World Wide Web.
Just return UIView.This is a sample in my iPad app.-(UIView *)customViewForGraphic:(AGSGraphic *)graphic screenPoint:(CGPoint)screen mapPoint:(AGSPoint *)mapPoint{ if ([graphic.layer.name isEqualToString:@spb_amphor_sm1]) { NSArray *ampInfo = [NSArray arrayWithObjects:[graphic.attributes objectForKey:colCTLSUM],[graphic.attributes objectForKey:colCOWSUM],[graphic.attributes objectForKey:colBUFSUM],[graphic.attributes objectForKey:colPIGSUM],[graphic.attributes objectForKey:colCHCSUM],[graphic.attributes objectForKey:colDCKSUM],[graphic.attributes objectForKey:colGOASUM],[graphic.attributes objectForKey:colSHPSUM],[graphic.attributes objectForKey:colOTHSUM], nil]; UIView *oldView = [self.view viewWithTag:102]; if (oldView != nil) { [oldView removeFromSuperview]; } if (infoType == 0) { AGSPopupsContainerViewController *popView = [[AGSPopupsContainerViewController alloc] initWithPopupInfo:[self.webmap popupInfoForFeatureLayer:graphic.layer] graphic:graphic usingNavigationControllerStack:NO]; popView.delegate = self; return popView.view; } else if (infoType == 1) { BarAnimal *info = [[BarAnimal alloc] initWithNibName:@ChartSample bundle:nil]; [info DataBind:ampInfo]; info.title = [graphic.attributes objectForKey:colAmpnamethai]; [info.view setFrame:CGRectMake(0, 0, 420, 260)]; return info.view; } else { ChartSample *info = [[ChartSample alloc] initWithNibName:@ChartSample bundle:nil]; [info DataBind:ampInfo]; info.title = [graphic.attributes objectForKey:colAmpnamethai]; [info.view setFrame:CGRectMake(0, 0, 280, 280)]; return info.view; } } else { AGSPopupsContainerViewController *popView = [[AGSPopupsContainerViewController alloc] initWithPopupInfo:[self.webmap popupInfoForFeatureLayer:graphic.layer] graphic:graphic usingNavigationControllerStack:NO]; popView.delegate = self; return popView.view; }}
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.