月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-09-15 92291bdc16443dca885956d74644f2abe04eaf6f
src/assets/js/Map/server.js
@@ -4,6 +4,7 @@
import store from "@/store";
const server = {
  layerList: [],
  graticules: null,
  addTreeData(treeNode) {
    if (!treeNode.checked) {
      this.delLayer(treeNode.id);
@@ -15,6 +16,29 @@
    } else {
      this.addUrlAddress(treeNode); //无代理
    }
    if (this.graticules) {
      window.Viewer.imageryLayers.raiseToTop(this.graticules.imageryLayer);
    }
  },
  showlonlatLine() {
    if (!this.graticules) {
      SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid(1737400.0, 1737400.0, 1737400.0)
      this.graticules = new SmartEarth.Cesium.Graticules(
        earthCtrl.Viewer,
        SmartEarth.Cesium.Color.PALEGREEN
      );
      // graticules.makeCoordAxiss();
      var that = this;
      earthCtrl.Viewer.scene.preUpdate.addEventListener(function () {
        that.graticules.update();
      });
    } else {
      this.graticules.enabled = !this.graticules.enabled
    }
  },
  //代理地址
  addProxyAddress(res) {
@@ -390,6 +414,7 @@
    });
    layer.name = `Wms_Layer${res.id}`;
    let img_layer = window.Viewer.imageryLayers.addImageryProvider(layer);
    this.layerList.push({ id: res.id, layerData: img_layer, type: "wmts" });
  },
  addGeoServerMmsLayers(layer, url) {