Ejemplo n.º 1
0
        /// <summary>
        /// 打开地图文件
        /// </summary>
        /// <param name="axGlobeControl"></param>
        /// <param name="InitDirectory"></param>
        public static void Open3DGlobeMap(AxGlobeControl axGlobeControl, string InitDirectory)
        {
            try
            {
                OpenFileDialog ofd = new OpenFileDialog();
                ofd.InitialDirectory = InitDirectory;
                ofd.Multiselect      = false;
                ofd.RestoreDirectory = true;
                ofd.Title            = "打开三维地图文档";
                ofd.Filter           = "三维地图(*.3dd)|*.3dd|所有文件(*.*)|*.*";
                ofd.CheckFileExists  = true; //检查文件是否存在

                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    if (File.Exists(ofd.FileName))               //判断文件是否存在
                    {
                        axGlobeControl.Load3dFile(ofd.FileName); //加载地图
                    }
                }
            }
            catch
            {
                return;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 加载地图文档
 /// </summary>
 /// <param name="fileName"></param>
 private void Open3ddFile(string fileName)
 {
     if (axGlobeControl.Check3dFile(fileName))
     {
         axGlobeControl.Load3dFile(fileName);
     }
 }
Ejemplo n.º 3
0
 private void glbDisplay_AfterDraw(ISceneViewer pViewer)
 {
     // load 3dd on first time render only, let the WPF drawing thread render the window controls first
     if (globeControl.DocumentFilename == null)
     {
         globeControl.Load3dFile(mapPath + _map.MapName + ".3dd");
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 打开地图文件
        /// </summary>
        /// <param name="axGlobeControl"></param>
        /// <param name="InitDirectory"></param>
        public static void Open3DGlobeMap(AxGlobeControl axGlobeControl, string InitDirectory)
        {
            try
            {
                OpenFileDialog ofd = new OpenFileDialog();
                ofd.InitialDirectory = InitDirectory;
                ofd.Multiselect = false;
                ofd.RestoreDirectory = true;
                ofd.Title = "打开三维地图文档";
                ofd.Filter = "三维地图(*.3dd)|*.3dd|所有文件(*.*)|*.*";
                ofd.CheckFileExists = true; //检查文件是否存在

                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    if (File.Exists(ofd.FileName))      //判断文件是否存在
                    {
                        axGlobeControl.Load3dFile(ofd.FileName);    //加载地图
                    }
                }
            }
            catch
            {
                return;
            }
        }