I load some layers and set the properities such that overlapping labels will not display.
However, I have a need to find out which features did not display their labels due to the overlapping algorithms.
1. Is there a way I can find this out?
2. Is there a way I could determine (in advance) which labels would not display and then change their label to something smaller that might display because of less overlap likeliness. For instance, if the label would have been "Bob Smith", I could change the label to "1" - this would then be used as an index to look up on a seperate list of features that could not display their full labels.
Sorry to make you wait on this. We are launching 4 products to production today and it was quite busy last week as we pulled some support resource to help with the testing.
On to your question… I think there is a way to do what you are talking about. In our labeling system we have setup a series of protected virtual methods that get called in order to do the labeling. Like for example the first method gets the labels in view, the second step eliminated duplicates, the third step does something etc. What you could do is inherit from our text style, override the proper step and then in your code call the base code. You can look at the results and then if you don’t like them do something to modify the stuff coming in and then resend them. You will see the features going in and the results going out. You will control if the results are accepted. At the moment I need to run but when I get back in the office I will find that method, do a quick test and let you know my results.
Hope my following sample code can show you what is going on the labeling stuff. Of course, you can change the logic to anything you want. public class MyTextStyle : TextStyle { public MyTextStyle() : base() { }
this returns to me a list of features that did not print their labels - however, the features do not have anything but the label column in their columnvalues. I would like to get the identity column that I include with the feature so that I can reference back to the methods that will do something with this list.
Ok. So I grab the id of each feature that is returned by GetUnLabeledFeaturesForOverlapping() and then use the correct featureLayer to grab all features in that list - retreiving the column that I need for identification.