suerprisePlus
2024-07-16 6069325e1a37cf0462afda1627d4c660735dc57e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import mapServer from "./mapServer";
 
const mapInfo = {
  init(res) {
    switch (res) {
      case "flyto-tool":
        this.setFlyToImageryLayer();
        break;
      case "addWeapons":
        this.setAddWeapons();
        break;
      case "EntityQueryInput":
        this.setEntityQueryInput();
        break;
    }
  },
  setFlyToImageryLayer() {
    mapServer.addServer({
      sourceType: "tms",
      url: "http://103.135.160.14:9038/gisserver/tmsserver/SubicBayArea"
    });
  },
  setAddWeapons() {
    mapServer.addServer({
      sourceType: "wfs",
      url: "https://cim.smartearth.cn/geoserver/PolygonFeature/ows",
      layer: "PolygonFeature:Weapon",
      outlineColor: "#ff0000",
      alpha: 0
    });
  },
  setEntityQueryInput(){
    // earthCtrl.camera.flyTo(120.27012029869624, 14.794107005718674, 2921.642108119077, 0, -90, 0, 2);
    // earthCtrl.camera.flyTo(120.298738742, 14.80902903, 2921.642108119077, 0, -90, 0, 2);
     earthCtrl.camera.flyTo(
      120.25011537497547,
      14.785109412061856, 
      2921.642108119077, 
      57, -45, 0, 2
      );
  },
  setFlyTo(res){
    earthCtrl.camera.flyTo(
      res.longitude,
      res.latitude, 
      res.height, 
      0, -90, 0, 2
      );
  }
 
};
export default mapInfo;