diff --git a/src/views/overview/overview.vue b/src/views/overview/overview.vue index 63cb92a..936577c 100644 --- a/src/views/overview/overview.vue +++ b/src/views/overview/overview.vue @@ -33,7 +33,7 @@
- +
@@ -90,6 +90,7 @@ map: null, ysline: null, wsline: null, + underground: null, img_layer: null, tile_layer: null, tiles3dLayer: null, @@ -99,7 +100,7 @@ alarm_layer: null, fly_layer: null, type: 'massMarkers', // 加载数据方式:massMarkers或cluster - refreshType: 'clock', // 刷新数据方式:clock或websocket + refreshType: 'websocket', // 刷新数据方式:clock或websocket showAlarm: true, // 是否显示报警 showAll: false, // 是否显示全部井 alpha: 100, // 是否显示全部井 @@ -176,14 +177,18 @@ watch: { alpha(val){ this.img_layer.alpha = val/100 + // this.ysline.alpha = val/100 + // this.wsline.alpha = val/100 this.map.basemap.opacity = val/100 this.tiles3dLayer.opacity = val/100 - if(val<=10){ - this.map.scene.globe.show = false + this. underground.alpha = val/100 + console.log(val,this.map.level) + if(val<=90 && this.map.level>=19){ + // this.map.scene.globe.show = false this.ysline.show = false this.wsline.show = false }else { - this.map.scene.globe.show = true + // this.map.scene.globe.show = true this.ysline.show = true this.wsline.show = true } @@ -191,26 +196,27 @@ showAll(val) { this.tile_layer.show = val }, - needRefresh(val) { - // 需要刷新 - if (val) { - this.refreshAlarm() - } - }, + // needRefresh(val) { + // // 需要刷新 + // if (val) { + // this.refreshAlarm() + // } + // }, showAlarm(val){ if(!val && this.currentWindow.windowType=='alarm'){ this.currentWindow.visible = false } + this.alarm_layer.show = val } }, created() { this.fetchWellType() }, - // computed: { - // handler() { - // return new Cesium.ScreenSpaceEventHandler(this.map.scene.canvas) - // } - // }, + computed: { + handler() { + return new Cesium.ScreenSpaceEventHandler(this.map.scene.canvas) + } + }, methods: { changetype(){ if(this.listQuery.wellType==='1'){ // 雨水 @@ -362,6 +368,10 @@ // 鼠标左键平移 map.scene.screenSpaceCameraController.rotateEventTypes = [Cesium.CameraEventType.LEFT_DRAG] this.map = map + this.underground = new mars3d.thing.Underground({ + alpha: 1, + }) + map.addThing(this.underground) this.tiles3dLayer = new mars3d.layer.TilesetLayer({ name: '倾斜摄影', url: 'http://111.198.10.15:20603/CRGroup03/tileset.json', @@ -384,8 +394,21 @@ flyTo: true }) - map.addLayer(this.tiles3dLayer) let that = this + this.handler.setInputAction(function(movement) { + console.log(movement,that.map.level)//向上滑是100 向下滑是-100 + if(that.map.level<19){ + that.ysline.show = true + that.wsline.show = true + }else{ + if(that.alpha<90){ + that.ysline.show = false + that.wsline.show = false + } + } + }, Cesium.ScreenSpaceEventType.WHEEL) + map.addLayer(this.tiles3dLayer) + this.tile_layer = new mars3d.layer.ArcGisLayer({ url: 'http://223.82.47.232:11408/arcgis/rest/services/crgx/MapServer', layers: '0,3', @@ -564,6 +587,8 @@ type: 'modelP', styleOptions: { url: '../static/model/baojing.gltf', + minimumPixelSize: 20, + maximumScale: 15, scale: 1 }, // callback: function (attr, styleOpt){ @@ -573,7 +598,7 @@ }, popup: function(e){ var val = e.graphic.options.attr - return `编号:${val.编号}
井名称:${val.附属物名称}
所属道路:${val.所属道路}
告警原因:${map[val.编号].alarmContent}
时间:${map[val.编号].alarmTime}` + return `井编号:${val.编号}
井名称:${val.附属物名称}
所属道路:${val.所属道路}
告警原因:${map[val.编号].alarmContent}
告警时间:${map[val.编号].alarmTime}` } }) this.map.addLayer(this.alarm_layer) @@ -610,6 +635,7 @@ if(this.alpha<10){ this.alpha = 15 } + this.flytoinit() var that = this if(this.fly_layer!==null) this.map.removeLayer(this.fly_layer)