/** * 工具栏-场景 */ var Cesium = window.Cesium; // 全球网格 var LayerGrid = null; // 鹰眼 var HawkeyeData = null; // 夜晚模式 var isNightMode = false; import Bus from "@tools/Bus"; export default { data() { return { // 雾 isFog: false, // 雨 isRain: false, // 雪 isSnow: false, // 天际线 isSkyLine: false, }; }, methods: { // 场景 - 天空纹理 skyTexture() { this.$refs.skyTexture.open(); }, // 场景 - 雨 rain(btn) { btn.checked = !btn.checked; this.isRain = !this.isRain; if (this.isRain) { sgworld.Analysis.createWeather("rain", true); } else { sgworld.Analysis.createWeather("rain", false); } }, // 场景 - 雪 snow(btn) { btn.checked = !btn.checked; this.isSnow = !this.isSnow; if (this.isSnow) { sgworld.Analysis.createWeather("snow", true); } else { sgworld.Analysis.createWeather("snow", false); } }, // 场景 - 雾 fog(btn) { btn.checked = !btn.checked; this.isFog = !this.isFog; if (this.isFog) { sgworld.Analysis.createWeather("fog", true, { distance: 1000, color: "rgba(255,255,255,0.9)", }); } else { sgworld.Analysis.createWeather("fog", false); } }, // 场景 - 室内模式 indoorModel(btn) { sgworld.Analysis.createindoormode({ showHelp: true, helpPosition: { top: '20px', right: '20px' } }); }, // 场景 - 地下模式 undergroundModel() { this.$refs.undergroundModel.open(); }, // 场景 - 全球网格 globalGrid(btn) { btn.checked = !btn.checked; if (!LayerGrid) { LayerGrid = sgworld.Creator.createImageryLayerGrid(); } else { LayerGrid.item.show = !LayerGrid.item.show; } }, // 场景 - 鹰眼 HawkEye(btn) { btn.checked = !btn.checked; if (!HawkeyeData) { HawkeyeData = sgworld.Creator.createHawkeye( { imageryProvider: new Cesium.WebMapTileServiceImageryProvider({ url: "http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=c53eb074c3fcba5ac86103d4d711bbe8", layer: "tdtBasicLayer", style: "default", format: "image/jpeg", tileMatrixSetID: "GoogleMapsCompatible", show: false, }), }, { left: "0px" } ); } else { HawkeyeData.close(); HawkeyeData = undefined; } }, // 场景 - 夜晚 nightModel(btn) { btn.checked = !btn.checked; isNightMode = !isNightMode; sgworld.Creator.NightMode(isNightMode); if (isNightMode) { this.$notify({ title: "夜晚模式", message: "夜晚模式已开启", type: "success", duration: "2000", }); } else { this.$notify({ title: "夜晚模式", message: "地下模式已关闭", duration: "2000", }); } }, // 场景 - HDR HDRmodel(btn) { btn.checked = !btn.checked; if (Viewer.scene.highDynamicRange == false) { Viewer.scene.highDynamicRange = true; this.$notify({ title: "HDR", message: "已开启HDR", type: "success", duration: "2000", }); } else { Viewer.scene.highDynamicRange = false; this.$notify({ title: "HDR", message: "已关闭HDR", duration: "2000", }); } }, Localtion() { // 打开路径查询弹窗 this.$refs.localtion && this.$refs.localtion.open(); }, // 演示动画 DemoAnimation() { this.$refs.DemoAnimation.open(); }, // 演示动画 DemoAnimationtest() { Bus.$emit("editDemoAnimation"); }, // 征拆迁演示 Demolition() { this.$refs.Demolition.open(); }, colorAdjustment(){ this.$refs.colorAdjustment.open(); } }, };