| | |
| | | StaticFileBaseUrl: config.StaticFileBaseUrl, |
| | | ellipsoidCoordinates: 'MOON2000', |
| | | timeline: true, |
| | | shadowBackCul1: false |
| | | }); |
| | | |
| | | |
| | | this.earthCtrl.Viewer.scene.debugShowFramesPerSecond = true |
| | | this.earthCtrl.coreMap.scene.screenSpaceCameraController.enableCollisionDetection = true; |
| | | this.earthCtrl.Viewer.scene.globe.terrainExaggeration = 1.00001 |
| | | |
| | | |
| | | // this.earthCtrl.shadowMap.maximumDistance = 10000.0; |
| | | window.earthCtrl = this.earthCtrl; |
| | | |
| | | window.Viewer = this.earthCtrl._Viewer; |
| | | |
| | | Viewer.scene.skyAtmosphere.show = false; |
| | | |
| | | window.Cesium = SmartEarth.Cesium; |
| | | |
| | | window.sgworld = earthCtrl; |
| | | |
| | | sgworld.Creator.SimpleGraphic.edit(true, { editProp: false }); |
| | | |
| | | |
| | | // 最小缩放高度(米) |
| | | Viewer.scene.screenSpaceCameraController.minimumZoomDistance =10000; |
| | | // 最大缩放高度(米) |
| | | Viewer.scene.screenSpaceCameraController.maximumZoomDistance = 5000000; |
| | | |
| | | //======================= |
| | | //阴影分析 |
| | | Viewer.scene.globe.lightingFadeOutDistance = 5.8e+7; |
| | | Viewer.scene.globe.enableLighting = false; |
| | | earthCtrl.shadows = false; |
| | | //设置球体颜色 |
| | | window.Viewer.scene.globe.baseColor = new Cesium.Color.fromCssColorString('#A9A9A9'); |
| | | //清除所有默认图层 |
| | | window.Viewer.imageryLayers.removeAll(); |
| | | window.setLayer(); |
| | | |
| | | |
| | | Viewer.scene.globe.depthTestAgainstTerrain = false; // 开启深度测试 |
| | | Viewer.animation.container.style.visibility = "hidden"; |
| | |
| | | sgworld.Navigate.Stop(); //取消飞行状态 |
| | | sgworld.Navigate.setPosition(-1093596.38, 5729026.12, 4136590.41); |
| | | this.addMouseLeftClickEvents(); |
| | | this.addMouseLeftDownEvents(); |
| | | }, |
| | | |
| | | //鼠标左键点击事件添加 |
| | | addMouseLeftClickEvents() { |
| | | addMouseLeftDownEvents() { |
| | | if (window.handleLeftClick) { |
| | | window.handleLeftClick.removeInputAction( |
| | | Cesium.ScreenSpaceEventType.LEFT_CLICK |
| | | ); //移除事件 |
| | | window.handleLeftClick = null; |
| | | } |
| | | const pickGlobeSlope = new SmartEarth.Cesium.PickGlobeSlope(earthCtrl.Viewer) |
| | | window.handleLeftClick = new Cesium.ScreenSpaceEventHandler( |
| | | window.Viewer.scene.canvas |
| | | ); |
| | | var that = this; |
| | | window.handleLeftClick.setInputAction(function (event) { |
| | | const angle = pickGlobeSlope.pickSlope(event.position) |
| | | if (store.state.slopeQueyFlag) { |
| | | if (!store.state.showSlopeQuey) { |
| | | store.state.showSlopeQuey = true; |
| | | } |
| | | store.state.slopeQueyValue = angle.toFixed(6); |
| | | |
| | | } |
| | | |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | }, |
| | | |
| | | //鼠标左键点击事件添加 |
| | | addMouseLeftClickEvents() { |
| | | if (window.handleLeftDown) { |
| | | window.handleLeftDown.removeInputAction( |
| | | Cesium.ScreenSpaceEventType.LEFT_DOWN |
| | | ); //移除事件 |
| | | window.handleLeftDown = null; |
| | | } |
| | | window.handleLeftDown = new Cesium.ScreenSpaceEventHandler( |
| | | window.Viewer.scene.canvas |
| | | ); |
| | | var that = this; |
| | | window.handleLeftDown.setInputAction(function (event) { |
| | | let cartesian = window.Viewer.scene.pick(event.position); |
| | | if (Cesium.defined(cartesian)) { |
| | | |
| | | if (cartesian.id.shpType && cartesian.id.shpType == 'temporaryLayer') { |
| | | |
| | | that.setEditTemporaryLayer() |
| | | that.setEditTemporaryLayer(cartesian.id._id) |
| | | } |
| | | |
| | | } |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | }, Cesium.ScreenSpaceEventType.LEFT_DOWN); |
| | | }, |
| | | setEditTemporaryLayer(res) { |
| | | // store.state.editTemporaryId = res; |
| | | // console.log(store.state.editTemporaryId) |
| | | |
| | | if (store.state.editTemporaryId) { |
| | | if (store.state.editTemporaryId && store.state.editTemporaryId == res) { |
| | | |
| | | store.state.setEditTemporaryShow = true; |
| | | } |
| | |
| | | console.log(moonPosition); |
| | | }, |
| | | }; |
| | | export default InitMap; |
| | | export default InitMap; |