| | |
| | | <template> |
| | | <div class="layer-tree"> |
| | | <el-tree ref="treeRef" style="max-width: 600px" show-checkbox node-key="label" :default-checked-keys="defaultSelectedKeys" @check-change="handleCheckChange" :data="treeData" /> |
| | | <el-tree ref="treeRef" style="max-width: 600px" show-checkbox node-key="label" |
| | | :default-checked-keys="defaultSelectedKeys" @check-change="handleCheckChange" :data="treeData" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | const treeRef = ref(null); |
| | | const treeMap = new Map(); |
| | | const defaultSelectedKeys = ref(["模型数据", "影像数据", "地形数据"]); |
| | | function handleCheckChange (data, checked, indeterminate) { |
| | | function handleCheckChange(data, checked, indeterminate) { |
| | | const label = data.label; |
| | | const list = treeMap.get(label); |
| | | if (list) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | function initMap () { |
| | | function initMap() { |
| | | // let modelPromise = addTileset( |
| | | // `http://106.120.22.26:9103/gisserver/c3dserver/sunhugou3d/tileset.json` |
| | | // ) |
| | |
| | | // url: "http://106.120.22.26:9103/gisserver/ctsserver/sunhugoudem", |
| | | // }) |
| | | |
| | | let TerrainLayer = earthCtrl.factory.createTerrainLayer({ |
| | | sourceType: "ctb", |
| | | url: "http://106.120.22.26:9103/gisserver/ctsserver/sungugoudem", |
| | | }); |
| | | let TerrainLayer = earthCtrl.factory.createTerrainLayer({ |
| | | sourceType: "ctb", |
| | | url: "http://106.120.22.26:9103/gisserver/ctsserver/sungugoudem", |
| | | }); |
| | | |
| | | // let TerrainLayer = earthCtrl.factory.createTerrainLayer({ |
| | | // sourceType: "ctb", |
| | |
| | | }, |
| | | ]); |
| | | |
| | | function initDevicePoint () { |
| | | function initDevicePoint() { |
| | | let list = []; |
| | | |
| | | devicetList.value.forEach((item) => { |
| | |
| | | }, |
| | | ]); |
| | | |
| | | function initDistrictPoint () { |
| | | function initDistrictPoint() { |
| | | let list = []; |
| | | districtList.value.forEach((item) => { |
| | | item.showBillboard = true; |
| | |
| | | |
| | | let divPointList = []; |
| | | |
| | | function initDuanmianPoint () { |
| | | function initDuanmianPoint() { |
| | | getDuanMainData().then((res) => { |
| | | const duanmianList = res.data; |
| | | const list = []; |
| | |
| | | }); |
| | | } |
| | | |
| | | function addTetrahedron (visible) { |
| | | function addTetrahedron(visible) { |
| | | const emergencyAreaList = []; |
| | | |
| | | // 这里是添加避险点底层面片 |
| | | loadAreaPolygon("/json/emergency_area.geojson", true).then((entities) => { |
| | | emergencyAreaList.push(...entities); |
| | | }); |
| | |
| | | // altitude: 528, |
| | | // }, |
| | | ]; |
| | | // 这里是添加避险点富文本高亮显示 |
| | | list.forEach((item) => { |
| | | let point = earthCtrl.factory.addTetrahedron({ |
| | | position: { |
| | | lon: item.longitude, |
| | | lat: item.latitude, |
| | | height: item.altitude, |
| | | }, |
| | | multiple: 1.0, |
| | | scale: new SmartEarth.Cesium.Cartesian3(80, 80, 80), |
| | | color:"#00ff00" |
| | | }); |
| | | let point = earthCtrl.factory.createRichTextPoint("避险点", [item.longitude, item.latitude, item.altitude - 10], { |
| | | distanceDisplayCondition: new SmartEarth.Cesium.DistanceDisplayCondition(0, 2000), |
| | | fontColor: "#ffffff", |
| | | fontSize: 20 |
| | | }, "0"); |
| | | console.log("point", point); |
| | | emergencyAreaList.push(point); |
| | | }); |
| | | treeMap.set("避险点", emergencyAreaList); |
| | | } |
| | | function toggleLayerVisible (name, checked) { |
| | | function toggleLayerVisible(name, checked) { |
| | | const entityList = treeMap.get(name); |
| | | if (Array.isArray(entityList) && entityList.length > 0) { |
| | | entityList.forEach((entity) => { |
| | |
| | | treeMap.set(name, entityList); |
| | | } |
| | | |
| | | function getData () { |
| | | function getData() { |
| | | initDevicePoint(); |
| | | initDistrictPoint(); |
| | | initDuanmianPoint(); |
| | |
| | | } else if (path == "/mnfz") { |
| | | treeRef.value.setCheckedKeys( |
| | | defaultKeys.concat("孙胡沟断面"), |
| | | true |
| | | false |
| | | ); |
| | | toggleLayerVisible("孙胡沟断面", true); |
| | | toggleLayerVisible("孙胡沟断面", false); |
| | | toggleLayerVisible("孙胡沟隐患点", false); |
| | | toggleLayerVisible("综合监测设备信息", false); |
| | | } else { |