AnsweredAssumed Answered

Graphics do not show up after upgrading to latest SDK (10.1.1)

Question asked by oguzhantopsakal on Jul 5, 2013
Latest reply on Jul 5, 2013 by oguzhantopsakal
I searched for an answer about this issue but could not find..

I upgraded the SDK to 10.1.1 and now graphics that I add to the graphics layer do not show up. I am copy pasting my code below. I removed [graphicsLayer dataChanged] method call since it is removed with the new SDK.


    NSString *imageName = @"Orange.png";     // Creates a custom marker symbol with the picture     AGSPictureMarkerSymbol *myMarkerSymbol = [AGSPictureMarkerSymbol pictureMarkerSymbolWithImageNamed:imageName];     // Gets the size for the node     float diameter = 50.0;         myMarkerSymbol.size = CGSizeMake( diameter, diameter );          // Converts latitude and longitude values to mercator  double num = longtitude * 0.017453292519943295;  double x = 6378137.0 * num;  double a = latitude * 0.017453292519943295;  double mercatorX = x;  double mercatorY = 3189068.5 * log((1.0 + sin(a))/(1.0 - sin(a)));    //Create an AGSPoint (which inherits from AGSGeometry) that  //defines where the Graphic will be drawn  AGSPoint* myMarkerPoint = [AGSPoint pointWithX:mercatorX              y:mercatorY           spatialReference:self.mapView.spatialReference];          //NodeInfoTemplate handles what needs to be written in the callout window  NodeInfoTemplate *template = [[NodeInfoTemplate alloc] init];  //Create the Graphic, using the symbol and geometry created earlier  AGSGraphic* myGraphic =[AGSGraphic graphicWithGeometry:myMarkerPoint              symbol:myMarkerSymbol             attributes:nodeDict            infoTemplateDelegate:template];       //Add the graphic to the Graphics layer  [self.graphicsLayer addGraphic:myGraphic];


Note that I removed the following line since dataChanged method is removed with the new SDK.
[self.graphicsLayer dataChanged];