• 大小: 1.38MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-24
  • 语言: 其他
  • 标签: SkyLine  ArcGISEngine  

资源简介

简单实现SkyLine+Arcgis Engine 二三维联动 ,加载图层联动,删除图层联动。地图操作联动。仅供参考(实际坐标转换自行解决)

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.DataSourcesGDB;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
using TerraExplorerX;
using IGeometry = ESRI.ArcGIS.Geometry.IGeometry;
using IPoint = ESRI.ArcGIS.Geometry.IPoint;
using Path = System.IO.Path;
using Point = System.Drawing.Point;

namespace 二三维联动
{
    public partial class Form1 : Form
    {
        private readonly SGWorld66 _sgworld;

        public Form1()
        {
            InitializeComponent();
            Init();
            _sgworld = new SGWorld66();
        }

        #region 打开项目
        public string SamplesDirectory { get { return Path.GetDirectoryName(Application.StartupPath); } }
        private void OpenProject()
        {
            string tMsg = String.Empty;

            // 1. 设置打开项目参数
            //string tAppRoot = Path.GetDirectoryName(Application.ExecutablePath);
            //string tProjectUrl = Path.Combine(SamplesDirectory @“Resources\FlyFiles\simplefly.fly“);
            string tProjectUrl = @“C:\Users\Administrator\Desktop\SkyLineDemo\SkyglobeLB.fly“;
            bool bIsAsync = false;
            string tUser = String.Empty;
            string tPassword = String.Empty;

            // 2. 实例化地球和项目接口
            try
            {
                //var sgworld = new SGWorld66();
                // 3. 注册地球加载完成事件
                _sgworld.onloadFinished += OnProjectLoadFinished;
                // 4. 在同步模式下打开项目
                _sgworld.Project.Open(tProjectUrl bIsAsync tUser tPassword);
                //MessageBox.Show(“异步打开: “ + tProjectUrl);
            }
            catch (Exception ex)
            {
                tMsg = String.Format(“打开项目异常: {0}“ ex.Message);
                MessageBox.Show(tMsg);
            }
        }

        void OnProjectLoadFinished(bool success)
        {
            string tMsg = String.Empty;

            try
            {
                //MessageBox.Show(“接受到项目加载事件“);
            }
            catch (Exception ex)
            {
                tMsg = String.Format(“项目加载完成异常: {0}“ ex.Message);
                MessageBox.Show(tMsg);
            }
        }

        #endregion

        private void Form1_Load(object sender EventArgs e)
        {
            OpenProject();
        }


        private ilayer m_layer; //沟通图层
        private ilayer Selectedlayer_TOC; //定义删除图层
        //toccontrol 鼠标点击事件,分为左键点击和右键点击,左键控制图层的显示,右键控制右键菜单
        private void axTOCControl1_onmousedown(object sender ITOCControlEvents_onmousedownEvent e)
        {
            //if (e.button == 1)
            //{
            //    var Ite

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        699  2016-07-12 17:01  SkyLineDemo\Shape\B_PROVINCE.dbf

     文件        145  2016-07-12 17:01  SkyLineDemo\Shape\B_PROVINCE.prj

     文件         64  2016-07-13 11:53  SkyLineDemo\Shape\B_PROVINCE.qix

     文件        132  2016-07-12 17:03  SkyLineDemo\Shape\B_PROVINCE.sbn

     文件        116  2016-07-12 17:03  SkyLineDemo\Shape\B_PROVINCE.sbx

     文件     348624  2016-07-12 17:01  SkyLineDemo\Shape\B_PROVINCE.shp

     文件       7076  2016-07-12 17:01  SkyLineDemo\Shape\B_PROVINCE.shp.xml

     文件        108  2016-07-12 17:01  SkyLineDemo\Shape\B_PROVINCE.shx

     文件      30042  2016-07-12 17:06  SkyLineDemo\Shape\B_RIVERTWO11.dbf

     文件        145  2016-07-11 18:10  SkyLineDemo\Shape\B_RIVERTWO11.prj

     文件        588  2016-07-13 11:50  SkyLineDemo\Shape\B_RIVERTWO11.qix

     文件        332  2016-07-12 17:06  SkyLineDemo\Shape\B_RIVERTWO11.sbn

     文件        132  2016-07-12 17:06  SkyLineDemo\Shape\B_RIVERTWO11.sbx

     文件    1443588  2016-07-12 17:06  SkyLineDemo\Shape\B_RIVERTWO11.shp

     文件       7590  2016-07-11 18:12  SkyLineDemo\Shape\B_RIVERTWO11.shp.xml

     文件        276  2016-07-12 17:06  SkyLineDemo\Shape\B_RIVERTWO11.shx

     文件      23310  2016-07-12 17:00  SkyLineDemo\Shape\T_RiskSource.dbf

     文件        145  2016-07-11 18:09  SkyLineDemo\Shape\T_RiskSource.prj

     文件        624  2016-07-13 11:59  SkyLineDemo\Shape\T_RiskSource.qix

     文件        308  2016-07-12 17:00  SkyLineDemo\Shape\T_RiskSource.sbn

     文件        124  2016-07-12 17:00  SkyLineDemo\Shape\T_RiskSource.sbx

     文件        660  2016-07-12 17:00  SkyLineDemo\Shape\T_RiskSource.shp

     文件       8042  2016-07-11 18:12  SkyLineDemo\Shape\T_RiskSource.shp.xml

     文件        260  2016-07-12 17:00  SkyLineDemo\Shape\T_RiskSource.shx

     文件       4293  2016-07-22 16:52  SkyLineDemo\SkyglobeLB.fly

     文件       1014  2016-07-29 17:48  SkyLineDemo\SkyLineDemo.sln

    ..A..H.     48128  2016-07-29 17:49  SkyLineDemo\SkyLineDemo.v12.suo

     文件        187  2016-07-26 10:18  SkyLineDemo\二三维联动\App.config

     文件      17408  2016-07-28 17:07  SkyLineDemo\二三维联动\bin\Debug\AxInterop.TerraExplorerX.dll

     文件     982528  2016-07-28 17:07  SkyLineDemo\二三维联动\bin\Debug\Interop.TerraExplorerX.dll

............此处省略45个文件信息

评论

共有 条评论