|
|
@ -45,7 +45,8 @@ export default { |
|
|
|
], |
|
|
|
isEdit: false, |
|
|
|
treeData: [], |
|
|
|
defaultProps: { children: 'children', label: 'text' } |
|
|
|
defaultProps: { children: 'children', label: 'text' }, |
|
|
|
defaultViewProps: { children: 'children', label: 'text', disabled: this.disabledNode } |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -54,9 +55,15 @@ export default { |
|
|
|
this.fetchSceneConfig(); |
|
|
|
this.fetchLayerTree(); |
|
|
|
}, |
|
|
|
disabledNode(data, node) { |
|
|
|
if (node.isLeaf) { |
|
|
|
const checkedKeys = this.$refs.layerTree.getCheckedKeys(); |
|
|
|
node.checked = checkedKeys.includes(data.id); |
|
|
|
} |
|
|
|
return true; |
|
|
|
}, |
|
|
|
fetchSceneConfig() { |
|
|
|
getSceneConfig(this.sceneId).then((res) => { |
|
|
|
console.log(res); |
|
|
|
if (res.success && res.data) { |
|
|
|
const { |
|
|
|
initTime, |
|
|
@ -68,8 +75,10 @@ export default { |
|
|
|
zoomSensitivity, |
|
|
|
cameraPosture, |
|
|
|
viewImg, |
|
|
|
layerId |
|
|
|
layerId, |
|
|
|
id |
|
|
|
} = res.data; |
|
|
|
this.initForm.id = id; |
|
|
|
this.initForm.initTime = initTime; |
|
|
|
this.initForm.initWeather = initWeather; |
|
|
|
this.initForm.ambientLightIntensity = ambientLightIntensity; |
|
|
@ -81,6 +90,21 @@ export default { |
|
|
|
this.viewForm.image = viewImg; |
|
|
|
const layerIds = JSON.parse(layerId); |
|
|
|
this.$emit('set-checked-keys', layerIds); |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.viewForm.image) { |
|
|
|
const { lng, lat, alt, heading, pitch, roll } = this.viewForm; |
|
|
|
setTimeout(() => { |
|
|
|
window.viewer.scene.camera.setView({ |
|
|
|
destination: new Cesium.Cartesian3.fromDegrees(lng, lat, alt), |
|
|
|
orientation: { |
|
|
|
heading, |
|
|
|
pitch, |
|
|
|
roll |
|
|
|
} |
|
|
|
}); |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
@ -123,14 +147,6 @@ export default { |
|
|
|
url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer' |
|
|
|
}); |
|
|
|
viewer.addBaseLayer(baseLayer); |
|
|
|
|
|
|
|
// this.$nextTick(() => { |
|
|
|
// let Tlayer = new sycim.TilesetLayer('Tlayer').addTo(viewer); |
|
|
|
// const tileset = new sycim.Tileset('/mapserver/jky-3dtiles/zjcm_encrypt/tileset.json'); |
|
|
|
// console.log(tileset); |
|
|
|
// Tlayer.addGraphic(tileset); |
|
|
|
// viewer.flyTo(tileset); |
|
|
|
// }); |
|
|
|
}, |
|
|
|
fetchView() { |
|
|
|
const { imageSrc, position, heading, pitch, roll } = getCanvasImageAndViewPoint(viewer); |
|
|
@ -287,7 +303,7 @@ export default { |
|
|
|
:show-search="true" |
|
|
|
:show-checkbox="true" |
|
|
|
:default-checked-keys="defaultCheckedKeys" |
|
|
|
:default-props="defaultProps" |
|
|
|
:default-props="defaultViewProps" |
|
|
|
:data="treeData" |
|
|
|
></layer-tree> |
|
|
|
</el-collapse-item> |
|
|
|