ArcEngine 如何判断Feature在哪个图层
1个回答
展开全部
直接判断每个要素类图层的selection条数是否为0:
string s = "";
for (int i = 0; i < axMapControl1.LayerCount; i++)
{
if (axMapControl1.get_Layer(i) is FeatureLayer)
{
IFeatureLayer pFeatureLayer = axMapControl1.get_Layer(i) as IFeatureLayer;
IFeatureSelection pFeatureSelection = pFeatureLayer as IFeatureSelection;
ISelectionSet pSelectionSet = pFeatureSelection.SelectionSet;
if (pSelectionSet.Count != 0)
s += pFeatureLayer.Name + "\r\n";
}
}
if (s != "") MessageBox.Show(s);
string s = "";
for (int i = 0; i < axMapControl1.LayerCount; i++)
{
if (axMapControl1.get_Layer(i) is FeatureLayer)
{
IFeatureLayer pFeatureLayer = axMapControl1.get_Layer(i) as IFeatureLayer;
IFeatureSelection pFeatureSelection = pFeatureLayer as IFeatureSelection;
ISelectionSet pSelectionSet = pFeatureSelection.SelectionSet;
if (pSelectionSet.Count != 0)
s += pFeatureLayer.Name + "\r\n";
}
}
if (s != "") MessageBox.Show(s);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询