From ff5731b6a22c9f2451dc8065d2fa32153bdd4a1a Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期一, 22 五月 2023 10:38:04 +0800 Subject: [PATCH] 图层管理,空间查询修改 --- src/components/MapView/mapSpaceTop.vue | 2 src/views/Tools/LayerTree.vue | 62 +++++++++++++++++++------------ src/components/MapView/mapMenuTop.vue | 4 +- src/components/mapsdk.vue | 30 +++++++++++--- 4 files changed, 64 insertions(+), 34 deletions(-) diff --git a/src/components/MapView/mapMenuTop.vue b/src/components/MapView/mapMenuTop.vue index dd34abe..d03243e 100644 --- a/src/components/MapView/mapMenuTop.vue +++ b/src/components/MapView/mapMenuTop.vue @@ -9,7 +9,7 @@ <el-select v-model="menuTopFrom.queryLayer" :title="treeChange" - placeholder="璇烽�夋嫨..." + placeholder="璇烽�夋嫨鏁版嵁..." :popper-append-to-body="false" > <el-option @@ -48,7 +48,7 @@ <el-select @change="changeValue($event)" v-model="menuTopFrom.queryType" - placeholder="璇烽�夋嫨..." + placeholder="閫夋嫨鑼冨洿" :popper-append-to-body="false" > <el-option diff --git a/src/components/MapView/mapSpaceTop.vue b/src/components/MapView/mapSpaceTop.vue index af8b830..609c9e0 100644 --- a/src/components/MapView/mapSpaceTop.vue +++ b/src/components/MapView/mapSpaceTop.vue @@ -3,7 +3,7 @@ <el-select v-model="menuTopFrom.queryLayer" @change="menuTreeCheck" - placeholder="璇烽�夋嫨..." + placeholder="璇烽�夋嫨鏁版嵁..." filterable ref="selectTree1" > diff --git a/src/components/mapsdk.vue b/src/components/mapsdk.vue index 2677e44..4aced36 100644 --- a/src/components/mapsdk.vue +++ b/src/components/mapsdk.vue @@ -78,13 +78,22 @@ label-width="50px" > <el-form-item label="缁忓害:"> - <el-input v-model="coordFrom.lon"></el-input> + <el-input + v-model="coordFrom.lon" + placeholder="璇疯緭鍏ョ粡搴�" + ></el-input> </el-form-item> <el-form-item label="绾害:"> - <el-input v-model="coordFrom.lat"></el-input> + <el-input + v-model="coordFrom.lat" + placeholder="璇疯緭鍏ョ淮搴�" + ></el-input> </el-form-item> <el-form-item label="楂樺害:"> - <el-input v-model="coordFrom.height"></el-input> + <el-input + v-model="coordFrom.height" + placeholder="璇疯緭鍏ラ珮搴�" + ></el-input> </el-form-item> <el-form-item> <el-button @@ -161,6 +170,7 @@ <el-input style="width: 160px" v-model="comprehensive.name" + placeholder="璇疯緭鍏ュ湴鍚�...." ></el-input> </el-form-item> <el-form-item> @@ -738,9 +748,9 @@ val: 50, }, coordFrom: { - lon: 116.3911, - lat: 39.9115, - height: 100000, + lon: "", + lat: "", + height: "", }, listData: { name: null, @@ -1194,6 +1204,12 @@ }, //瀹氫綅 setCoordLocal() { + if (!this.coordFrom.lon) { + return this.$message('璇疯緭鍏ョ粡搴�'); + } + if (!this.coordFrom.lat) { + return this.$message('璇疯緭鍏ョ含搴�'); + } var lon = parseFloat(this.coordFrom.lon) var lat = parseFloat(this.coordFrom.lat) var height = parseFloat(this.coordFrom.height) == NaN ? parseFloat(this.coordFrom.height) : 100; @@ -1201,7 +1217,7 @@ var position = { X: lon, Y: lat, - Altitude: 2000, + Altitude: height, }; if (this.imagePoint != null) { sgworld.Creator.DeleteObject(this.imagePoint); diff --git a/src/views/Tools/LayerTree.vue b/src/views/Tools/LayerTree.vue index 01a4ac7..352fd35 100644 --- a/src/views/Tools/LayerTree.vue +++ b/src/views/Tools/LayerTree.vue @@ -115,7 +115,7 @@ <div class="edit" @click="pellucidity()" - v-if="showlocal" + v-if="showopaque" > <i class="el-icon-tickets"></i> 閫忔槑搴� </div> @@ -227,6 +227,7 @@ return { shwoHistogram: false, showlocal: false, + showopaque: false, eleId: "", isShow: false, currentData: "", @@ -321,12 +322,18 @@ } this.currentData = object; this.currentNode = Node; - this.menuVisible = true; + this.$store.state.propertiesName = this.currentData; - if (this.currentData.serveType == "Tileset" || this.currentData.serveType == "3DML") { + this.showModelAttach = false; + this.shwoTitle = false; + this.menuVisible = true; + + if (this.currentData.serveType == 'TMS') { + this.shwoTitle = true + } else if (this.currentData.serveType == "Tileset" || this.currentData.serveType == "3DML") { this.showModelAttach = true; - } else { - this.showModelAttach = false; + } else if (this.currentData.serveType == "DEM" || this.currentData.serveType == "DOM" || this.currentData.serveType == "MPT") { + this.menuVisible = false; } if (this.currentData.enName == "s_explorationpoint") { this.shwoHistogram = true; @@ -341,16 +348,13 @@ } if (Node.data.children == null && Node.data.serveType == "Tileset" || Node.data.serveType == "3DML") { this.showlocal = true; - } else if (Node.data.children == null && Node.data.serveType != "Tileset" || Node.data.serveType == "3DML") { + this.showopaque = true; + } else if (Node.data.children == null && Node.data.serveType == "TMS") { + this.showlocal = true; + this.showopaque = false; + } else if (Node.data.children == null && Node.data.serveType != "Tileset") { this.showlocal = false; - } - - - - if (Node.data.serveType == "DEM") { - this.firstLevel = true; - this.menuVisible = false - + this.showopaque = false; } @@ -492,13 +496,23 @@ //妯″瀷瀹氫綅 - positioning() { + async positioning() { this.menuVisible = false - for (var i in Viewer.scene.primitives._primitives) { - if ( - Viewer.scene.primitives._primitives[i].id == this.currentData.cnName - ) { - Viewer.flyTo(Viewer.scene.primitives._primitives[i]); + if (this.currentData.serveType == 'Tileset' || this.currentData.serveType == '3DML') { + for (var i in Viewer.scene.primitives._primitives) { + if ( + Viewer.scene.primitives._primitives[i].id == this.currentData.cnName + ) { + Viewer.flyTo(Viewer.scene.primitives._primitives[i]); + } + } + } else if (this.currentData.serveType == 'TMS' && this.currentData.pubid) { + const data = await comprehensive_selectPubById({ id: this.currentData.pubid }) + if (data.result.geom) { + var wkt = this.$wkt.parse(data.result.geom); + Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], 2000), + }); } } }, @@ -1043,10 +1057,10 @@ layer.name = res.cnName; if (data.result.geom) { - var wkt = this.$wkt.parse(data.result.geom); - Viewer.camera.flyTo({ - destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], 2000), - }); + // var wkt = this.$wkt.parse(data.result.geom); + // Viewer.camera.flyTo({ + // destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], 2000), + // }); } this.setChangeWMS(); } -- Gitblit v1.9.3