月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-09-14 0e828960b1ffc10f19303316e7e1a10c9117614e
src/assets/js/Map/index.js
@@ -1,5 +1,5 @@
//配置文件地址
import config from "./config";
// import config from "../../../../public/config/config";
//服务加载配置文件
import server from "./server";
@@ -17,14 +17,13 @@
    //贴地线
    SmartEarth.Cesium.ExternalParameter.changeApproximateTerrainHeights = true
    SmartEarth.Cesium.ExternalParameter.changeApproximateTerrainHeights = true;
    //页面初始化
    this.earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", {
      StaticFileBaseUrl: config.StaticFileBaseUrl,
      ellipsoidCoordinates: "MOON",
      timeline: true
      timeline: true,
    });
    window.earthCtrl = this.earthCtrl;
@@ -39,45 +38,27 @@
    sgworld.Creator.SimpleGraphic.edit(true, { editProp: true });
    //=======================
    window.Viewer.imageryLayers.removeAll();
    Viewer.scene.globe.depthTestAgainstTerrain = false; // 开启深度测试
    Viewer.animation.container.style.visibility = "hidden";
    Viewer.timeline.container.style.visibility = "hidden";
    //=======================
    //大气层
    Viewer.scene.globe.showGroundAtmosphere = false;
    window.setLayer();
    sgworld.Navigate.Stop(); //取消飞行状态
    sgworld.Navigate.setPosition(-1093596.38, 5729026.12, 4136590.41);
  },
  showlonlatLine() {
    // server.AddTmsLayer(config.moonTms);
    server.AddWmtesLayer(config.moonWmts);
    var terrain = new Cesium.CesiumTerrainProvider({
      url: config.moonTerrain,
      tilingScheme: new Cesium.GeographicTilingScheme({
        ellipsoid: Cesium.Ellipsoid.MOON,
      }),
    window.graticules = new SmartEarth.Cesium.Graticules(
      earthCtrl.Viewer,
      SmartEarth.Cesium.Color.PALEGREEN
    );
    // graticules.makeCoordAxiss();
    earthCtrl.Viewer.scene.preUpdate.addEventListener(function () {
      graticules.update();
    });
    window.Viewer.terrainProvider = terrain;
    // server.AddTmsLayer("http://172.16.2.10:50001/sj_raster/v6/service/10003901/1");
    // server.AddGeoWmsLayer();
    // var param = {
    //     name: labelName,
    //     id: earthCtrl.factory.createUUID(),
    //     text: "文字工具",
    //     font: '50pt monospace',
    //     outlineWidth: 2,
    //     fillColor: SmartEarth.Cesium.Color.RED,
    //     lon: 47.5087,
    //     lat: 23.6963,
    //     alt: 10
    // };
    // labelEntity = earthCtrl.factory.createLabel(param);
    // server.AddTmsLayer('http://localhost:8080/abc');
    // earthCtrl.camera.flyTo(47.5087, 23.6963, 300, 9.5, -45, 0.0, 5);
    // //添加鼠标左击事件
    // this.addMouseLeftClickEvents();
    // this.addMouseMouseMoveEvents();
  },
  //鼠标左键点击事件添加
  addMouseLeftClickEvents() {