//present popup view controller //if ipad show formsheet if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { self.popupsContainerVC.modalPresentationStyle = UIModalPresentationFormSheet; self.popupsContainerVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentModalViewController:self.popupsContainerVC animated:YES]; } else { self.popupsContainerVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentModalViewController:self.popupsContainerVC animated:YES]; }
if (PopupGraphics.count > 0) { self.popupVC = [[ AGSPopupsContainerViewController alloc] initWithPopups:PopupGraphics usingNavigationControllerStack:NO]; self.popupVC.delegate = self; self.popupVC.style = AGSPopupsContainerPagingStylePageControl; self.popupVC.styleColor = [UIColor blackColor]; self.popupVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet; [self presentModalViewController:self.popupVC animated:YES]; }
-(void) mapView:(AGSMapView *)mapView didClickAtPoint:(CGPoint)screen mapPoint:(AGSPoint *)mappoint graphics:(NSDictionary *)graphics{ PopupGraphics = [[NSMutableArray alloc] init]; for (NSString* key in graphics) { id value = [graphics objectForKey:key]; for (AGSGraphic *featureGraphic in value) { AGSPopupInfo *popupinfo = [AGSPopupInfo popupInfoForGraphic:featureGraphic]; NSArray *CellBustedValues = [featureGraphic.layer.name componentsSeparatedByString:@" - "]; if (CellBustedValues.count >1) { popupinfo.title = [CellBustedValues objectAtIndex:1]; } else { popupinfo.title = featureGraphic.layer.name; } AGSPopup *popup = [AGSPopup popupWithGraphic:featureGraphic popupInfo:popupinfo]; [PopupGraphics addObject:popup]; } } if (PopupGraphics.count > 0) { self.popupVC = [[ AGSPopupsContainerViewControlleralloc] initWithPopups:PopupGraphicsusingNavigationControllerStack:NO]; self.popupVC.delegate = self; self.popupVC.style = AGSPopupsContainerPagingStylePageControl; self.popupVC.styleColor = [UIColor blackColor]; self.popupVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet; [selfpresentModalViewController:self.popupVCanimated:YES]; } }