"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;