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