Multiple Features in Popup

3134
4
Jump to solution
07-25-2012 02:42 PM
JeffGiesler
Occasional Contributor
Hey Everyone,
I am having trouble getting multiple feature to show up in my popup view controller.  I get creating the Mutable array for the popups but I am not sure where to populate it.  Whenever I click on the didClickCalloutAccessoryButtonForGraphic I only get the top graphic for the layer. I don't know if I am doing something wrong there or missing a method.  Any help would be greatly appreciated.
Cheers,
Jeff
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
Here are the steps to show multiple popups in a popups view controller.

1. Adopt AGSMapViewTouchDelegate protocol and set self.mapView.touchDelegate = self.
2. Implement mapView:didClickAtPoint:mapPoint:graphics: method which provides all graphics at tap location.
3. Loop through all graphics and create popup (AGSPopup) for each graphic with popupInfo.
4. Store all AGSPopup objectes in an array.
5. If you want to show popups from didClickCalloutAccessoryButtonForGraphic then use AGSPopupsContainerViewController's initWithPopups method to create popups view controller.
6. Show/present view controller.

Hope this helps!

Regards,
Nimesh

View solution in original post

0 Kudos
4 Replies
PaulLohr
Occasional Contributor III
I am having trouble getting multiple feature to show up in my popup view controller. I get creating the Mutable array for the popups but I am not sure where to populate it.


http://resources.arcgis.com/en/help/runtime-ios-sdk/concepts/#/Displaying_Web_Map_Popups/00pw0000005...

Looking at the linked page above, I don't see the code for putting the AGSGraphics into an array. Are we supposed to get all the features on the map, put them into AGSGraphics objects, then put those into an array? Just a guess.

If you don't get a response (you probably will), you might take a look at the samples.
0 Kudos
NimeshJarecha
Esri Regular Contributor
Here are the steps to show multiple popups in a popups view controller.

1. Adopt AGSMapViewTouchDelegate protocol and set self.mapView.touchDelegate = self.
2. Implement mapView:didClickAtPoint:mapPoint:graphics: method which provides all graphics at tap location.
3. Loop through all graphics and create popup (AGSPopup) for each graphic with popupInfo.
4. Store all AGSPopup objectes in an array.
5. If you want to show popups from didClickCalloutAccessoryButtonForGraphic then use AGSPopupsContainerViewController's initWithPopups method to create popups view controller.
6. Show/present view controller.

Hope this helps!

Regards,
Nimesh
0 Kudos
JeffGiesler
Occasional Contributor
Nimesh,
Thanks very much for your help.  That answered my question perfectly.
Cheers,
Jeff
0 Kudos
NimeshJarecha
Esri Regular Contributor
You're welcome! Please mark thread as answered! 🙂

Regards,
Nimesh
0 Kudos