| | |
| | | sourceType: null, |
| | | init() {}, |
| | | addServer(res) { |
| | | this.remoServer(res); |
| | | this.sourceType = res.sourceType; |
| | | console.log(this.sourceType); |
| | | |
| | | switch (this.sourceType) { |
| | | case "arcgis": |
| | | this.addArcgisServer(res); |
| | |
| | | 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", |
| | | // 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({ |
| | |
| | | layer: layer, |
| | | type: this.sourceType |
| | | }); |
| | | |
| | | }, |
| | | addGeoServer(res) { |
| | | const layer = earthCtrl.factory.createWfsLayer("polygon", { |