ARCGIS Engine 图层

来源:互联网 发布:手机fps显示软件 编辑:程序博客网 时间:2024/03/28 21:56

从MapControl中获取图层

1通过图层UID类型来遍历

常见图层的UID 如下

{6CA416B1-E160-11D2-9F4E-00C04F6BC78E} IDataLayer (包括所有类型的图层){40A9E885-5533-11d0-98BE-00805F7CED21} IFeatureLayer{E156D7E5-22AF-11D3-9F99-00C04F6BC78E} IGeoFeatureLayer{34B2EF81-F4AC-11D1-A245-080009B6F22B} IGraphicsLayer{5CEAE408-4C0A-437F-9DB3-054D83919850} IFDOGraphicsLayer{0C22A4C7-DAFD-11D2-9F46-00C04F6BC78E} ICoverageAnnotationLayer{EDAD6644-1810-11D1-86AE-0000F8751720} IGroupLayer
另外UID也可以通过如下方式获取
<pre name="code" class="csharp"> IFeatureClassDescription  fcDesc = new FeatureClassDescriptionClass(); IObjectClassDescription ObjectDescription = (IObjectClassDescription)fcDesc;
ObjectDescription.InstanceCLSID,
ObjectDescription.ClassExtensionCLSID

其通过IFeatureClassDescription、IRasterItemDescription等对象传值。

1 便利所有的矢量图层

public IEnumLayer GetFeatureLayers()        {            UID uid = new UIDClass();            uid.Value = "{40A9E885-5533-11d0-98BE-00805F7CED21}";//FeatureLayer            IEnumLayer layers = axMapControl.Map.get_Layers(uid, true);            return layers;        }

public IFeatureLayer GetFeatureLayer(string layerName)        {                        IEnumLayer layers = GetFeatureLayers();            layers.Reset();            ILayer layer = null; while ((layer = layers.Next()) != null)            {                if (layer.Name == layerName)                    return layer as IFeatureLayer;            }            return null;        }


支持赞助:505180987@qq.com


0 0
原创粉丝点击