| | |
| | | <div class="m-l-inbut zoom-in" @click="zoomIn()"> |
| | | <i class="el-icon-refresh"></i> |
| | | </div> |
| | | <div |
| | | <!-- <div |
| | | class="m-l-inbut zoom-in m-l-inbut-2d" |
| | | :class="{ active: dimension == '3D' }" |
| | | @click="zoomIn('3D')" |
| | | > |
| | | 3 维 |
| | | </div> |
| | | </div> --> |
| | | <div |
| | | class="m-l-inbut zoom-in m-l-inbut-3d" |
| | | :class="{ active: dimension == '2.5D' }" |
| | |
| | | // if (height > 2000) { |
| | | // conBack(2000); |
| | | // } |
| | | if (height < 500 && isSet) { |
| | | conBack(500); |
| | | if (height < 200 && isSet) { |
| | | conBack(200); |
| | | } |
| | | if (height > 6000 && isSet) { |
| | | conBack(6000); |
| | |
| | | let startPoint; |
| | | if (true) { |
| | | startPoint = () => { |
| | | let doit2 = (int) => { |
| | | let doit2 = (int, h) => { |
| | | viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(108), |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(h[0]), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-26.46), |
| | | roll: 0.0, |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(h[1]), |
| | | roll: h[2], |
| | | }, |
| | | }); |
| | | }; |
| | | that.dimension == "2.5D" |
| | | ? doit2([114.03928791, 27.62954732, 360.0]) |
| | | ? doit2( |
| | | [114.03928791, 27.62954732, 360.0], |
| | | [ |
| | | that.dimensionData.heading, |
| | | that.dimensionData.pitch, |
| | | that.dimensionData.roll, |
| | | ] |
| | | ) |
| | | : // : doit([116.39038494750986, 39.902393222208644, 330.0]); |
| | | // doit("建模"); |
| | | doit2([114.0351, 27.6314, 300.0]); |
| | | doit2([114.0351, 27.6314, 300.0], [108, -26.46, 0.0]); |
| | | }; |
| | | } else { |
| | | startPoint = (val) => { |
| | |
| | | }, |
| | | // 默认起始点函数 |
| | | startPointFn: "", |
| | | dimension: "3D", // 维度 |
| | | dimension: "2.5D", // 维度 |
| | | dimensionData: { |
| | | // 维度镜头数据 |
| | | heading: 0, |
| | |
| | | //切换2D和2.5D |
| | | MSET_DIMENSION(state, data) { |
| | | //关闭弹窗 |
| | | |
| | | //3d,2.5d转换事件 |
| | | state.dimension = data; |
| | | if (data == "3D") { |
| | |
| | | state.startPointFn(); //移动默认视角 |
| | | |
| | | //2.5D视角限制 |
| | | state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 500; |
| | | state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 200; |
| | | // 最大 |
| | | state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 6000; |
| | | // 设置相机缩小时的速率 |
| | |
| | | } else if (state.dimension == "2.5D") { |
| | | Flys = [ |
| | | +data.lntLat[0] + 0.01197, |
| | | +data.lntLat[1] - 0.0001, |
| | | +data.lntLat[1] - 0.00055, |
| | | // +data.lntLat[1] - 0.0022, |
| | | nowHeight, |
| | | ]; |