AGSTextSymbol missing properties after encodeToJSON

2708
1
Jump to solution
06-10-2014 09:31 AM
JamesRichards1
Occasional Contributor
Some properties are missing after encoding a text symbol to JSON. Most notably the color and borderLineWidth. This makes it difficult to rehydrate the symbol later. Example:

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);


Results in this:

{   "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"   } }
0 Kudos
1 Solution

Accepted Solutions
DiveshGoyal
Esri Regular Contributor
Thanks for reporting that. We plan to fix it in the next release.

View solution in original post

0 Kudos
1 Reply
DiveshGoyal
Esri Regular Contributor
Thanks for reporting that. We plan to fix it in the next release.
0 Kudos