| | |
| | | tilesetLayer: null, //2.5d模型 |
| | | usetowpointfive: null, |
| | | tilesetLayer: null, //瀑布流 |
| | | |
| | | audioData: null, //语音 |
| | | }, |
| | | mutations: { |
| | | MSET_VIEWER(state, viewer) { |
| | |
| | | // }, |
| | | //切换2D和2.5D |
| | | MSET_DIMENSION(state, data) { |
| | | //关闭弹窗 |
| | | |
| | | //3d,2.5d转换事件 |
| | | state.dimension = data; |
| | | if (data == "3D") { |
| | |
| | | // state.mviewer.flyTo(state.tileset); |
| | | |
| | | //3D视角不限制 |
| | | state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 100; |
| | | state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 80; |
| | | // 最大 |
| | | state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 999999999999; |
| | | state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 4000000; |
| | | // 设置相机缩小时的速率 |
| | | state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 3000; |
| | | state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 10000; |
| | | // 设置相机放大时的速率 |
| | | state.mviewer.scene.screenSpaceCameraController._maximumZoomRate = 3000; |
| | | state.mviewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000; |
| | | // 视角平移 |
| | | state.mviewer.scene.screenSpaceCameraController.enableRotate = true; |
| | | // 视角缩放 |
| | |
| | | }; |
| | | state.tilesetLayer.show = false; //隐藏3d图形 |
| | | state.newLayer = state.usetowpointfive(); //添加2.5d图形贴片 |
| | | state.wallLayer.show = true; //打开瀑布 |
| | | state.wallLayer.show = false; //打开瀑布 |
| | | state.startPointFn(); //移动默认视角 |
| | | |
| | | //2.5D视角限制 |
| | |
| | | }, |
| | | setMobileWindows({ state, commit, dispatch }, data) { |
| | | // 打开随地图移动窗口 |
| | | // 关闭前一个弹窗? |
| | | dispatch("closeMobileWindowsDom"); |
| | | let clas, Flys; |
| | | const nowHeight = Math.ceil( |
| | | state.mviewer.camera.positionCartographic.height |
| | |
| | | if (!state.MobileWindowsHide && state.popupsDom) { |
| | | state.popupsDom.closeOur(); |
| | | commit("MSET_MOBILEWINDOWSHIDE", true); |
| | | } |
| | | if (state.audioData) { |
| | | state.audioData = null; |
| | | window.speechSynthesis.cancel(); |
| | | } |
| | | } //cancel |
| | | }, |
| | | CHANGETOC3({ state, commit }, data) { |
| | | // //转换经纬度坐标 成世界坐标cartesian3 |
| | |
| | | // console.log(global.DC.Namespace.Cesium.Matrix4.IDENTITY) |
| | | }, |
| | | MSET_DIMENSIONS({ state, commit, dispatch }, val) { |
| | | //关闭弹窗 |
| | | dispatch("closeMobileWindowsDom"); |
| | | //3d,2.5d转换事件 |
| | | commit("MSET_DIMENSION", val); |
| | | //控制高度 |
| | |
| | | }, |
| | | }); |
| | | }, |
| | | MSET_GETAUDIO({ state, commit, dispatch }, val) { |
| | | if (state.audioData) { |
| | | state.audioData = null; |
| | | window.speechSynthesis.cancel(); |
| | | } else { |
| | | state.audioData = new window.SpeechSynthesisUtterance(); |
| | | state.audioData.text = val; |
| | | window.speechSynthesis.speak(state.audioData); |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | |