Problem displaying PopUp info

1892
2
10-12-2013 11:12 AM
ZahidChaudhry1
New Contributor
I been working with popup sample (that uses popupHelper custom class) with web map and its working fine. I add an extra dynamic map service to mapview as AGSFeatureLayer.
[HTML]
NSURL* url = [NSURL URLWithString: @"map service url"];
  AGSFeatureLayer *flayer = [AGSFeatureLayer featureServiceLayerWithURL:url mode:AGSFeatureLayerModeOnDemand];
 
  NSArray *outf = @[@"*"];
  flayer.outFields = outf;
  [self.mapView addMapLayer:flayer];
  flayer.delegate = self;
[/HTML]
it is displaying perfect and when i click on a feature, it calls the method but i get blank popup.  I tried to debug and i can see that graphics has all the attributes but popupinfo is nil (see below)....not sure why
[HTML]
if ([graphics allValues].count>0) {
    NSArray *graphicsArrays = [graphics allValues];
    for (NSArray *graphicsArray in graphicsArrays) {
      for (AGSGraphic *graphic in graphicsArray) {
        if ([graphic.layer isKindOfClass:[AGSFeatureLayer class]]) {
          AGSPopupInfo *popupInfo = [webmap popupInfoForFeatureLayer:(AGSFeatureLayer*)graphic.layer];
          AGSPopup *popup = [AGSPopup popupWithGraphic:graphic popupInfo:popupInfo];
          [popups addObject:popup];
        }
       
      }

[/HTML]
it is working fine with all the layers that are in the webmap but not working with the extra layer that i added to the mapView...

thanks

Zahid
0 Kudos
2 Replies
Noah-Sager
Esri Regular Contributor
Hi Zahid,

Welcome to Esri Forums!

Popups are most easily configured in webmaps via ArcGIS Online. Try publishing all your layers of interest as webmaps, then load them in your iOS application.

Hope this helps!

-Noah
0 Kudos
ZahidChaudhry1
New Contributor
Hi Zahid,

Welcome to Esri Forums!

Popups are most easily configured in webmaps via ArcGIS Online. Try publishing all your layers of interest as webmaps, then load them in your iOS application.

Hope this helps!

-Noah

Thanks Noah,
Plan was not to edit the webmap via ArcGIS Online...I was able to find a way to do that programatically. Thanks though.
0 Kudos