//不用mapcontrol获得一个mxd的图层
        private static int getLayercount(string mxdFileName)
        {
            IMapDocument pMapDocument = new MapDocumentClass();
            pMapDocument.Open(mxdFileName, "");
            INetworkDataset networkDataset = null;
            int num = 0;
            //iterate all the maps
            for (int cMap = 0; cMap < pMapDocument.MapCount; cMap++)
            {
                for (int cLayer = 0; cLayer < pMapDocument.get_Map(cMap).LayerCount; cLayer++)
                {
                      ILayer pLayer = pMapDocument.get_Map(cMap).get_Layer(cLayer);
                      MessageBox.Show(pLayer.Name);
                    num++;
                }
            }
            return num;
        }

相关文章:

  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
相关资源
相似解决方案