| | |
| | | border-radius: 6px; |
| | | background-color: #999; |
| | | } |
| | | .layui-tree-btnGroup .layui-icon{ |
| | | |
| | | .layui-tree-btnGroup .layui-icon { |
| | | display: inline-block; |
| | | color:white |
| | | color: white |
| | | } |
| | | </style> |
| | | |
| | |
| | | layui.use(['tree'], function () { |
| | | var tree = layui.tree |
| | | isloading = true; |
| | | var modelTree=tree.render({ |
| | | var modelTree = tree.render({ |
| | | elem: '#model-tree-list' |
| | | , data: layerMenu |
| | | , edit:["del"] |
| | | , edit: ["del"] |
| | | , showCheckbox: true //是否显示复选框 |
| | | , id: 'model-tree-list' |
| | | , isJump: false //是否允许点击节点时弹出新窗口跳转 |
| | |
| | | var data = obj.data.ext; //获取当前点击的节点数据 |
| | | var viewer = parent.viewer; |
| | | var Cesium = parent.Cesium; |
| | | if (type != 'BaseMap' && type != 'Terrain' && type != 'Plotting') { |
| | | if (type != 'BaseMap' && type != 'Terrain' && type != 'Plotting' && type != 'DDE') { |
| | | var model = undefined; |
| | | switch (obj.data.field) { |
| | | case "Primitive": { |
| | |
| | | let shpArray = JSON.parse(path); |
| | | var shpPromises = []; |
| | | for (let i = 0; i < shpArray.length; i++) { |
| | | shpPromises.push( Cesium.loadBlob(parent.httpConfig.nginxUrl + shpArray[i])); |
| | | } |
| | | |
| | | shpPromises.push(Cesium.loadBlob(parent.httpConfig.nginxUrl + shpArray[i])); |
| | | } |
| | | |
| | | var layer = null; |
| | | parent.Cesium.when.all(shpPromises, function (files) { |
| | | for(let i=0;i<shpArray.length;i++){ |
| | | for (let i = 0; i < shpArray.length; i++) { |
| | | files[i].name = shpArray[i]; |
| | | } |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | } |
| | | else if (type == 'DDE') { |
| | | var lon, lat, alt; |
| | | lon = obj.data.lon; |
| | | lat = obj.data.lat; |
| | | alt = obj.data.altitude; |
| | | console.log(lon,lat,alt); |
| | | let flyPromise = viewer.camera.flyTo({ |
| | | duration: 3, |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(lon), Number(lat), alt), |
| | | orientation: { |
| | | heading: Cesium.Math.toRadians(0), //绕垂直于地心的轴旋转 |
| | | pitch: Cesium.Math.toRadians(-90), //绕纬度线旋转 |
| | | roll: Cesium.Math.toRadians(0) //绕经度线旋转 |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | , oncheck: function (obj) { |
| | |
| | | } |
| | | } |
| | | //zzf:隐藏除绘图菜单以外的删除按钮 |
| | | $(modelTree.config.elem[0].children[0].childNodes).each(function(){ |
| | | let parentDiv=$(this)[0].childNodes[0]; |
| | | $(parentDiv).find("div .layui-icon-delete").remove(); |
| | | if($(this)[0].dataset.id!="4"){ |
| | | let childrenDiv=$(this)[0].childNodes[1]; |
| | | $(childrenDiv).find("div .layui-icon-delete").remove(); |
| | | $(modelTree.config.elem[0].children[0].childNodes).each(function () { |
| | | let parentDiv = $(this)[0].childNodes[0]; |
| | | $(parentDiv).find("div .layui-icon-delete").remove(); |
| | | if ($(this)[0].dataset.id != "4") { |
| | | let childrenDiv = $(this)[0].childNodes[1]; |
| | | $(childrenDiv).find("div .layui-icon-delete").remove(); |
| | | } |
| | | }) |
| | | function delDrawEntity(modelId){ |
| | | let updateData= { |
| | | "ids":modelId, |
| | | function delDrawEntity(modelId) { |
| | | let updateData = { |
| | | "ids": modelId, |
| | | } |
| | | let token = window.localStorage.getItem("token"); |
| | | $.ajax({ |
| | |
| | | url: parent.httpConfig.webApiUrl + "landstamp/front/removeDrawEntity", |
| | | data: updateData, |
| | | contentType: "application/x-www-form-urlencoded", |
| | | beforeSend:function(request){ |
| | | request.setRequestHeader("token",token); |
| | | beforeSend: function (request) { |
| | | request.setRequestHeader("token", token); |
| | | }, |
| | | success: function (data) { |
| | | console.log(data) |