iOS Popup not displaying feature layer information

3644
7
Jump to solution
06-27-2012 07:03 AM
JohnMcleod1
New Contributor III
Hello Everyone,
I'm still learning, so please be patient.
I'm trying to duplicate the "Feature Layer Editing Sample" with some changes.
1. No editing of feature layer (I just comment the "+" button)

I have downloaded the sample and it runs fine.  When I change the ID in the URL of the sample code to my custom webmap ID, the App works as I want.

In my App, these things happen
1. the map loads fine
2. the layer loads fine
3. the callout opens with an accessory button
4. the popup opens when the button is clicked and closes when the "Done" button is clicked.

The feature layer information however does not load in the popup.

Thank you for any help with this.

John
0 Kudos
1 Solution

Accepted Solutions
JohnMcleod1
New Contributor III
Well, I got the info to display in the popup.
Here's my solution.

I checked the "Related Record Editing Sample".
I commented a line and added a line to my code within MapViewController.m

-(void)mapView:(AGSMapView *)mapView didClickCalloutAccessoryButtonForGraphic:(AGSGraphic *)graphic{          self.activeFeatureLayer = (AGSFeatureLayer*) graphic.layer;          AGSPopupInfo *info = [AGSPopupInfo popupInfoForGraphic:graphic];     //Show popup for the graphic because the user tapped on the callout accessory button          //ADDED THIS LINE FROM THE "Related Record Editing Sample"     self.popupVC = [[[AGSPopupsContainerViewController alloc] initWithPopupInfo:info graphic:graphic usingNavigationControllerStack:NO] autorelease];          //COMMENTED MY CODE     //self.popupVC = [[[AGSPopupsContainerViewController alloc] initWithWebMap:self.webmap forFeature:graphic usingNavigationControllerStack:NO] autorelease];          self.popupVC.delegate = self;     self.popupVC.modalTransitionStyle =  UIModalTransitionStyleFlipHorizontal;          //If iPad, use a modal presentation style     if([[UIDevice currentDevice] isIPad])         self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet;     [self presentModalViewController:self.popupVC animated:YES];      }


If someone could explain why, that would be one more step to understanding.

John

View solution in original post

0 Kudos
7 Replies
JohnMcleod1
New Contributor III
Something I forgot to mention.
I'm using Xcode 4.3.2
I noticed the .xib files in the sample.
I have also downloaded and successfully run the "Related Record Editing Sample".
I'm looking into each to find a solution.

John
0 Kudos
JohnMcleod1
New Contributor III
Well, I got the info to display in the popup.
Here's my solution.

I checked the "Related Record Editing Sample".
I commented a line and added a line to my code within MapViewController.m

-(void)mapView:(AGSMapView *)mapView didClickCalloutAccessoryButtonForGraphic:(AGSGraphic *)graphic{          self.activeFeatureLayer = (AGSFeatureLayer*) graphic.layer;          AGSPopupInfo *info = [AGSPopupInfo popupInfoForGraphic:graphic];     //Show popup for the graphic because the user tapped on the callout accessory button          //ADDED THIS LINE FROM THE "Related Record Editing Sample"     self.popupVC = [[[AGSPopupsContainerViewController alloc] initWithPopupInfo:info graphic:graphic usingNavigationControllerStack:NO] autorelease];          //COMMENTED MY CODE     //self.popupVC = [[[AGSPopupsContainerViewController alloc] initWithWebMap:self.webmap forFeature:graphic usingNavigationControllerStack:NO] autorelease];          self.popupVC.delegate = self;     self.popupVC.modalTransitionStyle =  UIModalTransitionStyleFlipHorizontal;          //If iPad, use a modal presentation style     if([[UIDevice currentDevice] isIPad])         self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet;     [self presentModalViewController:self.popupVC animated:YES];      }


If someone could explain why, that would be one more step to understanding.

John
0 Kudos
NimeshJarecha
Esri Regular Contributor
You should only use following method if the popups are defined in a web map you are using for the feature layer to which graphic belongs. Was that the case?

//COMMENTED MY CODE
//self.popupVC = [[[AGSPopupsContainerViewController alloc] initWithWebMap:self.webmap forFeature:graphic usingNavigationControllerStack:NO] autorelease];

Regards,
Nimesh
0 Kudos
JohnMcleod1
New Contributor III
I checked and yes, popups are enabled on my webmap. 
Should they be disabled?

John
0 Kudos
NimeshJarecha
Esri Regular Contributor
No, It has to be enabled. If that was the case then that method should have worked.

If you want me to look into this further, then please post your sample project so I can test it.

Regards,
Nimesh
0 Kudos
JohnMcleod1
New Contributor III
Thank you again.
My webmap is http://bit.ly/N3gBJ7

I'm not sure how to post my iOS app.

John
0 Kudos
NimeshJarecha
Esri Regular Contributor
The graphic which you are passing to the method is belong to which layer? There are two layers in the web map one has popup defined and other one does not.

You can print the name (graphic.layer.name) of the layer in the debug window to verify.

Regards,
Nimesh
0 Kudos