Rotating an AGSTextSymbol in XCode

929
2
11-20-2016 07:17 PM
dungbui_van
New Contributor

Hi

I'm using the ArcGIS Runtime SDK XCode 8 with 10.2.5 for iOS. I'm having strange problems about AGSTextSymbols rotation.
Here is my code:

        

        AGSCompositeSymbol *csl = [AGSCompositeSymbol compositeSymbol];

        

        NSString *str_length=[NSString stringWithFormat:@"%.2f m", [geometryEngine lengthOfGeometry:polyline]];

        AGSTextSymbol *textSym = [[AGSTextSymbol alloc] initWithText:[NSString stringWithFormat:@"%@", str_length] color:[UIColor brownColor]];

        textSym.fontSize=22;     

        double an = (double) ((180 * atan(((p1.x - p.x) / (p1.y - p.y)))) / 3.14);

        if (an < 0)

        {an += 90;

        }

        else{

        an = an - 90;

        }

        [textSym setAngle:an];

        [csl addSymbol:textSym];

       AGSGraphic *mygraphic = [[AGSGraphic alloc]  initWithGeometry:polyline symbol:csl attributes:nil];

        [myGraphicsLayer addGraphic:mygraphic];

As you can see in the screenshot. the text  rotates in a strange manner.
I need to help me. Thanks in advance!

0 Kudos
2 Replies
dungbui_van
New Contributor

help me

0 Kudos
DiveshGoyal
Esri Regular Contributor

This is fixed with the latest version of the SDK (v100.0)

0 Kudos