| | |
| | | that.map.scene.globe.depthTestAgainstTerrain = false; |
| | | obj.data.children.forEach(item => { |
| | | Cesium.when(that[item.id], function (layer) { |
| | | topic.publish('removeTilt', 'Layermanagement', item); |
| | | topic.publish('removeLayersLegends', 'legends', item); |
| | | that.map.scene.layers.remove(layer[0].name) |
| | | }) |
| | | var host = that.returnStr(item.src).host; |
| | | var scene = that.map.scene; |
| | | var partOfUrl = that.returnStr(item.src).partOfUrl; |
| | | //添加S3M图层服务 |
| | | that[item.id] = scene.open(host + partOfUrl); |
| | | that[item.id] = scene.open(host + partOfUrl, undefined, { |
| | | autoSetView: false //不自动定位 |
| | | }); |
| | | topic.publish('appendTilt', 'Layermanagement', item); |
| | | topic.publish('addLayersLegends', 'legends', item); |
| | | //定位到场景 |
| | | Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) { |
| | | var sname = scenes[0].name; |
| | | Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) { |
| | | Cesium.when(that[item.id], function (layer) { |
| | | |
| | | //设置相机位置、视角,便于观察场景 |
| | | scene.camera.setView({ |
| | | destination: new Cesium.Cartesian3.fromDegrees(Number(item.lon), Number(item.lat), Number(item.height)), |
| | |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | |
| | | }); |
| | | } else { |
| | | |
| | |
| | | if (obj.data.model) { |
| | | obj.data.children.forEach(item => { |
| | | Cesium.when(that[item.id], function (layer) { |
| | | topic.publish('removeTilt', 'Layermanagement', item); |
| | | topic.publish('removeLayersLegends', 'legends', item); |
| | | that.map.scene.layers.remove(layer[0].name) |
| | | }) |
| | | }); |
| | |
| | | |
| | | if (obj.data.model) { |
| | | Cesium.when(that[obj.data.id], function (layer) { |
| | | topic.publish('removeTilt', 'Layermanagement', obj.data); |
| | | topic.publish('removeLayersLegends', 'legends', obj.data); |
| | | that.map.scene.layers.remove(layer[0].name) |
| | | }) |
| | | |
| | |
| | | var partOfUrl = that.returnStr(obj.data.src).partOfUrl; |
| | | //添加S3M图层服务 |
| | | |
| | | that[obj.data.id] = scene.open(host + partOfUrl); |
| | | that[obj.data.id] = scene.open(host + partOfUrl, undefined, { |
| | | autoSetView: false //不自动定位 |
| | | }); |
| | | topic.publish('appendTilt', 'Layermanagement', obj.data); |
| | | topic.publish('addLayersLegends', 'legends', obj.data); |
| | | //定位到场景 |
| | | |
| | | Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) { |
| | | var sname = scenes[0].name; |
| | | Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) { |
| | |
| | | |
| | | if (obj.data.model) { |
| | | Cesium.when(that[obj.data.id], function (layer) { |
| | | |
| | | topic.publish('removeTilt', 'Layermanagement', obj.data); |
| | | topic.publish('removeLayersLegends', 'legends', obj.data); |
| | | that.map.scene.layers.remove(layer[0].name) |
| | | }) |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | for (var i = 0; i < that.dataAllArray.length; i++) { |
| | | |
| | | if (obj.data.id == that.dataAllArray[i].id) { |