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
133
"use strict";
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
 
var _mapRoam = _interopRequireDefault(require("./mapRoam.js"));
 
var _mapServer = _interopRequireDefault(require("./mapServer.js"));
 
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
 
var layerUrl = "https://cim.smartearth.cn/geoserver/JiaShanBase/ows";
var mapImg = {
  label: null,
  label2: null,
  label3: null,
  layObj2: [{
    sid: "l21",
    url: layerUrl,
    layer: "JiaShanBase:RadarS",
    sourceType: "PolylineWfs",
    color: "#FF0000"
  }, {
    sid: "l22",
    url: layerUrl,
    layer: "JiaShanBase:RadarM",
    color: "#de3",
    sourceType: "PolylineWfs"
  }, {
    sid: "l23",
    url: layerUrl,
    layer: "JiaShanBase:RadarL",
    sourceType: "PolylineWfs",
    color: "#87CEFA"
  }],
  layerObj4: {
    id: "132",
    url: layerUrl,
    layer: "JiaShanBase:RehersalPolygon",
    sourceType: "PolygonWfs",
    width: 1,
    outlineColor: "#FF0000",
    alpha: 0.2,
    height: 500,
    color: "#FF0000"
  },
  init: function init() {
    this.addLabel1();
  },
  addLabel1: function addLabel1() {
    this.label = earthCtrl.factory.createLabel({
      lon: 123.13255714786649,
      lat: 23.067683098974722,
      alt: 3000,
      text: "Nanchang",
      image: "https://cim.smartearth.cn/sdkdemo/master/src/static/image/ChinaFlag.png",
      // 文本偏移量
      pixelOffset: new SmartEarth.Cesium.Cartesian2(0, 10),
      // 图片偏移量
      iPixelOffset: new SmartEarth.Cesium.Cartesian2(0, -20),
      iWidth: 20,
      iHeight: 20
    });
    this.addLabel2();
  },
  addLabel2: function addLabel2() {
    this.label2 = earthCtrl.factory.createLabel({
      lon: 122.74666265573835,
      lat: 22.682558205364717,
      alt: 3000,
      text: "Hainan",
      image: "https://cim.smartearth.cn/sdkdemo/master/src/static/image/ChinaFlag.png",
      // 文本偏移量
      pixelOffset: new SmartEarth.Cesium.Cartesian2(0, 10),
      // 图片偏移量
      iPixelOffset: new SmartEarth.Cesium.Cartesian2(0, -20),
      iWidth: 20,
      iHeight: 20
    });
    this.addLabel3();
  },
  addLabel3: function addLabel3() {
    this.label3 = earthCtrl.factory.createLabel({
      lon: 123.64553245193589,
      lat: 23.739138102644453,
      alt: 3000,
      text: "Jiaozuo",
      image: "https://cim.smartearth.cn/sdkdemo/master/src/static/image/ChinaFlag.png",
      // 文本偏移量
      pixelOffset: new SmartEarth.Cesium.Cartesian2(0, 10),
      // 图片偏移量
      iPixelOffset: new SmartEarth.Cesium.Cartesian2(0, -20),
      iWidth: 20,
      iHeight: 20
    });
 
    _mapRoam["default"].startRoam();
  },
  addImageLayer: function addImageLayer() {
    var _this = this;
 
    setTimeout(function () {
      _mapServer["default"].addServer(_this.layerObj4);
    }, 1000);
    setTimeout(function () {
      for (var i in _this.layObj2) {
        _mapServer["default"].addServer(_this.layObj2[i]);
      }
    }, 1500);
    setTimeout(function () {
      mapImg.init();
    }, 2000);
  },
  removeInit: function removeInit() {
    if (this.label) {
      this.label3.removeFromMap();
      this.label2.removeFromMap();
      this.label.removeFromMap();
    }
 
    _mapRoam["default"].closeRoam();
 
    _mapServer["default"].remoServer(this.layerObj4);
 
    for (var i in this.layObj2) {
      _mapServer["default"].remoServer(this.layObj2[i]);
    }
  }
};
var _default = mapImg;
exports["default"] = _default;