问题描述
有人在吗,我想在TOCControl里添加图层,就像图中所示,,其中是我添加的图层,我想用Engine实现,在MapControl中使用addlayer添加图层,怎么操作才能使图层在TOCControl控件中的NewGroupLayer下呢?
解决方案
解决方案二:
http://m.blog.csdn.net/blog/u010499087/26142391希望对你有帮助谢谢
解决方案三:
https://saeidp.wordpress.com/2010/11/18/arcobjects-working-with-group-layer/publicvoidAddRasterCatalogLayer(ESRI.ArcGIS.Carto.IActiveViewactiveView,ESRI.ArcGIS.Geodatabase.IRasterCatalograsterCatalog){//Createarastercataloglayer.ESRI.ArcGIS.Carto.IGdbRasterCatalogLayerrastercatalogLayer=newGdbRasterCatalogLayerClass();rastercatalogLayer.Setup((ITable)rasterCatalog);IGroupLayergroupLayer=newGroupLayerClass();groupLayer.Name="MyGroupName";ESRI.ArcGIS.Carto.IMapmap=activeView.FocusMap;if(!(rastercatalogLayer==null)){IFeatureLayerpFeatureLayer=(IFeatureLayer)rastercatalogLayer;pFeatureLayer.Name="MyImage";groupLayer.Add((ILayer)pFeatureLayer);}groupLayer.Expanded=false;map.AddLayer(groupLayer);activeView.Refresh();}}