AnsweredAssumed Answered

How to show an annotation on a map

Question asked by sjmahmud on Sep 27, 2015
Latest reply on Oct 7, 2015 by Gagandeep_Singh-esristaff

Now that I have loaded a map in my app, I need to show a marker annotation for a location. Here is the code I'm using but nothing is showing on the map:

 

 

CLLocation *location = [[CLLocation alloc] initWithLatitude:douLat longitude:douLon];

  AGSPoint *markerPoint = [AGSPoint pointWithLocation:location];

 

  AGSGraphicsLayer* myGraphicsLayer = [AGSGraphicsLayer graphicsLayer];

 

  [self.ibMapView addMapLayer:myGraphicsLayer withName:@"Graphic Layer"];

  AGSPictureMarkerSymbol *markerSymbol = [AGSPictureMarkerSymbol pictureMarkerSymbolWithImageNamed:@"existing_project_icon.png"];

  AGSGraphic* myGraphic = [AGSGraphic graphicWithGeometry:markerPoint

   symbol:markerSymbol

   attributes:nil];

 

  // Add the graphic to the Graphics layer

  [myGraphicsLayer addGraphic:myGraphic];

  [self.ibMapView.callout showCalloutAtPoint:markerPoint forFeature:myGraphic layer:myGraphicsLayer animated:YES];

 

 

Please help.

Outcomes