| | |
| | | }, |
| | | //默认起始点函数 |
| | | startPointFn: '', |
| | | dimension: "2D",// 维度 |
| | | dimension: "2.5D",// 维度 |
| | | dimensionData: {// 维度镜头数据 |
| | | heading: 0, |
| | | pitch: -90, |
| | | roll: 0 |
| | | }, |
| | | perspectiveControl: '',//视角控制:高度、角度 ()=>{} |
| | | perspectiveControls: '',//视角控制:高度、角度 ()=>{} |
| | | }, |
| | | mutations: { |
| | | MSET_VIEWER(state, viewer) { |
| | |
| | | //切换2D和2.5D |
| | | MSET_DIMENSION(state, data) { |
| | | state.dimension = data; |
| | | if (data == "2D") { |
| | | state.dimensionData = {// 维度镜头数据 |
| | | heading: 0, |
| | | pitch: -90, |
| | | roll: 0 |
| | | }; |
| | | } else if (data == "2.5D") { |
| | | state.dimensionData = {// 维度镜头数据 |
| | | heading: 0, |
| | | pitch: -90, |
| | | roll: 0 |
| | | }; |
| | | } |
| | | }, |
| | | //切换控制 |
| | | MSET_PERSPECTIVECONTROL(state, data) { |
| | | state.perspectiveControl = data; |
| | | } |
| | | state.perspectiveControls = !state.perspectiveControls; |
| | | }, |
| | | }, |
| | | actions: { |
| | | MSET_CREADE({ state, commit, dispatch }) { |
| | |
| | | // 关闭前一个弹窗? |
| | | dispatch("closeMobileWindowsDom"); |
| | | let clas, Flys; |
| | | |
| | | const nowHeight = Math.ceil(state.mviewer.camera.positionCartographic.height); |
| | | if (state.dimension == "2D") { |
| | | Flys = [ |
| | | +data.lntLat[0] + 0.01197, |
| | | +data.lntLat[1] - 0.0001, |
| | | 330, |
| | | nowHeight, |
| | | ] |
| | | clas = [ |
| | | data.from == "PopupOurOnce" ? +data.lntLat[0] : +data.lntLat[0], |
| | |
| | | // 330, |
| | | ...Flys, |
| | | 0, |
| | | state.dimension == "2D" ? -90 : state.dimension == "2.5D" ? -45 : -45 |
| | | state.dimensionData.pitch |
| | | ); |
| | | dispatch("mapFlyTo", {//飞入 |
| | | lntLat: [Position.lng, Position.lat, Position.alt], |
| | |
| | | }, |
| | | MSET_DIMENSIONS({ state, commit, dispatch }, val) { |
| | | commit("MSET_DIMENSION", val); |
| | | //控制高度 |
| | | const height = Math.ceil(state.mviewer.camera.positionCartographic.height); |
| | | state.mviewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | state.mviewer.camera.positionCartographic.longitude, |
| | | state.mviewer.camera.positionCartographic.latitude, |
| | | height |
| | | ), |
| | | orientation: { |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(state.dimensionData.heading), // 方向 |
| | | pitch: global.DC.Namespace.Cesium.Math.toRadians( |
| | | state.dimensionData.pitch |
| | | ), // 倾斜角度 |
| | | roll: state.dimensionData.roll, |
| | | }, |
| | | }); |
| | | }, |
| | | MSET_GOTOCC({ state, commit, dispatch }, val) { |
| | | // commit("MSET_DIMENSION", val); |
| | | //控制高度 |
| | | // const height = Math.ceil(state.mviewer.camera.positionCartographic.height); |
| | | state.mviewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | state.mviewer.camera.positionCartographic.longitude, |
| | | state.mviewer.camera.positionCartographic.latitude, |
| | | val.height |
| | | ), |
| | | orientation: { |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(val.heading), // 方向 |
| | | pitch: global.DC.Namespace.Cesium.Math.toRadians( |
| | | val.pitch |
| | | ), // 倾斜角度 |
| | | roll: val.roll, |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | } |