arcgis【0基础 】【1】 中如何添加MXD

1,第一种方法 MapControl  直接添加

 

if (!axMapControl1.CheckMxFile(FileName))
{
MessageBox.Show("文件不合法");
return;
}
else
{

axMapControl1.LoadMxFile(FileName);
}

  

第二种方法:通过MapDocument  进行添加

   string FileName = open.FileName;
                IMapDocument mapDoc = new MapDocument();
                mapDoc.Open(FileName, "");
                axMapControl1.Map = mapDoc.ActiveView.FocusMap;
                axMapControl1.ActiveView.Refresh();

  

posted @ 2017-04-08 09:04  需要GIS小工具找我  阅读(1306)  评论(0编辑  收藏  举报