IFeatureSelection接口由FeatureLayer类实现,主要用来存放用户在该图层中选择的要素,例如一般的属性查图,找到的元素一般放置在IFeatureSelection接口中。具体方法如下:
Members
Description | ||
---|---|---|
Add | Adds a feature to the selection set. | |
BufferDistance | Buffer distance used for the selection. | |
Clear | Clears the selection. | |
CombinationMethod | Combination method for the selection. | |
SelectFeatures | Selects features based upon the specifed criteria and combination method. | |
SelectionChanged | Fires the features layer update event. Required when SelectionSet changes. | |
SelectionColor | Selection color. (used when SetSelectionSymbol = FALSE). | |
SelectionSet | The selected set of features. | |
SelectionSymbol | Selection symbol. | |
SetSelectionSymbol | Indicates if the selected set of features is drawn using the SelectionSymbol. |
使用方法:
IFeatureSelection pfeaturesel = pfeatureLyr as IFeatureSelection; pfeaturesel.Add(pFeature);//tianjia yuansu IFeatureSelection pfeaturesel = pfeatureLyr as IFeatureSelection; pfeaturesel.Clear();
注意:操作完成后要更新MapControl
IMap接口中有 SelectFeature方法,用来向FeatureLayer的Selection中添加Feature
[C#]public void SelectFeature ( ILayerLayer, IFeatureFeature);
ClearFeature用来清除整个Map地图文档中所有图层的Selection中的feature .
[C#]public void ClearSelection ();