| | |
| | | }) |
| | | }, |
| | | changeData: function (val, type) { //重写数据 |
| | | var that = this; |
| | | var data = [], |
| | | i = 1, |
| | | inits = (d, childData) => { |
| | |
| | | a.model = true |
| | | } |
| | | |
| | | if (a.model) { |
| | | |
| | | if (that[a.id]) { |
| | | Cesium.when(that[a.id], function (layer) { |
| | | that.map.scene.layers.remove(layer[0].name) |
| | | }) |
| | | } |
| | | |
| | | } else { |
| | | |
| | | if (that[a.id]) { |
| | | that.map.imageryLayers.remove(that[a.id]); |
| | | } |
| | | |
| | | } |
| | | |
| | | b.push(a); |
| | | i++; |
| | |
| | | b[k].children = []; |
| | | b[k].who = 'father'; |
| | | inits(d[k].children, b[k].children) |
| | | } |
| | | } |
| | | } |
| | | |
| | | }; |
| | |
| | | //添加S3M图层服务 |
| | | that[obj.data.id] = scene.open(host + partOfUrl); |
| | | //定位到场景 |
| | | |
| | | Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) { |
| | | // var sname = scenes[0].name; |
| | | // Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) { |