C# + AE 判断图层类型

0
分享 2014-11-07
在C# + ArcEngine开发中,判断axMapControl中的图层是什么样的类型,代码如下
               if (axMapControl1.LayerCount> 0)
{
for (inti = 0; i < axMapControl1.LayerCount; i++)
{
ILayer pLayer = axMapControl1.get_Layer(i);
if (pLayer is IFeatureLayer)
{
MessageBox.Show("IFeatureLayer name : " +pLayer.Name);
}
else if (pLayer is IRasterLayer)
{
MessageBox.Show("IRasterLayer name : " +pLayer.Name);
}
}
}


更多类型的判断,写法类似。
文章来源:http://blog.csdn.net/sydbc/article/details/17141989

0 个评论

要回复文章请先登录注册