| | |
| | | >确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <queryinfo ref="queryinfo" /> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | var layer = this.currentData.enName.replaceAll("_", ""); |
| | | this.$store.state.mapSpaceQueryLayer = layer; |
| | | this.$store.state.mapPopBoxFlag = "2"; |
| | | this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); |
| | | this.$refs && |
| | | this.$refs.queryinfo && |
| | | this.$refs.queryinfo.open("属性", null, { |
| | | close: () => { |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | |
| | | if (window.Viewer.scene.primitives.length != 0) { |
| | | window.Viewer.scene.primitives.removeAll(); |
| | | } |
| | | }, |
| | | }); |
| | | this.$store.state.showPopBoxFlag = true; |
| | | }, |
| | | modelAttach() { |
| | | this.menuVisible = false; |
| | |
| | | rightClick(event, object, Node, element) { |
| | | this.currentData = object; |
| | | this.currentNode = Node; |
| | | |
| | | this.$store.state.propertiesName = this.currentData; |
| | | if (this.currentData.serveType == "Tileset") { |
| | | this.showModelAttach = true; |
| | |
| | | this.menuVisible = false |
| | | var label = this.currentNode.data.cnName; |
| | | if (this.currentNode.data.serveType == "WMS") { |
| | | for (var i in window.Viewer.imageryLayers._layers) { |
| | | if ( |
| | | window.Viewer.imageryLayers._layers[i].imageryProvider.name === |
| | | label |
| | | ) { |
| | | window.Viewer.imageryLayers.remove( |
| | | window.Viewer.imageryLayers._layers[i] |
| | | ); |
| | | } |
| | | } |
| | | var value = this.$refs.tree.getCheckedNodes(); |
| | | |
| | | this.$bus.$emit("showMenuLayer", value); |
| | | |
| | | } else if (this.currentNode.data.serveType == "WFS") { |
| | | for (var i in window.Viewer.dataSources._dataSources) { |
| | | if (window.Viewer.dataSources._dataSources[i].name == label) { |
| | |
| | | this.currentData = data ? data : this.currentData; |
| | | var layer = this.currentData.enName.replaceAll("_", ""); |
| | | this.$store.state.mapSpaceQueryLayer = layer; |
| | | |
| | | this.$store.state.showPopBoxFlag = true; |
| | | this.$store.state.mapPopBoxFlag = "2"; |
| | | this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); |
| | | this.$refs && |
| | | this.$refs.queryinfo && |
| | | this.$refs.queryinfo.open("属性", null, { |
| | | close: () => { |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | |
| | | if (window.Viewer.scene.primitives.length != 0) { |
| | | window.Viewer.scene.primitives.removeAll(); |
| | | } |
| | | }, |
| | | }); |
| | | |
| | | }, |
| | | //模型定位 |
| | | positioning() { |
| | |
| | | handleCheckChange(data, checked, indeterminate) { |
| | | |
| | | if (data.type != 2) return; |
| | | var std = []; |
| | | if (data.serveType == "WMS") { |
| | | for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) { |
| | | var val_id = |
| | | window.Viewer.imageryLayers._layers[i].imageryProvider.name; |
| | | if (val_id == data.cnName) { |
| | | std.push(data.label); |
| | | var value = this.$refs.tree.getCheckedNodes(); |
| | | |
| | | const img_layer = window.Viewer.imageryLayers._layers[i]; |
| | | img_layer.show = checked; |
| | | } |
| | | } |
| | | //存储选中图层 |
| | | let checkedLayers = JSON.parse(sessionStorage.getItem("checkedLayers")); |
| | | if (checked && data.url){ |
| | | checkedLayers.push(data); |
| | | } |
| | | else { |
| | | for (let i = 0; i < checkedLayers.length; i++) { |
| | | let item = checkedLayers[i]; |
| | | if (item.enName == data.enName){ |
| | | checkedLayers.splice(i,1); |
| | | } |
| | | } |
| | | } |
| | | sessionStorage.setItem("checkedLayers",JSON.stringify(checkedLayers)); |
| | | setTimeout(() => { |
| | | this.$bus.$emit("treeChanged", true); |
| | | }, 500) |
| | | } else if (data.serveType == "WFS") { |
| | | this.$bus.$emit("showMenuLayer", value); |
| | | |
| | | |
| | | |
| | | if (data.serveType == "WFS") { |
| | | if (window.Viewer.dataSources._dataSources.length == 0) { |
| | | this.setAddLayers(data); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } else if (data.serveType == "Tileset") { |
| | | |
| | | if (Viewer.scene.primitives._primitives.length == 0) { |
| | | this.setAddLayers(data); |
| | | } else { |
| | | var std = []; |
| | | for (var i in Viewer.scene.primitives._primitives) { |
| | | Viewer.scene.primitives._primitives[i].show = checked; |
| | | if (Viewer.scene.primitives._primitives[i].id == data.cnName) { |
| | | // std.push(res.id); |
| | | std.push(data.id); |
| | | Viewer.flyTo(Viewer.scene.primitives._primitives[i]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (std.length == 0 && checked == true) { |
| | | this.setAddLayers(data); |
| | | } else { |
| | | window.map.getLayers().getArray().forEach(item => { |
| | | if (item.get("name") == data.cnName) { |
| | | item.setVisible(checked); |
| | | if (std.length == 0 && checked == true) { |
| | | this.setAddLayers(data); |
| | | } else { |
| | | window.map.getLayers().getArray().forEach(item => { |
| | | if (item.get("name") == data.cnName) { |
| | | item.setVisible(checked); |
| | | |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | this.tileSet(tileset, parseFloat(res.elev)) |
| | | Viewer.flyTo(tileset); |
| | | }); |
| | | window.model = tileset |
| | | // window.model = tileset |
| | | } |
| | | }, |
| | | |
| | |
| | | if (str.isShow == 1) { |
| | | checkKey.push(str.id); |
| | | that.setAddLayers(str); |
| | | if (str.serveType == "WMS" && str.url){ |
| | | if (str.serveType == "WMS" && str.url) { |
| | | checkedLayers.push(str); |
| | | } |
| | | } |
| | |
| | | }); |
| | | |
| | | //存储选中图层 |
| | | sessionStorage.setItem("checkedLayers",JSON.stringify(checkedLayers)); |
| | | sessionStorage.setItem("checkedLayers", JSON.stringify(checkedLayers)); |
| | | var res = this.setTreeData(val); |
| | | |
| | | for (var i in res) { |