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" } }