|
这个是我写的SHP文件加载,在对话框中可以多选SHP文件,但是加载到MAP窗口中只有一个,怎样把多选的SHP点线面文件都一次性加载进去? 希望有心人指导,最好有源码。谢谢!
try
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Multiselect = true; //能同时选择对话框里面的多个文件
openFileDialog.Title = "打开地图文档!";
openFileDialog.Filter = "map document(*.shp)|*.shp";
openFileDialog.ShowDialog();
string filePath = openFileDialog.FileName;
FileInfo fileInfo = new FileInfo(filePath);
string path = filePath.Substring(0, filePath.Length - fileInfo.Name.Length);
MapCtrl.AddShapeFile(path, fileInfo.Name);
}
catch (Exception a)
{
MessageBox.Show("加载图层失败!" + e.ToString());
}
|
|