AGSPictureMarkerSymbol *myMarkerSymbol = [AGSPictureMarkerSymbol pictureMarkerSymbolWithImageNamed:@"Pushpin.png"]; myMarkerSymbol.color = [UIColor redColor]; [AGSPoint pointWithX:32.0636 y:34.7922 spatialReference:[AGSSpatialReference spatialReferenceWithWKID:43276]]; AGSGraphic* myGraphic = [AGSGraphic graphicWithGeometry:myMarkerPoint symbol:myMarkerSymbol attributes:nil infoTemplateDelegate:nil]; [myGraphic addGraphic:myGraphic]; [self.myGraphicsLayer dataChanged]; [self.mapView addMapLayer:self.myGraphicsLayer withName:@"test];
myGraphicsLayeris a layer that on the moment of calling this code is showen on the map, i tried also setting it to layer that not displayed and then calling it...
//add graphics layer first the map [self.mapView addMapLayer:self.myGraphicsLayer withName:@"test]; //then add graphic to graphics layer AGSPictureMarkerSymbol *myMarkerSymbol = [AGSPictureMarkerSymbol pictureMarkerSymbolWithImageNamed:@"Pushpin.png"]; myMarkerSymbol.color = [UIColor redColor]; [AGSPoint pointWithX:32.0636 y:34.7922 spatialReference:[AGSSpatialReference spatialReferenceWithWKID:4326]]; AGSGraphic* myGraphic = [AGSGraphic graphicWithGeometry:myMarkerPoint symbol:myMarkerSymbol attributes:nil infoTemplateDelegate:nil]; [self.myGraphicsLayeraddGraphic:myGraphic]; [self.myGraphicsLayer dataChanged];