| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getToken } from "../../utils/auth.js"; |
| | | export default { |
| | | components: {}, |
| | | data() { |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | // wmts加载 |
| | | AddWmtesLayer(url, id) { |
| | | var urlTemplateImageryProvider = earthCtrl.factory.createImageryLayer({ |
| | | sourceType: "wmts", |
| | | url: url, |
| | | layer: "", |
| | | format: "image/png", |
| | | tileMatrixSetID: "GoogleCRS84Quad01", |
| | | tileMatrixLabels: [ |
| | | "0", |
| | | "1", |
| | | "2", |
| | | "3", |
| | | "4", |
| | | "5", |
| | | "6", |
| | | "7", |
| | | "8", |
| | | "9", |
| | | "10", |
| | | "11", |
| | | "12", |
| | | "13", |
| | | "14", |
| | | "15", |
| | | "16", |
| | | "17", |
| | | "18", |
| | | ], |
| | | style: "", |
| | | tilingScheme: new Cesium.GeographicTilingScheme({ |
| | | ellipsoid: Cesium.Ellipsoid.MOON, |
| | | }), |
| | | }); |
| | | console.log(urlTemplateImageryProvider); |
| | | // this.layerList.push({ |
| | | // id: id, |
| | | // layerData: urlTemplateImageryProvider._primitive, |
| | | // type: "wmts", |
| | | // }); |
| | | }, |
| | | // 地形加载 |
| | | AddDemLayer(url, id) { |
| | | var terrain = new Cesium.CesiumTerrainProvider({ |
| | | url: url, |
| | | // url: url, |
| | | tilingScheme: new Cesium.GeographicTilingScheme({ |
| | | ellipsoid: Cesium.Ellipsoid.MOON, |
| | | }), |
| | | }); |
| | | window.Viewer.terrainProvider = terrain; |
| | | |
| | | // let img_layer = Viewer.imageryLayers.addImageryProvider(layer); |
| | | // this.layerList.push({ id: id, type: "dem" }); |
| | | }, |
| | | //地图初始化 |
| | | init3DMap() { |
| | | //设置月球坐标系 |
| | |
| | | ); |
| | | //页面初始化 |
| | | this.earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", { |
| | | StaticFileBaseUrl: StaticFileBaseUrl, |
| | | // StaticFileBaseUrl: StaticFileBaseUrl, |
| | | ellipsoidCoordinates: "MOON", |
| | | }); |
| | | // this.earthCtrl.environment.disableAllEffect(); |
| | | this.earthCtrl.environment.disableAllEffect(); |
| | | |
| | | this.Viewer = this.earthCtrl._Viewer; |
| | | |
| | |
| | | window.sgworld = earthCtrl; |
| | | |
| | | sgworld.Creator.SimpleGraphic.edit(true, { editProp: true }); |
| | | var token = getToken(); |
| | | var demUrl = `${BASE_URL}/proxy/${token}/24` |
| | | var wmtsUrl = `${BASE_URL}/proxy/${token}/17` |
| | | |
| | | this.AddDemLayer(demUrl) |
| | | this.AddWmtesLayer(wmtsUrl) |
| | | //======================= |
| | | // window.Viewer.imageryLayers.removeAll(); |
| | | //======================= |
| | |
| | | height: 100%; |
| | | } |
| | | } |
| | | |
| | | </style> |
| | | <style> |
| | | .cesium-viewer-animationContainer{ |
| | | display: none !important; |
| | | } |
| | | </style> |