Hi,
Earlier version of SDK can set the text content fromw values from the graphic's attributes like below:
AGSTextSymbol *textSymbol = [AGSTextSymbol textSymbolWithTextTemplate:@${pointID} color:[UIColor redColor]];
How to do this in recent version?
Hello Lynn,
I think the method still using in 10.2.3. Please check this online documentation:10.2.3: AGSTextSymbol Class Reference
Hope this help.
Hi, Yue!
I red a document before. It saids the porperty 'text' will replace the porerty 'text template' after v10.2.2.
I tried 'text' porperty with the token like ${pointID}. But it doesn't work.
Did you test this function before? ??
Does it works?
If so , please show me some codes.
Thanks.
Hi Lynn,
I am not really sure what is ${pointID}? Is it point to your database field or something else?
Here are two snippet code to use this AGSTextSymbol textSymbolWith Text method:
NSString *stopString = @""; if (stopNumber != NSNotFound) { stopString = [NSString stringWithFormat:@%d, stopNumber]; } AGSTextSymbol *ts = [AGSTextSymbol textSymbolWithText:stopString color:[UIColor blackColor]];
Or
NSMutableString *word = [NSMutableString stringWithFormat:@Hello world]; AGSTextSymbol *txtSymbol = [AgSTextSymbol textSymbolWithText:word color:[UIColor redColor]];
Hi, Yue
Yes, the pointID is a field name of a graphic. In the old version of iOS SDK, I can use the property ‘textTemplate’ to set the text symbol text content of a graphic using its attribute field name but not a very string (just like your codes above). That will be very convenient. This function is very similar with the AGSCalloutTemplate 's titleTemplate.
I just like to know wether the AGSTextSymbol still supports this kind of template function.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.