AnsweredAssumed Answered

Feature layer callouts in iOS

Question asked by on Aug 1, 2014
Latest reply on Aug 4, 2014 by

I am displaying one of the sample feature layers from ArcGIS online on my map and  I want to show a callout when a graphic on the feature layer is selected (tapped).


Following is a code snippet ..


- (void)viewDidLoad


    [super viewDidLoad];

     self.mapView.callout.delegate = self;


      NSURL *featureLayerURL =           [NSURL URLWithString:@""];


    AGSFeatureLayer *featureLayer = [AGSFeatureLayer featureServiceLayerWithURL:featureLayerURL mode:AGSFeatureLayerModeOnDemand];

    [self.mapView addMapLayer:featureLayer withName:@"CloudData"];




-(BOOL)callout:(AGSCallout *)callout willShowForFeature:(id<AGSFeature>)feature layer:(AGSLayer<AGSHitTestable> *)layer mapPoint:(AGSPoint *)mapPoint


    //Specify the callout's contents


     self.mapView.callout.title = (NSString*)[feature attributeForKey:@"NAME"];

     self.mapView.callout.detail =(NSString*)[feature attributeForKey:@"COUNTRY"];


    return YES;



However this sets title and details as nil, even though when I call this from the desktop browser ( it shows the name, country and other attributes.


What am I missing here? Is there a way to show the attributes/fields of the feature being selected? Any examples will be helpful too.