ArcEngine中getLayer方法的UID参数的详解

UID中value的几种值以及表示的意思:

{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


例:

private bool IsLayerExist(string layerName)
{
	UID uid = new UIDClass();
	uid.Value = "{40A9E885-5533-11d0-98BE-00805F7CED21}"; // 代表只获取矢量图层
	IEnumLayer layers = mapControl.get_Layers(uid, true);
      
	ILayer layer;
	while(layer = layers.Next() != null)
	{
		if (layer.Name == layerName)
		{
			return true;
		}
	}

	return false;
}


你可能感兴趣的:(c#,ArcGIS,string,layer,c,null)