AGSTextSymbol *textSymbol = [[AGSTextSymbol alloc] initWithText:@"Hello World" color:[UIColor redColor]]; textSymbol.fontSize = 14; textSymbol.borderLineWidth = 4; textSymbol.borderLineColor = [[AGSColor alloc] initWithRed:1 green:1 blue:1 alpha:.8]; NSDictionary *dict = [textSymbol encodeToJSON]; NSData *data = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:nil]; NSString *json = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@"%@", json);
{ "text" : "Hello World", "type" : "esriTS", "backgroundColor" : [ 0, 0, 0, 0 ], "verticalAlignment" : "middle", "horizontalAlignment" : "center", "borderLineColor" : [ 255, 255, 255, 204 ], "font" : { "weight" : "normal", "style" : "normal", "size" : 14, "decoration" : "none", "family" : "Helvetica" } }
Solved! Go to Solution.