Can you explain what you mean by faster? Do you mean that it takes to long to do the refresh? Do you mean the collection of items to exclude is hard to clunky to deal with? Can you give me a scenario? Can you give me the perfect API you would want to do what you need? If you provided that we can back into how to accomplish it. Once I know what you mean exactly I am sure we can do something for you.
Anil - I feel that selective hiding (or showing) of features should be instantaneous (Ideally less than 0.05 sec) for better user experience.
Q2) Do you mean that it takes to long to do the refresh?
Anil - Yes. When the number of features increase refreshing takes time. It typically takes 1-2 seconds when I have 1000+ points and a typical human eye can see it drawing when invoking Refresh on the overlay!!!
Q3) Do you mean the collection of items to exclude is hard to clunky to deal with? Can you give me a scenario?
Anil ->No.
Q4) Can you give me the perfect API you would want to do what you need? If you provided that we can back into how to accomplish it. Once I know what you mean exactly I am sure we can do something for you.
I think I understand your issue now. I want to verify though that you are using the InMemoryFeatureLayer. The reason I ask is that the if this is a ShapeFileFeatureLayer the fix or adjustment might be different. I also want to verify that if you are using the InMemeoryFeatureLayer and you add the features through the InternalFeatures collection that you are calling the BuildIndex method once you add all of your feature and before you display the layer. The BuildIndex builds an R-Tree spatial index to speed up retrieving the related records in the bounding box. We will look at the internals of the exclusion collection and see what we find.
I will see where the ticket is and see if I can help. We have had allot of tickets lately so we are a little behind. We usually get caught up quickly though.