From 9c6a42531e53c7e846cfa17eed66104fb5c2727e Mon Sep 17 00:00:00 2001 From: xujingliang <3225043@qq.com> Date: Sun, 4 Feb 2024 10:57:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=B4=E6=BA=90=E5=9C=B0=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 12 ++--- src/components/mars3d/Map.vue | 2 +- src/views/home/widget/waterbox.vue | 74 ++++++++++++++++++++++++++++-- src/views/login/index.vue | 2 - 4 files changed, 77 insertions(+), 13 deletions(-) diff --git a/.env.dev b/.env.dev index 92a58e8..4ac16f9 100644 --- a/.env.dev +++ b/.env.dev @@ -1,14 +1,14 @@ NODE_ENV = development # 正式服务器 -#VUE_APP_BASE_API = http://221.2.83.254:9001/api -#VUE_APP_BASE_IMG_URL = http://221.2.83.254:9001 -#VUE_APP_WEBSOCKET_URL = ws://221.2.83.254:9002/ws +VUE_APP_BASE_API = http://221.2.83.254:9001/api +VUE_APP_BASE_IMG_URL = http://221.2.83.254:9001 +VUE_APP_WEBSOCKET_URL = ws://221.2.83.254:9002/ws # 本地测试 -VUE_APP_BASE_API = http://221.2.83.254:9013/api -VUE_APP_BASE_IMG_URL = http://221.2.83.254:9013 -VUE_APP_WEBSOCKET_URL = ws://221.2.83.254:9002/ws +# VUE_APP_BASE_API = http://221.2.83.254:9013/api +# VUE_APP_BASE_IMG_URL = http://221.2.83.254:9013 +# VUE_APP_WEBSOCKET_URL = ws://221.2.83.254:9002/ws # VUE_APP_BASE_API = http://192.168.10.114:81/api # VUE_APP_BASE_IMG_URL = http://192.168.10.114:81 diff --git a/src/components/mars3d/Map.vue b/src/components/mars3d/Map.vue index cea7a16..1b4fcca 100644 --- a/src/components/mars3d/Map.vue +++ b/src/components/mars3d/Map.vue @@ -116,7 +116,7 @@ export default { attribute.symbol.styleOptions.label.pixelOffsetY = -40 } attribute.pid = group.id; - // 替换所有图层地址路径 + // 替换所有图层地址路径 历史遗留数据库保存的是223服务器地址 attribute.url = attribute.url.replace("http://223.99.16.253:9007","http://221.2.83.254:9007") // 去掉所有图层点击选中样式 delete attribute.highlight; diff --git a/src/views/home/widget/waterbox.vue b/src/views/home/widget/waterbox.vue index 5ef98d3..01f20f0 100644 --- a/src/views/home/widget/waterbox.vue +++ b/src/views/home/widget/waterbox.vue @@ -161,7 +161,9 @@ export default { }, addGoodsLayer(){ if (this.waterGraphicLayer == null) { - this.waterGraphicLayer = new mars3d.layer.GraphicLayer(); + this.waterGraphicLayer = new mars3d.layer.GraphicLayer({ + zIndex:1 + }); window.globalmap.addLayer(this.waterGraphicLayer); } @@ -172,6 +174,7 @@ export default { this.nestWaterPoints.forEach((item, index) => { let graphic = new mars3d.graphic.BillboardEntity({ + id:index, position: [item.lngLat[0], item.lngLat[1]], style: { image: "img/water.png", @@ -341,12 +344,75 @@ export default { }, flyToPosition(item,index,type) { this.startLngLat = item.lngLat - window.globalmap.flyToPoint([item.lngLat[0],item.lngLat[1]], { radius: 4000, pitch: -90 }); + window.globalmap.flyToPoint([item.lngLat[0],item.lngLat[1]], { radius: 800, pitch: -90 }); this.flyAddPoint(item,index) }, - flyAddPoint(item,index){ + flyAddPoint(it,idx){ + let grap=this.waterGraphicLayer.getGraphicByAttr(idx,"id") + + this.nestWaterPoints.forEach((item,index)=>{ + let obj = this.waterGraphicLayer.getGraphicByAttr(index,"id") + obj.setStyle({ + image: "img/water.png", + horizontalOrigin: Cesium.HorizontalOrigin.LEFT, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + distanceDisplayCondition: new Cesium.DistanceDisplayCondition( + 0, + 200000 + ), // 按视距距离显示 + scaleByDistance: new Cesium.NearFarScalar(1000, 1.0, 200000, 0.2), + clampToGround: true, + highlight: { + type:'click', + image: "img/wateractive.png", + }, + label: { + text:"水源地"+(index+1)+"("+item.distance+")km", + font_size: 12, + color: "#ffffff", + pixelOffsetY: -78, + pixelOffsetX:20, + distanceDisplayCondition: true, + distanceDisplayCondition_far: 6000, + distanceDisplayCondition_near: 0, + }, + }) + }) + + + grap.setStyle( + { + image: "img/wateractive.png", + horizontalOrigin: Cesium.HorizontalOrigin.LEFT, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + distanceDisplayCondition: new Cesium.DistanceDisplayCondition( + 0, + 200000 + ), // 按视距距离显示 + scaleByDistance: new Cesium.NearFarScalar(1000, 1.0, 200000, 0.2), + clampToGround: true, + highlight: { + type:'click', + image: "img/wateractive.png", + }, + label: { + text:"水源地"+(idx+1)+"("+it.distance+")km", + font_size: 12, + color: "#ffffff", + pixelOffsetY: -78, + pixelOffsetX:20, + distanceDisplayCondition: true, + distanceDisplayCondition_far: 6000, + distanceDisplayCondition_near: 0, + }, + }) + return; + + console.log("grap",grap); if (this.waterGraphicLayerFly == null) { - this.waterGraphicLayerFly = new mars3d.layer.GraphicLayer(); + this.waterGraphicLayerFly = new mars3d.layer.GraphicLayer({ + zIndex:99999999999999999999 + }); window.globalmap.addLayer(this.waterGraphicLayerFly); } this.waterGraphicLayerArrFly.forEach((graphic) => { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 9a372b9..72e2f0c 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -129,7 +129,6 @@ import md5 from 'js-md5' 'tenantid' ]) }, - methods: { ...mapActions([ 'setTenantId', // @@ -167,7 +166,6 @@ import md5 from 'js-md5' } } } -