From 2dc217ef7ea1a58350962cffe6962bc4a6053df9 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期二, 07 三月 2023 14:52:05 +0800 Subject: [PATCH] 转孔柱状图添加鼠标移入显示信息,登录页面修改,样式管理,资料馆添加批量下载 --- src/components/MapView/mapSpacePop.vue | 58 ++++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 44 insertions(+), 14 deletions(-) diff --git a/src/components/MapView/mapSpacePop.vue b/src/components/MapView/mapSpacePop.vue index 73d023e..fc5f70a 100644 --- a/src/components/MapView/mapSpacePop.vue +++ b/src/components/MapView/mapSpacePop.vue @@ -88,7 +88,7 @@ label="鏌辩姸鍥�" width="100" align="center" - v-show="spaceLayer== 'spaceLayer'" + v-if="spaceLayer == 'sexplorationpoint'" > <template slot-scope="scope"> <el-button @@ -405,6 +405,12 @@ Viewer.entities.remove(this.$store.state.histogramLayer[i]) } } + if (window.histogramHandler != null && Cesium.defined(window.histogramHandler)) { + window.histogramHandler.removeInputAction( + Cesium.ScreenSpaceEventType.MOUSE_MOVE + ) + window.histogramHandler = null + } var param = { gid: row.gid, name: this.spaceLayer, @@ -425,8 +431,10 @@ } var data = await dataQuerySelectByPage(obj) if (data.code != 200) { + } - if (data.result) { + + if (data.result.length != 0) { var val = data.result; //鍐掓场鎺掑簭 for (var i = 0; i < val.length; i++) { @@ -439,8 +447,6 @@ } } } - - var outlineList = [ 'rgba(141,135,114,1)', 'rgba(248,235,179,1)', @@ -450,11 +456,8 @@ 'rgba(197,222,130,1)', 'rgba(208,228,177,1)', ] - - var num = row.elev; var height = 0; - for (var i = 0; i < val.length; i++) { var fill, line; if (i > outlineList.length) { @@ -465,10 +468,11 @@ fill = outlineList[i]; line = outlineList[i]; } - var height = num - val[i].botdepth var layer = Viewer.entities.add({ position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]), + tag: 'Histogram', + properties: val[i], ellipse: { semiMinorAxis: 1.0, //鐭酱 semiMajorAxis: 1.0, //闀胯酱 @@ -485,14 +489,40 @@ this.$store.state.histogramLayer.push(layer) sgworld.Navigate.flyToObj(layer) } + window.histogramHandler = new Cesium.ScreenSpaceEventHandler( + sgworld.Viewer.scene.canvas + ) + var that = this; + window.histogramHandler.setInputAction((event) => { + // var ellipsoid = sgworld.Viewer.scene.globe.ellipsoid; + // var cartesian = sgworld.Viewer.scene.camera.pickEllipsoid(event.endPosition, ellipsoid); + var pick = sgworld.Viewer.scene.pick(event.endPosition); + var selectedEntity = null; + + if (Cesium.defined(pick)) { + if (pick && pick.id && pick.id.tag && pick.id.tag == "Histogram") { + + that.$store.state.propertiesInfo = { + title: pick.id.properties._exppointid._value, + name: pick.id.properties._geoname._value, + type: pick.id.properties.geotype._value, + botdepth: pick.id.properties._botdepth._value, + describe: pick.id.properties._describe._value, + } + that.$store.state.propertiesFlag = "2" + } else { + that.$store.state.propertiesFlag = null + } + } else { + that.$store.state.propertiesFlag = null + } + + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) - - - - - - + } else { + var msg = row.exppointid + " 娌″嫎鎺㈢偣鍦板眰琛ㄦ暟鎹紝鏃犳硶鐢熸垚鏌辩姸鍥�" + this.$message.error(msg); } }, async spaceLocation(index, row) { -- Gitblit v1.9.3