From f5763f787d5cc5aa0b7d248e0f494c4232f1e3f3 Mon Sep 17 00:00:00 2001 From: surprise <15810472099@163.com> Date: 星期一, 27 十一月 2023 16:31:21 +0800 Subject: [PATCH] 版本更新 --- src/assets/js/Map/index.js | 64 +++++++++++++++++++++++-------- 1 files changed, 47 insertions(+), 17 deletions(-) diff --git a/src/assets/js/Map/index.js b/src/assets/js/Map/index.js index 7fb0fd1..91803d7 100644 --- a/src/assets/js/Map/index.js +++ b/src/assets/js/Map/index.js @@ -29,32 +29,37 @@ 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 = true; Viewer.scene.globe.depthTestAgainstTerrain = false; // 寮�鍚繁搴︽祴璇� Viewer.animation.container.style.visibility = "hidden"; Viewer.timeline.container.style.visibility = "hidden"; @@ -65,26 +70,51 @@ 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(cartesian.id._id) } @@ -94,9 +124,9 @@ setEditTemporaryLayer(res) { // store.state.editTemporaryId = res; // console.log(store.state.editTemporaryId) - - if (store.state.editTemporaryId && store.state.editTemporaryId == res) { - + + if (store.state.editTemporaryId && store.state.editTemporaryId == res) { + store.state.setEditTemporaryShow = true; } }, @@ -176,4 +206,4 @@ console.log(moonPosition); }, }; -export default InitMap; +export default InitMap; \ No newline at end of file -- Gitblit v1.9.3