| | |
| | | v-show="menuVisible" |
| | | > |
| | | <div @click="addSameLevelNode()"> |
| | | <i class="el-icon-circle-plus-outline"></i> 同级增加 |
| | | <i class="el-icon-circle-plus-outline"></i> 添加图层组 |
| | | </div> |
| | | <div |
| | | class="add" |
| | | @click="addChildNode()" |
| | | v-show="firstLevel" |
| | | > |
| | | <i class="el-icon-circle-plus-outline"></i> 子级增加 |
| | | <i class="el-icon-circle-plus-outline"></i> 添加图层 |
| | | </div> |
| | | <div |
| | | class="delete" |
| | |
| | | import GeoJSON from 'ol/format/GeoJSON.js'; |
| | | import Map from 'ol/Map.js'; |
| | | |
| | | import { Vector as VectorSource } from "ol/source"; |
| | | import { Vector as VectorLayer, } from "ol/layer"; |
| | | import { Vector as VectorSource } from "ol/source"; |
| | | import { Vector as VectorLayer, } from "ol/layer"; |
| | | |
| | | import View from 'ol/View.js'; |
| | | import { Fill, Stroke, Style } from 'ol/style.js'; |
| | |
| | | deleteNode() { |
| | | |
| | | this.foo(); |
| | | var label = this.currentNode.data.label; |
| | | if (this.currentNode.data.layerType == 'WMS') { |
| | | for (var i in window.Viewer.imageryLayers_layers) { |
| | | if (window.Viewer.imageryLayers_layers[i].name === label) { |
| | | window.Viewer.imageryLayers.remove(window.Viewer.imageryLayers_layers[i]) |
| | | } |
| | | } |
| | | |
| | | } else if (this.currentNode.data.layerType == 'WFS') { |
| | | for (var i in window.Viewer.dataSources._dataSources) { |
| | | if (window.Viewer.dataSources._dataSources[i].name == label) { |
| | | window.Viewer.dataSources.remove(window.Viewer.dataSources._dataSources[i]); |
| | | std.push(data.label) |
| | | } |
| | | } |
| | | } |
| | | var layers_ol = window.map.getAllLayers(); |
| | | for (var i in layers_ol) { |
| | | var layerOl = layers_ol[i]; |
| | | if (layerOl.values_.name == label) { |
| | | window.map.removeLayer(layerOl); //显示图层 |
| | | } |
| | | } |
| | | |
| | | this.$refs.tree.remove(this.currentNode); |
| | | }, |
| | | |
| | |
| | | var node = this.currentNode; |
| | | var data = this.currentData; |
| | | let copyNode = this.currentNode |
| | | debugger |
| | | |
| | | // copyNode.previousSibling = {...node. } |
| | | // copyNode.nextSibling = {...node.nextSibling} |
| | | // window.sessionStorage.setItem('menuNode',CircularJSON.stringify(copyNode)) |
| | |
| | | setAddLayers(res) { |
| | | |
| | | if (res.layerType == 'WMS') { |
| | | |
| | | var url = geoServerURl; |
| | | if (res.url != null && res.url != undefined) { |
| | | url = res.url |
| | | } |
| | | var imageryLayers = window.Viewer.scene.imageryLayers; |
| | | let layerWMS = new Cesium.WebMapServiceImageryProvider({ |
| | | url: url, |
| | | layers: res.resource, |
| | |
| | | }, |
| | | }); |
| | | layerWMS.name = res.label; |
| | | window.Viewer.imageryLayers.addImageryProvider(layerWMS); |
| | | //透明度 |
| | | var tdtAnnoLayer = imageryLayers.addImageryProvider(layerWMS); |
| | | if (res.opacity) { |
| | | tdtAnnoLayer.alpha = parseInt(res.opacity) / 100; |
| | | } |
| | | var layer2 = new Image({ |
| | | name: res.label, |
| | | source: new ImageWMS({ |
| | | crossOrigin: 'anonymous', |
| | | url: url, |
| | | |
| | | params: { |
| | | FORMAT: 'image/png', |
| | | VERSION: '1.1.1', |
| | |
| | | }, |
| | | }), |
| | | }); |
| | | if (res.opacity) { |
| | | layer2.setOpacity(parseInt(res.opacity) / 100); |
| | | } |
| | | window.map.addLayer(layer2); |
| | | |
| | | } else if (res.layerType == 'WFS') { |
| | |
| | | success: function (data) { |
| | | var datasource = Cesium.GeoJsonDataSource.load(data, { |
| | | stroke: Cesium.Color.YELLOW, |
| | | fill: Cesium.Color.YELLOW.withAlpha(0.5), |
| | | fill: Cesium.Color.YELLOW.withAlpha(0.1), |
| | | alpha: 0.1, |
| | | strokeWidth: 8, |
| | | clampToGround: true //是否贴地 |
| | | }); |
| | |
| | | }); |
| | | |
| | | var vectorLayer = new VectorLayer({ |
| | | |
| | | name: res.label, |
| | | source: new VectorSource({ |
| | | url: url, |
| | | format: new GeoJSON(), |
| | | }), |
| | | |
| | | |
| | | }); |
| | | window.map.addLayer(vectorLayer); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | async layersStart() { |
| | | const data = await perms_selectLayers(); |
| | |
| | | watch: { |
| | | filterText(val) { |
| | | this.$refs.tree.filter(val); |
| | | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | |
| | | this.$bus.$on("treeDataCopy", (res) => { |
| | | this.$store.state.treeData = this.treeData; |
| | | this.$store.state.checkedKeys = this.$refs.tree.getCheckedKeys() |
| | | }); |
| | | |
| | | if (this.$store.state.showAllLayers == true) { |
| | | this.layersStart(); |
| | | this.$store.state.showAllLayers = false; |
| | | } else { |
| | | this.treelayersStart(); |
| | | |
| | | this.treeData = this.$store.state.treeData; |
| | | this.$refs.tree.setCheckedKeys(this.$store.state.checkedKeys); |
| | | } |
| | | |
| | | }, |