| | |
| | | baseLayer: false, |
| | | fullscreenButton: false, |
| | | } |
| | | |
| | | |
| | | this.viewer = new Viewer(options.dom, viewerOptions) |
| | | |
| | | this.viewer.imageryLayers.removeAll() |
| | |
| | | |
| | | if (terrain) { |
| | | try { |
| | | Cesium.CesiumTerrainProvider.fromUrl(`${import.meta.env.VITE_APP_TERRAIN_URL}/ztzf_terrain/all_terrain`, { |
| | | Cesium.CesiumTerrainProvider.fromUrl(`${import.meta.env.VITE_APP_TERRAIN_URL}`, { |
| | | requestVertexNormals: true, // 启用地形法线增强立体感 |
| | | requestWaterMask: true, // 启用水体遮罩效果 |
| | | }).then(terrainProvider => { |
| | |
| | | } |
| | | return a |
| | | } |
| | | |
| | | // 添加entity |
| | | addCustomImageryProviderDataSource (imageryLayers) { |
| | | console.log(imageryLayers, this.viewer, '---1-') |
| | | |
| | | return this.viewer?.imageryLayers.addImageryProvider(imageryLayers) |
| | | } |
| | | |
| | | showCustomImageryProviderDataSource (imageryLayers, show) { |
| | | if (imageryLayers) { |
| | | imageryLayers.show = show |
| | | } |
| | | } |
| | | |
| | | |
| | | removeAllCustomImageryProviderDataSource (imageryLayers) { |
| | | if (imageryLayers) { |
| | | this.viewer?.imageryLayers.remove(imageryLayers) |
| | | } |
| | | } |
| | | } |