This was mentioned in the AreaStyles Obsolete thread but seems to have been missed in the background noise, so I’m opening it on a separate thread.
Marking Columns obsolete and referring to the constructor is fine for IMFL instances that we own/create, and I’ve updated them for this change. However, there are 2 problems that I see, one of them major.
1) There is a very minor problem with the selection of ctors. For our use, we don’t know the feature set until much later so I don’t have features to pass in when the layer is constructed. Not having a constructor requiring only columns requires me to construct and pass an empty collection of features. Certainly not difficult, and the same as you would do inside if I didn’t (just as you did for the parameterless ctor), but it leaves the client code a bit crufty.
2) The major problem is with instances I don’t own. For instance, the specific problem I have is with TrackInteractiveOverlay.TrackShapeLayer. My code adds a custom LengthColumnName used to provide a length of segments dynamically for measuring map features (linear ruler, line segments, and polygon segments depending). This was done based on a sample you provided, but is now no longer possible without ignoring the obsolete warning, and hoping that it doesn’t go away after version 10 as warned in the message.
That second one seems to be a HUGE oversight.
InMemoryFeatureLayer.Columns is obsolete
Hi Russ,
Thanks for let us know this, but it looks you can directly use your custom LengthColumnName in style but not need to add it to columns, you can handle that in CustomColumnFetch event.
Do you think that can solve the warning?
Regards,
Don
Sorry, I have not had a chance to try it yet. But I don’t think that will work for the same reason it does not work for our other labels. As discussed in the recent thread titled “CustomColumnFetch not getting called”, it would appear that the method gets called only once. However, I suppose this code could be adapted to match the suggestion there. Also for reference, this now obsolete code is based on Troy’s answer to an earlier thread late last year titled “Different labels on each interactive line segment”. Updating the project he posted would be helpful for me and potentially others attempting the same thing (which will prove problematic if they find and try to use that sample).
Hi Russ,
Could you please paste the post link of “Different labels on each interactive line segment”? I am sorry but I hadn’t searched it succeed.
Regards,
Don
Hi Russ,
Thanks for your suggestion.
We have updated the sample in post 12357 you mentioned.
Regards,
Don
Thank you.
You’re welcome.