| | |
| | | var jqDom = $("#left-tree-list > .layui-tree > div"); |
| | | |
| | | for (var i = 0; i < jqDom.length; i++) { |
| | | if ($(jqDom[i]).text().indexOf("三维倾斜数据") != -1) { |
| | | $(jqDom[i]).find('.layui-btn-group').remove() |
| | | } |
| | | |
| | | var textList = $(jqDom[i]).find('.layui-tree-txt'); |
| | | |
| | |
| | | if (e.keyCode == 13) { |
| | | leftSearchItemLayer() |
| | | } |
| | | }) |
| | | |
| | | $(".jimu-widget-LeftNavigationBar .tree-layer-opcity .close").click(function () { |
| | | $(".jimu-widget-LeftNavigationBar .tree-layer-opcity").stop().hide(); |
| | | }) |
| | | |
| | | function leftSearchItemLayer() { |
| | |
| | | var jqDom = $("#left-tree-list > .layui-tree > div"); |
| | | |
| | | for (var i = 0; i < jqDom.length; i++) { |
| | | if ($(jqDom[i]).text().indexOf("三维倾斜数据") != -1) { |
| | | $(jqDom[i]).find('.layui-btn-group').remove() |
| | | } |
| | | |
| | | var textList = $(jqDom[i]).find('.layui-tree-txt'); |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | b.push(a); |
| | | i++; |
| | | if (d[k].children && d[k].children.length > 0) { |
| | |
| | | var partOfUrl = that.returnStr(small.src).partOfUrl; |
| | | //添加S3M图层服务 |
| | | that[small.id] = scene.open(host + partOfUrl); |
| | | } else { |
| | | |
| | | if (that[small.id]) { |
| | | that[small.id].show = true |
| | | } else { |
| | | $.ajax({ |
| | | url: small.src + '/maps.json', |
| | | type: 'get', |
| | | dataType: 'JSON', |
| | | success: function (res) { |
| | | |
| | | that[small.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({ |
| | | url: res[0].path, |
| | | })); |
| | | that[small.id].alpha = small.alpha |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | }, |
| | | showLine: false, //是否开启连接线 |
| | | oncheck: function (obj) { |
| | | |
| | | |
| | | var keyId = that.getUrlKeyId("serviceId"); |
| | | |
| | | if (obj.data.children && obj.data.children.length > 0) { |
| | |
| | | |
| | | if (that[item.id]) { |
| | | that[item.id].show = true |
| | | topic.publish('appendItem', 'Layermanagement', item, that[item.id]); |
| | | } else { |
| | | $.ajax({ |
| | | url: item.src + '/maps.json', |
| | |
| | | dataType: 'JSON', |
| | | success: function (res) { |
| | | |
| | | |
| | | that[item.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({ |
| | | url: res[0].path, |
| | | })); |
| | | topic.publish('appendItem', 'Layermanagement', item, that[item.id]); |
| | | that[item.id].alpha = item.alpha |
| | | |
| | | if (keyId && keyId != "") { |
| | |
| | | }); |
| | | } else { |
| | | obj.data.children.forEach(item => { |
| | | if (that[item.id]) that[item.id].show = false |
| | | if (that[item.id]) { |
| | | topic.publish('removeItem', 'Layermanagement', item); |
| | | that[item.id].show = false; |
| | | } |
| | | }); |
| | | |
| | | } |
| | |
| | | } else { |
| | | |
| | | if (that[obj.data.id]) { |
| | | that[obj.data.id].show = true |
| | | } else { |
| | | that[obj.data.id].show = true; |
| | | topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]); |
| | | } else { |
| | | $.ajax({ |
| | | url: obj.data.src + '/maps.json', |
| | | type: 'get', |
| | | dataType: 'JSON', |
| | | success: function (res) { |
| | | |
| | | |
| | | |
| | | that[obj.data.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({ |
| | | url: res[0].path, |
| | | })); |
| | | |
| | | topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]); |
| | | |
| | | that[obj.data.id].alpha = obj.data.alpha |
| | | |
| | | |
| | | if (keyId && keyId != "") { |
| | | that[obj.data.id].getViewableRectangle().then(function (rectangle) { |
| | | return that.map.camera.flyTo({ |
| | |
| | | }); |
| | | }); |
| | | } |
| | | console.log(that[obj.data.id]) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | } else { |
| | | |
| | | if (that[obj.data.id]) that[obj.data.id].show = false |
| | | if (that[obj.data.id]) { |
| | | topic.publish('removeItem', 'Layermanagement', obj.data); |
| | | that[obj.data.id].show = false; |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | }, |
| | | edit: ['add'], |
| | | operate: function (obj) { |
| | | var type = obj.type; //得到操作类型: add、edit、 del |
| | | var data = obj.data; //得到当前节点的数据 |
| | | var elem = obj.elem; //得到当前节点元素var deptId = data.id;//得到节点索引var parentId = data.parentId;l/父节点 |
| | | var depId = data.id; |
| | | var parentId = data.parentId; |
| | | if (type == 'add') { |
| | | |
| | | $(".jimu-widget-LeftNavigationBar .tree-layer-opcity ul").empty(); |
| | | |
| | | if (data.children) { |
| | | |
| | | data.children.forEach(item => { |
| | | var liC = `<li> |
| | | <div title="${item.title}"> |
| | | ${item.title} |
| | | </div> |
| | | <div id="${item.id + 'Layer'}"> |
| | | |
| | | </div> |
| | | </li>`; |
| | | |
| | | $(".jimu-widget-LeftNavigationBar .tree-layer-opcity ul").append(liC) |
| | | |
| | | $(".jimu-widget-LeftNavigationBar .tree-layer-opcity").stop().show(); |
| | | slider.render({ |
| | | elem: '#' + item.id + 'Layer', |
| | | min: 0, |
| | | max: 10, |
| | | value: item.alpha * 10, |
| | | step: 1, |
| | | theme: '#1E9FFF', |
| | | setTips: function (value) { //自定义提示文本 |
| | | return value / 10; |
| | | }, |
| | | change: function (value) { |
| | | item.alpha = value / 10 |
| | | if (that[item.id]) { |
| | | that[item.id].alpha = item.alpha |
| | | } |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | } else { |
| | | var liC = `<li> |
| | | <div title="${data.title}"> |
| | | ${data.title} |
| | | </div> |
| | | <div id="${data.id + 'Layer'}"> |
| | | |
| | | </div> |
| | | </li>`; |
| | | |
| | | $(".jimu-widget-LeftNavigationBar .tree-layer-opcity ul").append(liC) |
| | | |
| | | $(".jimu-widget-LeftNavigationBar .tree-layer-opcity").stop().show(); |
| | | slider.render({ |
| | | elem: '#' + data.id + 'Layer', |
| | | min: 0, |
| | | max: 10, |
| | | value: data.alpha * 10, |
| | | step: 1, |
| | | theme: '#1E9FFF', |
| | | setTips: function (value) { //自定义提示文本 |
| | | return value / 10; |
| | | }, |
| | | change: function (value) { |
| | | data.alpha = value / 10 |
| | | if (that[data.id]) { |
| | | that[data.id].alpha = data.alpha |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | }); |