<template>
|
<div class="body_box">
|
<div id="cesiumContainer"></div>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
components: {},
|
data() {
|
return {
|
earthCtrl: null,
|
Viewer: null,
|
};
|
},
|
methods: {
|
//地图初始化
|
init3DMap() {
|
//设置月球坐标系
|
SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid(
|
1737400.0,
|
1737400.0,
|
1737400.0
|
);
|
//页面初始化
|
this.earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", {
|
StaticFileBaseUrl: StaticFileBaseUrl,
|
ellipsoidCoordinates: "MOON",
|
});
|
// this.earthCtrl.environment.disableAllEffect();
|
|
this.Viewer = this.earthCtrl._Viewer;
|
|
// this.Viewer.scene.skyAtmosphere.show = false;
|
|
this.Viewer.scene.globe.depthTestAgainstTerrain = false;
|
|
window.earthCtrl = this.earthCtrl;
|
|
window.Viewer = this.earthCtrl._Viewer;
|
|
window.Cesium = SmartEarth.Cesium;
|
|
window.sgworld = earthCtrl;
|
|
sgworld.Creator.SimpleGraphic.edit(true, { editProp: true });
|
//=======================
|
// window.Viewer.imageryLayers.removeAll();
|
//=======================
|
// Viewer.scene.globe.showGroundAtmosphere = false;
|
|
// var terrain = new Cesium.CesiumTerrainProvider({
|
// url: config.moonTerrain,
|
// tilingScheme: new Cesium.GeographicTilingScheme({
|
// ellipsoid: Cesium.Ellipsoid.MOON,
|
// }),
|
// });
|
// window.Viewer.terrainProvider = terrain;
|
},
|
},
|
mounted() {
|
this.init3DMap();
|
},
|
created() {},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.body_box {
|
width: 100%;
|
height: 100%;
|
position: absolute;
|
top: 0;
|
left: 0;
|
.cesiumContainer {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
</style>
|