| | |
| | | // import cameraIcon from "../assets/images/base/视频测点.png" |
| | | // import cameraIconSel from "../assets/images/base/视频测点sel.png" |
| | | import { ElLoading, ElMessage } from "element-plus"; |
| | | import RainEffect from './rain' |
| | | let layerIsOpen = false; |
| | | const Cesium = SmartEarth.Cesium; |
| | | const colorAll = { |
| | |
| | | analysisDXPMRes: [], |
| | | slopeArrow: null, |
| | | elevationTool: null, |
| | | rainEffect: null, |
| | | |
| | | init(earthCtrl) { |
| | | this.earthCtrl = earthCtrl; |
| | | return this; |
| | | }, |
| | | hexToColor(hexColor) { |
| | | const hex = hexColor.replace('#', ''); |
| | | const r = parseInt(hex.substring(0, 2), 16) / 255; |
| | | const g = parseInt(hex.substring(2, 4), 16) / 255; |
| | | const b = parseInt(hex.substring(4, 6), 16) / 255; |
| | | return new Cesium.Color(r, g, b, 1.0); |
| | | }, |
| | | // 天气 |
| | | toggleRain(option, show) { |
| | | console.log(option, 'option') |
| | | // 先销毁旧实例 |
| | | if (this.rainEffect) { |
| | | this.rainEffect.destroy() |
| | | this.rainEffect = null |
| | | } |
| | | this.rainEffect = new RainEffect(earthCtrl.viewer, { |
| | | tiltAngle: -0.2, //倾斜角度 |
| | | rainSize: option.rainSize, // 雨的大小 |
| | | rainSpeed: option.rainSpeed, // 雨的速度 |
| | | color: this.hexToColor(option.rainColor) // 雨的颜色 |
| | | }) |
| | | }, |
| | | // 坡度分析 |
| | | pdfx(option) { |
| | |
| | | this.slopeArrow.setPositions(polygonPosition); |
| | | this.slopeArrow.setSlopeType(1); |
| | | this.slopeArrow.setRegionEnabled(true); |
| | | console.log(this.slopeArrow,'slope') |
| | | console.log(this.slopeArrow, 'slope') |
| | | }); |
| | | }, |
| | | // 关闭坡向箭头 |
| | |
| | | } |
| | | }, |
| | | |
| | | // 天气 |
| | | toggleRain(weather = "rain", show) { |
| | | if (show) { |
| | | earthCtrl.environment.showEffect(weather); |
| | | } else { |
| | | earthCtrl.environment.disableEffect(weather); |
| | | } |
| | | }, |
| | | |
| | | toggleSnow(weather = "snow", show) { |
| | | if (show) { |
| | | earthCtrl.environment.showEffect(weather); |