suerprisePlus
2024-12-17 5dfcbd19cd041e1f8a5fb7ed9ab694bf4de00352
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
"use strict";
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
 
var _mapServer = _interopRequireDefault(require("./mapServer"));
 
var _FWV = _interopRequireDefault(require("./json/FWV2.js"));
 
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
 
var mapInfo = {
  layer: null,
  init: function init(res) {
    switch (res) {
      case "flyto-tool":
        this.setFlyToImageryLayer();
        break;
 
      case "addWeapons":
        this.setAddWeapons();
        break;
 
      case "EntityQueryInput":
        this.setEntityQueryInput();
        break;
    }
  },
  setFlyToImageryLayer: function setFlyToImageryLayer() {
    _mapServer["default"].addServer({
      sourceType: "tms",
      url: "http://103.135.160.14:9038/gisserver/tmsserver/SubicBayArea"
    });
  },
  setAddWeapons: function setAddWeapons() {
    _mapServer["default"].addServer({
      sourceType: "wfs",
      url: "https://cim.smartearth.cn/geoserver/PolygonFeature/ows",
      layer: "PolygonFeature:Weapon",
      outlineColor: "#ff0000",
      alpha: 0
    });
  },
  delRadarMaskScan: function delRadarMaskScan() {
    if (this.layer) {
      this.layer.deleteObject();
      this.layer = null;
    }
  },
  createRadarMaskScan: function createRadarMaskScan() {
    var option = {
      radius: 150000,
      //半径
      yaw: 300,
      //雷达方向(可选)
      angle: 120,
      //雷达夹角(可选)
      scanAngle: 30,
      //扫描夹角(可选)
      speed: 5,
      //倍速(可选)
      maxLat: 90,
      //下维度(可选)
      minLat: 45,
      //上维度(可选)
      stackPartitions: 40,
      //横向网格数(可选)
      slicePartitions: 80 //纵向网格数(可选)
      //color: 'rgba(255,255,255,0.5)',  //雷达遮罩颜色(可选)
      //outlineColor: 'rgba(255,255,255,0.5)',  //雷达遮罩边框线颜色(可选)
      //scanColor: 'rgba(255,0,0,0.5)',   //扫描颜色(可选)
 
    };
    var position1 = [121.614202387521061, 23.990136825668284, 120];
    this.layer = earthCtrl.factory.createRadarMaskScan("雷达遮罩扫描1", position1, option);
  },
  setEntityQueryInput: function 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(121.51795297995497, 23.884136798593303, 1463114.1994667982, 0, -90, 0, 2);
  },
  setModelChaneColor: function setModelChaneColor(res) {
    var colorList = res;
    var fwvJson = _FWV["default"].features;
 
    var modelLayer = _mapServer["default"].listData.filter(function (i) {
      if (i.type == "Tileset") return i;
    });
 
    console.log("modelLayer", modelLayer);
    if (modelLayer.length < 0) return;
    modelLayer[0].layer.style = new Cesium.Cesium3DTileStyle({
      color: {
        evaluateColor: function evaluateColor(feature) {
          var id = feature.getProperty("id");
          console.log("id", id);
          var property = fwvJson.filter(function (p) {
            console.log("property", property);
 
            if (p.properties.enti_uuid == id) {
              return p;
            }
          });
          console.log("property", property);
 
          if (property.length > 0) {
            var obj = property[0].properties;
            var objColor = colorList.filter(function (j) {
              if (j.name == obj.fclass_1) {
                return j;
              }
            });
 
            if (objColor.length > 0) {
              return new SmartEarth.Cesium.Color.fromCssColorString(objColor[0].color);
            }
          } // if (ids.indexOf(id) > -1) {
          //
          // }
 
        }
      }
    });
  },
  setFlyTo: function setFlyTo(res) {
    earthCtrl.camera.flyTo(res.longitude, res.latitude, res.height, 0, -90, 0, 2);
  }
};
var _default = mapInfo;
exports["default"] = _default;