suerprisePlus
2024-06-12 0b7865733542931c7c3fcf74febd30fe145af957
src/assets/js/map/mapServer.js
@@ -5,8 +5,9 @@
  sourceType: null,
  init() {},
  addServer(res) {
    this.remoServer(res);
    this.sourceType = res.sourceType;
    console.log(this.sourceType);
    switch (this.sourceType) {
      case "arcgis":
        this.addArcgisServer(res);
@@ -19,17 +20,26 @@
        break;
    }
  },
  remoServer(res) {
    for (var i in this.listData) {
      const obj = this.listData[i];
      if (obj.type == res.sourceType) {
        obj.layer.removeFromMap();
        this.listData.splice(i, 1);
      }
    }
  },
  addTmsLayer(res) {
    console.log(res.url);
    var layer = earthCtrl.factory.createImageryLayer({
        sourceType: "tms",
        url: "http://test.smartearth.cn:9037/gisserver/tmsserver/SubicBayArea",
      sourceType: "tms",
      // url: "http://test.smartearth.cn:9037/gisserver/tmsserver/SubicBayArea"
      url: res.url
    });
    this.listData.push({
      layer: layer,
      type: this.sourceType
    });
    mapConfig.flyToImageryLayer(layer)
    mapConfig.flyToImageryLayer(layer);
  },
  addArcgisServer(res) {
    const layer = earthCtrl.factory.createImageryLayer({
@@ -40,7 +50,6 @@
      layer: layer,
      type: this.sourceType
    });
  },
  addGeoServer(res) {
    const layer = earthCtrl.factory.createWfsLayer("polygon", {