| | |
| | | let layerSATtwo = null |
| | | let tcLayer = null |
| | | |
| | | let idlerFlag = true |
| | | let viewerHeight = 950 |
| | | let smallViewerHeight = 1950 |
| | | |
| | | // const wallLayer = null |
| | | |
| | |
| | | // mapCenter: [115.871863, 28.743861, 950.0] |
| | | } |
| | | }, |
| | | props: ['wheelFlag', 'startWheel', 'startSmallWheel'], |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'viewerExist', |
| | |
| | | select = { |
| | | overlay: null, |
| | | color: null |
| | | } |
| | | |
| | | windowAddMouseWheel() |
| | | function windowAddMouseWheel () { |
| | | var scrollFunc = function (e) { |
| | | e = e || window.event |
| | | if (e.wheelDelta) { // 判断浏览器IE,谷歌滑轮事件 |
| | | if (e.wheelDelta > 0) { // 当滑轮向上滚动时 |
| | | idlerFlag = false |
| | | } |
| | | if (e.wheelDelta < 0) { // 当滑轮向下滚动时 |
| | | idlerFlag = true |
| | | } |
| | | } else if (e.detail) { // Firefox滑轮事件 |
| | | if (e.detail > 0) { // 当滑轮向上滚动时 |
| | | idlerFlag = false |
| | | } |
| | | if (e.detail < 0) { // 当滑轮向下滚动时 |
| | | idlerFlag = true |
| | | } |
| | | } |
| | | } |
| | | // 给页面绑定滑轮滚动事件 |
| | | if (document.addEventListener) { // 火狐使用DOMMouseScroll绑定 |
| | | document.addEventListener('DOMMouseScroll', scrollFunc, false) |
| | | } |
| | | // 其他浏览器直接绑定滚动事件 |
| | | window.onmousewheel = document.onmousewheel = scrollFunc |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | | that.mapCenter[0], |
| | | that.mapCenter[1], |
| | | 950.0 |
| | | that.mapCenter[2] |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | |
| | | that.dimensionValue != undefined && |
| | | that.dimensionValue != '真三维' |
| | | ) { |
| | | const height = Math.ceil( |
| | | global.viewer.camera.positionCartographic.height |
| | | ) |
| | | |
| | | if (height < 575) { |
| | | if (viewerHeight == 500) { |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 650 |
| | | ), |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 650 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | |
| | | viewerHeight = 650 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | return |
| | | } |
| | | |
| | | if (height < 725) { |
| | | if (viewerHeight == 650) { |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 800 |
| | | ), |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 800 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | |
| | | viewerHeight = 800 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | return |
| | | } |
| | | |
| | | if (height < 875) { |
| | | if (viewerHeight == 800) { |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 950 |
| | | ), |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 950 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | viewerHeight = 950 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | } |
| | | } |
| | | } |
| | |
| | | that.dimensionValue != undefined && |
| | | that.dimensionValue != '真三维' |
| | | ) { |
| | | const height = Math.ceil( |
| | | global.viewer.camera.positionCartographic.height |
| | | ) |
| | | |
| | | if (height > 875) { |
| | | if (viewerHeight == 950) { |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 800 |
| | | ), |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 800 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | |
| | | viewerHeight = 800 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | return |
| | | } |
| | | |
| | | if (height > 725) { |
| | | if (viewerHeight == 800) { |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 650 |
| | | ), |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 650 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | |
| | | viewerHeight = 650 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | return |
| | | } |
| | | |
| | | if (height > 575) { |
| | | if (viewerHeight == 650) { |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 500 |
| | | ), |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 500 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | viewerHeight = 500 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | } |
| | | } |
| | | } |
| | | |
| | | global.viewer.on(global.DC.SceneEventType.CAMERA_CHANGED, that.mapCameraEvent) |
| | | // global.eagleViewer.on(global.DC.SceneEventType.CAMERA_CHANGED, that.smallMapCameraEvent) |
| | | global.eagleViewer.on(global.DC.SceneEventType.CAMERA_CHANGED, that.smallMapCameraEvent) |
| | | } |
| | | } |
| | | } |
| | |
| | | }, |
| | | |
| | | mapCameraEvent () { |
| | | const height = Math.ceil( |
| | | global.viewer.camera.positionCartographic.height |
| | | ) |
| | | |
| | | global.viewer.camera.setView({ |
| | | orientation: { |
| | | // 指向 |
| | |
| | | } |
| | | }) |
| | | |
| | | if (idlerFlag) { // 下 |
| | | if (height > 810) { |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 950 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: global.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | return |
| | | } |
| | | if (this.startWheel == false) return |
| | | |
| | | if (height > 660) { |
| | | if (this.wheelFlag) { // 下 |
| | | if (viewerHeight == 950) { |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | viewerHeight = 800 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | return |
| | | } |
| | | |
| | | if (height > 510) { |
| | | if (viewerHeight == 800) { |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | viewerHeight = 650 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | return |
| | | } |
| | | } else { // 上 |
| | | if (height < 640) { |
| | | |
| | | if (viewerHeight == 650) { |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | return |
| | | viewerHeight = 500 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | } |
| | | |
| | | if (height < 790) { |
| | | } else { // 上 |
| | | if (viewerHeight == 500) { |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | viewerHeight = 650 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | return |
| | | } |
| | | |
| | | if (height < 940) { |
| | | if (viewerHeight == 650) { |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | viewerHeight = 800 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | return |
| | | } |
| | | |
| | | if (viewerHeight == 800) { |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 950 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: global.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | viewerHeight = 950 |
| | | this.$emit('change-wheel', false, 'startWheel') |
| | | } |
| | | } |
| | | }, |
| | | |
| | | smallMapCameraEvent () { |
| | | const height = Math.ceil( |
| | | global.eagleViewer.camera.positionCartographic.height |
| | | ) |
| | | |
| | | global.eagleViewer.camera.setView({ |
| | | orientation: { |
| | | // 指向 |
| | |
| | | } |
| | | }) |
| | | |
| | | if (idlerFlag) { // 下 |
| | | if (height > 1810) { |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 1950 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: global.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | return |
| | | } |
| | | if (this.startSmallWheel == false) return |
| | | |
| | | if (height > 1660) { |
| | | global.viewer.camera.setView({ |
| | | if (this.wheelFlag) { // 下 |
| | | if (smallViewerHeight == 1950) { |
| | | global.eagleViewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | global.eagleViewer.camera.positionCartographic.longitude, |
| | | global.eagleViewer.camera.positionCartographic.latitude, |
| | | 1800 |
| | | ), |
| | | orientation: { |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | smallViewerHeight = 1800 |
| | | this.$emit('change-wheel', false, 'startSmallWheel') |
| | | return |
| | | } |
| | | |
| | | if (height > 1510) { |
| | | global.viewer.camera.setView({ |
| | | if (smallViewerHeight == 1800) { |
| | | global.eagleViewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | global.eagleViewer.camera.positionCartographic.longitude, |
| | | global.eagleViewer.camera.positionCartographic.latitude, |
| | | 1650 |
| | | ), |
| | | orientation: { |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | smallViewerHeight = 1650 |
| | | this.$emit('change-wheel', false, 'startSmallWheel') |
| | | return |
| | | } |
| | | } else { // 上 |
| | | if (height < 1640) { |
| | | global.viewer.camera.setView({ |
| | | |
| | | if (smallViewerHeight == 1650) { |
| | | global.eagleViewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | global.eagleViewer.camera.positionCartographic.longitude, |
| | | global.eagleViewer.camera.positionCartographic.latitude, |
| | | 1500 |
| | | ), |
| | | orientation: { |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | return |
| | | smallViewerHeight = 1500 |
| | | this.$emit('change-wheel', false, 'startSmallWheel') |
| | | } |
| | | |
| | | if (height < 1790) { |
| | | global.viewer.camera.setView({ |
| | | } else { // 上 |
| | | if (smallViewerHeight == 1500) { |
| | | global.eagleViewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | global.eagleViewer.camera.positionCartographic.longitude, |
| | | global.eagleViewer.camera.positionCartographic.latitude, |
| | | 1650 |
| | | ), |
| | | orientation: { |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | smallViewerHeight = 1650 |
| | | this.$emit('change-wheel', false, 'startSmallWheel') |
| | | return |
| | | } |
| | | |
| | | if (height < 1940) { |
| | | global.viewer.camera.setView({ |
| | | if (smallViewerHeight == 1650) { |
| | | global.eagleViewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | global.eagleViewer.camera.positionCartographic.longitude, |
| | | global.eagleViewer.camera.positionCartographic.latitude, |
| | | 1800 |
| | | ), |
| | | orientation: { |
| | |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | smallViewerHeight = 1800 |
| | | this.$emit('change-wheel', false, 'startSmallWheel') |
| | | return |
| | | } |
| | | |
| | | if (smallViewerHeight == 1800) { |
| | | global.eagleViewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | global.eagleViewer.camera.positionCartographic.longitude, |
| | | global.eagleViewer.camera.positionCartographic.latitude, |
| | | 1950 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: global.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | smallViewerHeight = 1950 |
| | | this.$emit('change-wheel', false, 'startSmallWheel') |
| | | } |
| | | } |
| | | }, |
| | |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | | that.mapCenter[0], |
| | | that.mapCenter[1], |
| | | 950.0 |
| | | that.mapCenter[2] |
| | | ), |
| | | orientation: { |
| | | // 指向 |