| | |
| | | import config from "./config"; |
| | | //服务加载配置文件 |
| | | import server from "./server"; |
| | | |
| | | const InitMap = { |
| | | sgworld: null, |
| | | earthCtrl: null, |
| | | Viewer: null, |
| | | //地图初始化 |
| | | init3DMap() { |
| | | //设置月球坐标系 |
| | | Cesium.Ellipsoid.WGS84 = new Cesium.Ellipsoid( |
| | | SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid( |
| | | 1737400.0, |
| | | 1737400.0, |
| | | 1737400.0 |
| | | ); |
| | | //页面初始化 |
| | | this.sgworld = new SmartEarth.SGWorld("cesiumContainer", { |
| | | url: SmartEarthRootUrl + config.imgUrl, |
| | | licenseServer: config.licenseServer, |
| | | infoBox: false, |
| | | this.earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", { |
| | | licenseServer: "https://cim.smartearth.cn/", |
| | | StaticFileBaseUrl: "/CIMSDK/" |
| | | }); |
| | | this.Viewer = this.sgworld._Viewer; |
| | | window.sgworld = this.sgworld; |
| | | window.Viewer = this.Viewer; |
| | | //显示fps |
| | | sgworld._Viewer.scene.debugShowFramesPerSecond = false; |
| | | |
| | | this.Viewer = this.earthCtrl._Viewer; |
| | | window.earthCtrl = this.earthCtrl; |
| | | window.Viewer = this.earthCtrl._Viewer; |
| | | // //显示fps |
| | | // sgworld._Viewer.scene.debugShowFramesPerSecond = false; |
| | | //添加月球初始化切片服务 |
| | | server.AddTmsLayer(config.moonTms); |
| | | //添加鼠标左击事件 |
| | | this.addMouseLeftClickEvents(); |
| | | this.addMouseMouseMoveEvents(); |
| | | // //添加鼠标左击事件 |
| | | // this.addMouseLeftClickEvents(); |
| | | // this.addMouseMouseMoveEvents(); |
| | | }, |
| | | //鼠标左键点击事件添加 |
| | | addMouseLeftClickEvents() { |