| | |
| | | :style="{ ...rightClickMenuStyle }" |
| | | v-show="menuVisible" |
| | | > |
| | | <div |
| | | <!-- <div |
| | | @click="addSameLevelNode()" |
| | | v-show="firstLevel" |
| | | > |
| | | <i class="el-icon-plus"></i> 添加图层组 |
| | | </div> |
| | | <div |
| | | </div> --> |
| | | <!-- <div |
| | | class="add" |
| | | @click="addChildNode()" |
| | | > |
| | | <i class="el-icon-plus"></i> 添加图层 |
| | | </div> |
| | | <div |
| | | </div> --> |
| | | <!-- <div |
| | | class="delete" |
| | | @click="deleteNode()" |
| | | > |
| | | <i class="el-icon-delete"></i> 删除 |
| | | </div> |
| | | <div |
| | | </div> --> |
| | | <!-- <div |
| | | class="edit" |
| | | @click="editNode()" |
| | | > |
| | | <i class="el-icon-edit"></i> 重命名 |
| | | </div> |
| | | </div> --> |
| | | <div |
| | | class="edit" |
| | | @click="showLayerAttribute()" |
| | |
| | | import { Fill, Stroke, Style } from "ol/style.js"; |
| | | import { |
| | | perms_selectLayers, inquiry_selectDomains, comprehensive_selectPubById, |
| | | project_selectDirAll, project_selectByDirid |
| | | project_selectDirAll, project_selectByDirid, dataQuerySelectWktById |
| | | } from "../../api/api.js"; |
| | | export default { |
| | | name: "tree", |
| | |
| | | }, |
| | | // 鼠标右击事件 |
| | | rightClick(event, object, Node, element) { |
| | | if (object.type == 1) { |
| | | return |
| | | } |
| | | this.currentData = object; |
| | | this.currentNode = Node; |
| | | |
| | | this.$store.state.propertiesName = this.currentData; |
| | | if (this.currentData.serveType == "Tileset") { |
| | | if (this.currentData.serveType == "Tileset" || this.currentData.serveType == "3DML") { |
| | | this.showModelAttach = true; |
| | | } else { |
| | | this.showModelAttach = false; |
| | |
| | | } else { |
| | | this.shwoHistogram = false; |
| | | } |
| | | if (Node.level === 3) { |
| | | |
| | | if (Node.data.children == null) { |
| | | this.firstLevel = false; |
| | | } else { |
| | | this.firstLevel = true; |
| | | } |
| | | if (Node.level === 3 && Node.data.serveType == "Tileset") { |
| | | if (Node.data.children == null && Node.data.serveType == "Tileset" || Node.data.serveType == "3DML") { |
| | | this.showlocal = true; |
| | | } else if (Node.level === 3 && Node.data.serveType != "Tileset") { |
| | | } else if (Node.data.children == null && Node.data.serveType != "Tileset" || Node.data.serveType == "3DML") { |
| | | this.showlocal = false; |
| | | } |
| | | this.menuVisible = true; |
| | |
| | | case 'WFS': |
| | | listWFS.push(this.childOption[i]) |
| | | break; |
| | | case '3DML': |
| | | listTileset.push(this.childOption[i]) |
| | | break; |
| | | case 'Tileset': |
| | | listTileset.push(this.childOption[i]) |
| | | break; |
| | |
| | | case 'TMS': |
| | | listTMS.push(this.childOption[i]) |
| | | break; |
| | | |
| | | } |
| | | } |
| | | this.setChangeWMS(listWMS, checked); |
| | |
| | | } else if (data.type == 2) { |
| | | if (data.serveType == "WMS") { |
| | | this.setChangeWMS([data], checked); |
| | | } else if (data.serveType == "Tileset") { |
| | | } else if (data.serveType == "Tileset" || data.serveType == "3DML") { |
| | | this.setChangeTileset([data], checked); |
| | | } else if (data.serveType == "TMS") { |
| | | this.setChangeTMS([data], checked); |
| | |
| | | } |
| | | }, |
| | | |
| | | setAddLayers(res) { |
| | | async setAddLayers(res) { |
| | | |
| | | if (res.serveType == "WMS") { |
| | | var resource = geoServerURl; |
| | |
| | | }), |
| | | }); |
| | | window.map.addLayer(vectorLayer); |
| | | } else if (res.serveType == "Tileset") { |
| | | } else if (res.serveType == "Tileset" || res.serveType == "3DML") { |
| | | var url; |
| | | if (res.url.indexOf("{host}") != -1) { |
| | | url = res.url.replace("{host}", iisHost); |
| | |
| | | ); |
| | | |
| | | tileset.readyPromise.then((tileset) => { |
| | | |
| | | tileset.id = res.cnName; |
| | | tileset.layerId = res.id; |
| | | tileset.pubid = res.pubid; |
| | | // Cesium.Matrix4.equals(a,b)判断两个四维矩阵是否相等 |
| | | // 整个根节点模型矩阵,该tileSet=>世界坐标系 |
| | | // 单位矩阵,对角线值为1.0的4*4矩阵 |
| | | if (!Cesium.Matrix4.equals(tileset.root.transform, Cesium.Matrix4.IDENTITY)) { |
| | | // 获取模型的世界坐标(笛卡尔) |
| | | // Cesium.Matrix4.getTranslation 通过仿射变换矩阵获取该tileSet的世界坐标 |
| | | const transformCenter = Cesium.Matrix4.getTranslation( |
| | | tileset.root.transform, |
| | | new Cesium.Cartesian3() |
| | | ); |
| | | // 将笛卡尔坐标转换为WGS84经纬度坐标(模型的) |
| | | const transformCartographic = Cesium.Cartographic.fromCartesian( |
| | | transformCenter |
| | | ); |
| | | // 将笛卡尔坐标转换为WGS84经纬度坐标(截面的) |
| | | const boundingSphereCartographic = Cesium.Cartographic.fromCartesian( |
| | | tileset.boundingSphere.center |
| | | ); |
| | | const height = boundingSphereCartographic.height - transformCartographic.height; |
| | | // 从一个Cartesian3对象生成Matrix4变换矩阵(裁切面的) |
| | | window.modelHeight = height; |
| | | } else window.modelHeight = 0; |
| | | this.getTilesetArgs(tileset, res); |
| | | if (res.serveType != '3DML') { |
| | | |
| | | // Cesium.Matrix4.equals(a,b)判断两个四维矩阵是否相等 |
| | | // 整个根节点模型矩阵,该tileSet=>世界坐标系 |
| | | // 单位矩阵,对角线值为1.0的4*4矩阵 |
| | | if (!Cesium.Matrix4.equals(tileset.root.transform, Cesium.Matrix4.IDENTITY)) { |
| | | // 获取模型的世界坐标(笛卡尔) |
| | | // Cesium.Matrix4.getTranslation 通过仿射变换矩阵获取该tileSet的世界坐标 |
| | | const transformCenter = Cesium.Matrix4.getTranslation( |
| | | tileset.root.transform, |
| | | new Cesium.Cartesian3() |
| | | ); |
| | | // 将笛卡尔坐标转换为WGS84经纬度坐标(模型的) |
| | | const transformCartographic = Cesium.Cartographic.fromCartesian( |
| | | transformCenter |
| | | ); |
| | | // 将笛卡尔坐标转换为WGS84经纬度坐标(截面的) |
| | | const boundingSphereCartographic = Cesium.Cartographic.fromCartesian( |
| | | tileset.boundingSphere.center |
| | | ); |
| | | const height = boundingSphereCartographic.height - transformCartographic.height; |
| | | // 从一个Cartesian3对象生成Matrix4变换矩阵(裁切面的) |
| | | window.modelHeight = height; |
| | | } else window.modelHeight = 0; |
| | | this.getTilesetArgs(tileset, res); |
| | | } |
| | | }); |
| | | this.$store.state.setAlphaList.push({ |
| | | name: res.cnName, |
| | |
| | | if (res.pubid) { |
| | | this.setQueryPubid(res); |
| | | } else { |
| | | |
| | | var layer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: url, |
| | | maximumLevel: 18, |
| | | maximumLevel: 22, |
| | | }) |
| | | ); |
| | | layer.name = res.cnName; |
| | |
| | | if (data.code != 200) { |
| | | |
| | | } else { |
| | | this.reload(tileset, data.result.json) |
| | | if (res.serveType != '3DML') { |
| | | this.reload(tileset, data.result.json) |
| | | } else { |
| | | this.tileSet(tileset, parseFloat(res.elev)) |
| | | } |
| | | |
| | | } |
| | | } else { |
| | | this.tileSet(tileset, parseFloat(res.elev)) |
| | |
| | | |
| | | } else { |
| | | var url = data.result.url; |
| | | |
| | | if (res.url.indexOf("{host}") != -1) { |
| | | url = res.url.replace("{host}", iisHost); |
| | | } |
| | | var layer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: url, |
| | | maximumLevel: 18, |
| | | }) |
| | | ); |
| | | var min = data.result.min; |
| | | var max = data.result.max; |
| | | var layer; |
| | | if (max > 0) { |
| | | layer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: url, |
| | | minimumLevel: min, |
| | | maximumLevel: max, |
| | | |
| | | }) |
| | | ); |
| | | } else { |
| | | layer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: url, |
| | | minimumLevel: min, |
| | | }) |
| | | ); |
| | | } |
| | | |
| | | layer.name = res.cnName; |
| | | |
| | | if (data.result.geom) { |
| | |
| | | var hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(vm.yaw), 0, 0); |
| | | var matrix = Cesium.Transforms.headingPitchRollToFixedFrame(pos, hpr, Cesium.Ellipsoid.WGS84, converter); |
| | | tileset._root.transform = matrix; |
| | | Viewer.flyTo(tileset); |
| | | // Viewer.flyTo(tileset); |
| | | }, |
| | | tileSet(tileset, height) { |
| | | //3dtile模型的边界球体 |
| | |
| | | var translation = Cesium.Cartesian3.subtract(Cartesian3_offset, Cartesian3_original, new Cesium.Cartesian3()); |
| | | //修改模型矩阵 |
| | | tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); |
| | | Viewer.flyTo(tileset); |
| | | // Viewer.flyTo(tileset); |
| | | }, |
| | | setTreeData(source) { |
| | | let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆 |