月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-06-02 2643da125528f4392bc69cd40c5241cb9324bd45
src/assets/js/Map/index.js
@@ -2,33 +2,34 @@
import config from "./config";
//服务加载配置文件
import server from "./server";
const InitMap = {
    sgworld: null,
    earthCtrl: null,
    Viewer: null,
    //地图初始化
    init3DMap() {
        //设置月球坐标系
        Cesium.Ellipsoid.WGS84 = new Cesium.Ellipsoid(
        SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid(
            1737400.0,
            1737400.0,
            1737400.0
        );
        //页面初始化
        this.sgworld = new SmartEarth.SGWorld("cesiumContainer", {
            url: SmartEarthRootUrl + config.imgUrl,
            licenseServer: config.licenseServer,
            infoBox: false,
        this.earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", {
            licenseServer: "https://cim.smartearth.cn/",
            StaticFileBaseUrl: "/CIMSDK/"
        });
        this.Viewer = this.sgworld._Viewer;
        window.sgworld = this.sgworld;
        window.Viewer = this.Viewer;
        //显示fps
        sgworld._Viewer.scene.debugShowFramesPerSecond = false;
        this.Viewer = this.earthCtrl._Viewer;
        window.earthCtrl = this.earthCtrl;
        window.Viewer = this.earthCtrl._Viewer;
        // //显示fps
        // sgworld._Viewer.scene.debugShowFramesPerSecond = false;
        //添加月球初始化切片服务
        server.AddTmsLayer(config.moonTms);
        //添加鼠标左击事件
        this.addMouseLeftClickEvents();
        this.addMouseMouseMoveEvents();
        // //添加鼠标左击事件
        // this.addMouseLeftClickEvents();
        // this.addMouseMouseMoveEvents();
    },
    //鼠标左键点击事件添加
    addMouseLeftClickEvents() {