We are in the process of upgrading from Mapsuite web(MSW) 2.0 to version 3.0.
In the project, there is a requirement to NOT draw some features of the layer based on the logged in user.
A logged in user can have access to multiple layers and each layer may have different logic to draw some features and to exclude some features (based on the data from columns of the shape file or data from columns from datatable attached to shape file when it was loaded).
In MSW version 2.0, we used DONOTDRAW function, but there is no equivalent function in 3.0.
I dont think we can use "DrawingFeatures" event , because when we load layers, we dont know how many layers will be loaded for each user and hence we can not attach different event handlers to each layer.
and also, I am bit concerned about the performance of this function.
I think a property FeatureIdsToExclude in FeatureLayer can satisfy your requirement. It’s a collection of features Id which not get into the layer. Hope it helps.
Hi Howard, Thanks for the reply. Seems like FeatureIdsToExclude is similar to DoNotDraw in the previous version. Will try it this evening and will get back to u.
All the derived classes of FeatureLayer such as ShapeFileFeatureLayer, InMemoryFeatureLayer, etc can use this property.
For example, pretend I’m using ShapeFileFeatureLayer,shapeFileFeatureLayer.FeatureIdsToExclude.Add("1");
If you still can’t find this property, please check the file version you are using. The following code can get the File Version of Map Suite.string version = Map.Version;
Sorry for my mistake; "FeatureIdsToExclude" is a new API in 3.1.124, you can update it to the latest version.
In 3.1.16, there is another idea for you which is DrawingFeatures event. You can suppress the features from the event args. Please see the following code:tmpLayer.DrawingFeatures += new EventHandler<DrawingFeaturesEventArgs>(tmpLayer_DrawingFeatures);