Select to view content in your preferred language

popup with multiple graphics on graphic click

2474
4
Jump to solution
11-09-2012 06:17 AM
VIKRANTKRISHNA
Regular Contributor
Hi,
    I want to show popup with multiple features upon click on graphic. I followed the steps mentioned in this thread http://forums.arcgis.com/threads/63167-Multiple-Features-in-Popup?highlight=popup+click  , but not yet successful. I need to remove the steps of callout and accessory button.  What should I do in mapView:didClickAtPoint to launch popup.

Thanks,
Vikrant
0 Kudos
1 Solution

Accepted Solutions
JeffGiesler
Deactivated User
Vikrant,
Below is my code for the didClickAtPoint. 
-(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; // so it doesn't take up the entire screen self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet;         [selfpresentModalViewController:self.popupVCanimated:YES];     } }

Also i found that setting your self.mapView.CalloutDelegate = self in the viewDidLoad turns off the callout box
Hope this helps.
Jeff

View solution in original post

0 Kudos
4 Replies
JeffGiesler
Deactivated User
Vikrant,
Below is my code for the didClickAtPoint. 
-(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; // so it doesn't take up the entire screen self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet;         [selfpresentModalViewController:self.popupVCanimated:YES];     } }

Also i found that setting your self.mapView.CalloutDelegate = self in the viewDidLoad turns off the callout box
Hope this helps.
Jeff
0 Kudos
VIKRANTKRISHNA
Regular Contributor
Hi Jeff,
         I just found the solution from the same post, was about to respond to it.

Thanks,
Vikrant
0 Kudos
JeffGiesler
Deactivated User
Glad you figured it out,
Cheers,
Jeff
0 Kudos
DiveshGoyal
Esri Regular Contributor
Check out our latest sample showing how to display popups.
0 Kudos