/** * * SmartEarthSDK 基于Cesium的三维web开发 * author: 张丹钊、金磊、薛鹏、张恒 * */ ! function(e, t) { "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define .amd ? define(["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self) .SmartEarth = {}) }(this, function(o) { "use strict"; function X(e, t, i, o) { var r = Math.PI; function n(e) { return e * r / 180 } var a = n((e + i) / 2), e = n((e - i) / 2), i = n((t - o) / 2), t = Math.sin(e), o = Math.sin(i), e = Math.sin(a), i = (t *= t) * (1 - (o *= o)) + (1 - (e *= e)) * o, a = (1 - t) * (1 - o) + e * o; return 2 * (o = Math.atan(Math.sqrt(i / a))) * 6378137 * (1 + 1 / 298.257 * ((3 * (o = Math.sqrt(i * a) / o) - 1) / 2 / a * e * (1 - t) - (3 * o + 1) / 2 / i * (1 - e) * t)) } function K(e, t) { this._viewer = e, this._cesium = t } function Z(e, t) { this._viewer = e, this._cesium = t } function ee(e, t) { var i = Math.PI / 180, o = 180 / Math.PI, r = e.y * i, e = e.x * i, n = t.y * i, t = t.x * i, i = -Math.atan2(Math.sin(e - t) * Math.cos(n), Math.cos(r) * Math.sin(n) - Math.sin(r) * Math.cos(n) * Math.cos(e - t)); return i < 0 && (i += 2 * Math.PI), i *= o } function te(e, t, i) { e = ee(t, e) - ee(t, i); return e < 0 && (e += 360), e } function ie(e) { if (!e || e.length < 3) return 0; for (var t = Math.PI / 180, i = 0, o = 0; o < e.length; o++) { var r = (o + 1) % e.length, n = (o + 2) % e.length; i += te(e[o], e[r], e[n]) } var a = 180 * (e.length - 2), s = i - a; return 420 < s ? s = (i = 360 * e.length - i) - a : 300 < s && s < 420 && (s = Math.abs(360 - s)), s * t * 6371e3 * 6371e3 } function oe(e, t) { this._viewer = e, this._cesium = t } function re(e, t) { this._viewer = e, this._cesium = t } K.prototype.measureTerrainPerimeter = function(e) { var t = e[e.length - 2], e = e[e.length - 1]; return Math.abs(t.x - e.x), Math.abs(t.y - e.y), X(t.y, t.x, e.y, e.x) }, Z.prototype.measureTerrainHeight = function(e) { var t = e[e.length - 2], e = e[e.length - 1]; return Math.abs(t.x - e.x), Math.abs(t.y - e.y), t.hit, e.hit, Math.abs(t.z - e.z) }, oe.prototype.measureTerrainArea = function(e) { return ie(e).toFixed(1) }, re.prototype.measureTerrainkPerimeter = function(e) { var t = e[e.length - 2], e = e[e.length - 1], i = (Math.abs(t.x - e.x), Math.abs(t.y - e.y), Math.abs(t.z - e.z)), t = X(t.y, t.z, e.y, e.z); return Math.sqrt(i * i + t * t) }; var D = Object.freeze({ testModel: "Workers/Model/xiaoche.gltf", modelAxis: "Workers/Model/axis.gltf", flyModel: "Workers/Model/fly.glb", divpoint: "Workers/image/divpoint.png", divpoint1: "Workers/image/divpoint1.png", richtextpoint: "Workers/image/richtextpoint1.png", mark: "Workers/image/mark.png", TrailLine: "Workers/image/TrailLine.png", road: "Workers/image/road.jpg", colors3: "Workers/image/colors3.png", loading: "Workers/image/loading.gif", smog: "Workers/image/smog.png", penquan: "Workers/image/penquan.png", fire: "Workers/image/fire.png", fire2: "Workers/image/fire2.png", bottomplane: "Workers/image/bottomplane.jpg", wall: "Workers/image/ggy.jpg", rotate: "Workers/image/rotate.png", move: "Workers/image/move.png", draw: "Workers/image/cursor/draw.cur", water: "Workers/image/waterNormals.jpg", movingRiver: "Workers/image/movingRiver.png" }); function ne(e, t, i) { Cesium.PolylineTrailLinkMaterialProperty || (Cesium.PolylineTrailLinkMaterialProperty = ne, Cesium.Material .PolylineTrailLinkType = "PolylineTrailLink", Cesium.Material.PolylineTrailLinkImage = window .SmartEarthRootUrl + D.colors1, Cesium.Material.PolylineTrailLinkSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n if(twoColor){\n if(st.s Cesium.Math.toRadians( 80)) return !1; t = t.cartesianToCanvasCoordinates(e); return t ? [t.x - this._mapOffset[0], t.y - this._mapOffset[ 1]] : [] } return [] } }, { key: "pointToData", value: function(e) { var t = this._mapOffset, i = u.scene.globe.ellipsoid, e = new Cesium.cartesian3(e[1] + t, e[2] + t[2], 0), t = i.cartesianToCartographic(e); return [t.lng, t.lat] } }, { key: "getViewRect", value: function() { var e = this._api; return new echarts.graphic.BoundingRect(0, 0, e.getWidth(), e .getHeight()) } }, { key: "getRoamTransform", value: function() { return echarts.matrix.create() } }]), o(r, n); var r, n, a = s; function s(e, t) { var i = this; if (!(i instanceof s)) throw new TypeError("Cannot call a class as a function"); this._viewer = e, this.dimensions = ["lng", "lat"], this._mapOffset = [0, 0], this ._api = t } function l() { echarts.registerCoordinateSystem("GLMap", a), echarts.registerAction({ type: "GLMapRoam", event: "GLMapRoam", update: "updateLayout" }, function(e, t) {}) } echarts.extendComponentModel({ type: "GLMap", getViewer: function() { return u }, defaultOption: { roam: !1 } }), echarts.extendComponentView({ type: "GLMap", init: function(e, t) { this.api = t, this.dispose(), u.scene.postRender.addEventListener(this .moveHandler, this) }, moveHandler: function(e, t) { this.api.dispatchAction({ type: "GLMapRoam" }) }, render: function(e, t, i) {}, dispose: function(e) { u.scene.postRender.removeEventListener(this.moveHandler, this) } }), i.d(t, "load", function() { return l }) }], o = {}, r.m = i, r.c = o, r.d = function(e, t, i) { r.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: i }) }, r.r = function(e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol .toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) }, r.t = function(t, e) { if (1 & e && (t = r(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var i = Object.create(null); if (r.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var o in t) r.d(i, o, function(e) { return t[e] }.bind(null, o)); return i }, r.n = function(e) { var t = e && e.__esModule ? function() { return e.default } : function() { return e }; return r.d(t, "a", t), t }, r.o = function(e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, r.p = "", r(r.s = 0) }, ue.prototype.getSceneList = function(t) { $.ajax({ url: this.serverUrl + "/scene/sceneList", type: "get", success: function(e) { t && "function" == typeof t && e && t(JSON.parse(e)) } }) }, ue.prototype.query = function(e, t) { var i = e.database, e = { type: ae(e.type, "building"), id: e.id, returnGeometry: ae(e.returnGeometry, !0), returnChildren: ae(e.returnChildren, !0) }; $.ajax({ url: this.serverUrl + "/" + i + "/query?version=v2.1", type: "post", async: !0, data: e, success: function(e) { t && "function" == typeof t && e && t(JSON.parse(e)) }, error: function(e, t, i) { alert("error:" + e.status) } }) }, ce.prototype.startRecord = function() { navigator.mediaDevices.getDisplayMedia({ video: !0, audio: !0 }).then(e => { this.createRecorder(e) }).catch(e => { this.getUserMediaError(e) }) }, ce.prototype.getUserMediaError = function(e) { console.log("mediaError", e) }, ce.prototype.createRecorder = function(e) { console.log("start record"); var t = { videoBitsPerSecond: this.videoBPS }, i = (this.recorder = new MediaRecorder(e, t), this.recorder.start(), []); this.recorder.onstop = e => { var t = new Blob(i, { type: "video/mp4" }); this.saveMedia(t) }, this.recorder.ondataavailable = e => { i.push(e.data) } }, ce.prototype.saveMedia = function(e) { var e = window.URL.createObjectURL(e), t = document.createElement("a"); t.innerHTML = "test", t.download = this.mediaOutputPath, t.href = e, t.click() }, ce.prototype.stopRecord = function() { this.recorder.stop() }; const he = 52.35987755982988, me = 3.141592653589793, de = 6378245, pe = .006693421622965943, ge = { BD09ToGCJ02(e, t) { var e = +e - .0065, t = +t - .006, i = Math.sqrt(e * e + t * t) - 2e-5 * Math.sin(t * he), t = Math.atan2(t, e) - 3e-6 * Math.cos(e * he); return [i * Math.cos(t), i * Math.sin(t)] }, GCJ02ToBD09(e, t) { t = +t, e = +e; var i = Math.sqrt(e * e + t * t) + 2e-5 * Math.sin(t * he), t = Math.atan2(t, e) + 3e-6 * Math.cos(e * he); return [i * Math.cos(t) + .0065, i * Math.sin(t) + .006] }, WGS84ToGCJ02(e, t) { return this.out_of_china(e = +e, t = +t) ? [e, t] : [e + (e = this.delta(e, t))[0], t + e[1]] }, GCJ02ToWGS84(e, t) { return this.out_of_china(e = +e, t = +t) ? [e, t] : [2 * e - (e + (e = this.delta(e, t))[0]), 2 * t - (t + e[1]) ] }, delta(e, t) { var i = this.transformLng(e - 105, t - 35), e = this.transformLat(e - 105, t - 35), t = t / 180 * me, o = Math.sin(t), o = 1 - pe * o * o, r = Math.sqrt(o); return [180 * i / (de / r * Math.cos(t) * me), 180 * e / (de * (1 - pe) / (o * r) * me)] }, transformLng(e, t) { t = 300 + (e = +e) + 2 * (t = +t) + .1 * e * e + .1 * e * t + .1 * Math.sqrt(Math.abs(e)); return (t += 2 * (20 * Math.sin(6 * e * me) + 20 * Math.sin(2 * e * me)) / 3) + 2 * (20 * Math.sin( e * me) + 40 * Math.sin(e / 3 * me)) / 3 + 2 * (150 * Math.sin(e / 12 * me) + 300 * Math .sin(e / 30 * me)) / 3 }, transformLat(e, t) { var i = 2 * (e = +e) - 100 + 3 * (t = +t) + .2 * t * t + .1 * e * t + .2 * Math.sqrt(Math.abs(e)); return (i += 2 * (20 * Math.sin(6 * e * me) + 20 * Math.sin(2 * e * me)) / 3) + 2 * (20 * Math.sin( t * me) + 40 * Math.sin(t / 3 * me)) / 3 + 2 * (160 * Math.sin(t / 12 * me) + 320 * Math .sin(t * me / 30)) / 3 }, out_of_china(e, t) { return t = +t, !(73.66 < (e = +e) && e < 135.05 && 3.86 < t && t < 53.55) } }; function f() {} f.prototype.defaultValue = ae, f.prototype.mouse = function(e, t, i) { e.style.cursor = 1 == t ? "url(" + i + "),auto" : "default" }, f.prototype.CreateTooltip = function(e = {}, t, i) { (o = "object" == typeof e ? e : o) && o.origin ? ("center" === o.origin && (r = 15, n = -12), "top" === o.origin && (r = 15, n = -44), "bottom" === o.origin && (r = 15, n = 20)) : (r = 15, n = 20), o && o.color ? ("white" === o.color && (a = "background: rgba(255, 255, 255, 0.8);color: black;"), "black" === o.color && (a = "background: rgba(0, 0, 0, 0.5);color: white;"), "yellow" === o .color && (a = "color: black;background-color: #ffcc33;border: 1px solid white;")) : a = "background: rgba(0, 0, 0, 0.5);color: white;", s = o && o.id ? "toolTip" + o.id : "toolTip"; var o, r, n, a, s, l, u = document.getElementById(s); return u || (l = document.createElement("div"), $(".cesium-viewer").append(l), l = '', $(".cesium-viewer").append(l), u = document.getElementById(s)), i ? (u .innerHTML = e, u.style.left = t.x + r + "px", u.style.top = t.y + n + "px", u.style.display = "block") : u.style.display = "none", { tooltip: u, style: o, showAt: function(e, t) { this.tooltip.innerHTML = t, this.style && this.style.origin ? ("center" === this.style .origin && (r = 15, n = -this.tooltip.offsetHeight / 2), "top" === this.style .origin && (r = 15, n = -this.tooltip.offsetHeight - 20), "bottom" === this .style.origin && (r = 15, n = 20)) : (r = 15, n = -this.tooltip.offsetHeight / 2), this.tooltip.style.left = e.x + r + "px", this.tooltip.style.top = e.y + n + "px", this.tooltip.style.display = "block" }, show: function(e) { this.tooltip.style.display = e ? "block" : "none" } } }, f.prototype.getPointToCameraDistance = function(e, t) { let i; var o; return i = 2 === e.scene.mode ? (o = e.camera.positionCartographic.clone(), Cesium.Cartesian3.distance( t, Cesium.Cartesian3.fromRadians(o.longitude, o.latitude, o.height))) : Cesium.Cartesian3 .distance(t, e.camera.position) }, f.prototype.getPositionFromHR = function(e, t, i, o = 0) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = 6356725 + 21412 * (90 - t) / 90; return [180 * (r / (o * Math.cos(t * Math.PI / 180)) + e * Math.PI / 180) / Math.PI, 180 * (i / o + t * Math.PI / 180) / Math.PI] }, f.prototype.getPositionFromHPR = function(e, t, i = 0, o = 0) { var r = Math.cos(Math.radians(o)) * t, o = Math.sin(Math.radians(o)) * t, t = this.getPositionFromHR(e[0], e[1], r, i); return { lon: t[0], lat: t[1], height: e[2] + o } }, f.prototype.CreateResultTooltip = function(i, t = {}) { var o, r, e, n, a = t.id ? "resultToolTip" + t.id : "resultToolTip", s = document.getElementById(a), l = (t.color ? ("white" === t.color && (e = "background: rgba(255, 255, 255, 0.8);color: black;"), "black" === t.color && (e = "background: rgba(0, 0, 0, 0.5);color: white;"), "blue" === t .color && (e = "background: rgba(48, 119, 221);color: white;"), "yellow" === t.color && (e = "color: black;background-color: #ffcc33;border: 1px solid white;")) : e = "color: black;background-color: #ffcc33;border: 1px solid white;", s || (e = '', $(i.container).append(e), s = document.getElementById(a)), t.addX || 0), u = t.addY || 0, c = this; function h() { if (n) { if (void 0 !== t.far || void 0 !== t.near) { var e = c.getPointToCameraDistance(i, n); if (e > t.far) return void(s.style.display = "none"); if (e < t.near) return void(s.style.display = "none"); s.style.display = "block" } e = i.scene.cartesianToCanvasCoordinates(n); e && (o = -s.offsetWidth / 2 + l, r = -s.offsetHeight + u, s.style.left = e.x + o + "px", s .style.top = e.y + r + "px") } } return i.clock.onTick.addEventListener(h), { tooltip: s, position: n, showAt: function(e, t) { this.tooltip.innerHTML = t, this.tooltip.style.display = "block", this.position = e, ( n = e) && (t = i.scene.cartesianToCanvasCoordinates(n)) && (o = -this.tooltip .offsetWidth / 2 + l, r = -this.tooltip.offsetHeight + u, this.tooltip.style .left = t.x + o + "px", this.tooltip.style.top = t.y + r + "px") }, show: function(e) { n = e ? (this.tooltip.style.display = "block", this.position) : void(this.tooltip.style .display = "none") }, destroy() { i.clock.onTick.removeEventListener(h), s.remove() } } }, f.prototype.CombineEcharts = function(e, t, i) { return this._CombineEcharts || (this._CombineEcharts = new le(e)), this._CombineEcharts.setOption(t, i) }, f.prototype.getHeatmapData = function(t, i, o = 600) { let r = []; for (let e = 0; e < o; e++) { var n = Math.random() * (t.east - t.west) + t.west, a = Math.random() * (t.north - t.south) + t.south, s = i.value || Math.random() * (i.max - i.min) + i.min; r.push({ x: n, y: a, value: s }) } return r }, f.prototype.pickFromRay = function(e, t, i, o = []) { i = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(i, t, new Cesium.Cartesian3), new Cesium .Cartesian3), t = new Cesium.Ray(t, i); return e.scene.pickFromRay(t, o) }, f.prototype.isDOM = function(e) { return "object" == typeof HTMLElement ? e instanceof HTMLElement : e && "object" == typeof e && 1 === e .nodeType && "string" == typeof e.nodeName }, f.prototype.getJSON = function(e, t) { const i = new XMLHttpRequest; i.responseType = "json", i.open("get", e, !0), i.onload = function() { if (!(200 <= i.status && i.status < 300)) throw new Error(i.statusText); t(i.response) }, i.send() }, f.prototype.getPositionFromWKT = function(e) { let t = e + "!", n, a = []; return -1 < t.indexOf("MULTIPOLYGON") ? (n = (n = (n = t.replace("MULTIPOLYGON(", "")).replace(")!", "")).split(")),((")).forEach((e, t) => { let r; (r = (r = 1 === n.length ? e.substring(1, e.length - 1) : 0 === t ? e.substring(1, e .length) + ")" : t === n.length - 1 ? "(" + e.substring(0, e.length - 1) : "(" + e + ")").split("),(")).forEach((e, t) => { let i, o = (1 === r.length ? i = e.substring(1, e.length - 1) : 0 === t ? i = e .substring(1, e.length) : t === r.length - 1 && (i = e.substring(0, e .length - 1)), i = i.split(","), []); i.forEach(e => { e = e.split(" "); o.push(Cesium.Cartesian3.fromDegrees(e[0], e[1])) }), a.push(o) }) }) : -1 < t.indexOf("POLYGON") && (n = (n = (n = t.replace("POLYGON(", "")).replace(")!", "")) .split("),(")).forEach((e, t) => { let i, o = (1 === n.length ? i = e.substring(1, e.length - 1) : 0 === t ? i = e.substring(1, e.length) : t === n.length - 1 && (i = e.substring(0, e.length - 1)), i = i .split(","), []); i.forEach(e => { e = e.split(" "); o.push(Cesium.Cartesian3.fromDegrees(e[0], e[1])) }), a.push(o) }), a }, f.prototype.VectorSlice = function(e) { var t = "EPSG:4490"; return e.port && (t = e.port), { url: e.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: e.layer, STYLE: "", TILEMATRIX: t + ":{z}", TILEMATRIXSET: t, FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: e.upperLevelLimit, lowerLevelLimit: e.lowerLevelLimit, rectangle: Cesium.Rectangle.fromDegrees(e.minx, e.miny, e.maxx, e.maxy) } }, f.prototype.arge = function(e, t, i, o = "180", r = !1) { var n = Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)), a = Math.sqrt(Math.pow(e.x - i.x, 2) + Math.pow(e.y - i.y, 2)), s = Math.sqrt(Math.pow(t.x - i.x, 2) + Math.pow(t.y - i.y, 2)), s = (Math.pow(n, 2) + Math.pow(a, 2) - Math.pow(s, 2)) / (2 * n * a); let l = Math.round(180 * Math.acos(s) / Math.PI); return "360" !== o && "+-" !== o || (this.isClockwise([ [t.x, (n = r ? -1 : 1) * t.y], [e.x, n * e.y], [i.x, n * i.y], [t.x, n * t.y] ]) || (l = "+-" === o ? -l : 360 - l)), l }, f.prototype.isClockwise = function(e) { e = Cesium_turf.lineString(e); return Cesium_turf.booleanClockwise(e) }, f.prototype.saveAs = function(e, t) { if (!window.saveAs) { let e = new se(!1); e.addJs(document.body, window.SmartEarthRootUrl + "Workers/FileSaver.js") } saveAs(e, t) }, f.prototype.setheight = function(e, t) { e = Cesium.Cartographic.fromCartesian(e); return Cesium.Cartesian3.fromRadians(e.longitude, e.latitude, t) }, f.prototype.setpolylineheight = function(e, t) { var i = []; return e.forEach(function(e) { e = Cesium.Cartographic.fromCartesian(e); i.push(Cesium.Cartesian3.fromRadians(e.longitude, e.latitude, t)) }), i }, f.prototype.StyleContrastGeoJson = function(e, t) { var i = { color: t.Color.WHITE, pixelSize: 1, outlineColor: t.Color.BLACK, outlineWidth: 0, show: !0, distanceDisplayCondition: new t.DistanceDisplayCondition(0, 999999999) }, o = { id: "my label", text: "", font: "30px sans-serif", fillColor: t.Color.WHITE, outlineColor: t.Color.WHITE, outlineWidth: "10", scale: 1, distanceDisplayCondition: new t.DistanceDisplayCondition(0, 999999999) }, r = { show: !0, scale: 1, width: void 0, height: void 0, pixelOffset: void 0, color: t.Color.WHITE, image: "", distanceDisplayCondition: new t.DistanceDisplayCondition(0, 999999999) }, n = { positions: [], arcType: t.ArcType.GEODESIC, clampToGround: !0, width: 1, show: !0, material: t.Color.RED, height: 30 }, a = { height: 0, heightReference: t.HeightReference.NONE, show: !0, fill: !0, material: t.Color.WHITE, outline: !1, outlineColor: t.Color.BLACK, outlineWidth: 1, stRotation: 0, granularity: t.Math.RADIANS_PER_DEGREE, perPositionHeight: !1, closeTop: !0, closeBottom: !0, shadows: t.ShadowMode.ENABLED, clampToGround: !0 }, s = (this.isnull(e.near) && (e.near = 0), this.isnull(e.far) && (e.far = 999999999), parseFloat(e .near)), l = parseFloat(e.far); return delete e.near, delete e.far, null != e.point && (e.point = this.extend(i, e.point, !0), e.point .distanceDisplayCondition = new t.DistanceDisplayCondition(s, l)), null != e.label && (e.label = this.extend(o, e.label, !0), e.label.distanceDisplayCondition = new t.DistanceDisplayCondition( s, l)), null != e.billboard && (e.billboard = this.extend(r, e.billboard, !0), e.billboard .distanceDisplayCondition = new t.DistanceDisplayCondition(s, l)), null != e.polyline && (e .polyline = this.extend(n, e.polyline, !0), e.polyline.distanceDisplayCondition = new t .DistanceDisplayCondition(s, l)), null != e.polygon && (e.polygon = this.extend(a, e.polygon, ! 0), e.polygon.distanceDisplayCondition = new t.DistanceDisplayCondition(s, l)), e }, f.prototype.getCatesian3FromPX = function(e, t, i, o) { var r, n = t.scene.pick(e), a = t.scene.drillPick(e), s = null; if (o) { for (var l = 0; l < a.length; l++) if (a[l].id._id != (o && o[0] && o[0].id) && a[l].id._id != (o && o[1] && o[1].id)) { s = a[l].id; break } } else s = n; if (t.scene.pickPositionSupported && i.defined(s)) r = t.scene.pickPosition(e); else { n = t.camera.getPickRay(e); if (!n) return; r = t.scene.globe.pick(n, t.scene) } return r }, f.prototype.StyleContrast = function(e, t, i) { var o = { text: "", font: " 30px sans-serif", style: i.LabelStyle.FILL_AND_OUTLINE, fillColor: i.Color.WHITE, outlineColor: i.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new i.Color(.165, .165, .165, .8), backgroundPadding: new i.Cartesian2(7, 5), scale: 1, horizontalOrigin: i.HorizontalOrigin.CENTER, verticalOrigin: i.VerticalOrigin.CENTER, eyeOffset: i.Cartesian3.ZERO, pixelOffset: i.Cartesian2.ZERO, heightReference: i.HeightReference.NONE, scaleByDistance: void 0, distanceDisplayCondition: void 0 }, r = { show: !0, position: i.Cartesian3.ZERO, pixelOffset: i.Cartesian2.ZERO, eyeOffset: i.Cartesian3.ZERO, heightReference: i.HeightReference.NONE, horizontalOrigin: i.HorizontalOrigin.CENTER, verticalOrigin: i.VerticalOrigin.CENTER, scale: 1, image: "", imageSubRegion: void 0, color: i.Color.WHITE, rotation: 0, alignedAxis: i.Cartesian3.ZERO, width: void 0, height: void 0, scaleByDistance: void 0, translucencyByDistance: void 0, pixelOffsetScaleByDistance: void 0, sizeInMeters: !1, distanceDisplayCondition: void 0 }, n = { show: !0, pixelSize: 1, heightReference: i.HeightReference.NONE, color: i.WHITE, outlineColor: i.Color.BLACK, outlineWidth: 1, scaleByDistance: void 0, translucencyByDistance: void 0, distanceDisplayCondition: void 0 }, a = { positions: [], width: 5, material: i.Color.ALICEBLUE, arcType: i.ArcType.GEODESIC }, s = { polygonHierarchy: new i.PolygonHierarchy(i.Cartesian3.fromDegreesArray([-72, 40, -70, 35, -75, 30, -70, 30, -68, 40 ])), height: 0, extrudedHeight: 0, material: "rgba(245, 20, 20, 0.91)" }, l = (this.isnull(t.near) && (t.near = 0), this.isnull(t.far) && (t.far = 999999999), parseFloat(t .near)), u = parseFloat(t.far); return delete t.near, delete t.far, t.distanceDisplayCondition = new i.DistanceDisplayCondition(l, u), "lable" == e ? t = this.extend(o, t, !0) : "billboard" == e ? t = this.extend(r, t, !0) : "point" == e ? t = this.extend(n, t, !0) : "polyline" == e ? t = this.extend(a, t, !0) : "polygon" == e && (t = this.extend(s, t, !0)), t }, f.prototype.createPolyline = function(e, t, i, o) { var r; return -1 == t ? (r = new o.PolylineGeometry(e), new o.GeometryInstance({ id: i, geometry: r })) : (r = new o.GroundPolylineGeometry(e), new o.GeometryInstance({ geometry: r, id: i })) }, f.prototype.createPolygon = function(e, t, i, o) { var r = e.material, n = new o.PolygonGeometry(e); return delete e.material, new o.GeometryInstance({ id: i, geometry: n, attributes: { color: new o.ColorGeometryInstanceAttribute.fromColor(r) } }) }, f.prototype.coordinate = function(e, t) { for (var i = 0; i < t.length; i++) Array.isArray(t[i]) ? this.coordinate(e, t[i]) : e.push(t[i]); return e }, f.prototype.Analysis = function(e, t) { var i; return /^\[/.test(e) && /\]$/.test(e) && (i = e.replace(/\[/, "").replace(/\]/, ""), null != t .properties[i] && (e = t.properties[i])), e }, f.prototype.unique = function(e) { for (var t = [], i = 0; i < e.length; i++) - 1 === t.indexOf(e[i]) && t.push(e[i]); return t }, f.prototype.extend = function(e, t, i = !1, o = !1) { for (var r in t) o ? e.hasOwnProperty(r) && (e[r] = t[r]) : e.hasOwnProperty(r) && !i || (e[r] = t[r]); return e }, f.prototype.getOffsetTilingScheme = function(e = "GCJ02") { let t, i; return "GCJ02" === e && (t = new Cesium.WebMercatorTilingScheme, i = new Cesium.WebMercatorProjection, t ._projection.project = function(e, t) { return t = ge.WGS84ToGCJ02(Cesium.Math.toDegrees(e.longitude), Cesium.Math.toDegrees(e .latitude)), t = i.project(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]), Cesium.Math.toRadians(t[1]))), new Cesium.Cartesian2(t.x, t.y) }, t._projection.unproject = function(e, t) { e = i.unproject(e); return t = ge.GCJ02ToWGS84(Cesium.Math.toDegrees(e.longitude), Cesium.Math.toDegrees(e .latitude)), new Cesium.Cartographic(Cesium.Math.toRadians(t[0]), Cesium.Math .toRadians(t[1])) }), t }, f.prototype.trackedEntity = function(n, a, e = {}) { let c = { type: "tracked", heading: 0, pitch: -45, distance: 1e3, minDistance: 0 }; Object.assign(c, e); let h, m, d; if (c.tooltip) { c.tooltip = Object.assign({ innerHTML: "", drag: !1, near: 0, far: 1e3, addX: 0, addY: 0 }, c.tooltip); e = ``; if ($(n.container).append(e), h = document.getElementById("trackedTooltip" + a.id), (m = h .firstElementChild).innerHTML = c.tooltip.innerHTML, m.style.left = c.tooltip.addX + "px", m .style.top = c.tooltip.addY + "px", m.style.position = "relative", c.tooltip.drag) { (d = document.createElement("div")).className = "trackedTooltip-arrow", h.appendChild(d); let n, a, s, l, u = (e, t) => { let i; n = Math.sqrt(Math.pow(e, 2) + Math.pow(t, 2)), a = -(n - e) / 2 + "px", s = -t / 2 + "px", e ? (i = Cesium.Math.toDegrees(Math.atan(t / e)), e < 0 && (a = (n + e) / 2 - n + "px")) : i = 0 < t ? 90 : -90, l = `rotate(${i}deg)` }; u(c.tooltip.addX, c.tooltip.addY), d.style.cssText = ` position: absolute; bottom: ${s}; left: ${a}; width: ${n}px; height: 0px; transform: ${l}; border-top: 2px dashed #f00; `, m.style.pointerEvents = "all", m.addEventListener("mousedown", function(e) { let t = e.pageX - m.offsetLeft, i = e.pageY - m.offsetTop, o, r; document.onmousemove = e => { o = e.pageX - t, r = e.pageY - i, m.style.left = o + "px", m.style.top = r + "px", u(o, r), d.style.width = n + "px", d.style.left = a, d.style .bottom = s, d.style.transform = l }, document.onmouseup = e => { document.onmousemove = null } }) } } this.endTrackedEntity && this.endTrackedEntity(), c.start && "function" == typeof c.start && c.start(); let s = new Cesium.ScreenSpaceEventHandler(n.scene.canvas), l; if ("setView" === c.type) { l = () => { var e = n.clock.currentTime.clone(), e = a.position.getValue(e); if (n.scene.camera.setView({ destination: e, orientation: { heading: Cesium.Math.toRadians(c.heading), pitch: Cesium.Math.toRadians(c.pitch) } }), n.scene.camera.moveBackward(c.distance), c.tooltip) { c.distance <= c.tooltip.far && c.distance >= c.tooltip.near ? h.style.display = "block" : h.style.display = "none"; var t = n.scene.cartesianToCanvasCoordinates(e); if (!t) return; h.style.left = t.x + "px", h.style.top = t.y - h.offsetHeight + "px" } c.position = e, c.update && "function" == typeof c.update && c.update() }, n.scene.preRender.addEventListener(l); let t, i, o, r; s.setInputAction(e => { t = { position: e.position, heading: c.heading, pitch: c.pitch } }, Cesium.ScreenSpaceEventType.LEFT_DOWN), s.setInputAction(e => { t = void 0 }, Cesium.ScreenSpaceEventType.LEFT_UP), s.setInputAction(e => { t && (i = e.endPosition, o = i.x - t.position.x, r = i.y - t.position.y, c.heading = t .heading + o / 8, c.pitch = t.pitch - r / 6) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), s.setInputAction(e => { c.distance -= e * c.distance / 1e3, c.distance < c.minDistance && (c.distance = c .minDistance) }, Cesium.ScreenSpaceEventType.WHEEL) } else c.viewFrom && (a.viewFrom = c.viewFrom), n.trackedEntity = a; return s.setInputAction(e => { this.endTrackedEntity && this.endTrackedEntity() }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this.endTrackedEntity = () => { s && s.destroy(), n.trackedEntity = void 0, l && n.scene.preRender.removeEventListener(l), h && h.remove(), h = void 0, l = void 0, s = void 0, c.end && "function" == typeof c.end && c .end() }, c.destroy = this.endTrackedEntity, c.updataTooltip = e => { m.innerHTML = c.tooltip.innerHTML = e }, c }, f.prototype.getPointFromWindowPoint = function(e, t) { return "EllipsoidTerrainProvider" == t.scene.terrainProvider.constructor.name ? t.camera.pickEllipsoid( e, t.scene.globe.ellipsoid) : (e = t.scene.camera.getPickRay(e), t.scene.globe.pick(e, t.scene)) }, f.prototype.isnull = function(e) { return null == e || "" === e }, f.prototype.getuid = function() { return this.uuid(8, 16) }, f.prototype.extendgl = function(e, t, i) { return null != t ? ("string" == typeof t && "[" == t.charAt(0) && "]" == t.charAt(t.length - 1) && (t = (t = t.substr(0, t.length - 1)).substr(1), null != e.properties[t]._value ? t = e .properties[t]._value : null != e.properties[t] && (t = e.properties[t])), t) : i }, f.prototype.uuid = function(e, t) { var i, o, r = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), n = [], n = []; if (t = t || r.length, e) for (i = 0; i < e; i++) n[i] = r[0 | Math.random() * t]; else for (n[8] = n[13] = n[18] = n[23] = "-", n[14] = "4", i = 0; i < 36; i++) n[i] || (o = 0 | 16 * Math .random(), n[i] = r[19 == i ? 3 & o | 8 : o]); return n.join("") }, f.prototype.Shaders = function(e) { var t = ""; return "VSHADER_SOURCE " == e ? t = "attribute vec4 a_Position;\nattribute vec2 a_TexCoord;\nuniform mat4 u_MvpMatrix;\nvarying vec2 v_TexCoord;\nvoid main(){\ngl_Position = u_MvpMatrix * a_Position;\nv_TexCoord = a_TexCoord;\n}\n" : "TRIANGLE_FSHADER_SOURCE" == e ? t = "#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec4 v_Color;\nvoid main() {\ngl_FragColor = v_Color;\n'}\n" : "TRIANGLE_VSHADER_SOURCE" == e ? t = "attribute vec4 a_Position;\nattribute vec4 a_Normal;\nuniform mat4 u_MvpMatrix;\nuniform mat4 u_NormalMatrix;\nvarying vec4 v_Color;\nvoid main() {\nvec3 lightDirection = vec3(0.0, 0.0, 1.0);\nvec4 color = vec4(1.0, 1.0, 0.0, 1.0);\ngl_Position = u_MvpMatrix * a_Position;\nvec3 normal = normalize(vec3(u_NormalMatrix * a_Normal));\nfloat nDotL = max(dot(normal, lightDirection), 0.0);\nv_Color = vec4(color.rgb * nDotL, color.a);\n}\n" : "vertexShaderSource" == e ? t = "attribute vec3 position3DHigh;\r\nattribute vec3 position3DLow;\r\nattribute vec3 normal;\r\nattribute vec2 st;\r\nattribute vec4 color;\r\nattribute float batchId;\r\nvarying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec4 v_color;\r\nvoid main()\r\n{\r\nvec4 p = czm_computePosition();\r\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\r\nv_normalEC = czm_normal * normal;\r\nv_st = st;\r\nv_color = color;\r\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\r\n}\r\n" : "fragmentShaderSource" == e && (t = "varying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec4 v_color;\r\n\r\nvec4 czm_phong(vec3 toEye, czm_material material)\r\n{\r\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\r\nif (czm_sceneMode == czm_sceneMode3D) {\r\n diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\r\n}\r\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\r\nvec3 materialDiffuse = material.diffuse * 0.5;\r\nvec3 ambient = materialDiffuse;\r\nvec3 color = ambient + material.emission;\r\ncolor += materialDiffuse * diffuse;\r\ncolor += material.specular * specular;\r\nreturn vec4(color, material.alpha);\r\n}void main()\r\n{\r\nvec3 positionToEyeEC = -v_positionEC;\r\nvec3 normalEC = normalize(v_normalEC);\r\n#ifdef FACE_FORWARD\r\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r\n#endif\r\nvec4 color = czm_gammaCorrect(v_color);\r\nczm_materialInput materialInput;\r\nmaterialInput.normalEC = normalEC;\r\nmaterialInput.positionToEyeEC = positionToEyeEC;\r\nmaterialInput.st = v_st;\r\nczm_material material = czm_getDefaultMaterial(materialInput);\r\nmaterial.diffuse = color.rgb;\r\nmaterial.alpha = color.a;\r\n#ifdef FLAT\r\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\r\n#else\r\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\r\n#endif\r\n}\r\n" ), t }, f.prototype.isHtmlColor = function(e) { return /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e) }, f.prototype.isUrl = function(e) { if (this.isnull(e)) return !1; return /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/ .test(e) }, f.prototype.dateTimespan = function() { return (new Date).toTimeString() }, f.prototype.getPointFromTwoPointCenter = function(e, t, i) { var o = this.getSpaceDistancem(e, Cesium), r = e[0], e = e[1], r = Cesium.Cartographic.fromCartesian(r), n = Cesium.Math.toDegrees(r.longitude), a = Cesium.Math.toDegrees(r.latitude), r = r.height, e = Cesium.Cartographic.fromCartesian(e), s = Cesium.Math.toDegrees(e.longitude), l = Cesium.Math.toDegrees(e.latitude), e = e.height, o = parseFloat(o / t), t = Cesium.Math.lerp(n, s, 1 / o) - n, s = Cesium.Math.lerp(a, l, 1 / o) - a, l = Cesium.Math.lerp(r, e, 1 / o) - r; return Cesium.Cartesian3.fromDegrees(n + t, a + s, i || r + l) }, f.prototype.getSpaceDistance = function(e, t) { for (var i = 0, o = 0; o < e.length - 1; o++) { var r = t.Cartographic.fromCartesian(e[o]), n = t.Cartographic.fromCartesian(e[o + 1]), a = new t.EllipsoidGeodesic, a = (a.setEndPoints(r, n), a.surfaceDistance); i += Math.sqrt(Math.pow(a, 2) + Math.pow(n.height - r.height, 2)) } return 1e3 <= i ? (i / 1e3).toFixed(2) + "千米" : i.toFixed(2) + "米" }, f.prototype.getSpaceDistancem = function(e, t) { for (var i = 0, o = 0; o < e.length - 1; o++) { var r = t.Cartographic.fromCartesian(e[o]), n = t.Cartographic.fromCartesian(e[o + 1]), a = new t.EllipsoidGeodesic, a = (a.setEndPoints(r, n), a.surfaceDistance); i += Math.sqrt(Math.pow(a, 2) + Math.pow(n.height - r.height, 2)) } return i.toFixed(2) }, f.prototype.getHorizontalDistance = function(e, t) { for (var i = 0, o = 0; o < e.length - 1; o++) { var r = t.Cartographic.fromCartesian(e[o]), n = t.Cartographic.fromCartesian(e[o + 1]), a = new t.EllipsoidGeodesic; a.setEndPoints(r, n), i += a.surfaceDistance } return i = 1e3 <= i ? (i / 1e3).toFixed(2) + "千米" : i.toFixed(2) + "米" }, f.prototype.getPointsInPolygon = function(o, r = 50, e = !0) { if (!(o.length < 3)) { o.push(o[0]); var t = Cesium_turf.lineString(o), t = Cesium_turf.bbox(t), t = Cesium_turf.pointGrid(t, r, { units: "meters" }), n = Cesium_turf.polygon([o]); let i = Cesium_turf.pointsWithinPolygon(t, n); if (e) for (let e = 0; e < o.length - 1; e++) { var a = Cesium_turf.lineString([o[e], o[e + 1]]), s = { units: "meters" }, l = Cesium_turf.length(a, s); let t; for (let e = r;; e += r) { 1; { if (!(e <= l)) { t = Cesium_turf.along(a, l, s), i.features.push(t); break } t = Cesium_turf.along(a, e, s), i.features.push(t) } } } return i } }, f.prototype.tinFromPoints = function(e, t = {}) { let { polygon: r, getArea: n } = t, i = Cesium_turf.tin(e), a = 0; return i && i.features && i.features.forEach(e => { let t = !0; var i; if (r && (i = Cesium_turf.centerOfMass(e), t = Cesium_turf.booleanPointInPolygon(i, r)), t) { var o = e.geometry.coordinates[0]; let t = [], i = []; for (let e = 0; e < 3; e++) t.push([o[e][0], o[e][1]]), i.push(Cesium.Cartesian3 .fromDegrees(o[e][0], o[e][1], o[e][2])); e.positions = i, n && (e.area = this.getArea(t, i, !0), a += e.area) } }), { tin: i, area: a } }, f.prototype.getSpaceArea = function(i, e, t = {}) { var o = this.defaultValue(t.distance, 50), r = this.defaultValue(t.onlyTerrain, !1); let n = this.defaultValue(t.isNum, !1), a = this.getPointsInPolygon(e, o, !0), s = Cesium_turf.polygon([e]), l = () => { let { tin: e, area: t } = this.tinFromPoints(a, { getArea: !0, polygon: s }); return n ? { area: t, tin: e } : { area: t = t < 1e6 ? t.toFixed(2) + "平方米" : (t / 1e6).toFixed(2) + "平方千米", tin: e } }; if (r) { let t = []; return a.features.forEach(e => { e = e.geometry.coordinates; t.push(Cesium.Cartographic.fromDegrees(e[0], e[1])) }), this.getHeightsFromLonLat(i, t).then(o => (a.features.forEach((e, t) => { let i = e.geometry.coordinates; i[2] = o[t] || 0 }), l())) } return a.features.forEach(e => { let t = e.geometry.coordinates; e = new Cesium.Cartographic(Cesium.Math.toRadians(t[0]), Cesium.Math.toRadians(t[1])), e = i .scene.sampleHeight(e) || 0; t[2] = e }), l() }, f.prototype.starPositions = function(e, t, i) { for (var o = Math.PI / e, r = [], n = 0; n < 2 * e; n++) { var a = n % 2 == 0 ? t : i, a = new Cesium.Cartesian2(Math.cos(n * o) * a, Math.sin(n * o) * a); r.push(a) } return r }, f.prototype.computeCircle = function(e) { for (var t = [], i = 0; i < 360; i++) { var o = Cesium.Math.toRadians(i); t.push(new Cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, f.prototype.getArea = function(t, u, i) { if (!(t.length < 3)) { let r = Array.concat(t, [t[0]]); var c = 0, t = Cesium_turf.polygon([r]); let e; e = 4 === r.length ? [t] : Cesium_turf.tesselate(t).features; let n, a, s, l; return (e.forEach(e => { n = e.geometry.coordinates[0], a = r.findIndex(e => e.toString() === n[0] .toString()), s = r.findIndex(e => e.toString() === n[1].toString()), l = r .findIndex(e => e.toString() === n[2].toString()); var e = this.getdistance(u[a], u[s]), t = this.getdistance(u[s], u[l]), i = this.getdistance(u[a], u[l]), o = (e + t + i) / 2; c += Math.sqrt((o - e) * (o - t) * (o - i) * o) }), i) ? c : c = c < 1e6 ? c.toFixed(2) + "平方米" : (c / 1e6).toFixed(2) + "平方千米" } }, f.prototype.getdistance = function(e, t) { var e = Cesium.Cartographic.fromCartesian(e), t = Cesium.Cartographic.fromCartesian(t), i = new Cesium.EllipsoidGeodesic, i = (i.setEndPoints(e, t), i.surfaceDistance); return Math.sqrt(Math.pow(i, 2) + Math.pow(t.height - e.height, 2)) }, f.prototype.Angle = function(e, t, i) { e = this.Bearing(t, e) - this.Bearing(t, i); return e < 0 && (e += 360), e }, f.prototype.Bearing = function(e, t) { var i = Math.PI / 180, o = 180 / Math.PI, r = e.lat * i, e = e.lon * i, n = t.lat * i, t = t.lon * i, i = -Math.atan2(Math.sin(e - t) * Math.cos(n), Math.cos(r) * Math.sin(n) - Math.sin(r) * Math.cos( n) * Math.cos(e - t)); return i < 0 && (i += 2 * Math.PI), i *= o }, f.prototype.getHeight = function(e, t) { try { var i; return 1 < e.length ? (i = t.Cartographic.fromCartesian(e[0]), ((t.Cartographic.fromCartesian(e[1]) .height - i.height) / 1e3).toFixed(2)) : 0 } catch (e) { console.log(e) } }, f.prototype.getPmfx = function(e, t, i, o, r, n) { var a = { gcs: [], min: 99999, max: 0, juli: 0, cys: t }, s = this.getSpaceDistancem(e, o), s = (a.juli = s, 0 != i && (t = parseInt(s / i)), a.cys = t, e[0]), i = e[e.length - 1], e = o.Cartographic.fromCartesian(s), l = o.Math.toDegrees(e.longitude), u = o.Math.toDegrees(e.latitude), s = (e.height, o.Cartographic.fromCartesian(i)), i = o.Math.toDegrees(s.longitude), c = o.Math.toDegrees(s.latitude), h = (s.height, t), m = o.Math.lerp(l, i, 1 / h) - l, d = o.Math.lerp(u, c, 1 / h) - u, p = [], g = []; p.push(e); for (var _ = 0; _ < h; _++) { var f = l + (_ + 1) * m, y = u + (_ + 1) * d, f = o.Cartesian3.fromDegrees(f, y); p.push(o.Cartographic.fromCartesian(f)) } var v = this; this.getHeightsFromLonLat(r, p).then(e => { if (e) { g = e; e = !1; for (!0 !== r.scene.globe.depthTestAgainstTerrain && (e = r.scene.globe .depthTestAgainstTerrain = !0), _ = 0; _ < g.length; _++) { var t = v.get3DTileOrPrimitivesHeights(p[_], r), t = (void 0 !== t && (g[_] = t), g[_].toFixed(2)); parseFloat(t) < parseFloat(a.min) && (a.min = parseFloat(t)), parseFloat(t) > parseFloat(a.max) && (a.max = parseFloat(t)), a.gcs.push(t) } e && (r.scene.globe.depthTestAgainstTerrain = !1), "" != n && null != n && "function" == typeof n && n(a) } }) }, f.prototype.getPmfxPro = function(m, t, i, d, o, r) { let n = this, a = { gcs: [], min: 99999, max: 0, juli: 0, cys: 0 }, p = [], s = []; for (let e = 0; e < m.length - 1; e++) { var l = n.getSpaceDistancem([m[e], m[e + 1]], d), l = parseFloat(l); a.juli += l, 0 != i && (t = parseInt(l / i)), s.push(t), a.cys += t } let u = () => { s.forEach((e, t) => { var i = m[t], o = m[t + 1], i = d.Cartographic.fromCartesian(i), r = d.Math.toDegrees(i.longitude), n = d.Math.toDegrees(i.latitude), o = d.Cartographic.fromCartesian(o), a = d.Math.toDegrees(o.longitude), o = d.Math.toDegrees(o.latitude), s = e, l = d.Math.lerp(r, a, 1 / s) - r, u = d.Math.lerp(n, o, 1 / s) - n; 0 === t && p.push(i); for (let e = 0; e < s; e++) { var c = r + (e + 1) * l, h = n + (e + 1) * u, c = d.Cartesian3.fromDegrees(c, h); p.push(d.Cartographic.fromCartesian(c)) } }), p.push(d.Cartographic.fromCartesian(m[m.length - 1])); let i = []; a.allPoint = p, this.getHeightsFromLonLat(o, p).then(e => { if (e) { i = e; e = o.scene.globe.depthTestAgainstTerrain; o.scene.globe.depthTestAgainstTerrain = !0; for (let e = 0; e < i.length; e++) { var t = n.get3DTileOrPrimitivesHeights(p[e], o), t = (void 0 !== t && (i[e] = t), i[e].toFixed(2)); parseFloat(t) < parseFloat(a.min) && (a.min = parseFloat(t)), parseFloat( t) > parseFloat(a.max) && (a.max = parseFloat(t)), a.gcs.push(t) } o.scene.globe.depthTestAgainstTerrain = e, r && "function" == typeof r && r(a) } }) }; 1e3 < a.cys ? layuiLayer && layuiLayer.msg("当前采样点数过多,是否继续分析?", { time: 0, btn: ["继续", "取消"], btnAlign: "c", yes: e => { layuiLayer.close(e), setTimeout(() => { u() }, 10) }, btn2: () => { r && "function" == typeof r && r(a) } }) : setTimeout(() => { u() }, 10) }, f.prototype.get3DTileOrPrimitivesHeights = function(e, t) { return t.scene.sampleHeight(e) }, f.prototype.getHeightsFromLonLat = function(i, o) { var r = []; if (i.terrainProvider) { if (i.terrainProvider instanceof Cesium.EllipsoidTerrainProvider) return new Promise(function(e, t) { o.forEach(e => { r.push(0) }), e(r) }); { let e = Cesium.sampleTerrainMostDetailed(i.terrainProvider, o); return e.then(e => (e.forEach(function(e) { r.push(e.height) }), r), () => (o.forEach(e => { r.push(i.scene.globe.getHeight(e)) }), r)) } } return new Promise(function(e, t) { o.forEach(e => { r.push(i.scene.globe.getHeight(e)) }), e(r) }) }, f.prototype.getColorRamp = function(e, i, t, o) { var r, n = [], a = document.createElement("canvas"), s = (a.width = 100, a.height = 1, a.getContext("2d")), l = ("elevation" === e ? r = [0, .05, .2, .35, .5, .65, .8, .95, 1] : "slope" === e ? r = n : "aspect" === e && (r = [0, 0, .2, .4, .6, .8, .9, 1, 1]), i = i || ["#0b0b88", "#2747E0", "#D33B7D", "#D33038", "#FF9742", "#ffd700", "#bbff00" ], s.createLinearGradient(0, 0, 100, 0)); if ("slope" === e) { void 0 === t && (t = 0), 0 == (t = void 0 === o ? 90 : t) ? n.push(0) : (n.push(t / 90), l .addColorStop(0, "#000000")); var u = (o - t) / 6; if (90 == o) { for (var c = 1; c <= 5; c++) n.push((t + c * u) / 90); n.push(1), n.forEach(function(e, t) { l.addColorStop(e, i[t]) }) } else { for (c = 1; c <= 5; c++) n.push((t + c * u) / 90); n.push(o / 90), n.forEach(function(e, t) { l.addColorStop(e, i[t]) }), l.addColorStop(1, "#000000") } } else l.addColorStop(r[0], "#000000"), l.addColorStop(r[1], i[0]), l.addColorStop(r[2], i[1]), l .addColorStop(r[3], i[2]), l.addColorStop(r[4], i[3]), l.addColorStop(r[5], i[4]), l.addColorStop(r[ 6], i[5]), l.addColorStop(r[7], i[6]), l.addColorStop(r[8], "#000000"); return s.fillStyle = l, s.fillRect(0, 0, 100, 1), a }, f.prototype.Gauss_to_XY = function(e, t, i, o) { var r, n, a = 6356752.3142, a = Math.sqrt(272331606681.9453) / a, i = this.to_Radian(i), e = (t = this.to_Radian(t), (e = this.to_Radian(e)) - i), i = Math.cos(t), s = (n = this.to_N(t)) * Math.cos(t), l = (r = Math.tan(t), a = a * i, Math.pow(r, 2)), u = Math.pow(r, 4), c = Math.pow(a, 2), h = Math.pow(a, 4), m = Math.pow(i, 3), d = Math.pow(i, 5), t = this.to_Sm(t) + Math.pow(e, 2) / 2 * s * i * r + Math.pow(e, 4) / 24 * r * s * m * (5 - l + 9 * c + 4 * h) + Math.pow(e, 6) / 720 * r * s * d * (61 - 58 * r * r + u + 270 * c - 330 * r * r * c), h = e * n * i + Math.pow(e, 3) / 6 * n * m * (1 - r * r + a * a) + Math.pow(e, 5) / 120 * n * d * ( 5 - 18 * r * r + u + 14 * c - 58 * c * l); return new o.Cartesian2(h, t) }, f.prototype.to_Radian = function(e) { return e * Math.PI / 180 }, f.prototype.to_N = function(e) { var t = 6378137, i = 6356752.3142, i = Math.sqrt(t * t - i * i) / t; return t / Math.sqrt(1 - i * i * Math.sin(e) * Math.sin(e)) }, f.prototype.to_Sm = function(e) { var t = 6378137, i = 6356752.3142, i = Math.sqrt(t * t - i * i) / t, o = 1 + i * i * 3 / 4 + 45 * Math.pow(i, 4) / 64 + 175 * Math.pow(i, 6) / 256 + 11025 * Math.pow(i, 8) / 16384, r = 3 * Math.pow(i, 2) / 4 + 15 * Math.pow(i, 4) / 16 + 525 * Math.pow(i, 6) / 512 + 2205 * Math .pow(i, 8) / 2048, n = 15 * Math.pow(i, 4) / 64 + 105 * Math.pow(i, 6) / 256 + 2205 * Math.pow(i, 8) / 4096, a = 35 * Math.pow(i, 6) / 512 + 315 * Math.pow(i, 8) / 2048, s = 315 * Math.pow(i, 8) / 16384; return t * (1 - i * i) * (o * e - r / 2 * Math.sin(2 * e) + n / 4 * Math.sin(4 * e) - a / 6 * Math.sin( 6 * e) + s / 8 * Math.sin(8 * e)) }, f.prototype.ElevationAngle = function(e, t, i) { var o = i.Cartographic.fromCartesian(e), r = i.Cartographic.fromCartesian(t), r = (o.height, o.height, r.height, i.Cartesian3.fromDegrees(i.Math.toDegrees(r.longitude), i.Math .toDegrees(r.latitude), o.height)), o = parseFloat(function(e, t) { for (var i = 0, o = 0; o < e.length - 1; o++) { var r = t.Cartographic.fromCartesian(e[o]), n = t.Cartographic.fromCartesian(e[o + 1]), a = new t.EllipsoidGeodesic, a = (a.setEndPoints(r, n), a.surfaceDistance); i += Math.sqrt(Math.pow(a, 2) + Math.pow(n.height - r.height, 2)) } return i }([e, t], i)), e = (parseFloat(function(e, t) { for (var i = 0, o = 0; o < e.length - 1; o++) { var r = t.Cartographic.fromCartesian(e[o]), n = t.Cartographic.fromCartesian(e[o + 1]), a = new t.EllipsoidGeodesic; a.setEndPoints(r, n), i += a.surfaceDistance } return i }([e, r], i)), parseFloat(function(e, t) { try { var i; return 1 < e.length ? (i = t.Cartographic.fromCartesian(e[0]), t.Cartographic .fromCartesian(e[1]).height - i.height) : 0 } catch (e) { console.log(e) } }([r, t], i))); return 180 * Math.asin(e / o) / 3.14 }, f.prototype.TwoPointAzimuth = function(e, t, i, o) { function r(e) { return e * Math.PI / 180 } var n = 0, a = Math.round(.5 + 36e4 * t), s = Math.round(.5 + 36e4 * o), l = Math.round(.5 + 36e4 * e), u = Math.round(.5 + 36e4 * i); return t = r(t), e = r(e), o = r(o), i = r(i), a === s && l === u || (l === u ? s < a && (n = 180) : ( t = Math.acos(Math.sin(o) * Math.sin(t) + Math.cos(o) * Math.cos(t) * Math.cos(i - e)), n = 180 * Math.asin(Math.cos(o) * Math.sin(i - e) / Math.sin(t)) / Math.PI, a < s && l < u || ( s < a && u < l || s < a && l < u ? n = 180 - n : a < s && u < l && (n += 360)))), n }, f.prototype.ThreePointAzimuth = function(e, t, i, o) { var r = Math.PI / 180, n = 180 / Math.PI, e = o.Cartographic.fromCartesian(e), a = o.Cartographic.fromCartesian(t), s = o.Cartographic.fromCartesian(i); function l(e, t) { var i = e.latitude * r, e = e.longitude * r, o = t.latitude * r, t = t.longitude * r, i = -Math.atan2(Math.sin(e - t) * Math.cos(o), Math.cos(i) * Math.sin(o) - Math.sin(i) * Math .cos(o) * Math.cos(e - t)); return i < 0 && (i += 2 * Math.PI), i *= n } t = o.Cartesian3.fromDegrees(o.Math.toDegrees(a.longitude), o.Math.toDegrees(a.latitude), e.height), i = o.Cartesian3.fromDegrees(o.Math.toDegrees(s.longitude), o.Math.toDegrees(s.latitude), e.height); a = o.Cartographic.fromCartesian(t), s = o.Cartographic.fromCartesian(i); return t = s, (i = l(o = a, i = e) - l(o, t)) < 0 && (i += 360), i }, f.prototype.setDepthTest = function(e, t) { "open" === e && void 0 === this.defaultDepthTest ? (this.defaultDepthTest = !!t.scene.globe .depthTestAgainstTerrain, t.scene.globe.depthTestAgainstTerrain = !0) : "close" === e && void 0 !== this.defaultDepthTest && (t.scene.globe.depthTestAgainstTerrain = !!this .defaultDepthTest, this.defaultDepthTest = void 0) }, f.prototype.setImageMaterialProperty = function(e, t, i, o) { this.id = o; var n = this, o = document.createElement("canvas"), r = (o.id = this.id + "-a", o.width = 700, o.height = 100, document.createElement("canvas")), o = (r.id = this.id + "-b", r.width = 700, r.height = 100, document.body.appendChild(o), document .body.appendChild(r), e && (n.images = e), new t.CallbackProperty(function(e, t) { var i = document.getElementById(n.id + "-" + n.curCanvas), o = i.getContext("2d"), r = new Image; return r.src = n.images, o.clearRect(0, 0, 700, 100), r.onload = function() { n.i <= 700 ? (o.drawImage(r, n.i, 0), o.drawImage(r, n.i + 100, 0)) : n.i = 0, n .i += 5 }, n.curCanvas = "a" === n.curCanvas ? "b" : "a", i }, !1)); return 1 == i && (o = new t.CallbackProperty(function(e, t) { var i = document.getElementById(n.id + "-" + n.curCanvas), o = i.getContext("2d"), r = o.createLinearGradient(0, 100, 0, 0); return r.addColorStop(0, "red"), 1 < n.i && (n.i = 1), r.addColorStop(n.i, "rgb(255,0,0,0.6)"), r.addColorStop(1, "rgb(255,0,0,0.1)"), o.clearRect(0, 0, 700, 100), o.fillStyle = r, o.fillRect(0, 0, 700, 100), n.i < 1 ? n.i += .01 : n .i = 0, n.curCanvas = "a" === n.curCanvas ? "b" : "a", i }, !1)), new t.ImageMaterialProperty({ image: o, transparent: !0 }) }, f.prototype.setDrawCanvasImage = function(e, t) { var o = document.getElementById("canvas-" + curCanvas), r = o.getContext("2d"), n = new Image; return n.src = images, r.clearRect(0, 0, 700, 100), n.onload = function() { i <= 700 ? (r.drawImage(n, i, 0), r.drawImage(n, i + 100, 0)) : i = 0, i += 5 }, curCanvas = "a" === curCanvas ? "b" : "a", o }, f.prototype.setDrawCanvasColorUpdown = function(e, t) { var o = document.getElementById("canvas-" + curCanvas), r = o.getContext("2d"), n = r.createLinearGradient(0, 100, 0, 0); return n.addColorStop(0, "red"), 1 < i && (i = 1), n.addColorStop(i, "rgb(255,0,0,0.6)"), n .addColorStop(1, "rgb(255,0,0,0.1)"), r.clearRect(0, 0, 700, 100), r.fillStyle = n, r.fillRect(0, 0, 700, 100), i < 1 ? i += .01 : i = 0, curCanvas = "a" === curCanvas ? "b" : "a", o }, f.prototype.getMousePosition = function(e, t, i, o, r, n, a) { var s, l, u, c, e = e.endPosition || e.position, t = (void 0 === r && (r = 0), this._cesium = t, this._viewer = i, n = this._cesium.defaultValue(n, ! 1), void 0 === this.defaultDepthTest && (this.defaultDepthTest = !!this._viewer.scene.globe .depthTestAgainstTerrain), n ? a || 30 : 1); if (0 !== r ? (this._viewer.scene.globe.depthTestAgainstTerrain = !0, (s = this._viewer.camera .getPickRay(e)) && (l = this._viewer.scene.globe.pick(s, this._viewer.scene)), c = this ._viewer.scene.drillPick(e, o && o.length && o.length + 1 || 1, t, t), (c = this .getNotExcludedObj(c, o)) && !n ? (this._viewer.scene.pick(e), (u = this._viewer.scene .pickPosition(e)) && (l = u)) : (u = l && n ? this._getAdsorptionPosition(e, c, a) : u) && ( l = u)) : (c = this._viewer.scene.drillPick(e, o && o.length && o.length + 1 || 1, t, t), ( c = this.getNotExcludedObj(c, o)) && !n ? (this._viewer.scene.pick(e), l = this._viewer .scene.pickPosition(e)) : c && n ? (this._viewer.scene.pick(e), l = this._viewer.scene .pickPosition(e), (u = this._getAdsorptionPosition(e, c, a)) && (l = u)) : (this._viewer .scene.globe.depthTestAgainstTerrain = !0, (s = this._viewer.camera.getPickRay(e)) && (l = this._viewer.scene.globe.pick(s, this._viewer.scene)))), l) return this._viewer.scene.globe .depthTestAgainstTerrain = !!this.defaultDepthTest, this.defaultDepthTest = void 0, l; console.log("未拾取到坐标!") }, f.prototype.toDegrees = function(e) { e = Cesium.Cartographic.fromCartesian(e); return { lon: Cesium.Math.toDegrees(e.longitude), lat: Cesium.Math.toDegrees(e.latitude), height: e.height } }, f.prototype.LineInterpolation = function(i, e) { let t, o, r = !1, n = (t = e.positions || e, o = e.num || 100, e.getHeight && (r = !0), { positions: [], cartographic: [], lon_lat: [], height: [] }); for (let e = 0; e < t.length - 1; e++) { var a = this.toDegrees(t[e]), s = this.toDegrees(t[e + 1]); { l = void 0; u = void 0; c = void 0; h = void 0; m = void 0; d = void 0; p = void 0; g = void 0; _ = void 0; f = void 0; var l = a.lon; var u = a.lat; var c = s.lon; var h = s.lat; var m = Cesium.Math.lerp(l, c, 1 / o) - l, d = Cesium.Math.lerp(u, h, 1 / o) - u; n.lon_lat.push(l, u); let t; if (r) { t = y(l, u), n.height.push(t), n.positions.push(Cesium.Cartesian3.fromDegrees(l, u, t)); for (let e = 0; e < o; e++) { var p = l + (e + 1) * m, g = u + (e + 1) * d; n.lon_lat.push(p, g), t = y(p, g), n.height.push(t), n.positions.push(Cesium.Cartesian3 .fromDegrees(p, g, t)) } n.lon_lat.push(c, h), t = y(c, h), n.height.push(t), n.positions.push(Cesium.Cartesian3 .fromDegrees(c, h, t)) } else { n.positions.push(Cesium.Cartesian3.fromDegrees(l, u)); for (let e = 0; e < o; e++) { var _ = l + (e + 1) * m, f = u + (e + 1) * d; n.lon_lat.push(_, f), n.positions.push(Cesium.Cartesian3.fromDegrees(_, f)) } n.lon_lat.push(c, h), n.positions.push(Cesium.Cartesian3.fromDegrees(c, h)) } } } function y(e, t) { e = Cesium.Cartographic.fromDegrees(e, t); return i.scene.globe.getHeight(e) } return n }, f.prototype.CIMServerTool = function(e) { return new ue(e) }, f.prototype.Recorder = function(e, t) { return this._Recorder ? (this._Recorder.mediaOutputPath = this.defaultValue(e, "test.mp4"), t && (this ._Recorder.videoBPS = t)) : this._Recorder = new ce(e, t), this._Recorder }, f.prototype.getLinkMaterial = function(e, t, i) { function o(e, t, i) { this._definitionChanged = new Cesium.Event, this._color = void 0, this._colorSubscription = void 0, this.color = e, this.lightSpotColor = t, this.duration = i, this.old = void 0, this._time = ( new Date).getTime() } return Cesium.PolylineLinkMaterialProperty || (Object.defineProperties(o.prototype, { isConstant: { get: function() { return !1 } }, definitionChanged: { get: function() { return this._definitionChanged } }, color: Cesium.createPropertyDescriptor("color") }), o.prototype.getType = function(e) { return "PolylineLink" }, o.prototype.getValue = function(e, t) { return (t = Cesium.defined(t) ? t : {}).color = Cesium.Property.getValueOrClonedDefault(this ._color, e, Cesium.Color.WHITE, t.color), t.lightSpotColor = this.lightSpotColor, t .time = ((new Date).getTime() - this._time) % this.duration / this.duration, void 0 === this.old && (this.old = t.time), .5 < this.old && t.time < .5 && (t.plus = !t.plus, t .inverse = !t.inverse), this.old = t.time, t.plus ? t.time = 1.1 * t.time : t.time = 1.2 * t.time - .1, t }, o.prototype.equals = function(e) { return this === e || e instanceof o && Cesium.Property.equals(this._color, e._color) }, Cesium.PolylineLinkMaterialProperty = o, Cesium.Material.PolylineLinkType = "PolylineLink", Cesium.Material.PolylineLinkSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n if(plus && st.s < time && time - st.s <= 0.1){\n material.alpha = 1.0 - (time - st.s) / 0.1;\n if(material.alpha < 0.3){\n material.alpha = 0.3;\n material.diffuse = color.rgb;\n }else{\n material.diffuse = lightSpotColor.rgb;\n }\n }else if(inverse && st.s < (1.0 - time) && (1.0 - time) - st.s <= 0.1){\n material.alpha = ((1.0-time) - st.s) / 0.1;\n if(material.alpha < 0.3){\n material.alpha = 0.3;\n material.diffuse = color.rgb;\n }else{\n material.diffuse = lightSpotColor.rgb;\n }\n }else{\n material.alpha = 0.3;\n material.diffuse = color.rgb;\n }\n return material;\n }", Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineLinkType, { fabric: { type: Cesium.Material.PolylineLinkType, uniforms: { color: new Cesium.Color(1, 0, 0, .5), lightSpotColor: new Cesium.Color(1, 1, 1, .5), time: 0, plus: !0, inverse: !1 }, source: Cesium.Material.PolylineLinkSource }, translucent: function(e) { return !0 } })), new Cesium.PolylineLinkMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue( e, "#0000ff")), Cesium.Color.fromCssColorString(this.defaultValue(t, "#ffffff")), this .defaultValue(i, 3e3)) }, f.prototype.getTrailLinkMaterial = function(e, t, i) { return new ne(e, t, i) }, f.prototype.getConeRadarMaterial = function(e) { function t(e, t) { this._definitionChanged = new Cesium.Event, this._color = void 0, this._colorSubscription = void 0, this.color = e, this.duration = t, this._time = (new Date).getTime() } return Cesium.ConeRadarMaterialProperty || (Object.defineProperties(t.prototype, { isConstant: { get: function() { return !1 } }, definitionChanged: { get: function() { return this._definitionChanged } }, color: Cesium.createPropertyDescriptor("color") }), t.prototype.getType = function(e) { return "ConeRadar" }, t.prototype.getValue = function(e, t) { return (t = Cesium.defined(t) ? t : {}).color = Cesium.Property.getValueOrClonedDefault(this ._color, e, Cesium.Color.WHITE, t.color), t.time = ((new Date).getTime() - this ._time) % this.duration / this.duration, t }, t.prototype.equals = function(e) { return this === e || e instanceof t && Cesium.Property.equals(this._color, e._color) }, Cesium.ConeRadarMaterialProperty = t, Cesium.Material.ConeRadarType = "ConeRadar", Cesium .Material.ConeRadarSource = "\n float ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n }\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n material.alpha = 0.0;\n float intensity = step(0.001,ripple(dis, 80.0, 15.0));\n if(intensity == 1.0)\n {\n material.alpha = 1.0;\n }\n return material;\n }", Cesium.Material._materialCache.addMaterial(Cesium.Material.ConeRadarType, { fabric: { type: Cesium.Material.ConeRadarType, uniforms: { color: new Cesium.Color(1, 0, 0, .5), time: 0 }, source: Cesium.Material.ConeRadarSource }, translucent: function(e) { return !0 } })), new Cesium.ConeRadarMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e, "#0000ff")), 3e3) }, f.prototype.getMultiCircleScanMaterial = function(e, t) { function i(e, t) { this._definitionChanged = new Cesium.Event, this._color = void 0, this._colorSubscription = void 0, this.color = e, this.u_radius1 = 0, this.u_radius2 = 0, this.u_radius3 = 0, this.duration = t, this._time = (new Date).getTime() } return Cesium.CircleScanMultiMaterialProperty || (Object.defineProperties(i.prototype, { isConstant: { get: function() { return !1 } }, definitionChanged: { get: function() { return this._definitionChanged } }, color: Cesium.createPropertyDescriptor("color") }), i.prototype.getType = function(e) { return "CircleScanMulti" }, i.prototype.getValue = function(e, t) { return (t = Cesium.defined(t) ? t : {}).color = Cesium.Property.getValueOrClonedDefault(this ._color, e, Cesium.Color.WHITE, t.color), t.time = ((new Date).getTime() - this ._time) % this.duration / this.duration, t.time < 1 / 3 && 0 === this.u_radius2 && 0 === this.u_radius1 ? this.u_radius3 = t.time : t.time >= 1 / 3 && t.time < 2 / 3 && 0 === this.u_radius1 ? (this.u_radius3 = t.time, this.u_radius2 = this.u_radius3 - 1 / 3) : t.time >= 2 / 3 ? (this.u_radius3 = t.time, this.u_radius2 = this.u_radius3 - 1 / 3, this.u_radius1 = this.u_radius3 - 2 / 3) : t.time < 1 / 3 && 0 !== this .u_radius2 && 0 !== this.u_radius1 ? (this.u_radius1 = t.time, this.u_radius2 = t.time + 1 / 3, this.u_radius3 = t.time + 2 / 3) : t.time >= 1 / 3 && t.time < 2 / 3 && 0 !== this.u_radius1 && (this.u_radius1 = t.time - 1 / 3, this.u_radius2 = t.time, this .u_radius3 = t.time + 1 / 3), t.u_radius1 = this.u_radius1, t.u_radius2 = this .u_radius2, t.u_radius3 = this.u_radius3, t }, i.prototype.equals = function(e) { return this === e || e instanceof i && Cesium.Property.equals(this._color, e._color) }, Cesium.CircleScanMultiMaterialProperty = i, Cesium.Material.CircleScanMultiType = "CircleScanMulti", Cesium.Material.CircleScanMultiSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n dis = dis * 2.0;\n if(dis < u_radius1)\n\n {\n float f = dis / u_radius1;\n material.alpha = pow(f, 9.0);\n }else if(dis < u_radius2){\n float f = dis / u_radius2;\n material.alpha = pow(f, 9.0);\n }else if(dis < u_radius3){\n float f = dis / u_radius3;\n material.alpha = pow(f, 9.0);\n }else{\n material.alpha = 0.0;\n }\n return material;\n }", Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleScanMultiType, { fabric: { type: Cesium.Material.CircleScanMultiType, uniforms: { color: new Cesium.Color(1, 0, 0, 1), time: 0, u_radius1: 0, u_radius2: 0, u_radius3: 0 }, source: Cesium.Material.CircleScanMultiSource }, translucent: function(e) { return !0 } })), new Cesium.CircleScanMultiMaterialProperty(Cesium.Color.fromCssColorString(this .defaultValue(e, "#ff0000")), this.defaultValue(t, 3e3)) }, f.prototype.getSectorScanMaterial = function(e, t) { function i(e, t, i) { this._definitionChanged = new Cesium.Event, this._color = void 0, this._colorSubscription = void 0, this.color = e, this.duration = i, this._angle = t, this._time = (new Date).getTime() } return Cesium.EllipsoidFadeMaterialProperty || (Object.defineProperties(i.prototype, { isConstant: { get: function() { return !1 } }, definitionChanged: { get: function() { return this._definitionChanged } }, color: Cesium.createPropertyDescriptor("color"), angle: Cesium.createPropertyDescriptor("angle") }), i.prototype.getType = function(e) { return "EllipsoidFade" }, i.prototype.getValue = function(e, t) { return (t = Cesium.defined(t) ? t : {}).color = Cesium.Property.getValueOrClonedDefault(this ._color, e, Cesium.ColorWHITE, t.color), t.angle = this._angle, t }, i.prototype.equals = function(e) { return this === e || e instanceof i && Property.equals(this._color, e._color) }, Cesium.EllipsoidFadeMaterialProperty = i, Cesium.Material.EllipsoidFadeType = "EllipsoidFade", Cesium.Material.EllipsoidFadeSource = "float getAngle(in vec2 dv)\n{\n if(dv.y == 0.0 && dv.x > 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n if(dv.y > 0.0)\n {\n rAngle = 360.0 + rAngle;\n }\n }\n return rAngle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n if(nowAngle < angle)\n {\n material.alpha = 1.0 - dis/0.5;\n float intensity =step(0.001,ripple(dis, 100.0, 15.0));\n if(intensity == 1.0)\n {\n material.alpha = material.alpha/2.0;\n }\n }\n else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n}", Cesium.Material._materialCache.addMaterial(Cesium.Material.EllipsoidFadeType, { fabric: { type: Cesium.Material.EllipsoidFadeType, uniforms: { color: new Cesium.Color(1, 0, 0, 1), angle: 90 }, source: Cesium.Material.EllipsoidFadeSource }, translucent: function(e) { return !0 } })), new Cesium.EllipsoidFadeMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue( e, "#ff0000")), this.defaultValue(t, 45)) }, f.prototype.getCircleScanMaterial = function(e, t) { function i(e, t) { this._definitionChanged = new Cesium.Event, this._color = void 0, this._colorSubscription = void 0, this.color = e, this.duration = t, this._time = (new Date).getTime() } return Cesium.CircleScanMaterialProperty || (Object.defineProperties(i.prototype, { isConstant: { get: function() { return !1 } }, definitionChanged: { get: function() { return this._definitionChanged } }, color: Cesium.createPropertyDescriptor("color") }), i.prototype.getType = function(e) { return "CircleScan" }, i.prototype.getValue = function(e, t) { return (t = Cesium.defined(t) ? t : {}).color = Cesium.Property.getValueOrClonedDefault(this ._color, e, Cesium.Color.WHITE, t.color), t.time = ((new Date).getTime() - this ._time) % this.duration / this.duration, t }, i.prototype.equals = function(e) { return this === e || e instanceof i && Cesium.Property.equals(this._color, e._color) }, Cesium.CircleScanMaterialProperty = i, Cesium.Material.CircleScanType = "CircleScan", Cesium .Material.CircleScanSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n if(dis { var i = e.nodeType, o = h(e.localName || e.nodeName), r = e.text || e.nodeValue || ""; 8 != i && (3 != i && 4 != i && o ? (s = s || {})[o] ? (s[o].length || (s[o] = m( s[o])), s[o] = m(s[o]), s[o][s[o].length] = n(e, !0), s[o] .length = s[o].length) : s[o] = n(e) : r.match(/^\s+$/) || (a += r .replace(/^\s+/, "").replace(/\s+$/, ""))) }), i.attributes && 0 < i.attributes.length) { o = {}, s = s || {}; for (let e = 0, t; e < i.attributes.length; e++) { t = i.attributes[e]; var r = h("@" + t.name), l = t.value; o[r] = l, s[r] ? (s[cnn] = m(s[cnn]), s[r][s[r].length] = l, s[r].length = s[r] .length) : s[r] = l } } s && (s = c.extend("" != a ? new String(a) : {}, s || {}), (a = s.text ? [s.text || ""] .concat([a]) : a) && (s.text = a), a = ""); var t = s || a; return u && ((a = (t = a ? {} : t).text || a || "") && (t.text = a), e || (t = m(t))), t }(9 == e.nodeType ? e.documentElement : e, !0); e = null; return t } }, fe.prototype.colorRgb = function(e) { if ((e = e.toLowerCase()) && /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)) { if (4 === e.length) { for (var t = "#", i = 1; i < 4; i += 1) t += e.slice(i, i + 1).concat(e.slice(i, i + 1)); e = t } for (var o = [], i = 1; i < 7; i += 2) o.push(parseInt("0x" + e.slice(i, i + 2))); return o } return e }, fe.prototype.colorHex = function(e) { if (/^(rgb|RGB)/.test(e)) { for (var t = e.replace(/(rgb|RGB)*/g, "").replace("(", "").replace(")", "").split(","), i = "#", o = 0; o < t.length; o++) { var r = Number(t[o]).toString(16); "0" === (r = 1 === r.length ? "0" + r : r) && (r += r), i += r } return i = 7 !== i.length ? e : i } if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)) return e; var n = e.replace(/#/, "").split(""); if (6 === n.length) return e; if (3 === n.length) { for (var a = "#", o = 0; o < n.length; o += 1) a += n[o] + n[o]; return a } }, f.prototype.getBrowser = function() { var e, t = navigator.userAgent.toLowerCase(), i = (t.match(/firefox|chrome|safari|opera/g) || "other")[0], o = ((t.match(/msie|trident/g) || [])[0] && (i = "msie"), ""), r = "", o = "ontouchstart" in window || -1 !== t.indexOf("touch") || -1 !== t.indexOf("mobile") ? -1 !== t .indexOf("ipad") ? "pad" : -1 !== t.indexOf("mobile") ? "mobile" : -1 !== t.indexOf("android") ? "androidPad" : "pc" : "pc"; switch (i) { case "chrome": case "safari": case "mobile": r = "webkit"; break; case "msie": r = "ms"; break; case "firefox": r = "Moz"; break; case "opera": r = "O"; break; default: r = "webkit" } return e = 0 < t.indexOf("android") ? "android" : navigator.platform.toLowerCase(), { version: (t.match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], plat: e, type: i, pc: o, prefix: r, isMobile: "pc" != o } }, m.prototype.VectorColorTransformation = function(e, t) { var i; return e && "[" == e.toString().charAt(0) && "]" == e.toString().charAt(e.length - 1) && (i = styleOption.fillColor.replace(/\[/, "").replace(/\]/, ""), e = t.properties[i]), this._core .isnull(e) || (this._core.isHtmlColor(e) ? e = this.colorFromHtmlColor(e) : null != (e = /^rgb/ .test(e) ? this.rgbaStringToRgbaObj(e) : e).r ? (1 < e.r && (e.r = e.r / 255), 1 < e.g && (e .g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), e = this .createColor(e.r, e.g, e.b, e.a)) : null != e.red && (1 < e.red && (e.red = e.red / 255), 1 < e.green && (e.green = e.green / 255), 1 < e.blue && (e.blue = e.blue / 255), 1 < e .alpha && (e.alpha = e.alpha / 255), e = this.createColor(e.red, e.green, e.blue, e.alpha))), e }, m.prototype.createColorTransformation = function(e) { return e = this._core.isnull(e) || "[" == e.toString().charAt(0) && "]" == e.toString().charAt(e .length - 1) ? e : this._core.isHtmlColor(e) ? this.colorFromHtmlColor(e) : (1 < (e = /^rgb/ .test(e) ? this.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this.createColor(e.r, e.g, e.b, e.a)) }, m.prototype.createColor = function(e, t, i, o) { return new this._cesium.Color(e, t, i, o) }, m.prototype.colorFromHtmlColor = function(e) { if ("object" == typeof e) return e.color || void 0; if (e = e.toLowerCase(), /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e)) { if (4 == e.length) { for (var t = "#", i = 1; i < 4; i += 1) t += e.slice(i, i + 1).concat(e.slice(i, i + 1)); e = t } for (var o, r = [], i = 1; i < 7; i += 2) r.push(parseInt("0x" + e.slice(i, i + 2))); return 9 == e.length ? (o = parseInt(e.substr(7, 2)) / 100, this.createColor(r[0] / 255, r[1] / 255, r[2] / 255, o)) : this.createColor(r[0] / 255, r[1] / 255, r[2] / 255, 1) } console.log("不是有效的html颜色", e) }, m.prototype.toHtmlColor = function(e) { e = e.split(","); return "#" + ((1 << 24) + (parseInt(e[0].split("(")[1]) << 16) + (parseInt(e[1]) << 8) + parseInt(e[2] .split(")")[0])).toString(16).slice(1) }, m.prototype.rgbaStringToRgbaObj = function(e) { var t; return /^rgb/.test(e) && (t = (e = (e = (e = e.replace(/rgba\(/g, "")).replace(/rgb\(/g, "")).replace( /\)/g, "")).split(","), e = {}, 3 == t.length ? (e.r = parseFloat(t[0]), e.g = parseFloat(t[ 1]), e.b = parseFloat(t[2]), e.a = 1) : 4 == t.length && (e.r = parseFloat(t[0]), e.g = parseFloat(t[1]), e.b = parseFloat(t[2]), e.a = parseFloat(t[3]))), e }, m.prototype.CreateColor = function(e, t, i, o) { return new this._cesium.Color(e, t, i, o) }, ye.prototype.createElevationContour = function(e, t, i) { var o, r = this, n = (r.item = {}, this._core.defaultValue(i.min, -414)), a = r._core.defaultValue(i.max, 8844), s = (r.item.selectedShading = t, r._viewer.scene.globe); return e ? ("elevation" === t ? (o = new r._cesium.Material({ fabric: { type: "ElevationColorContour", materials: { contourMaterial: { type: "ElevationContour" }, elevationRampMaterial: { type: "ElevationRamp" } }, components: { diffuse: "contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse", alpha: "max(contourMaterial.alpha, elevationRampMaterial.alpha)" } }, translucent: !1 }), r.item.shadingUniforms = o.materials.elevationRampMaterial.uniforms, r.item .shadingUniforms.minimumHeight = n, r.item.shadingUniforms.maximumHeight = a, r.item .contourUniforms = o.materials.contourMaterial.uniforms) : "slope" === t ? (o = new r ._cesium.Material({ fabric: { type: "SlopeColorContour", materials: { contourMaterial: { type: "ElevationContour" }, slopeRampMaterial: { type: "SlopeRamp" } }, components: { diffuse: "contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse", alpha: "max(contourMaterial.alpha, slopeRampMaterial.alpha)" } }, translucent: !1 }), r.item.shadingUniforms = o.materials.slopeRampMaterial.uniforms, r.item .contourUniforms = o.materials.contourMaterial.uniforms) : "aspect" === t ? (o = new r ._cesium.Material({ fabric: { type: "AspectColorContour", materials: { contourMaterial: { type: "ElevationContour" }, aspectRampMaterial: { type: "AspectRamp" } }, components: { diffuse: "contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse", alpha: "max(contourMaterial.alpha, aspectRampMaterial.alpha)" } }, translucent: !1 }), r.item.shadingUniforms = o.materials.aspectRampMaterial.uniforms, r.item .contourUniforms = o.materials.contourMaterial.uniforms) : (o = r._cesium.Material.fromType( "ElevationContour"), r.item.contourUniforms = o.uniforms), r.item.contourUniforms.width = r ._core.defaultValue(i.width, 2), r.item.contourUniforms.spacing = r._core.defaultValue(i .spacing, 150), r.item.contourUniforms.color = r._cesium.Color.fromCssColorString(r._core .defaultValue(i.lineColor, "#ff0000"))) : "elevation" === t ? (o = r._cesium.Material .fromType("ElevationRamp"), r.item.shadingUniforms = o.uniforms, r.item.shadingUniforms .minimumHeight = n, r.item.shadingUniforms.maximumHeight = a) : "slope" === t ? (o = r._cesium .Material.fromType("SlopeRamp"), r.item.shadingUniforms = o.uniforms) : "aspect" === t && (o = r ._cesium.Material.fromType("AspectRamp"), r.item.shadingUniforms = o.uniforms), "none" !== t && (r.item.shadingUniforms.image = i ? r._core.getColorRamp(t, i.colorArr, i.min, i.max) : r._core .getColorRamp(t)), s.material = void 0, r._viewer.render(), s.material = o, r.item.material = s .material, this }, ye.prototype.executeMaterial = function(e) { var t, i = this, e = (i.item = {}, i.item.selectedShading = e, i.item.shadingUniforms = {}, this._viewer.scene .globe); return "elevation" === i.item.selectedShading ? (t = this._cesium.Material.fromType("ElevationRamp"), i .item.shadingUniforms = t.uniforms, i.item.shadingUniforms.minHeight = -414, i.item .shadingUniforms.maxHeight = 8777) : "slope" === i.item.selectedShading ? (t = this._cesium .Material.fromType("SlopeRamp"), i.item.shadingUniforms = t.uniforms) : "aspect" === i.item .selectedShading && (t = this._cesium.Material.fromType("AspectRamp"), i.item.shadingUniforms = t .uniforms), "none" !== i.item.selectedShading && (i.item.shadingUniforms.image = this._core .getColorRamp(i.item.selectedShading)), e.material = t, i.item.material = e.material, this }, ye.prototype.setSpacing = function(e) { try { this.item.contourUniforms.spacing = parseFloat(e) } catch (e) { console.log(e) } return this }, ye.prototype.setMaterialColor = function(e) { try { this.item.contourUniforms.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, ye.prototype.setWidth = function(e) { try { this.item.contourUniforms.width = parseFloat(e) } catch (e) { console.log(e) } return this }, ye.prototype.executeContourMaterial = function(e) { var t, i = this, e = (i.item = {}, i.item.selectedShading = e, i._viewer.scene.globe); return "elevation" === i.item.selectedShading ? (t = new this._cesium.Material({ fabric: { type: "ElevationColorContour", materials: { contourMaterial: { type: "ElevationContour" }, elevationRampMaterial: { type: "ElevationRamp" } }, components: { diffuse: "contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse", alpha: "max(contourMaterial.alpha, elevationRampMaterial.alpha)" } }, translucent: !1 }), i.item.shadingUniforms = t.materials.elevationRampMaterial.uniforms, i.item.shadingUniforms .minHeight = -414, i.item.shadingUniforms.maxHeight = 8777, i.item.contourUniforms = t.materials .contourMaterial.uniforms) : "slope" === i.item.selectedShading ? (t = getSlopeContourMaterial(), i.item.shadingUniforms = t.materials.slopeRampMaterial.uniforms, i.item .contourUniforms = t.materials.contourMaterial.uniforms) : "aspect" === i.item.selectedShading ? (t = getAspectContourMaterial(), i.item.shadingUniforms = t.materials.aspectRampMaterial.uniforms, i .item.contourUniforms = t.materials.contourMaterial.uniforms) : (t = this._cesium.Material .fromType("ElevationContour"), i.item.contourUniforms = t.uniforms), "none" !== i.item .selectedShading && (i.item.shadingUniforms.image = this._core.getColorRamp(i.item .selectedShading)), i.item.contourUniforms.width = 2, i.item.contourUniforms.spacing = 150, i.item .contourUniforms.color = this._cesium.Color.fromRandom({ alpha: 1 }, this._cesium.Color.RED.clone()), e.material = t, i.item.material = e.material, this }, Object.defineProperties(ye.prototype, { elevation: { get: function() { return this.item }, set: function(e) { this.item = e } } }), ve.prototype.createTerrainProfile = function(e) { for (var t = [], i = 0; i < e.length; i++) { var o = this._cesium.Ellipsoid.WGS84.cartesianToCartographic(e[i]); t.push(o.height) } return t }; var zn = "Expected a function", Un = "__lodash_hash_undefined__", Wn = "__lodash_placeholder__", Yn = 128, Qn = 9007199254740991, qn = NaN, Jn = 4294967295, Xn = [ ["ary", Yn], ["bind", 1], ["bindKey", 2], ["curry", 8], ["curryRight", 16], ["flip", 512], ["partial", 32], ["partialRight", 64], ["rearg", 256] ], Kn = "[object Arguments]", $n = "[object Array]", Zn = "[object Boolean]", ea = "[object Date]", ta = "[object Error]", ia = "[object Function]", oa = "[object GeneratorFunction]", ra = "[object Map]", na = "[object Number]", aa = "[object Object]", sa = "[object Promise]", la = "[object RegExp]", ua = "[object Set]", ca = "[object String]", ha = "[object Symbol]", ma = "[object WeakMap]", da = "[object ArrayBuffer]", pa = "[object DataView]", ga = "[object Float32Array]", _a = "[object Float64Array]", fa = "[object Int8Array]", ya = "[object Int16Array]", va = "[object Int32Array]", Ca = "[object Uint8Array]", wa = "[object Uint8ClampedArray]", ba = "[object Uint16Array]", Ta = "[object Uint32Array]", Sa = /\b__p \+= '';/g, Pa = /\b(__p \+=) '' \+/g, Ea = /(__e\(.*?\)|\b__t\)) \+\n'';/g, xa = /&(?:amp|lt|gt|quot|#39);/g, Ia = /[&<>"']/g, Da = RegExp(xa.source), La = RegExp(Ia.source), Ma = /<%-([\s\S]+?)%>/g, Aa = /<%([\s\S]+?)%>/g, Ra = /<%=([\s\S]+?)%>/g, Oa = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Ha = /^\w*$/, Va = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ka = /[\\^$.*+?()[\]{}|]/g, Fa = RegExp(ka.source), Ga = /^\s+/, Ce = /\s/, Na = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Ba = /\{\n\/\* \[wrapped with (.+)\] \*/, ja = /,? & /, za = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, Ua = /[()=,{}\[\]\/\s]/, Wa = /\\(\\)?/g, Ya = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Qa = /\w*$/, qa = /^[-+]0x[0-9a-f]+$/i, Ja = /^0b[01]+$/i, Xa = /^\[object .+?Constructor\]$/, Ka = /^0o[0-7]+$/i, $a = /^(?:0|[1-9]\d*)$/, Za = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, es = /($^)/, ts = /['\n\r\u2028\u2029\\]/g, we = "\\ud800-\\udfff", be = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", Te = "\\u2700-\\u27bf", Se = "a-z\\xdf-\\xf6\\xf8-\\xff", Pe = "A-Z\\xc0-\\xd6\\xd8-\\xde", Ee = "\\ufe0e\\ufe0f", xe = "\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", Ie = "['’]", De = "[" + we + "]", Le = "[" + xe + "]", Me = "[" + be + "]", Ae = "[" + Te + "]", Re = "[" + Se + "]", xe = "[^" + we + xe + "\\d+" + Te + Se + Pe + "]", Te = "\\ud83c[\\udffb-\\udfff]", Se = "[^" + we + "]", Oe = "(?:\\ud83c[\\udde6-\\uddff]){2}", He = "[\\ud800-\\udbff][\\udc00-\\udfff]", Pe = "[" + Pe + "]", Ve = "\\u200d", ke = "(?:" + Re + "|" + xe + ")", xe = "(?:" + Pe + "|" + xe + ")", Fe = "(?:['’](?:d|ll|m|re|s|t|ve))?", Ge = "(?:['’](?:D|LL|M|RE|S|T|VE))?", Ne = "(?:" + Me + "|" + Te + ")" + "?", Be = "[" + Ee + "]?", Be = Be + Ne + ("(?:" + Ve + "(?:" + [Se, Oe, He].join("|") + ")" + Be + Ne + ")*"), Ne = "(?:" + [Ae, Oe, He].join("|") + ")" + Be, Ae = "(?:" + [Se + Me + "?", Me, Oe, He, De].join("|") + ")", is = RegExp(Ie, "g"), os = RegExp(Me, "g"), je = RegExp(Te + "(?=" + Te + ")|" + Ae + Be, "g"), rs = RegExp([Pe + "?" + Re + "+" + Fe + "(?=" + [Le, Pe, "$"].join("|") + ")", xe + "+" + Ge + "(?=" + [Le, Pe + ke, "$" ].join("|") + ")", Pe + "?" + ke + "+" + Fe, Pe + "+" + Ge, "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", "\\d+", Ne ].join("|"), "g"), ze = RegExp("[" + Ve + we + be + Ee + "]"), ns = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, as = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout" ], ss = -1, ls = {}, us = (ls[ga] = ls[_a] = ls[fa] = ls[ya] = ls[va] = ls[Ca] = ls[wa] = ls[ba] = ls[Ta] = !0, ls[Kn] = ls[$n] = ls[da] = ls[Zn] = ls[pa] = ls[ea] = ls[ta] = ls[ia] = ls[ra] = ls[na] = ls[aa] = ls[la] = ls[ua] = ls[ ca] = ls[ma] = !1, {}), Ue = (us[Kn] = us[$n] = us[da] = us[pa] = us[Zn] = us[ea] = us[ga] = us[_a] = us[fa] = us[ya] = us[va] = us[ ra] = us[na] = us[aa] = us[la] = us[ua] = us[ca] = us[ha] = us[Ca] = us[wa] = us[ba] = us[Ta] = !0, us[ta] = us[ia] = us[ma] = !1, { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }), cs = parseFloat, hs = parseInt, Se = "object" == typeof global && global && global.Object === Object && global, Oe = "object" == typeof self && self && self.Object === Object && self, ms = Se || Oe || Function("return this")(), He = "object" == typeof o && o && !o.nodeType && o, We = He && "object" == typeof module && module && !module.nodeType && module, ds = We && We.exports === He, Ye = ds && Se.process, De = function() { try { var e = We && We.require && We.require("util").types; return e ? e : Ye && Ye.binding && Ye.binding("util") } catch (e) {} }(), gs = De && De.isArrayBuffer, _s = De && De.isDate, fs = De && De.isMap, ys = De && De.isRegExp, vs = De && De.isSet, Cs = De && De.isTypedArray; function ws(e, t, i) { switch (i.length) { case 0: return e.call(t); case 1: return e.call(t, i[0]); case 2: return e.call(t, i[0], i[1]); case 3: return e.call(t, i[0], i[1], i[2]) } return e.apply(t, i) } function bs(e, t, i, o) { for (var r = -1, n = null == e ? 0 : e.length; ++r < n;) { var a = e[r]; t(o, a, i(a), e) } return o } function Ts(e, t) { for (var i = -1, o = null == e ? 0 : e.length; ++i < o && !1 !== t(e[i], i, e);); return e } function Ss(e, t) { for (var i = null == e ? 0 : e.length; i-- && !1 !== t(e[i], i, e);); return e } function Ps(e, t) { for (var i = -1, o = null == e ? 0 : e.length; ++i < o;) if (!t(e[i], i, e)) return !1; return !0 } function Es(e, t) { for (var i = -1, o = null == e ? 0 : e.length, r = 0, n = []; ++i < o;) { var a = e[i]; t(a, i, e) && (n[r++] = a) } return n } function xs(e, t) { return !!(null == e ? 0 : e.length) && -1 < Vs(e, t, 0) } function Is(e, t, i) { for (var o = -1, r = null == e ? 0 : e.length; ++o < r;) if (i(t, e[o])) return !0; return !1 } function Ds(e, t) { for (var i = -1, o = null == e ? 0 : e.length, r = Array(o); ++i < o;) r[i] = t(e[i], i, e); return r } function Ls(e, t) { for (var i = -1, o = t.length, r = e.length; ++i < o;) e[r + i] = t[i]; return e } function Ms(e, t, i, o) { var r = -1, n = null == e ? 0 : e.length; for (o && n && (i = e[++r]); ++r < n;) i = t(i, e[r], r, e); return i } function As(e, t, i, o) { var r = null == e ? 0 : e.length; for (o && r && (i = e[--r]); r--;) i = t(i, e[r], r, e); return i } function Rs(e, t) { for (var i = -1, o = null == e ? 0 : e.length; ++i < o;) if (t(e[i], i, e)) return !0; return !1 } var Qe = Ns("length"); function Os(e, o, t) { var r; return t(e, function(e, t, i) { if (o(e, t, i)) return r = t, !1 }), r } function Hs(e, t, i, o) { for (var r = e.length, n = i + (o ? 1 : -1); o ? n-- : ++n < r;) if (t(e[n], n, e)) return n; return -1 } function Vs(e, t, i) { if (t != t) return Hs(e, Fs, i); for (var o = e, r = t, n = i - 1, a = o.length; ++n < a;) if (o[n] === r) return n; return -1 } function ks(e, t, i, o) { for (var r = i - 1, n = e.length; ++r < n;) if (o(e[r], t)) return r; return -1 } function Fs(e) { return e != e } function Gs(e, t) { var i = null == e ? 0 : e.length; return i ? js(e, t) / i : qn } function Ns(t) { return function(e) { return null == e ? jn : e[t] } } function qe(t) { return function(e) { return null == t ? jn : t[e] } } function Bs(e, o, r, n, t) { return t(e, function(e, t, i) { r = n ? (n = !1, e) : o(r, e, t, i) }), r } function js(e, t) { for (var i, o = -1, r = e.length; ++o < r;) { var n = t(e[o]); n !== jn && (i = i === jn ? n : i + n) } return i } function zs(e, t) { for (var i = -1, o = Array(e); ++i < e;) o[i] = t(i); return o } function Us(e) { return e && e.slice(0, al(e) + 1).replace(Ga, "") } function Ws(t) { return function(e) { return t(e) } } function Ys(t, e) { return Ds(e, function(e) { return t[e] }) } function Qs(e, t) { return e.has(t) } function qs(e, t) { for (var i = -1, o = e.length; ++i < o && -1 < Vs(t, e[i], 0);); return i } function Js(e, t) { for (var i = e.length; i-- && -1 < Vs(t, e[i], 0);); return i } var Xs = qe({ "À": "A", "Á": "A", "Â": "A", "Ã": "A", "Ä": "A", "Å": "A", "à": "a", "á": "a", "â": "a", "ã": "a", "ä": "a", "å": "a", "Ç": "C", "ç": "c", "Ð": "D", "ð": "d", "È": "E", "É": "E", "Ê": "E", "Ë": "E", "è": "e", "é": "e", "ê": "e", "ë": "e", "Ì": "I", "Í": "I", "Î": "I", "Ï": "I", "ì": "i", "í": "i", "î": "i", "ï": "i", "Ñ": "N", "ñ": "n", "Ò": "O", "Ó": "O", "Ô": "O", "Õ": "O", "Ö": "O", "Ø": "O", "ò": "o", "ó": "o", "ô": "o", "õ": "o", "ö": "o", "ø": "o", "Ù": "U", "Ú": "U", "Û": "U", "Ü": "U", "ù": "u", "ú": "u", "û": "u", "ü": "u", "Ý": "Y", "ý": "y", "ÿ": "y", "Æ": "Ae", "æ": "ae", "Þ": "Th", "þ": "th", "ß": "ss", "Ā": "A", "Ă": "A", "Ą": "A", "ā": "a", "ă": "a", "ą": "a", "Ć": "C", "Ĉ": "C", "Ċ": "C", "Č": "C", "ć": "c", "ĉ": "c", "ċ": "c", "č": "c", "Ď": "D", "Đ": "D", "ď": "d", "đ": "d", "Ē": "E", "Ĕ": "E", "Ė": "E", "Ę": "E", "Ě": "E", "ē": "e", "ĕ": "e", "ė": "e", "ę": "e", "ě": "e", "Ĝ": "G", "Ğ": "G", "Ġ": "G", "Ģ": "G", "ĝ": "g", "ğ": "g", "ġ": "g", "ģ": "g", "Ĥ": "H", "Ħ": "H", "ĥ": "h", "ħ": "h", "Ĩ": "I", "Ī": "I", "Ĭ": "I", "Į": "I", "İ": "I", "ĩ": "i", "ī": "i", "ĭ": "i", "į": "i", "ı": "i", "Ĵ": "J", "ĵ": "j", "Ķ": "K", "ķ": "k", "ĸ": "k", "Ĺ": "L", "Ļ": "L", "Ľ": "L", "Ŀ": "L", "Ł": "L", "ĺ": "l", "ļ": "l", "ľ": "l", "ŀ": "l", "ł": "l", "Ń": "N", "Ņ": "N", "Ň": "N", "Ŋ": "N", "ń": "n", "ņ": "n", "ň": "n", "ŋ": "n", "Ō": "O", "Ŏ": "O", "Ő": "O", "ō": "o", "ŏ": "o", "ő": "o", "Ŕ": "R", "Ŗ": "R", "Ř": "R", "ŕ": "r", "ŗ": "r", "ř": "r", "Ś": "S", "Ŝ": "S", "Ş": "S", "Š": "S", "ś": "s", "ŝ": "s", "ş": "s", "š": "s", "Ţ": "T", "Ť": "T", "Ŧ": "T", "ţ": "t", "ť": "t", "ŧ": "t", "Ũ": "U", "Ū": "U", "Ŭ": "U", "Ů": "U", "Ű": "U", "Ų": "U", "ũ": "u", "ū": "u", "ŭ": "u", "ů": "u", "ű": "u", "ų": "u", "Ŵ": "W", "ŵ": "w", "Ŷ": "Y", "ŷ": "y", "Ÿ": "Y", "Ź": "Z", "Ż": "Z", "Ž": "Z", "ź": "z", "ż": "z", "ž": "z", "IJ": "IJ", "ij": "ij", "Œ": "Oe", "œ": "oe", "ʼn": "'n", "ſ": "s" }), Ks = qe({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }); function $s(e) { return "\\" + Ue[e] } function Zs(e) { return ze.test(e) } function el(e) { var i = -1, o = Array(e.size); return e.forEach(function(e, t) { o[++i] = [t, e] }), o } function tl(t, i) { return function(e) { return t(i(e)) } } function il(e, t) { for (var i = -1, o = e.length, r = 0, n = []; ++i < o;) { var a = e[i]; a !== t && a !== Wn || (e[i] = Wn, n[r++] = i) } return n } function ol(e) { var t = -1, i = Array(e.size); return e.forEach(function(e) { i[++t] = e }), i } function rl(e) { return (Zs(e) ? function(e) { var t = je.lastIndex = 0; for (; je.test(e);) ++t; return t } : Qe)(e) } function nl(e) { return Zs(e) ? e.match(je) || [] : e.split("") } function al(e) { for (var t = e.length; t-- && Ce.test(e.charAt(t));); return t } var sl = qe({ "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }); var Je, y = function r(e) { var b = (e = null == e ? ms : _.defaults(ms.Object(), e, _.pick(ms, as))).Array, n = e.Date, R = e.Error, O = e.Function, H = e.Math, g = e.Object, j = e.RegExp, z = e.String, y = e.TypeError, U = b.prototype, W = O.prototype, Y = g.prototype, Q = e["__core-js_shared__"], q = W.toString, V = Y.hasOwnProperty, J = 0, X = (W = /[^.]+$/.exec(Q && Q.keys && Q.keys.IE_PROTO || "")) ? "Symbol(src)_1." + W : "", K = Y.toString, $ = q.call(g), Z = ms._, ee = j("^" + q.call(V).replace(ka, "\\$&").replace( /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), W = ds ? e.Buffer : jn, t = e.Symbol, te = e.Uint8Array, ie = W ? W.allocUnsafe : jn, oe = tl(g.getPrototypeOf, g), re = g.create, ne = Y.propertyIsEnumerable, ae = U.splice, se = t ? t.isConcatSpreadable : jn, le = t ? t.iterator : jn, ue = t ? t.toStringTag : jn, ce = function() { try { var e = $i(g, "defineProperty"); return e({}, "", {}), e } catch (e) {} }(), he = e.clearTimeout !== ms.clearTimeout && e.clearTimeout, me = n && n.now !== ms.Date.now && n.now, de = e.setTimeout !== ms.setTimeout && e.setTimeout, pe = H.ceil, ge = H.floor, _e = g.getOwnPropertySymbols, W = W ? W.isBuffer : jn, fe = e.isFinite, ye = U.join, ve = tl(g.keys, g), v = H.max, T = H.min, Ce = n.now, we = e.parseInt, be = H.random, Te = U.reverse, n = $i(e, "DataView"), Se = $i(e, "Map"), Pe = $i(e, "Promise"), Ee = $i(e, "Set"), e = $i(e, "WeakMap"), xe = $i(g, "create"), Ie = e && new e, De = {}, Le = So(n), Me = So(Se), Ae = So(Pe), Re = So(Ee), Oe = So(e), t = t ? t.prototype : jn, He = t ? t.valueOf : jn, Ve = t ? t.toString : jn; function p(e) { if (B(e) && !N(e) && !(e instanceof C)) { if (e instanceof f) return e; if (V.call(e, "__wrapped__")) return Po(e) } return new f(e) } var ke = function(e) { if (!E(e)) return {}; if (re) return re(e); Fe.prototype = e; e = new Fe; return Fe.prototype = jn, e }; function Fe() {} function Ge() {} function f(e, t) { this.__wrapped__ = e, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this .__values__ = jn } function C(e) { this.__wrapped__ = e, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this .__iteratees__ = [], this.__takeCount__ = Jn, this.__views__ = [] } function Ne(e) { var t = -1, i = null == e ? 0 : e.length; for (this.clear(); ++t < i;) { var o = e[t]; this.set(o[0], o[1]) } } function Be(e) { var t = -1, i = null == e ? 0 : e.length; for (this.clear(); ++t < i;) { var o = e[t]; this.set(o[0], o[1]) } } function je(e) { var t = -1, i = null == e ? 0 : e.length; for (this.clear(); ++t < i;) { var o = e[t]; this.set(o[0], o[1]) } } function ze(e) { var t = -1, i = null == e ? 0 : e.length; for (this.__data__ = new je; ++t < i;) this.add(e[t]) } function k(e) { e = this.__data__ = new Be(e); this.size = e.size } function Ue(e, t) { var i, o = N(e), r = !o && yr(e), n = !o && !r && Cr(e), a = !o && !r && !n && Mr(e), s = o || r || n || a, l = s ? zs(e.length, z) : [], u = l.length; for (i in e) !t && !V.call(e, i) || s && ("length" == i || n && ("offset" == i || "parent" == i) || a && ("buffer" == i || "byteLength" == i || "byteOffset" == i) || ro(i, u)) || l.push(i); return l } function We(e) { var t = e.length; return t ? e[Gt(0, t - 1)] : jn } function Ye(e, t) { return Co(S(e), tt(t, 0, e.length)) } function Qe(e) { return Co(S(e)) } function qe(e, t, i) { (i === jn || G(e[t], i)) && (i !== jn || t in e) || Ze(e, t, i) } function Je(e, t, i) { var o = e[t]; V.call(e, t) && G(o, i) && (i !== jn || t in e) || Ze(e, t, i) } function Xe(e, t) { for (var i = e.length; i--;) if (G(e[i][0], t)) return i; return -1 } function Ke(e, o, r, n) { return nt(e, function(e, t, i) { o(n, e, r(e), i) }), n } function $e(e, t) { return e && _i(t, L(t), e) } function Ze(e, t, i) { "__proto__" == t && ce ? ce(e, t, { configurable: !0, enumerable: !0, value: i, writable: !0 }) : e[t] = i } function et(e, t) { for (var i = -1, o = t.length, r = b(o), n = null == e; ++i < o;) r[i] = n ? jn : Wr(e, t[i]); return r } function tt(e, t, i) { return e == e && (i !== jn && (e = e <= i ? e : i), t !== jn && (e = t <= e ? e : t)), e } function w(i, o, r, e, t, n) { var a, s = 1 & o, l = 2 & o, u = 4 & o; if ((a = r ? t ? r(i, e, t, n) : r(i) : a) !== jn) return a; if (!E(i)) return i; var c, e = N(i); if (e) { if (a = function(e) { var t = e.length, i = new e.constructor(t); t && "string" == typeof e[0] && V.call(e, "index") && (i.index = e.index, i.input = e .input); return i }(i), !s) return S(i, a) } else { var h = F(i), m = h == ia || h == oa; if (Cr(i)) return ci(i, s); if (h == aa || h == Kn || m && !t) { if (a = l || m ? {} : io(i), !s) return l ? (d = m = i, d = (c = a) && _i(d, M(d), c), _i(m, eo(m), d)) : (m = $e(a, c = i), _i(c, Zi(c), m)) } else { if (!us[h]) return t ? i : {}; a = function(e, t, i) { var o = e.constructor; switch (t) { case da: return hi(e); case Zn: case ea: return new o(+e); case pa: return function(e, t) { t = t ? hi(e.buffer) : e.buffer; return new e.constructor(t, e.byteOffset, e.byteLength) }(e, i); case ga: case _a: case fa: case ya: case va: case Ca: case wa: case ba: case Ta: return mi(e, i); case ra: return new o; case na: case ca: return new o(e); case la: return function(e) { var t = new e.constructor(e.source, Qa.exec(e)); return t.lastIndex = e.lastIndex, t }(e); case ua: return new o; case ha: return function(e) { return He ? g(He.call(e)) : {} }(e) } }(i, h, s) } } var d = (n = n || new k).get(i); if (d) return d; n.set(i, a), Dr(i) ? i.forEach(function(e) { a.add(w(e, o, r, e, i, n)) }) : Pr(i) && i.forEach(function(e, t) { a.set(t, w(e, o, r, t, i, n)) }); var p = e ? jn : (u ? l ? Yi : Wi : l ? M : L)(i); return Ts(p || i, function(e, t) { p && (e = i[t = e]), Je(a, t, w(e, o, r, t, i, n)) }), a } function it(e, t, i) { var o = i.length; if (null == e) return !o; for (e = g(e); o--;) { var r = i[o], n = t[r], a = e[r]; if (a === jn && !(r in e) || !n(a)) return !1 } return !0 } function ot(e, t, i) { if ("function" != typeof e) throw new y(zn); return _o(function() { e.apply(jn, i) }, t) } function rt(e, t, i, o) { var r = -1, n = xs, a = !0, s = e.length, l = [], u = t.length; if (!s) return l; i && (t = Ds(t, Ws(i))), o ? (n = Is, a = !1) : 200 <= t.length && (n = Qs, a = !1, t = new ze(t)); e: for (; ++r < s;) { var c = e[r], h = null == i ? c : i(c), c = o || 0 !== c ? c : 0; if (a && h == h) { for (var m = u; m--;) if (t[m] === h) continue e; l.push(c) } else n(t, h, o) || l.push(c) } return l } p.templateSettings = { escape: Ma, evaluate: Aa, interpolate: Ra, variable: "", imports: { _: p } }, (p.prototype = Ge.prototype).constructor = p, (f.prototype = ke(Ge.prototype)).constructor = f, ( C.prototype = ke(Ge.prototype)).constructor = C, Ne.prototype.clear = function() { this.__data__ = xe ? xe(null) : {}, this.size = 0 }, Ne.prototype.delete = function(e) { return e = this.has(e) && delete this.__data__[e], this.size -= e ? 1 : 0, e }, Ne.prototype.get = function(e) { var t, i = this.__data__; return xe ? (t = i[e]) === Un ? jn : t : V.call(i, e) ? i[e] : jn }, Ne.prototype.has = function(e) { var t = this.__data__; return xe ? t[e] !== jn : V.call(t, e) }, Ne.prototype.set = function(e, t) { var i = this.__data__; return this.size += this.has(e) ? 0 : 1, i[e] = xe && t === jn ? Un : t, this }, Be.prototype.clear = function() { this.__data__ = [], this.size = 0 }, Be.prototype.delete = function(e) { var t = this.__data__; return !((e = Xe(t, e)) < 0) && (e == t.length - 1 ? t.pop() : ae.call(t, e, 1), --this.size, ! 0) }, Be.prototype.get = function(e) { var t = this.__data__; return (e = Xe(t, e)) < 0 ? jn : t[e][1] }, Be.prototype.has = function(e) { return -1 < Xe(this.__data__, e) }, Be.prototype.set = function(e, t) { var i = this.__data__, o = Xe(i, e); return o < 0 ? (++this.size, i.push([e, t])) : i[o][1] = t, this }, je.prototype.clear = function() { this.size = 0, this.__data__ = { hash: new Ne, map: new(Se || Be), string: new Ne } }, je.prototype.delete = function(e) { return e = Xi(this, e).delete(e), this.size -= e ? 1 : 0, e }, je.prototype.get = function(e) { return Xi(this, e).get(e) }, je.prototype.has = function(e) { return Xi(this, e).has(e) }, je.prototype.set = function(e, t) { var i = Xi(this, e), o = i.size; return i.set(e, t), this.size += i.size == o ? 0 : 1, this }, ze.prototype.add = ze.prototype.push = function(e) { return this.__data__.set(e, Un), this }, ze.prototype.has = function(e) { return this.__data__.has(e) }, k.prototype.clear = function() { this.__data__ = new Be, this.size = 0 }, k.prototype.delete = function(e) { var t = this.__data__, e = t.delete(e); return this.size = t.size, e }, k.prototype.get = function(e) { return this.__data__.get(e) }, k.prototype.has = function(e) { return this.__data__.has(e) }, k.prototype.set = function(e, t) { var i = this.__data__; if (i instanceof Be) { var o = i.__data__; if (!Se || o.length < 199) return o.push([e, t]), this.size = ++i.size, this; i = this.__data__ = new je(o) } return i.set(e, t), this.size = i.size, this }; var nt = vi(mt), at = vi(dt, !0); function st(e, o) { var r = !0; return nt(e, function(e, t, i) { return r = !!o(e, t, i) }), r } function lt(e, t, i) { for (var o = -1, r = e.length; ++o < r;) { var n, a, s = e[o], l = t(s); null != l && (n === jn ? l == l && !x(l) : i(l, n)) && (n = l, a = s) } return a } function ut(e, o) { var r = []; return nt(e, function(e, t, i) { o(e, t, i) && r.push(e) }), r } function l(e, t, i, o, r) { var n = -1, a = e.length; for (i = i || oo, r = r || []; ++n < a;) { var s = e[n]; 0 < t && i(s) ? 1 < t ? l(s, t - 1, i, o, r) : Ls(r, s) : o || (r[r.length] = s) } return r } var ct = Ci(), ht = Ci(!0); function mt(e, t) { return e && ct(e, t, L) } function dt(e, t) { return e && ht(e, t, L) } function pt(t, e) { return Es(e, function(e) { return br(t[e]) }) } function gt(e, t) { for (var i = 0, o = (t = ai(t, e)).length; null != e && i < o;) e = e[To(t[i++])]; return i && i == o ? e : jn } function _t(e, t, i) { t = t(e); return N(e) ? t : Ls(t, i(e)) } function i(e) { { if (null == e) return e === jn ? "[object Undefined]" : "[object Null]"; if (ue && ue in g(e)) { var t = e, i = V.call(t, ue), o = t[ue]; try { t[ue] = jn; var r = !0 } catch (e) {} var n = K.call(t); return r && (i ? t[ue] = o : delete t[ue]), n } return K.call(e) } } function ft(e, t) { return t < e } function yt(e, t) { return null != e && V.call(e, t) } function vt(e, t) { return null != e && t in g(e) } function Ct(e, t, i) { for (var o = i ? Is : xs, r = e[0].length, n = e.length, a = n, s = b(n), l = 1 / 0, u = []; a--;) { var c = e[a]; a && t && (c = Ds(c, Ws(t))), l = T(c.length, l), s[a] = !i && (t || 120 <= r && 120 <= c .length) ? new ze(a && c) : jn } var c = e[0], h = -1, m = s[0]; e: for (; ++h < r && u.length < l;) { var d = c[h], p = t ? t(d) : d, d = i || 0 !== d ? d : 0; if (!(m ? Qs(m, p) : o(u, p, i))) { for (a = n; --a;) { var g = s[a]; if (!(g ? Qs(g, p) : o(e[a], p, i))) continue e } m && m.push(p), u.push(d) } } return u } function wt(e, t, i) { t = null == (e = mo(e, t = ai(t, e))) ? e : e[To(o(t))]; return null == t ? jn : ws(t, e, i) } function bt(e) { return B(e) && i(e) == Kn } function Tt(e, t, i, o, r) { { if (e === t) return !0; if (null == e || null == t || !B(e) && !B(t)) return e != e && t != t; var n = Tt, a = N(e), s = N(t), l = a ? $n : F(e), s = s ? $n : F(t), u = (l = l == Kn ? aa : l) == aa, c = (s = s == Kn ? aa : s) == aa, s; if ((s = l == s) && Cr(e)) { if (!Cr(t)) return !1; u = !(a = !0) } if (s && !u) { r = r || new k; if (a || Mr(e)) return zi(e, t, i, o, n, r); else { var h = e; var m = t; var d = l; var p = i; var g = o; var _ = n; var f = r; switch (d) { case pa: if (h.byteLength != m.byteLength || h.byteOffset != m.byteOffset) return !1; h = h.buffer, m = m.buffer; case da: return h.byteLength == m.byteLength && _(new te(h), new te(m)) ? !0 : !1; case Zn: case ea: case na: return G(+h, +m); case ta: return h.name == m.name && h.message == m.message; case la: case ca: return h == m + ""; case ra: var y = el; case ua: var v = 1 & p; if (y = y || ol, h.size != m.size && !v) return !1; v = f.get(h); if (v) return v == m; p |= 2, f.set(h, m); v = zi(y(h), y(m), p, g, _, f); return f.delete(h), v; case ha: if (He) return He.call(h) == He.call(m) } return !1; return } } if (!(1 & i)) { a = u && V.call(e, "__wrapped__"), l = c && V.call(t, "__wrapped__"); if (a || l) return u = a ? e.value() : e, c = l ? t.value() : t, r = r || new k, n(u, c, i, o, r) } if (s) { r = r || new k; var C = e, w = t, b = i, T = o, S = n, P = r, E = 1 & b, x = Wi(C), I = x.length, a = Wi(w).length; if (I != a && !E) return !1; for (var D = I; D--;) { var L = x[D]; if (!(E ? L in w : V.call(w, L))) return !1 } a = P.get(C), l = P.get(w); if (a && l) return a == w && l == C; for (var M = !0, A = (P.set(C, w), P.set(w, C), E); ++D < I;) { L = x[D]; var R, O = C[L], H = w[L]; if (!((R = T ? E ? T(H, O, L, w, C, P) : T(O, H, L, C, w, P) : R) === jn ? O === H || S( O, H, b, T, P) : R)) { M = !1; break } A = A || "constructor" == L } return M && !A && (a = C.constructor, l = w.constructor, a != l && "constructor" in C && "constructor" in w && !("function" == typeof a && a instanceof a && "function" == typeof l && l instanceof l) && (M = !1)), P.delete(C), P.delete(w), M } return !1 } } function St(e, t, i, o) { var r = i.length, n = r, a = !o; if (null == e) return !n; for (e = g(e); r--;) { var s = i[r]; if (a && s[2] ? s[1] !== e[s[0]] : !(s[0] in e)) return !1 } for (; ++r < n;) { var l = (s = i[r])[0], u = e[l], c = s[1]; if (a && s[2]) { if (u === jn && !(l in e)) return !1 } else { var h, m = new k; if (!((h = o ? o(u, c, l, e, t, m) : h) === jn ? Tt(c, u, 3, o, m) : h)) return !1 } } return !0 } function Pt(e) { return !(!E(e) || (t = e, X && X in t)) && (br(e) ? ee : Xa).test(So(e)); var t } function Et(e) { return "function" == typeof e ? e : null == e ? A : "object" == typeof e ? N(e) ? At(e[0], e[1]) : Mt(e) : Dn(e) } function xt(e) { if (!lo(e)) return ve(e); var t, i = []; for (t in g(e)) V.call(e, t) && "constructor" != t && i.push(t); return i } function It(e) { if (!E(e)) { var t = e, i = []; if (null != t) for (var o in g(t)) i.push(o); return i } var r, n = lo(e), a = []; for (r in e)("constructor" != r || !n && V.call(e, r)) && a.push(r); return a } function Dt(e, t) { return e < t } function Lt(e, o) { var r = -1, n = c(e) ? b(e.length) : []; return nt(e, function(e, t, i) { n[++r] = o(e, t, i) }), n } function Mt(t) { var i = Ki(t); return 1 == i.length && i[0][2] ? co(i[0][0], i[0][1]) : function(e) { return e === t || St(e, t, i) } } function At(i, o) { return no(i) && uo(o) ? co(To(i), o) : function(e) { var t = Wr(e, i); return t === jn && t === o ? Yr(e, i) : Tt(o, t, 3) } } function Rt(g, _, f, y, v) { g !== _ && ct(_, function(e, t) { var i, o, r, n, a, s, l, u, c, h, m, d, p; v = v || new k, E(e) ? (o = _, n = f, a = Rt, s = y, l = v, m = po(i = g, r = t), d = po(o, r), (p = l.get(d)) ? qe(i, r, p) : (p = s ? s(m, d, r + "", i, o, l) : jn, (o = p === jn) && (u = N(d), c = !u && Cr(d), h = !u && !c && Mr(d), p = d, u || c || h ? p = N(m) ? m : P(m) ? S(m) : c ? ci(d, !(o = !1)) : h ? mi(d, !(o = !1)) : [] : xr(d) || yr(d) ? yr(p = m) ? p = kr(m) : E(m) && !br(m) || (p = io(d)) : o = !1), o && (l.set(d, p), a(p, d, n, s, l), l .delete(d)), qe(i, r, p))) : (u = y ? y(po(g, t), e, t + "", g, _, v) : jn, qe(g, t, u = u === jn ? e : u)) }, M) } function Ot(e, t) { var i = e.length; if (i) return ro(t += t < 0 ? i : 0, i) ? e[t] : jn } function Ht(e, o, c) { o = o.length ? Ds(o, function(t) { return N(t) ? function(e) { return gt(e, 1 === t.length ? t[0] : t) } : t }) : [A]; var r = -1; o = Ds(o, Ws(h())); var t = Lt(e, function(t, e, i) { return { criteria: Ds(o, function(e) { return e(t) }), index: ++r, value: t } }), e = function(e, t) { for (var i = c, o = -1, r = e.criteria, n = t.criteria, a = r.length, s = i.length; ++o < a;) { var l = di(r[o], n[o]); if (l) { if (s <= o) return l; var u = i[o]; return l * ("desc" == u ? -1 : 1) } } return e.index - t.index }, i = t.length; for (t.sort(e); i--;) t[i] = t[i].value; return t } function Vt(e, t, i) { for (var o = -1, r = t.length, n = {}; ++o < r;) { var a = t[o], s = gt(e, a); i(s, a) && zt(n, ai(a, e), s) } return n } function kt(e, t, i, o) { var r = o ? ks : Vs, n = -1, a = t.length, s = e; for (e === t && (t = S(t)), i && (s = Ds(e, Ws(i))); ++n < a;) for (var l = 0, u = t[n], c = i ? i(u) : u; - 1 < (l = r(s, c, l, o));) s !== e && ae.call(s, l, 1), ae.call(e, l, 1); return e } function Ft(e, t) { for (var i = e ? t.length : 0, o = i - 1; i--;) { var r, n = t[i]; i != o && n === r || (ro(r = n) ? ae.call(e, n, 1) : $t(e, n)) } } function Gt(e, t) { return e + ge(be() * (t - e + 1)) } function Nt(e, t) { var i = ""; if (!e || t < 1 || Qn < t) return i; for (; t % 2 && (i += e), (t = ge(t / 2)) && (e += e), t;); return i } function a(e, t) { return fo(ho(e, t, A), e + "") } function Bt(e) { return We(rn(e)) } function jt(e, t) { e = rn(e); return Co(e, tt(t, 0, e.length)) } function zt(e, t, i, o) { if (!E(e)) return e; for (var r = -1, n = (t = ai(t, e)).length, a = n - 1, s = e; null != s && ++r < n;) { var l, u = To(t[r]), c = i; if ("__proto__" === u || "constructor" === u || "prototype" === u) return e; r != a && (l = s[u], (c = o ? o(l, u, s) : jn) === jn && (c = E(l) ? l : ro(t[r + 1]) ? [] : {})), Je(s, u, c), s = s[u] } return e } var Ut = Ie ? function(e, t) { return Ie.set(e, t), e } : A, t = ce ? function(e, t) { return ce(e, "toString", { configurable: !0, enumerable: !1, value: yn(t), writable: !0 }) } : A; function Wt(e) { return Co(rn(e)) } function s(e, t, i) { for (var o = -1, r = e.length, n = ((i = r < i ? r : i) < 0 && (i += r), r = i < (t = t < 0 ? r < - t ? 0 : r + t : t) ? 0 : i - t >>> 0, t >>>= 0, b(r)); ++o < r;) n[o] = e[o + t]; return n } function Yt(e, o) { var r; return nt(e, function(e, t, i) { return !(r = o(e, t, i)) }), !!r } function Qt(e, t, i) { var o = 0, r = null == e ? o : e.length; if ("number" == typeof t && t == t && r <= 2147483647) { for (; o < r;) { var n = o + r >>> 1, a = e[n]; null !== a && !x(a) && (i ? a <= t : a < t) ? o = 1 + n : r = n } return r } return qt(e, t, A, i) } function qt(e, t, i, o) { var r = 0, n = null == e ? 0 : e.length; if (0 === n) return 0; for (var a = (t = i(t)) != t, s = null === t, l = x(t), u = t === jn; r < n;) { var c = ge((r + n) / 2), h = i(e[c]), m = h !== jn, d = null === h, p = h == h, g = x(h), p = a ? o || p : u ? p && (o || m) : s ? p && m && (o || !d) : l ? p && m && !d && (o || ! g) : !d && !g && (o ? h <= t : h < t); p ? r = c + 1 : n = c } return T(n, 4294967294) } function Jt(e, t) { for (var i = -1, o = e.length, r = 0, n = []; ++i < o;) { var a, s = e[i], l = t ? t(s) : s; i && G(l, a) || (a = l, n[r++] = 0 === s ? 0 : s) } return n } function Xt(e) { return "number" == typeof e ? e : x(e) ? qn : +e } function u(e) { if ("string" == typeof e) return e; if (N(e)) return Ds(e, u) + ""; if (x(e)) return Ve ? Ve.call(e) : ""; var t = e + ""; return "0" == t && 1 / e == -1 / 0 ? "-0" : t } function Kt(e, t, i) { var o = -1, r = xs, n = e.length, a = !0, s = [], l = s; if (i) a = !1, r = Is; else if (200 <= n) { var u = t ? null : ki(e); if (u) return ol(u); a = !1, r = Qs, l = new ze } else l = t ? [] : s; e: for (; ++o < n;) { var c = e[o], h = t ? t(c) : c, c = i || 0 !== c ? c : 0; if (a && h == h) { for (var m = l.length; m--;) if (l[m] === h) continue e; t && l.push(h), s.push(c) } else r(l, h, i) || (l !== s && l.push(h), s.push(c)) } return s } function $t(e, t) { return null == (e = mo(e, t = ai(t, e))) || delete e[To(o(t))] } function Zt(e, t, i, o) { return zt(e, t, i(gt(e, t)), o) } function ei(e, t, i, o) { for (var r = e.length, n = o ? r : -1; (o ? n-- : ++n < r) && t(e[n], n, e);); return i ? s(e, o ? 0 : n, o ? n + 1 : r) : s(e, o ? n + 1 : 0, o ? r : n) } function ti(e, t) { var i = e; return Ms(t, function(e, t) { return t.func.apply(t.thisArg, Ls([e], t.args)) }, i = e instanceof C ? e.value() : i) } function ii(e, t, i) { var o = e.length; if (o < 2) return o ? Kt(e[0]) : []; for (var r = -1, n = b(o); ++r < o;) for (var a = e[r], s = -1; ++s < o;) s != r && (n[r] = rt(n[r] || a, e[s], t, i)); return Kt(l(n, 1), t, i) } function oi(e, t, i) { for (var o = -1, r = e.length, n = t.length, a = {}; ++o < r;) { var s = o < n ? t[o] : jn; i(a, e[o], s) } return a } function ri(e) { return P(e) ? e : [] } function ni(e) { return "function" == typeof e ? e : A } function ai(e, t) { return N(e) ? e : no(e, t) ? [e] : bo(d(e)) } var si = a; function li(e, t, i) { var o = e.length; return i = i === jn ? o : i, !t && o <= i ? e : s(e, t, i) } var ui = he || function(e) { return ms.clearTimeout(e) }; function ci(e, t) { if (t) return e.slice(); t = e.length, t = ie ? ie(t) : new e.constructor(t); return e.copy(t), t } function hi(e) { var t = new e.constructor(e.byteLength); return new te(t).set(new te(e)), t } function mi(e, t) { t = t ? hi(e.buffer) : e.buffer; return new e.constructor(t, e.byteOffset, e.length) } function di(e, t) { if (e !== t) { var i = e !== jn, o = null === e, r = e == e, n = x(e), a = t !== jn, s = null === t, l = t == t, u = x(t); if (!s && !u && !n && t < e || n && a && l && !s && !u || o && a && l || !i && l || !r) return 1; if (!o && !n && !u && e < t || u && i && r && !o && !n || s && i && r || !a && r || !l) return - 1 } return 0 } function pi(e, t, i, o) { for (var r = -1, n = e.length, a = i.length, s = -1, l = t.length, u = v(n - a, 0), c = b(l + u), h = !o; ++s < l;) c[s] = t[s]; for (; ++r < a;)(h || r < n) && (c[i[r]] = e[r]); for (; u--;) c[s++] = e[r++]; return c } function gi(e, t, i, o) { for (var r = -1, n = e.length, a = -1, s = i.length, l = -1, u = t.length, c = v(n - s, 0), h = b( c + u), m = !o; ++r < c;) h[r] = e[r]; for (var d = r; ++l < u;) h[d + l] = t[l]; for (; ++a < s;)(m || r < n) && (h[d + i[a]] = e[r++]); return h } function S(e, t) { var i = -1, o = e.length; for (t = t || b(o); ++i < o;) t[i] = e[i]; return t } function _i(e, t, i, o) { for (var r = !i, n = (i = i || {}, -1), a = t.length; ++n < a;) { var s = t[n], l = o ? o(i[s], e[s], s, i, e) : jn; (r ? Ze : Je)(i, s, l = l === jn ? e[s] : l) } return i } function fi(r, n) { return function(e, t) { var i = N(e) ? bs : Ke, o = n ? n() : {}; return i(e, r, h(t, 2), o) } } function yi(s) { return a(function(e, t) { var i = -1, o = t.length, r = 1 < o ? t[o - 1] : jn, n = 2 < o ? t[2] : jn, r = 3 < s.length && "function" == typeof r ? (o--, r) : jn; for (n && m(t[0], t[1], n) && (r = o < 3 ? jn : r, o = 1), e = g(e); ++i < o;) { var a = t[i]; a && s(e, a, i, r) } return e }) } function vi(n, a) { return function(e, t) { if (null == e) return e; if (!c(e)) return n(e, t); for (var i = e.length, o = a ? i : -1, r = g(e); (a ? o-- : ++o < i) && !1 !== t(r[o], o, r);); return e } } function Ci(l) { return function(e, t, i) { for (var o = -1, r = g(e), n = i(e), a = n.length; a--;) { var s = n[l ? a : ++o]; if (!1 === t(r[s], s, r)) break } return e } } function wi(o) { return function(e) { var t = Zs(e = d(e)) ? nl(e) : jn, i = t ? t[0] : e.charAt(0), t = t ? li(t, 1).join("") : e.slice(1); return i[o]() + t } } function bi(t) { return function(e) { return Ms(gn(sn(e).replace(is, "")), t, "") } } function Ti(o) { return function() { var e = arguments; switch (e.length) { case 0: return new o; case 1: return new o(e[0]); case 2: return new o(e[0], e[1]); case 3: return new o(e[0], e[1], e[2]); case 4: return new o(e[0], e[1], e[2], e[3]); case 5: return new o(e[0], e[1], e[2], e[3], e[4]); case 6: return new o(e[0], e[1], e[2], e[3], e[4], e[5]); case 7: return new o(e[0], e[1], e[2], e[3], e[4], e[5], e[6]) } var t = ke(o.prototype), i = o.apply(t, e); return E(i) ? i : t } } function Si(n, a, s) { var l = Ti(n); return function e() { for (var t = arguments.length, i = b(t), o = t, r = Ji(e); o--;) i[o] = arguments[o]; r = t < 3 && i[0] !== r && i[t - 1] !== r ? [] : il(i, r); return (t -= r.length) < s ? Hi(n, a, xi, e.placeholder, jn, i, r, jn, jn, s - t) : ws( this && this !== ms && this instanceof e ? l : n, this, i) } } function Pi(n) { return function(e, t, i) { var o, r = g(e), t = (c(e) || (o = h(t, 3), e = L(e), t = function(e) { return o(r[e], e, r) }), n(e, t, i)); return -1 < t ? r[o ? e[t] : t] : jn } } function Ei(l) { return Ui(function(r) { var n = r.length, e = n, t = f.prototype.thru; for (l && r.reverse(); e--;) { var i = r[e]; if ("function" != typeof i) throw new y(zn); t && !s && "wrapper" == qi(i) && (s = new f([], !0)) } for (e = s ? e : n; ++e < n;) var o = qi(i = r[e]), a = "wrapper" == o ? Qi(i) : jn, s = a && ao(a[0]) && 424 == a[1] && !a[4].length && 1 == a[9] ? s[qi(a[0])] .apply(s, a[3]) : 1 == i.length && ao(i) ? s[o]() : s.thru(i); return function() { var e = arguments, t = e[0]; if (s && 1 == e.length && N(t)) return s.plant(t).value(); for (var i = 0, o = n ? r[i].apply(this, e) : t; ++i < n;) o = r[i].call(this, o); return o } }) } function xi(a, s, l, u, c, h, m, d, p, g) { var _ = s & Yn, f = 1 & s, y = 2 & s, v = 24 & s, C = 512 & s, w = y ? jn : Ti(a); return function e() { for (var t = b(n = arguments.length), i = n; i--;) t[i] = arguments[i]; if (v && (r = function(e, t) { for (var i = e.length, o = 0; i--;) e[i] === t && ++o; return o }(t, o = Ji(e))), u && (t = pi(t, u, c, v)), h && (t = gi(t, h, m, v)), n -= r, v && n < g) return r = il(t, o), Hi(a, s, xi, e.placeholder, l, t, r, d, p, g - n); var o = f ? l : this, r = y ? o[a] : a, n = t.length; return d ? t = function(e, t) { for (var i = e.length, o = T(t.length, i), r = S(e); o--;) { var n = t[o]; e[o] = ro(n, i) ? r[n] : jn } return e }(t, d) : C && 1 < n && t.reverse(), _ && p < n && (t.length = p), (r = this && this !== ms && this instanceof e ? w || Ti(r) : r).apply(o, t) } } function Ii(i, a) { return function(e, t) { return e = e, o = i, r = a(t), n = {}, mt(e, function(e, t, i) { o(n, r(e), t, i) }), n; var o, r, n } } function Di(o, r) { return function(e, t) { var i; if (e === jn && t === jn) return r; if (e !== jn && (i = e), t !== jn) { if (i === jn) return t; t = "string" == typeof e || "string" == typeof t ? (e = u(e), u(t)) : (e = Xt(e), Xt( t)), i = o(e, t) } return i } } function Li(o) { return Ui(function(e) { return e = Ds(e, Ws(h())), a(function(t) { var i = this; return o(e, function(e) { return ws(e, i, t) }) }) }) } function Mi(e, t) { var i = (t = t === jn ? " " : u(t)).length; if (i < 2) return i ? Nt(t, e) : t; i = Nt(t, pe(e / rl(t))); return Zs(t) ? li(nl(i), 0, e).join("") : i.slice(0, e) } function Ai(s, e, l, u) { var c = 1 & e, h = Ti(s); return function e() { for (var t = -1, i = arguments.length, o = -1, r = u.length, n = b(r + i), a = this && this !== ms && this instanceof e ? h : s; ++o < r;) n[o] = u[o]; for (; i--;) n[o++] = arguments[++t]; return ws(a, c ? l : this, n) } } function Ri(u) { return function(e, t, i) { i && "number" != typeof i && m(e, t, i) && (t = i = jn), e = Hr(e), t === jn ? (t = e, e = 0) : t = Hr(t), i = i === jn ? e < t ? 1 : -1 : Hr(i); for (var o = e, r = i, n = u, a = -1, s = v(pe((t - o) / (r || 1)), 0), l = b(s); s--;) l[ n ? s : ++a] = o, o += r; return l } } function Oi(i) { return function(e, t) { return "string" == typeof e && "string" == typeof t || (e = D(e), t = D(t)), i(e, t) } } function Hi(e, t, i, o, r, n, a, s, l, u) { var c = 8 & t, r = (4 & (t = (t | (c ? 32 : 64)) & ~(c ? 64 : 32)) || (t &= -4), [e, t, r, c ? n : jn, c ? a : jn, c ? jn : n, c ? jn : a, s, l, u ]), n = i.apply(jn, r); return ao(e) && go(n, r), n.placeholder = o, yo(n, e, t) } function Vi(e) { var o = H[e]; return function(e, t) { var i; return e = D(e), (t = null == t ? 0 : T(I(t), 292)) && fe(e) ? (i = (d(e) + "e").split("e"), +((i = (d(o(i[0] + "e" + (+i[1] + t))) + "e").split("e"))[0] + "e" + (+i[1] - t))) : o(e) } } var ki = Ee && 1 / ol(new Ee([, -0]))[1] == 1 / 0 ? function(e) { return new Ee(e) } : Pn; function Fi(n) { return function(e) { var t, i, o, r = F(e); return r == ra ? el(e) : r == ua ? (r = e, t = -1, i = Array(r.size), r.forEach(function( e) { i[++t] = [e, e] }), i) : Ds(n(o = e), function(e) { return [e, o[e]] }) } } function Gi(e, t, i, o, r, n, a, s) { var l = 2 & t; if (!l && "function" != typeof e) throw new y(zn); var u, c, h, m, d, p = o ? o.length : 0, g = (p || (t &= -97, o = r = jn), a = a === jn ? a : v(I(a), 0), s = s === jn ? s : I(s), p -= r ? r.length : 0, 64 & t && (_ = o, u = r, o = r = jn), l ? jn : Qi(e)), _ = [e, t, i, o, r, _, u, n, a, s]; return g && function(e, t) { var i = e[1], o = t[1], r = i | o, n = r < 131, a = o == Yn && 8 == i || o == Yn && 256 == i && e[7].length <= t[8] || 384 == o && t[7] .length <= t[8] && 8 == i; if (!n && !a) return; 1 & o && (e[2] = t[2], r |= 1 & i ? 0 : 4); n = t[3]; { var s; n && (s = e[3], e[3] = s ? pi(s, n, t[4]) : n, e[4] = s ? il(e[3], Wn) : t[4]) }(n = t[5]) && (s = e[5], e[5] = s ? gi(s, n, t[6]) : n, e[6] = s ? il(e[5], Wn) : t[6]); (n = t[7]) && (e[7] = n); o & Yn && (e[8] = null == e[8] ? t[8] : T(e[8], t[8])); null == e[9] && (e[9] = t[9]); e[0] = t[0], e[1] = r }(_, g), e = _[0], t = _[1], i = _[2], o = _[3], r = _[4], !(s = _[9] = _[9] === jn ? l ? 0 : e .length : v(_[9] - p, 0)) && 24 & t && (t &= -25), u = t && 1 != t ? 8 == t || 16 == t ? Si( e, t, s) : 32 != t && 33 != t || r.length ? xi.apply(jn, _) : Ai(e, t, i, o) : (h = i, m = 1 & t, d = Ti(c = e), function e() { return (this && this !== ms && this instanceof e ? d : c).apply(m ? h : this, arguments) }), yo((g ? Ut : go)(u, _), e, t) } function Ni(e, t, i, o) { return e === jn || G(e, Y[i]) && !V.call(o, i) ? t : e } function Bi(e, t, i, o, r, n) { return E(e) && E(t) && (n.set(t, e), Rt(e, t, jn, Bi, n), n.delete(t)), e } function ji(e) { return xr(e) ? jn : e } function zi(e, t, i, o, r, n) { var a = 1 & i, s = e.length, l = t.length; if (s != l && !(a && s < l)) return !1; var l = n.get(e), u = n.get(t); if (l && u) return l == t && u == e; var c = -1, h = !0, m = 2 & i ? new ze : jn; for (n.set(e, t), n.set(t, e); ++c < s;) { var d, p = e[c], g = t[c]; if ((d = o ? a ? o(g, p, c, t, e, n) : o(p, g, c, e, t, n) : d) !== jn) { if (d) continue; h = !1; break } if (m) { if (!Rs(t, function(e, t) { return !Qs(m, t) && (p === e || r(p, e, i, o, n)) && m.push(t) })) { h = !1; break } } else if (p !== g && !r(p, g, i, o, n)) { h = !1; break } } return n.delete(e), n.delete(t), h } function Ui(e) { return fo(ho(e, jn, Io), e + "") } function Wi(e) { return _t(e, L, Zi) } function Yi(e) { return _t(e, M, eo) } var Qi = Ie ? function(e) { return Ie.get(e) } : Pn; function qi(e) { for (var t = e.name + "", i = De[t], o = V.call(De, t) ? i.length : 0; o--;) { var r = i[o], n = r.func; if (null == n || n == e) return r.name } return t } function Ji(e) { return (V.call(p, "placeholder") ? p : e).placeholder } function h() { var e = (e = p.iteratee || wn) === wn ? Et : e; return arguments.length ? e(arguments[0], arguments[1]) : e } function Xi(e, t) { var i, o, e = e.__data__; return ("string" == (o = typeof(i = t)) || "number" == o || "symbol" == o || "boolean" == o ? "__proto__" !== i : null === i) ? e["string" == typeof t ? "string" : "hash"] : e.map } function Ki(e) { for (var t = L(e), i = t.length; i--;) { var o = t[i], r = e[o]; t[i] = [o, r, uo(r)] } return t } function $i(e, t) { t = t; e = null == (e = e) ? jn : e[t]; return Pt(e) ? e : jn } var Zi = _e ? function(t) { return null == t ? [] : (t = g(t), Es(_e(t), function(e) { return ne.call(t, e) })) } : An, eo = _e ? function(e) { for (var t = []; e;) Ls(t, Zi(e)), e = oe(e); return t } : An, F = i; function to(e, t, i) { for (var o = -1, r = (t = ai(t, e)).length, n = !1; ++o < r;) { var a = To(t[o]); if (!(n = null != e && i(e, a))) break; e = e[a] } return n || ++o != r ? n : !!(r = null == e ? 0 : e.length) && Sr(r) && ro(a, r) && (N(e) || yr(e)) } function io(e) { return "function" != typeof e.constructor || lo(e) ? {} : ke(oe(e)) } function oo(e) { return N(e) || yr(e) || !!(se && e && e[se]) } function ro(e, t) { var i = typeof e; return !!(t = null == t ? Qn : t) && ("number" == i || "symbol" != i && $a.test(e)) && -1 < e && e % 1 == 0 && e < t } function m(e, t, i) { var o; if (E(i)) return o = typeof t, ("number" == o ? c(i) && ro(t, i.length) : "string" == o && t in i) && G(i[t], e) } function no(e, t) { var i; if (!N(e)) return i = typeof e, "number" == i || "symbol" == i || "boolean" == i || null == e || x( e) || (Ha.test(e) || !Oa.test(e) || null != t && e in g(t)) } function ao(e) { var t = qi(e), i = p[t]; if ("function" == typeof i && t in C.prototype) { if (e === i) return 1; t = Qi(i); return t && e === t[0] } }(n && F(new n(new ArrayBuffer(1))) != pa || Se && F(new Se) != ra || Pe && F(Pe.resolve()) != sa || Ee && F(new Ee) != ua || e && F(new e) != ma) && (F = function(e) { var t = i(e), e = t == aa ? e.constructor : jn, e = e ? So(e) : ""; if (e) switch (e) { case Le: return pa; case Me: return ra; case Ae: return sa; case Re: return ua; case Oe: return ma } return t }); var so = Q ? br : Rn; function lo(e) { var t = e && e.constructor; return e === ("function" == typeof t && t.prototype || Y) } function uo(e) { return e == e && !E(e) } function co(t, i) { return function(e) { return null != e && (e[t] === i && (i !== jn || t in g(e))) } } function ho(n, a, s) { return a = v(a === jn ? n.length - 1 : a, 0), function() { for (var e = arguments, t = -1, i = v(e.length - a, 0), o = b(i); ++t < i;) o[t] = e[a + t]; for (var t = -1, r = b(a + 1); ++t < a;) r[t] = e[t]; return r[a] = s(o), ws(n, this, r) } } function mo(e, t) { return t.length < 2 ? e : gt(e, s(t, 0, -1)) } function po(e, t) { if (("constructor" !== t || "function" != typeof e[t]) && "__proto__" != t) return e[t] } var go = vo(Ut), _o = de || function(e, t) { return ms.setTimeout(e, t) }, fo = vo(t); function yo(e, t, i) { var o, r, t = t + ""; return fo(e, function(e, t) { var i = t.length; if (!i) return e; var o = i - 1; return t[o] = (1 < i ? "& " : "") + t[o], t = t.join(2 < i ? ", " : " "), e.replace(Na, "{\n/* [wrapped with " + t + "] */\n") }(t, (o = (e = (e = t).match(Ba)) ? e[1].split(ja) : [], r = i, Ts(Xn, function(e) { var t = "_." + e[0]; r & e[1] && !xs(o, t) && o.push(t) }), o.sort()))) } function vo(i) { var o = 0, r = 0; return function() { var e = Ce(), t = 16 - (e - r); if (r = e, 0 < t) { if (800 <= ++o) return arguments[0] } else o = 0; return i.apply(jn, arguments) } } function Co(e, t) { var i = -1, o = e.length, r = o - 1; for (t = t === jn ? o : t; ++i < t;) { var n = Gt(i, r), a = e[n]; e[n] = e[i], e[i] = a } return e.length = t, e } wo = (he = hr(he = function(e) { var r = []; return 46 === e.charCodeAt(0) && r.push(""), e.replace(Va, function(e, t, i, o) { r.push(i ? o.replace(Wa, "$1") : t || e) }), r }, function(e) { return 500 === wo.size && wo.clear(), e })).cache; var wo, bo = he; function To(e) { if ("string" == typeof e || x(e)) return e; var t = e + ""; return "0" == t && 1 / e == -1 / 0 ? "-0" : t } function So(e) { if (null != e) { try { return q.call(e) } catch (e) {} try { return e + "" } catch (e) {} } return "" } function Po(e) { if (e instanceof C) return e.clone(); var t = new f(e.__wrapped__, e.__chain__); return t.__actions__ = S(e.__actions__), t.__index__ = e.__index__, t.__values__ = e.__values__, t } n = a(function(e, t) { return P(e) ? rt(e, l(t, 1, P, !0)) : [] }), Pe = a(function(e, t) { var i = o(t); return P(i) && (i = jn), P(e) ? rt(e, l(t, 1, P, !0), h(i, 2)) : [] }), e = a(function(e, t) { var i = o(t); return P(i) && (i = jn), P(e) ? rt(e, l(t, 1, P, !0), jn, i) : [] }); function Eo(e, t, i) { var o = null == e ? 0 : e.length; if (!o) return -1; i = null == i ? 0 : I(i); return i < 0 && (i = v(o + i, 0)), Hs(e, h(t, 3), i) } function xo(e, t, i) { var o = null == e ? 0 : e.length; if (!o) return -1; var r = o - 1; return i !== jn && (r = I(i), r = i < 0 ? v(o + r, 0) : T(r, o - 1)), Hs(e, h(t, 3), r, !0) } function Io(e) { return (null == e ? 0 : e.length) ? l(e, 1) : [] } function Do(e) { return e && e.length ? e[0] : jn } Q = a(function(e) { var t = Ds(e, ri); return t.length && t[0] === e[0] ? Ct(t) : [] }), de = a(function(e) { var t = o(e), i = Ds(e, ri); return t === o(i) ? t = jn : i.pop(), i.length && i[0] === e[0] ? Ct(i, h(t, 2)) : [] }), t = a(function(e) { var t = o(e), i = Ds(e, ri); return (t = "function" == typeof t ? t : jn) && i.pop(), i.length && i[0] === e[0] ? Ct(i, jn, t) : [] }); function o(e) { var t = null == e ? 0 : e.length; return t ? e[t - 1] : jn } he = a(Lo); function Lo(e, t) { return e && e.length && t && t.length ? kt(e, t) : e } var Mo = Ui(function(e, t) { var i = null == e ? 0 : e.length, o = et(e, t); return Ft(e, Ds(t, function(e) { return ro(e, i) ? +e : e }).sort(di)), o }); function Ao(e) { return null == e ? e : Te.call(e) } var Ro = a(function(e) { return Kt(l(e, 1, P, !0)) }), Oo = a(function(e) { var t = o(e); return P(t) && (t = jn), Kt(l(e, 1, P, !0), h(t, 2)) }), Ho = a(function(e) { var t = "function" == typeof(t = o(e)) ? t : jn; return Kt(l(e, 1, P, !0), jn, t) }); function Vo(t) { if (!t || !t.length) return []; var i = 0; return t = Es(t, function(e) { return P(e) && (i = v(e.length, i), 1) }), zs(i, function(e) { return Ds(t, Ns(e)) }) } function ko(e, t) { if (!e || !e.length) return []; e = Vo(e); return null == t ? e : Ds(e, function(e) { return ws(t, jn, e) }) } var Fo = a(function(e, t) { return P(e) ? rt(e, t) : [] }), Go = a(function(e) { return ii(Es(e, P)) }), No = a(function(e) { var t = o(e); return P(t) && (t = jn), ii(Es(e, P), h(t, 2)) }), Bo = a(function(e) { var t = "function" == typeof(t = o(e)) ? t : jn; return ii(Es(e, P), jn, t) }), jo = a(Vo); var zo = a(function(e) { var t = e.length, t = "function" == typeof(t = 1 < t ? e[t - 1] : jn) ? (e.pop(), t) : jn; return ko(e, t) }); function Uo(e) { e = p(e); return e.__chain__ = !0, e } function Wo(e, t) { return t(e) } var Yo = Ui(function(t) { function e(e) { return et(e, t) } var i = t.length, o = i ? t[0] : 0, r = this.__wrapped__; return !(1 < i || this.__actions__.length) && r instanceof C && ro(o) ? ((r = r.slice(o, + o + (i ? 1 : 0))).__actions__.push({ func: Wo, args: [e], thisArg: jn }), new f(r, this.__chain__).thru(function(e) { return i && !e.length && e.push(jn), e })) : this.thru(e) }); var Qo = fi(function(e, t, i) { V.call(e, i) ? ++e[i] : Ze(e, i, 1) }); var qo = Pi(Eo), Jo = Pi(xo); function Xo(e, t) { return (N(e) ? Ts : nt)(e, h(t, 3)) } function Ko(e, t) { return (N(e) ? Ss : at)(e, h(t, 3)) } var $o = fi(function(e, t, i) { V.call(e, i) ? e[i].push(t) : Ze(e, i, [t]) }); var Zo = a(function(e, t, i) { var o = -1, r = "function" == typeof t, n = c(e) ? b(e.length) : []; return nt(e, function(e) { n[++o] = r ? ws(t, e, i) : wt(e, t, i) }), n }), er = fi(function(e, t, i) { Ze(e, i, t) }); function tr(e, t) { return (N(e) ? Ds : Lt)(e, h(t, 3)) } var ir = fi(function(e, t, i) { e[i ? 0 : 1].push(t) }, function() { return [ [], [] ] }); var or = a(function(e, t) { if (null == e) return []; var i = t.length; return 1 < i && m(e, t[0], t[1]) ? t = [] : 2 < i && m(t[0], t[1], t[2]) && (t = [t[0]]), Ht(e, l(t, 1), []) }), rr = me || function() { return ms.Date.now() }; function nr(e, t, i) { return t = i ? jn : t, t = e && null == t ? e.length : t, Gi(e, Yn, jn, jn, jn, jn, t) } function ar(e, t) { var i; if ("function" != typeof t) throw new y(zn); return e = I(e), function() { return 0 < --e && (i = t.apply(this, arguments)), e <= 1 && (t = jn), i } } var sr = a(function(e, t, i) { var o, r = 1; return i.length && (o = il(i, Ji(sr)), r |= 32), Gi(e, r, t, i, o) }), lr = a(function(e, t, i) { var o, r = 3; return i.length && (o = il(i, Ji(lr)), r |= 32), Gi(t, r, e, i, o) }); function ur(o, i, e) { var r, n, a, s, l, u, c = 0, h = !1, m = !1, t = !0; if ("function" != typeof o) throw new y(zn); function d(e) { var t = r, i = n; return r = n = jn, c = e, s = o.apply(i, t) } function p(e) { var t = e - u; return u === jn || i <= t || t < 0 || m && a <= e - c } function g() { var e, t = rr(); if (p(t)) return _(t); l = _o(g, (e = i - ((t = t) - u), m ? T(e, a - (t - c)) : e)) } function _(e) { return l = jn, t && r ? d(e) : (r = n = jn, s) } function f() { var e = rr(), t = p(e); if (r = arguments, n = this, u = e, t) { if (l === jn) return c = e = u, l = _o(g, i), h ? d(e) : s; if (m) return ui(l), l = _o(g, i), d(u) } return l === jn && (l = _o(g, i)), s } return i = D(i) || 0, E(e) && (h = !!e.leading, m = "maxWait" in e, a = m ? v(D(e.maxWait) || 0, i) : a, t = "trailing" in e ? !!e.trailing : t), f.cancel = function() { l !== jn && ui(l), c = 0, r = u = n = l = jn }, f.flush = function() { return l === jn ? s : _(rr()) }, f } var me = a(function(e, t) { return ot(e, 1, t) }), cr = a(function(e, t, i) { return ot(e, D(t) || 0, i) }); function hr(o, r) { if ("function" != typeof o || null != r && "function" != typeof r) throw new y(zn); function n() { var e = arguments, t = r ? r.apply(this, e) : e[0], i = n.cache; return i.has(t) ? i.get(t) : (e = o.apply(this, e), n.cache = i.set(t, e) || i, e) } return n.cache = new(hr.Cache || je), n } function mr(t) { if ("function" != typeof t) throw new y(zn); return function() { var e = arguments; switch (e.length) { case 0: return !t.call(this); case 1: return !t.call(this, e[0]); case 2: return !t.call(this, e[0], e[1]); case 3: return !t.call(this, e[0], e[1], e[2]) } return !t.apply(this, e) } } hr.Cache = je; var si = si(function(o, r) { var n = (r = 1 == r.length && N(r[0]) ? Ds(r[0], Ws(h())) : Ds(l(r, 1), Ws(h()))).length; return a(function(e) { for (var t = -1, i = T(e.length, n); ++t < i;) e[t] = r[t].call(this, e[t]); return ws(o, this, e) }) }), dr = a(function(e, t) { var i = il(t, Ji(dr)); return Gi(e, 32, jn, t, i) }), pr = a(function(e, t) { var i = il(t, Ji(pr)); return Gi(e, 64, jn, t, i) }), gr = Ui(function(e, t) { return Gi(e, 256, jn, jn, jn, t) }); function G(e, t) { return e === t || e != e && t != t } var _r = Oi(ft), fr = Oi(function(e, t) { return t <= e }), yr = bt(function() { return arguments }()) ? bt : function(e) { return B(e) && V.call(e, "callee") && !ne.call(e, "callee") }, N = b.isArray, vr = gs ? Ws(gs) : function(e) { return B(e) && i(e) == da }; function c(e) { return null != e && Sr(e.length) && !br(e) } function P(e) { return B(e) && c(e) } var Cr = W || Rn, W = _s ? Ws(_s) : function(e) { return B(e) && i(e) == ea }; function wr(e) { if (!B(e)) return !1; var t = i(e); return t == ta || "[object DOMException]" == t || "string" == typeof e.message && "string" == typeof e.name && !xr(e) } function br(e) { if (!E(e)) return !1; e = i(e); return e == ia || e == oa || "[object AsyncFunction]" == e || "[object Proxy]" == e } function Tr(e) { return "number" == typeof e && e == I(e) } function Sr(e) { return "number" == typeof e && -1 < e && e % 1 == 0 && e <= Qn } function E(e) { var t = typeof e; return null != e && ("object" == t || "function" == t) } function B(e) { return null != e && "object" == typeof e } var Pr = fs ? Ws(fs) : function(e) { return B(e) && F(e) == ra }; function Er(e) { return "number" == typeof e || B(e) && i(e) == na } function xr(e) { if (!B(e) || i(e) != aa) return !1; e = oe(e); if (null === e) return !0; e = V.call(e, "constructor") && e.constructor; return "function" == typeof e && e instanceof e && q.call(e) == $ } var Ir = ys ? Ws(ys) : function(e) { return B(e) && i(e) == la }; var Dr = vs ? Ws(vs) : function(e) { return B(e) && F(e) == ua }; function Lr(e) { return "string" == typeof e || !N(e) && B(e) && i(e) == ca } function x(e) { return "symbol" == typeof e || B(e) && i(e) == ha } var Mr = Cs ? Ws(Cs) : function(e) { return B(e) && Sr(e.length) && !!ls[i(e)] }; var Ar = Oi(Dt), Rr = Oi(function(e, t) { return e <= t }); function Or(e) { if (!e) return []; if (c(e)) return (Lr(e) ? nl : S)(e); if (le && e[le]) { for (var t, i = e[le](), o = []; !(t = i.next()).done;) o.push(t.value); return o } var r = F(e); return (r == ra ? el : r == ua ? ol : rn)(e) } function Hr(e) { return e ? (e = D(e)) === 1 / 0 || e === -1 / 0 ? 17976931348623157e292 * (e < 0 ? -1 : 1) : e == e ? e : 0 : 0 === e ? e : 0 } function I(e) { var e = Hr(e), t = e % 1; return e == e ? t ? e - t : e : 0 } function Vr(e) { return e ? tt(I(e), 0, Jn) : 0 } function D(e) { if ("number" == typeof e) return e; if (x(e)) return qn; if ("string" != typeof(e = E(e) ? E(t = "function" == typeof e.valueOf ? e.valueOf() : e) ? t + "" : t : e)) return 0 === e ? e : +e; e = Us(e); var t = Ja.test(e); return t || Ka.test(e) ? hs(e.slice(2), t ? 2 : 8) : qa.test(e) ? qn : +e } function kr(e) { return _i(e, M(e)) } function d(e) { return null == e ? "" : u(e) } var Fr = yi(function(e, t) { if (lo(t) || c(t)) _i(t, L(t), e); else for (var i in t) V.call(t, i) && Je(e, i, t[i]) }), Gr = yi(function(e, t) { _i(t, M(t), e) }), Nr = yi(function(e, t, i, o) { _i(t, M(t), e, o) }), Br = yi(function(e, t, i, o) { _i(t, L(t), e, o) }), jr = Ui(et); var zr = a(function(e, t) { e = g(e); var i = -1, o = t.length, r = 2 < o ? t[2] : jn; for (r && m(t[0], t[1], r) && (o = 1); ++i < o;) for (var n = t[i], a = M(n), s = -1, l = a.length; ++s < l;) { var u = a[s], c = e[u]; (c === jn || G(c, Y[u]) && !V.call(e, u)) && (e[u] = n[u]) } return e }), Ur = a(function(e) { return e.push(jn, Bi), ws(Kr, jn, e) }); function Wr(e, t, i) { e = null == e ? jn : gt(e, t); return e === jn ? i : e } function Yr(e, t) { return null != e && to(e, t, vt) } var Qr = Ii(function(e, t, i) { e[t = null != t && "function" != typeof t.toString ? K.call(t) : t] = i }, yn(A)), qr = Ii(function(e, t, i) { null != t && "function" != typeof t.toString && (t = K.call(t)), V.call(e, t) ? e[t].push( i) : e[t] = [i] }, h), Jr = a(wt); function L(e) { return (c(e) ? Ue : xt)(e) } function M(e) { return c(e) ? Ue(e, !0) : It(e) } var Xr = yi(function(e, t, i) { Rt(e, t, i) }), Kr = yi(function(e, t, i, o) { Rt(e, t, i, o) }), $r = Ui(function(t, e) { var i = {}; if (null == t) return i; for (var o = !1, r = (e = Ds(e, function(e) { return e = ai(e, t), o = o || 1 < e.length, e }), _i(t, Yi(t), i), o && (i = w(i, 7, ji)), e.length); r--;) $t(i, e[r]); return i }); var Zr = Ui(function(e, t) { return null == e ? {} : Vt(i = e, t, function(e, t) { return Yr(i, t) }); var i }); function en(e, i) { if (null == e) return {}; var t = Ds(Yi(e), function(e) { return [e] }); return i = h(i), Vt(e, t, function(e, t) { return i(e, t[0]) }) } var tn = Fi(L), on = Fi(M); function rn(e) { return null == e ? [] : Ys(e, L(e)) } var nn = bi(function(e, t, i) { return t = t.toLowerCase(), e + (i ? an(t) : t) }); function an(e) { return pn(d(e).toLowerCase()) } function sn(e) { return (e = d(e)) && e.replace(Za, Xs).replace(os, "") } var ln = bi(function(e, t, i) { return e + (i ? "-" : "") + t.toLowerCase() }), un = bi(function(e, t, i) { return e + (i ? " " : "") + t.toLowerCase() }), cn = wi("toLowerCase"); var hn = bi(function(e, t, i) { return e + (i ? "_" : "") + t.toLowerCase() }); var mn = bi(function(e, t, i) { return e + (i ? " " : "") + pn(t) }); var dn = bi(function(e, t, i) { return e + (i ? " " : "") + t.toUpperCase() }), pn = wi("toUpperCase"); function gn(e, t, i) { return e = d(e), (t = i ? jn : t) === jn ? (i = e, ns.test(i) ? e.match(rs) || [] : e.match(za) || []) : e.match(t) || [] } var _n = a(function(e, t) { try { return ws(e, jn, t) } catch (e) { return wr(e) ? e : new R(e) } }), fn = Ui(function(t, e) { return Ts(e, function(e) { e = To(e), Ze(t, e, sr(t[e], t)) }), t }); function yn(e) { return function() { return e } } var vn = Ei(), Cn = Ei(!0); function A(e) { return e } function wn(e) { return Et("function" == typeof e ? e : w(e, 1)) } var bn = a(function(t, i) { return function(e) { return wt(e, t, i) } }), Tn = a(function(t, i) { return function(e) { return wt(t, e, i) } }); function Sn(o, t, e) { var i = L(t), r = pt(t, i), n = (null != e || E(t) && (r.length || !i.length) || (e = t, t = o, o = this, r = pt(t, L(t))), !(E(e) && "chain" in e && !e.chain)), a = br(o); return Ts(r, function(e) { var i = t[e]; o[e] = i, a && (o.prototype[e] = function() { var e, t = this.__chain__; return n || t ? (((e = o(this.__wrapped__)).__actions__ = S(this .__actions__)).push({ func: i, args: arguments, thisArg: o }), e.__chain__ = t, e) : i.apply(o, Ls([this.value()], arguments)) }) }), o } function Pn() {} var En = Li(Ds), xn = Li(Ps), In = Li(Rs); function Dn(e) { return no(e) ? Ns(To(e)) : (t = e, function(e) { return gt(e, t) }); var t } var Ln = Ri(), Mn = Ri(!0); function An() { return [] } function Rn() { return !1 } var On = Di(function(e, t) { return e + t }, 0), Hn = Vi("ceil"), Vn = Di(function(e, t) { return e / t }, 1), kn = Vi("floor"); var Fn, Gn = Di(function(e, t) { return e * t }, 1), Nn = Vi("round"), Bn = Di(function(e, t) { return e - t }, 0); return p.after = function(e, t) { if ("function" != typeof t) throw new y(zn); return e = I(e), function() { if (--e < 1) return t.apply(this, arguments) } }, p.ary = nr, p.assign = Fr, p.assignIn = Gr, p.assignInWith = Nr, p.assignWith = Br, p.at = jr, p .before = ar, p.bind = sr, p.bindAll = fn, p.bindKey = lr, p.castArray = function() { if (!arguments.length) return []; var e = arguments[0]; return N(e) ? e : [e] }, p.chain = Uo, p.chunk = function(e, t, i) { t = (i ? m(e, t, i) : t === jn) ? 1 : v(I(t), 0); var o = null == e ? 0 : e.length; if (!o || t < 1) return []; for (var r = 0, n = 0, a = b(pe(o / t)); r < o;) a[n++] = s(e, r, r += t); return a }, p.compact = function(e) { for (var t = -1, i = null == e ? 0 : e.length, o = 0, r = []; ++t < i;) { var n = e[t]; n && (r[o++] = n) } return r }, p.concat = function() { var e = arguments.length; if (!e) return []; for (var t = b(e - 1), i = arguments[0], o = e; o--;) t[o - 1] = arguments[o]; return Ls(N(i) ? S(i) : [i], l(t, 1)) }, p.cond = function(o) { var r = null == o ? 0 : o.length, t = h(); return o = r ? Ds(o, function(e) { if ("function" != typeof e[1]) throw new y(zn); return [t(e[0]), e[1]] }) : [], a(function(e) { for (var t = -1; ++t < r;) { var i = o[t]; if (ws(i[0], this, e)) return ws(i[1], this, e) } }) }, p.conforms = function(e) { return t = w(e, 1), i = L(t), function(e) { return it(e, t, i) }; var t, i }, p.constant = yn, p.countBy = Qo, p.create = function(e, t) { return e = ke(e), null == t ? e : $e(e, t) }, p.curry = function e(t, i, o) { t = Gi(t, 8, jn, jn, jn, jn, jn, i = o ? jn : i); return t.placeholder = e.placeholder, t }, p.curryRight = function e(t, i, o) { t = Gi(t, 16, jn, jn, jn, jn, jn, i = o ? jn : i); return t.placeholder = e.placeholder, t }, p.debounce = ur, p.defaults = zr, p.defaultsDeep = Ur, p.defer = me, p.delay = cr, p.difference = n, p.differenceBy = Pe, p.differenceWith = e, p.drop = function(e, t, i) { var o = null == e ? 0 : e.length; return o ? s(e, (t = i || t === jn ? 1 : I(t)) < 0 ? 0 : t, o) : [] }, p.dropRight = function(e, t, i) { var o = null == e ? 0 : e.length; return o ? s(e, 0, (t = o - (t = i || t === jn ? 1 : I(t))) < 0 ? 0 : t) : [] }, p.dropRightWhile = function(e, t) { return e && e.length ? ei(e, h(t, 3), !0, !0) : [] }, p.dropWhile = function(e, t) { return e && e.length ? ei(e, h(t, 3), !0) : [] }, p.fill = function(e, t, i, o) { if (!(l = null == e ? 0 : e.length)) return []; i && "number" != typeof i && m(e, t, i) && (i = 0, o = l); var r = e, n = t, a = i, s = o, l = r.length; for ((a = I(a)) < 0 && (a = l < -a ? 0 : l + a), (s = s === jn || l < s ? l : I(s)) < 0 && (s += l), s = s < a ? 0 : Vr(s); a < s;) r[a++] = n; return r }, p.filter = function(e, t) { return (N(e) ? Es : ut)(e, h(t, 3)) }, p.flatMap = function(e, t) { return l(tr(e, t), 1) }, p.flatMapDeep = function(e, t) { return l(tr(e, t), 1 / 0) }, p.flatMapDepth = function(e, t, i) { return i = i === jn ? 1 : I(i), l(tr(e, t), i) }, p.flatten = Io, p.flattenDeep = function(e) { return (null == e ? 0 : e.length) ? l(e, 1 / 0) : [] }, p.flattenDepth = function(e, t) { return (null == e ? 0 : e.length) ? l(e, t = t === jn ? 1 : I(t)) : [] }, p.flip = function(e) { return Gi(e, 512) }, p.flow = vn, p.flowRight = Cn, p.fromPairs = function(e) { for (var t = -1, i = null == e ? 0 : e.length, o = {}; ++t < i;) { var r = e[t]; o[r[0]] = r[1] } return o }, p.functions = function(e) { return null == e ? [] : pt(e, L(e)) }, p.functionsIn = function(e) { return null == e ? [] : pt(e, M(e)) }, p.groupBy = $o, p.initial = function(e) { return (null == e ? 0 : e.length) ? s(e, 0, -1) : [] }, p.intersection = Q, p.intersectionBy = de, p.intersectionWith = t, p.invert = Qr, p.invertBy = qr, p.invokeMap = Zo, p.iteratee = wn, p.keyBy = er, p.keys = L, p.keysIn = M, p.map = tr, p .mapKeys = function(e, o) { var r = {}; return o = h(o, 3), mt(e, function(e, t, i) { Ze(r, o(e, t, i), e) }), r }, p.mapValues = function(e, o) { var r = {}; return o = h(o, 3), mt(e, function(e, t, i) { Ze(r, t, o(e, t, i)) }), r }, p.matches = function(e) { return Mt(w(e, 1)) }, p.matchesProperty = function(e, t) { return At(e, w(t, 1)) }, p.memoize = hr, p.merge = Xr, p.mergeWith = Kr, p.method = bn, p.methodOf = Tn, p.mixin = Sn, p .negate = mr, p.nthArg = function(t) { return t = I(t), a(function(e) { return Ot(e, t) }) }, p.omit = $r, p.omitBy = function(e, t) { return en(e, mr(h(t))) }, p.once = function(e) { return ar(2, e) }, p.orderBy = function(e, t, i, o) { return null == e ? [] : Ht(e, t = N(t) ? t : null == t ? [] : [t], i = N(i = o ? jn : i) ? i : null == i ? [] : [i]) }, p.over = En, p.overArgs = si, p.overEvery = xn, p.overSome = In, p.partial = dr, p.partialRight = pr, p.partition = ir, p.pick = Zr, p.pickBy = en, p.property = Dn, p.propertyOf = function(t) { return function(e) { return null == t ? jn : gt(t, e) } }, p.pull = he, p.pullAll = Lo, p.pullAllBy = function(e, t, i) { return e && e.length && t && t.length ? kt(e, t, h(i, 2)) : e }, p.pullAllWith = function(e, t, i) { return e && e.length && t && t.length ? kt(e, t, jn, i) : e }, p.pullAt = Mo, p.range = Ln, p.rangeRight = Mn, p.rearg = gr, p.reject = function(e, t) { return (N(e) ? Es : ut)(e, mr(h(t, 3))) }, p.remove = function(e, t) { var i = []; if (!e || !e.length) return i; var o = -1, r = [], n = e.length; for (t = h(t, 3); ++o < n;) { var a = e[o]; t(a, o, e) && (i.push(a), r.push(o)) } return Ft(e, r), i }, p.rest = function(e, t) { if ("function" != typeof e) throw new y(zn); return a(e, t = t === jn ? t : I(t)) }, p.reverse = Ao, p.sampleSize = function(e, t, i) { return t = (i ? m(e, t, i) : t === jn) ? 1 : I(t), (N(e) ? Ye : jt)(e, t) }, p.set = function(e, t, i) { return null == e ? e : zt(e, t, i) }, p.setWith = function(e, t, i, o) { return o = "function" == typeof o ? o : jn, null == e ? e : zt(e, t, i, o) }, p.shuffle = function(e) { return (N(e) ? Qe : Wt)(e) }, p.slice = function(e, t, i) { var o = null == e ? 0 : e.length; return o ? (i = i && "number" != typeof i && m(e, t, i) ? (t = 0, o) : (t = null == t ? 0 : I( t), i === jn ? o : I(i)), s(e, t, i)) : [] }, p.sortBy = or, p.sortedUniq = function(e) { return e && e.length ? Jt(e) : [] }, p.sortedUniqBy = function(e, t) { return e && e.length ? Jt(e, h(t, 2)) : [] }, p.split = function(e, t, i) { return i && "number" != typeof i && m(e, t, i) && (t = i = jn), (i = i === jn ? Jn : i >>> 0) ? (e = d(e)) && ("string" == typeof t || null != t && !Ir(t)) && !(t = u(t)) && Zs(e) ? li(nl( e), 0, i) : e.split(t, i) : [] }, p.spread = function(i, o) { if ("function" != typeof i) throw new y(zn); return o = null == o ? 0 : v(I(o), 0), a(function(e) { var t = e[o], e = li(e, 0, o); return t && Ls(e, t), ws(i, this, e) }) }, p.tail = function(e) { var t = null == e ? 0 : e.length; return t ? s(e, 1, t) : [] }, p.take = function(e, t, i) { return e && e.length ? s(e, 0, (t = i || t === jn ? 1 : I(t)) < 0 ? 0 : t) : [] }, p.takeRight = function(e, t, i) { var o = null == e ? 0 : e.length; return o ? s(e, (t = o - (t = i || t === jn ? 1 : I(t))) < 0 ? 0 : t, o) : [] }, p.takeRightWhile = function(e, t) { return e && e.length ? ei(e, h(t, 3), !1, !0) : [] }, p.takeWhile = function(e, t) { return e && e.length ? ei(e, h(t, 3)) : [] }, p.tap = function(e, t) { return t(e), e }, p.throttle = function(e, t, i) { var o = !0, r = !0; if ("function" != typeof e) throw new y(zn); return E(i) && (o = "leading" in i ? !!i.leading : o, r = "trailing" in i ? !!i.trailing : r), ur(e, t, { leading: o, maxWait: t, trailing: r }) }, p.thru = Wo, p.toArray = Or, p.toPairs = tn, p.toPairsIn = on, p.toPath = function(e) { return N(e) ? Ds(e, To) : x(e) ? [e] : S(bo(d(e))) }, p.toPlainObject = kr, p.transform = function(e, o, r) { var t, i = N(e), n = i || Cr(e) || Mr(e); return o = h(o, 4), null == r && (t = e && e.constructor, r = n ? i ? new t : [] : E(e) && br( t) ? ke(oe(e)) : {}), (n ? Ts : mt)(e, function(e, t, i) { return o(r, e, t, i) }), r }, p.unary = function(e) { return nr(e, 1) }, p.union = Ro, p.unionBy = Oo, p.unionWith = Ho, p.uniq = function(e) { return e && e.length ? Kt(e) : [] }, p.uniqBy = function(e, t) { return e && e.length ? Kt(e, h(t, 2)) : [] }, p.uniqWith = function(e, t) { return t = "function" == typeof t ? t : jn, e && e.length ? Kt(e, jn, t) : [] }, p.unset = function(e, t) { return null == e || $t(e, t) }, p.unzip = Vo, p.unzipWith = ko, p.update = function(e, t, i) { return null == e ? e : Zt(e, t, ni(i)) }, p.updateWith = function(e, t, i, o) { return o = "function" == typeof o ? o : jn, null == e ? e : Zt(e, t, ni(i), o) }, p.values = rn, p.valuesIn = function(e) { return null == e ? [] : Ys(e, M(e)) }, p.without = Fo, p.words = gn, p.wrap = function(e, t) { return dr(ni(t), e) }, p.xor = Go, p.xorBy = No, p.xorWith = Bo, p.zip = jo, p.zipObject = function(e, t) { return oi(e || [], t || [], Je) }, p.zipObjectDeep = function(e, t) { return oi(e || [], t || [], zt) }, p.zipWith = zo, p.entries = tn, p.entriesIn = on, p.extend = Gr, p.extendWith = Nr, Sn(p, p), p .add = On, p.attempt = _n, p.camelCase = nn, p.capitalize = an, p.ceil = Hn, p.clamp = function(e, t, i) { return i === jn && (i = t, t = jn), i !== jn && (i = (i = D(i)) == i ? i : 0), t !== jn && (t = (t = D(t)) == t ? t : 0), tt(D(e), t, i) }, p.clone = function(e) { return w(e, 4) }, p.cloneDeep = function(e) { return w(e, 5) }, p.cloneDeepWith = function(e, t) { return w(e, 5, t = "function" == typeof t ? t : jn) }, p.cloneWith = function(e, t) { return w(e, 4, t = "function" == typeof t ? t : jn) }, p.conformsTo = function(e, t) { return null == t || it(e, t, L(t)) }, p.deburr = sn, p.defaultTo = function(e, t) { return null == e || e != e ? t : e }, p.divide = Vn, p.endsWith = function(e, t, i) { e = d(e), t = u(t); var o = e.length, o = i = i === jn ? o : tt(I(i), 0, o); return 0 <= (i -= t.length) && e.slice(i, o) == t }, p.eq = G, p.escape = function(e) { return (e = d(e)) && La.test(e) ? e.replace(Ia, Ks) : e }, p.escapeRegExp = function(e) { return (e = d(e)) && Fa.test(e) ? e.replace(ka, "\\$&") : e }, p.every = function(e, t, i) { return (N(e) ? Ps : st)(e, h(t = i && m(e, t, i) ? jn : t, 3)) }, p.find = qo, p.findIndex = Eo, p.findKey = function(e, t) { return Os(e, h(t, 3), mt) }, p.findLast = Jo, p.findLastIndex = xo, p.findLastKey = function(e, t) { return Os(e, h(t, 3), dt) }, p.floor = kn, p.forEach = Xo, p.forEachRight = Ko, p.forIn = function(e, t) { return null == e ? e : ct(e, h(t, 3), M) }, p.forInRight = function(e, t) { return null == e ? e : ht(e, h(t, 3), M) }, p.forOwn = function(e, t) { return e && mt(e, h(t, 3)) }, p.forOwnRight = function(e, t) { return e && dt(e, h(t, 3)) }, p.get = Wr, p.gt = _r, p.gte = fr, p.has = function(e, t) { return null != e && to(e, t, yt) }, p.hasIn = Yr, p.head = Do, p.identity = A, p.includes = function(e, t, i, o) { return e = c(e) ? e : rn(e), i = i && !o ? I(i) : 0, o = e.length, i < 0 && (i = v(o + i, 0)), Lr(e) ? i <= o && -1 < e.indexOf(t, i) : !!o && -1 < Vs(e, t, i) }, p.indexOf = function(e, t, i) { var o = null == e ? 0 : e.length; return o ? (i = null == i ? 0 : I(i), Vs(e, t, i = i < 0 ? v(o + i, 0) : i)) : -1 }, p.inRange = function(e, t, i) { return t = Hr(t), i === jn ? (i = t, t = 0) : i = Hr(i), (e = e = D(e)) >= T(t = t, i = i) && e < v(t, i) }, p.invoke = Jr, p.isArguments = yr, p.isArray = N, p.isArrayBuffer = vr, p.isArrayLike = c, p .isArrayLikeObject = P, p.isBoolean = function(e) { return !0 === e || !1 === e || B(e) && i(e) == Zn }, p.isBuffer = Cr, p.isDate = W, p.isElement = function(e) { return B(e) && 1 === e.nodeType && !xr(e) }, p.isEmpty = function(e) { if (null == e) return !0; if (c(e) && (N(e) || "string" == typeof e || "function" == typeof e.splice || Cr(e) || Mr(e) || yr(e))) return !e.length; var t, i = F(e); if (i == ra || i == ua) return !e.size; if (lo(e)) return !xt(e).length; for (t in e) if (V.call(e, t)) return !1; return !0 }, p.isEqual = function(e, t) { return Tt(e, t) }, p.isEqualWith = function(e, t, i) { var o = (i = "function" == typeof i ? i : jn) ? i(e, t) : jn; return o === jn ? Tt(e, t, jn, i) : !!o }, p.isError = wr, p.isFinite = function(e) { return "number" == typeof e && fe(e) }, p.isFunction = br, p.isInteger = Tr, p.isLength = Sr, p.isMap = Pr, p.isMatch = function(e, t) { return e === t || St(e, t, Ki(t)) }, p.isMatchWith = function(e, t, i) { return i = "function" == typeof i ? i : jn, St(e, t, Ki(t), i) }, p.isNaN = function(e) { return Er(e) && e != +e }, p.isNative = function(e) { if (so(e)) throw new R("Unsupported core-js use. Try https://npms.io/search?q=ponyfill."); return Pt(e) }, p.isNil = function(e) { return null == e }, p.isNull = function(e) { return null === e }, p.isNumber = Er, p.isObject = E, p.isObjectLike = B, p.isPlainObject = xr, p.isRegExp = Ir, p .isSafeInteger = function(e) { return Tr(e) && -Qn <= e && e <= Qn }, p.isSet = Dr, p.isString = Lr, p.isSymbol = x, p.isTypedArray = Mr, p.isUndefined = function(e) { return e === jn }, p.isWeakMap = function(e) { return B(e) && F(e) == ma }, p.isWeakSet = function(e) { return B(e) && "[object WeakSet]" == i(e) }, p.join = function(e, t) { return null == e ? "" : ye.call(e, t) }, p.kebabCase = ln, p.last = o, p.lastIndexOf = function(e, t, i) { var o = null == e ? 0 : e.length; if (!o) return -1; var r = o; if (i !== jn && (r = (r = I(i)) < 0 ? v(o + r, 0) : T(r, o - 1)), t != t) return Hs(e, Fs, r, ! 0); for (var n = e, a = t, s = r + 1; s--;) if (n[s] === a) return s; return s }, p.lowerCase = un, p.lowerFirst = cn, p.lt = Ar, p.lte = Rr, p.max = function(e) { return e && e.length ? lt(e, A, ft) : jn }, p.maxBy = function(e, t) { return e && e.length ? lt(e, h(t, 2), ft) : jn }, p.mean = function(e) { return Gs(e, A) }, p.meanBy = function(e, t) { return Gs(e, h(t, 2)) }, p.min = function(e) { return e && e.length ? lt(e, A, Dt) : jn }, p.minBy = function(e, t) { return e && e.length ? lt(e, h(t, 2), Dt) : jn }, p.stubArray = An, p.stubFalse = Rn, p.stubObject = function() { return {} }, p.stubString = function() { return "" }, p.stubTrue = function() { return !0 }, p.multiply = Gn, p.nth = function(e, t) { return e && e.length ? Ot(e, I(t)) : jn }, p.noConflict = function() { return ms._ === this && (ms._ = Z), this }, p.noop = Pn, p.now = rr, p.pad = function(e, t, i) { e = d(e); var o = (t = I(t)) ? rl(e) : 0; return !t || t <= o ? e : Mi(ge(t = (t - o) / 2), i) + e + Mi(pe(t), i) }, p.padEnd = function(e, t, i) { e = d(e); var o = (t = I(t)) ? rl(e) : 0; return t && o < t ? e + Mi(t - o, i) : e }, p.padStart = function(e, t, i) { e = d(e); var o = (t = I(t)) ? rl(e) : 0; return t && o < t ? Mi(t - o, i) + e : e }, p.parseInt = function(e, t, i) { return t = i || null == t ? 0 : t && +t, we(d(e).replace(Ga, ""), t || 0) }, p.random = function(e, t, i) { var o; return i && "boolean" != typeof i && m(e, t, i) && (t = i = jn), i === jn && ("boolean" == typeof t ? (i = t, t = jn) : "boolean" == typeof e && (i = e, e = jn)), e === jn && t === jn ? (e = 0, t = 1) : (e = Hr(e), t === jn ? (t = e, e = 0) : t = Hr(t)), t < e && ( o = e, e = t, t = o), i || e % 1 || t % 1 ? (o = be(), T(e + o * (t - e + cs("1e-" + (( o + "").length - 1))), t)) : Gt(e, t) }, p.reduce = function(e, t, i) { var o = N(e) ? Ms : Bs, r = arguments.length < 3; return o(e, h(t, 4), i, r, nt) }, p.reduceRight = function(e, t, i) { var o = N(e) ? As : Bs, r = arguments.length < 3; return o(e, h(t, 4), i, r, at) }, p.repeat = function(e, t, i) { return t = (i ? m(e, t, i) : t === jn) ? 1 : I(t), Nt(d(e), t) }, p.replace = function() { var e = arguments, t = d(e[0]); return e.length < 3 ? t : t.replace(e[1], e[2]) }, p.result = function(e, t, i) { var o = -1, r = (t = ai(t, e)).length; for (r || (r = 1, e = jn); ++o < r;) { var n = null == e ? jn : e[To(t[o])]; n === jn && (o = r, n = i), e = br(n) ? n.call(e) : n } return e }, p.round = Nn, p.runInContext = r, p.sample = function(e) { return (N(e) ? We : Bt)(e) }, p.size = function(e) { if (null == e) return 0; if (c(e)) return Lr(e) ? rl(e) : e.length; var t = F(e); return t == ra || t == ua ? e.size : xt(e).length }, p.snakeCase = hn, p.some = function(e, t, i) { return (N(e) ? Rs : Yt)(e, h(t = i && m(e, t, i) ? jn : t, 3)) }, p.sortedIndex = function(e, t) { return Qt(e, t) }, p.sortedIndexBy = function(e, t, i) { return qt(e, t, h(i, 2)) }, p.sortedIndexOf = function(e, t) { var i = null == e ? 0 : e.length; if (i) { var o = Qt(e, t); if (o < i && G(e[o], t)) return o } return -1 }, p.sortedLastIndex = function(e, t) { return Qt(e, t, !0) }, p.sortedLastIndexBy = function(e, t, i) { return qt(e, t, h(i, 2), !0) }, p.sortedLastIndexOf = function(e, t) { if (null == e ? 0 : e.length) { var i = Qt(e, t, !0) - 1; if (G(e[i], t)) return i } return -1 }, p.startCase = mn, p.startsWith = function(e, t, i) { return e = d(e), i = null == i ? 0 : tt(I(i), 0, e.length), t = u(t), e.slice(i, i + t .length) == t }, p.subtract = Bn, p.sum = function(e) { return e && e.length ? js(e, A) : 0 }, p.sumBy = function(e, t) { return e && e.length ? js(e, h(t, 2)) : 0 }, p.template = function(a, e, t) { var s, l, i = p.templateSettings; t && m(a, e, t) && (e = jn), a = d(a), e = Nr({}, e, i, Ni); var o = L(t = Nr({}, e.imports, i.imports, Ni)), r = Ys(t, o), u = 0, i = e.interpolate || es, c = "__p += '", t = j((e.escape || es).source + "|" + i.source + "|" + (i === Ra ? Ya : es).source + "|" + ( e.evaluate || es).source + "|$", "g"), n = "//# sourceURL=" + (V.call(e, "sourceURL") ? (e.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++ss + "]") + "\n"; if (a.replace(t, function(e, t, i, o, r, n) { return i = i || o, c += a.slice(u, n).replace(ts, $s), t && (s = !0, c += "' +\n__e(" + t + ") +\n'"), r && (l = !0, c += "';\n" + r + ";\n__p += '"), i && (c += "' +\n((__t = (" + i + ")) == null ? '' : __t) +\n'"), u = n + e .length, e }), c += "';\n", i = V.call(e, "variable") && e.variable) { if (Ua.test(i)) throw new R("Invalid `variable` option passed into `_.template`") } else c = "with (obj) {\n" + c + "\n}\n"; if (c = (l ? c.replace(Sa, "") : c).replace(Pa, "$1").replace(Ea, "$1;"), c = "function(" + ( i || "obj") + ") {\n" + (i ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (s ? ", __e = _.escape" : "") + (l ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + c + "return __p\n}", (t = _n(function() { return O(o, n + "return " + c).apply(jn, r) })).source = c, wr(t)) throw t; return t }, p.times = function(e, t) { if ((e = I(e)) < 1 || Qn < e) return []; for (var i = Jn, o = T(e, Jn), o = (t = h(t), e -= Jn, zs(o, t)); ++i < e;) t(i); return o }, p.toFinite = Hr, p.toInteger = I, p.toLength = Vr, p.toLower = function(e) { return d(e).toLowerCase() }, p.toNumber = D, p.toSafeInteger = function(e) { return e ? tt(I(e), -Qn, Qn) : 0 === e ? e : 0 }, p.toString = d, p.toUpper = function(e) { return d(e).toUpperCase() }, p.trim = function(e, t, i) { return (e = d(e)) && (i || t === jn) ? Us(e) : e && (t = u(t)) ? (i = nl(e), e = nl(t), li(i, qs(i, e), Js(i, e) + 1).join("")) : e }, p.trimEnd = function(e, t, i) { return (e = d(e)) && (i || t === jn) ? e.slice(0, al(e) + 1) : e && (t = u(t)) ? li(i = nl(e), 0, Js(i, nl(t)) + 1).join("") : e }, p.trimStart = function(e, t, i) { return (e = d(e)) && (i || t === jn) ? e.replace(Ga, "") : e && (t = u(t)) ? li(i = nl(e), qs(i, nl(t))).join("") : e }, p.truncate = function(e, t) { var i, o = 30, r = "...", t = (E(t) && (i = "separator" in t ? t.separator : i, o = "length" in t ? I(t.length) : o, r = "omission" in t ? u(t.omission) : r), (e = d(e)).length); if ((t = Zs(e) ? (n = nl(e)).length : t) <= o) return e; if ((t = o - rl(r)) < 1) return r; var n, o = n ? li(n, 0, t).join("") : e.slice(0, t); if (i === jn) return o + r; if (n && (t += o.length - t), Ir(i)) { if (e.slice(t).search(i)) { var a, s = o; for ((i = i.global ? i : j(i.source, d(Qa.exec(i)) + "g")).lastIndex = 0; a = i.exec( s);) var l = a.index; o = o.slice(0, l === jn ? t : l) } } else e.indexOf(u(i), t) == t || -1 < (n = o.lastIndexOf(i)) && (o = o.slice(0, n)); return o + r }, p.unescape = function(e) { return (e = d(e)) && Da.test(e) ? e.replace(xa, sl) : e }, p.uniqueId = function(e) { var t = ++J; return d(e) + t }, p.upperCase = dn, p.upperFirst = pn, p.each = Xo, p.eachRight = Ko, p.first = Do, Sn(p, (Fn = {}, mt(p, function(e, t) { V.call(p.prototype, t) || (Fn[t] = e) }), Fn), { chain: !1 }), p.VERSION = "4.17.21", Ts(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(e) { p[e].placeholder = p }), Ts(["drop", "take"], function(i, o) { C.prototype[i] = function(e) { e = e === jn ? 1 : v(I(e), 0); var t = this.__filtered__ && !o ? new C(this) : this.clone(); return t.__filtered__ ? t.__takeCount__ = T(e, t.__takeCount__) : t.__views__.push({ size: T(e, Jn), type: i + (t.__dir__ < 0 ? "Right" : "") }), t }, C.prototype[i + "Right"] = function(e) { return this.reverse()[i](e).reverse() } }), Ts(["filter", "map", "takeWhile"], function(e, t) { var i = t + 1, o = 1 == i || 3 == i; C.prototype[e] = function(e) { var t = this.clone(); return t.__iteratees__.push({ iteratee: h(e, 3), type: i }), t.__filtered__ = t.__filtered__ || o, t } }), Ts(["head", "last"], function(e, t) { var i = "take" + (t ? "Right" : ""); C.prototype[e] = function() { return this[i](1).value()[0] } }), Ts(["initial", "tail"], function(e, t) { var i = "drop" + (t ? "" : "Right"); C.prototype[e] = function() { return this.__filtered__ ? new C(this) : this[i](1) } }), C.prototype.compact = function() { return this.filter(A) }, C.prototype.find = function(e) { return this.filter(e).head() }, C.prototype.findLast = function(e) { return this.reverse().find(e) }, C.prototype.invokeMap = a(function(t, i) { return "function" == typeof t ? new C(this) : this.map(function(e) { return wt(e, t, i) }) }), C.prototype.reject = function(e) { return this.filter(mr(h(e))) }, C.prototype.slice = function(e, t) { e = I(e); var i = this; return i.__filtered__ && (0 < e || t < 0) ? new C(i) : (e < 0 ? i = i.takeRight(-e) : e && (i = i.drop(e)), t !== jn ? (t = I(t)) < 0 ? i.dropRight(-t) : i.take(t - e) : i) }, C.prototype.takeRightWhile = function(e) { return this.reverse().takeWhile(e).reverse() }, C.prototype.toArray = function() { return this.take(Jn) }, mt(C.prototype, function(u, e) { var c = /^(?:filter|find|map|reject)|While$/.test(e), h = /^(?:head|last)$/.test(e), m = p[h ? "take" + ("last" == e ? "Right" : "") : e], d = h || /^find/.test(e); m && (p.prototype[e] = function() { function e(e) { return e = m.apply(p, Ls([e], o)), h && s ? e[0] : e } var t, i = this.__wrapped__, o = h ? [1] : arguments, r = i instanceof C, n = o[0], a = r || N(i), s = (a && c && "function" == typeof n && 1 != n.length && (r = a = !1), this .__chain__), n = !!this.__actions__.length, l = d && !s, r = r && !n; return !d && a ? (i = r ? i : new C(this), (t = u.apply(i, o)).__actions__ .push({ func: Wo, args: [e], thisArg: jn }), new f(t, s)) : l && r ? u.apply(this, o) : (t = this.thru(e), l ? h ? t .value()[0] : t.value() : t) }) }), Ts(["pop", "push", "shift", "sort", "splice", "unshift"], function(e) { var i = U[e], o = /^(?:push|sort|unshift)$/.test(e) ? "tap" : "thru", r = /^(?:pop|shift)$/.test(e); p.prototype[e] = function() { var e, t = arguments; return r && !this.__chain__ ? (e = this.value(), i.apply(N(e) ? e : [], t)) : this[ o](function(e) { return i.apply(N(e) ? e : [], t) }) } }), mt(C.prototype, function(e, t) { var i, o = p[t]; o && (i = o.name + "", V.call(De, i) || (De[i] = []), De[i].push({ name: t, func: o })) }), De[xi(jn, 2).name] = [{ name: "wrapper", func: jn }], C.prototype.clone = function() { var e = new C(this.__wrapped__); return e.__actions__ = S(this.__actions__), e.__dir__ = this.__dir__, e.__filtered__ = this .__filtered__, e.__iteratees__ = S(this.__iteratees__), e.__takeCount__ = this .__takeCount__, e.__views__ = S(this.__views__), e }, C.prototype.reverse = function() { var e; return this.__filtered__ ? ((e = new C(this)).__dir__ = -1, e.__filtered__ = !0) : (e = this .clone()).__dir__ *= -1, e }, C.prototype.value = function() { var e = this.__wrapped__.value(), t = this.__dir__, i = N(e), o = t < 0, r = i ? e.length : 0, n = function(e, t, i) { var o = -1, r = i.length; for (; ++o < r;) { var n = i[o], a = n.size; switch (n.type) { case "drop": e += a; break; case "dropRight": t -= a; break; case "take": t = T(t, e + a); break; case "takeRight": e = v(e, t - a) } } return { start: e, end: t } }(0, r, this.__views__), a = n.start, s = (n = n.end) - a, l = o ? n : a - 1, u = this.__iteratees__, c = u.length, h = 0, m = T(s, this.__takeCount__); if (!i || !o && r == s && m == s) return ti(e, this.__actions__); var d = []; e: for (; s-- && h < m;) { for (var p = -1, g = e[l += t]; ++p < c;) { var _ = u[p], f = _.iteratee, _ = _.type, f = f(g); if (2 == _) g = f; else if (!f) { if (1 == _) continue e; break e } } d[h++] = g } return d }, p.prototype.at = Yo, p.prototype.chain = function() { return Uo(this) }, p.prototype.commit = function() { return new f(this.value(), this.__chain__) }, p.prototype.next = function() { this.__values__ === jn && (this.__values__ = Or(this.value())); var e = this.__index__ >= this.__values__.length; return { done: e, value: e ? jn : this.__values__[this.__index__++] } }, p.prototype.plant = function(e) { for (var t, i = this; i instanceof Ge;) var o = Po(i), r = (o.__index__ = 0, o.__values__ = jn, t ? r.__wrapped__ = o : t = o, o), i = i.__wrapped__; return r.__wrapped__ = e, t }, p.prototype.reverse = function() { var e = this.__wrapped__; return e instanceof C ? (e = e, (e = (e = this.__actions__.length ? new C(this) : e).reverse()) .__actions__.push({ func: Wo, args: [Ao], thisArg: jn }), new f(e, this.__chain__)) : this.thru(Ao) }, p.prototype.toJSON = p.prototype.valueOf = p.prototype.value = function() { return ti(this.__wrapped__, this.__actions__) }, p.prototype.first = p.prototype.head, le && (p.prototype[le] = function() { return this }), p }(), V = { Source: [], TempSource: [], entity: [], lastSelectEntity: null, pointsId: [], states: 0, PointSelectSource: [], currentObj: null, selectedItem: null, setSource: function(e) { this.Source = e }, setTempSource: function(e) { this.TempSource = e }, setPointSelectSource: function(e) { this.PointSelectSource = e }, getSource: function() { return this.Source }, getTempSource: function() { return this.TempSource }, getPointSelectSource: function() { return this.PointSelectSource }, push: function(e) { this.Source.push(e) }, pusTemSource: function(e) { this.TempSource.push(e) }, pusPointSelectSource: function(e) { this.PointSelectSource.push(e) }, insertGroupId: function(e, t) { null != e.checked && "true" != e.checked && null != e.checked || (e.checked = !0); try { 0 == e.item.item.show && (e.checked = !1) } catch (e) {} var i = this.getSourceById(V.Source, t); if (i) { for (var o = 0, r = this.TempSource.length; o < r; o++) if (this.TempSource[o].id == t) { e.checked && !this.TempSource[o].checked && (this.TempSource[o].checked = !0); break } i.children || (i.children = []), i.children.push(e) } else this.push(e); i = y.clone(e); return i.item = null, V.currentObj = i, this.pusTemSource(i), e.id }, getSourceById: function(e, t) { if (e) for (var i = 0; i < e.length; i++) { if (e[i].id == t) return e[i]; if (e[i] && e[i].children && 0 < e[i].children.length) { var o = this.getSourceById(e[i].children, t); if (null != o) return o } } }, exitsGroup: function(e, t) { if (e) for (var i = V.Source, o = 0; o < i.length; o++) { if (i[o].id == e) { if ("group" == i[o].type) for (var r = 0; r < i[o].children.length; r++) if (i[o].children[r].name == t) return !0; return !1 } i[o] && i[o].children && 0 < i[o].children.length && this.getSourceById(i[o].children, e) } }, getTempSourceById: function(e) { for (var t = 0; t < this.TempSource.length; t++) if (this.TempSource[t].id == e) return this.TempSource[t] }, getPointSelectSourceById: function(e) { for (var t = 0; t < this.PointSelectSource.length; t++) if (this.PointSelectSource[t].id == e) return this.PointSelectSource[t] }, getSourceByName: function(e, t) { return y.find(e, function(e) { return e.name == t }) }, delete: function(e, t, i) { var o = this.getSourceById(V.Source, e); if (o && o.children && 0 < o.children.length) { for (; 0 < o.children.length;) this.delete(o.children[0].id); if (o && "group" == o.type) 0 == o.pId || "" == o.pId ? (a = this.getIndex(V.Source, o), V .Source.splice(a, 1)) : (n = this.getSourceById(V.Source, o.pId), a = this.getIndex( n.children, o), n.children.splice(a, 1)), this.delete1(o.id); else { if (o.item) o.item.deleteObject(e); else { try { t.entities.removeById(o.id) } catch (e) {} try { (r = t.dataSources.get(o.id)) && t.dataSources.remove(r) } catch (e) {} try { (r = t.imageryLayers.get(o.id)) && t.imageryLayers.remove(r) } catch (e) {} try { var r = t.scene.primitives.get(o.id); t.scene.primitives.remove(r) } catch (e) {} } var n = this.getSourceById(V.Source, o.pId), a = this.getIndex(n.children, o); n.children.splice(a, 1), this.delete1(o.id) } } else if (o && "group" == o.type) 0 == o.pId || "" == o.pId ? (a = this.getIndex(V.Source, o), V.Source.splice(a, 1)) : (n = this.getSourceById(V.Source, o.pId), a = this.getIndex(n .children, o), n.children.splice(a, 1)), this.delete1(o.id); else if (o) { if (o.item && o.item.deleteObject) o.item.deleteObject(e); else { try { t.entities.removeById(o.id) } catch (e) {} try { (r = t.dataSources.get(o.id)) && t.dataSources.remove(r) } catch (e) {} try { (r = t.imageryLayers.get(o.id)) && t.imageryLayers.remove(r) } catch (e) {} try { r = t.scene.primitives.get(o.id); t.scene.primitives.remove(r) } catch (e) {} } this.delete1(o.id), (n = this.getSourceById(V.Source, o.pId)) && (a = this.getIndex(n .children, o), n.children.splice(a, 1)) } }, temporaryItem: { obj: [], state: "start", operation: "" }, endtemporaryItem: function() { V.temporaryItem.obj = [], V.temporaryItem.state = "end", V.temporaryItem.operation = "" }, starttemporaryItem: function(e) { var t = null; try { t = document.getElementById("toolTip") } catch (e) {} if (null != t && (t.style.display = "none"), null != V.handler && (V.handler.destroy(), V .handler = null), 0 < V.temporaryItem.obj.length && "start" == V.temporaryItem.state) for (var i = 0; i < V.temporaryItem.obj.length; i++) { try { V.temporaryItem.obj[i].destroy() } catch (e) {} try { e.entities.remove(V.temporaryItem.obj[i]) } catch (e) {} } return V.temporaryItem.obj = [], V.temporaryItem.state = "start", V.temporaryItem.operation }, delete1: function(e) { for (var t = 0; t < this.TempSource.length; t++) this.TempSource[t].id == e && this.TempSource .splice(t, 1) }, getIndex: function(e, t) { for (var i = 0; i < e.length; i++) if (e[i].id == t.id) return i; return -1 }, setVisibilityTemp: function(t, e) { var i = y.filter(this.TempSource, function(e) { return e.id == t }); i && i.length && (i[0].checked = e) }, setVisibility: function(e, t, i, o) { this.setVisibilityTemp(e, t); var r = this.getSourceById(V.Source, e); if (r) if (r.children && 0 < r.children.length) { for (var n, a = 0; a < r.children.length; a++) this.setVisibility(r.children[a].id, t); if ("group" != r.type) if (r.item && r.item.setVisibility) r.item.setVisibility(t, e); else { try { (n = i.entities.getById(r.id)) && (n.show = t) } catch (e) {} try { (n = i.dataSources.get(r.id)) && (n.show = t) } catch (e) {} try { (n = i.imageryLayers.get(r.id)) && (n.show = t) } catch (e) {} try { (n = i.scene.primitives.get(r.id)) && (n.show = t) } catch (e) {} } } else if ("group" != r.type) if (r.item && r.item.setVisibility) r.item.setVisibility(t, e); else { try { (n = i.entities.getById(r.id)) && (n.show = t) } catch (e) {} try { (n = i.dataSources.get(r.id)) && (n.show = t) } catch (e) {} try { (n = i.imageryLayers.get(r.id)) && (n.show = t) } catch (e) {} try { (n = i.scene.primitives.get(r.id)) && (n.show = t) } catch (e) {} } }, removeItem: function(e) { if (e) for (var t = 0; t < e.length; t++) e[t].item = null, e[t].children && this.removeItem(e[t] .children); return e }, changeGroup: function(e, t) { var i, o, r = this.getSourceById(this.Source, e), n = this.getSourceById(this.Source, t); r && n && n.children && (0 == r.id || null == r.id || null == r.id ? (o = this.getIndex(this .Source, r), this.Source.splice(o, 1)) : (i = this.getSourceById(this.Source, r .pId), o = this.getIndex(i.children, r), i.children.splice(o, 1)), r.pId = t, n .children.push(r)), (r = this.getTempSourceById(e)) && (r.pId = t) }, handler: null, removeHandler: function() { V.handler && (V.handler.destroy(), V.handler = null) } }, Xe = 1e-5 * Math.PI / 180; function Ke(e, t) { Je = t, this._cesium = t, this._viewer = e, this._core = new f, this._polylines = [], this._points = [], this._tree = V, this._interval = 20 } function $e(e) { this._viewer = e, this._core = new f, this.tooltip = this._core.CreateTooltip({ id: "ModelEdit" }) } function Ze(e) { this._viewer = e, this._core = new f, this._tree = V } function et(e, t) { this._viewer = e, this._cesium = t, this._core = new f } function tt(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function it(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource(), this._core = new f } Ke.prototype.createlineOfSight = function(n, r) { var a = this, s = (this._tree.starttemporaryItem(this._viewer), []), l = [], u = { polyline: [] }, c = (this._tree.removeHandler(), this._core.CreateTooltip()), h = (a.objectsToExclude = null, void 0), m = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), e.prototype ._init = function() { var e = this; this.options.polyline.positions = new a._cesium.CallbackProperty(function() { return e.positionsp }, !1), this.polyline = a._viewer.entities.add(this.options), a.item = this.polyline, a ._tree.temporaryItem.obj.push(this.polyline), l.push(this.polyline) }, e); function e(e) { this.options = { polyline: { show: !0, positions: [], material: a._cesium.Color.YELLOW, width: 3, clampToGround: !1 } }, this.positionsp = e, this._init() } this._tree.handler = new a._cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas); var d = [], p = void 0; if (0 < this._points.length) for (var t = 0; t < this._points.length; t++) this._viewer.entities.remove(this._points[t]); var g = [], _ = (this._tree.handler.setInputAction(function(e) { var t, i, o, r = a._viewer.camera.getPickRay(e.position), r = a._viewer.scene.globe.pick(r, a._viewer.scene); a._viewer.scene.pick(e.position) && (i = a._viewer.scene.pickPosition(e.position)) && ( r = i), r && (0 === d.length ? (d.push(r.clone(), r.clone()), t = { leftX: e.position.x, leftY: e.position.y }, g.push(t), h = r.clone()) : (t = { rightX: e.position.x, rightY: e.position.y }, g.push(t), i = { postion: d, entity: l, cartesian: g }, s.push(i), g = [], p = void 0, d = [], r = h.clone(), null != n.height && (e = ellipsoid.cartesianToCartographic(h.clone()), t = Je.Math.toDegrees( cartograhphic.latitude), i = Je.Math.toDegrees(cartograhpinc .longitude), o = n.height, e = Je.Cartographic.fromDegrees(i, t, o), r = ellipsoid.cartographicToCartesian(e)), d.push(r), d.push(r), p = new m(d))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function( e) { var t, i = a._viewer.camera.getPickRay(e.endPosition), i = a._viewer.scene.globe.pick(i, a._viewer.scene); a._viewer.scene.pick(e.endPosition) && (t = a._viewer.scene.pickPosition(e .endPosition)) && (i = t), i && (0 === d.length ? c.showAt(e.endPosition, "点击添加视点") : c.showAt(e.endPosition, "点击添加目标视点,右键结束"), 2 <= d.length && (a ._cesium.defined(p) ? null != i && (d.pop(), d.push(i)) : p = new m(d))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), f = 0; return this._tree.handler.setInputAction(function(e) { a.end && a.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { if (c.show(!1), this.end = void 0, a._core.mouse(a._viewer.container, 0), a._tree .endtemporaryItem(), a._tree.handler.destroy(), "cancel" === e) for (var t = 0; t < l.length; t++) a._viewer.entities.remove(l[t]); else { for (var i, o = 0; o < s.length; o++) i = (0 == o ? (_ = s[o].cartesian[0].leftX, f = s[o] .cartesian[0].leftY, a.tsjx(s[o].postion, _, f, s[o].cartesian[1].rightX, s[o] .cartesian[1].rightY, 50, l, a._cesium, a._viewer)) : a.tsjx(s[o].postion, _, f, s[o].cartesian[0].rightX, s[o].cartesian[0].rightY, 50, l, a._cesium, a ._viewer)) ? a._viewer.entities.add({ name: "polyline1", polyline: { positions: s[o].postion, width: 3, material: a._cesium.Color.GREEN } }) : a._viewer.entities.add({ name: "polyline1", polyline: { positions: s[o].postion, width: 3, material: a._cesium.Color.RED } }), u.polyline.push(i); d.pop(), a._polylines = u.polyline, a._tree.handler.destroy(); for (t = 0; t < l.length; t++) a._viewer.entities.remove(l[t]); "" != r && null != r && "function" == typeof r && r(u) } }, this }, Ke.prototype.tsjx = function(e, t, i, o, r, n, a, s, l) { for (var u = this._core.getSpaceDistancem(e, s), u = (u <= 100 && 10 <= u ? n = parseInt(u / 2) : u < 10 && 0 < u ? n = parseInt(+u) : 100 < u && (n = parseInt(u / 10)), e[0]), e = e[e.length - 1], u = s.Cartographic.fromCartesian(u), c = s.Math.toDegrees(u.longitude), h = s.Math .toDegrees(u.latitude), m = (u.height, u.height), u = s.Cartographic.fromCartesian(e), e = s .Math.toDegrees(u.longitude), d = s.Math.toDegrees(u.latitude), u = (u.height, u.height), p = n, g = s.Math.lerp(c, e, 1 / p) - c, _ = s.Math.lerp(h, d, 1 / p) - h, f = s.Math.lerp(m, u, 1 / p) - m, y = (s.Math.lerp(t, o, 1 / p), s.Math.lerp(i, r, 1 / p), !0), v = 0; v < p - 2; v++) { var C = m + (v + 1) * f, w = s.Cartesian3.fromDegrees(c + (v + 1) * g, h + (v + 1) * _, C), w = s.Cartographic.fromCartesian(w), b = l.scene.globe.getHeight(w), w = l.scene.sampleHeight(w, a); if (w && (b = w), b = parseFloat(b.toFixed(1)), (C = parseFloat(C.toFixed(1))) < b) return y = !1 } return y }, Ke.prototype.deleteObject = function() { if (0 < this._points.length) { this.objectsToExclude = null; for (var e = 0; e < this._points.length; e++) this._viewer.entities.remove(this._points[e]) } }, Ke.prototype.InterpolateLineCartographic = function(e, t, i) { if (!e || !t) return null; if (!(e.longitude && e.latitude && t.longitude && t.latitude)) return null; var o = [], r = (o.push(new Je.Cartographic(e.longitude, e.latitude)), Math.sqrt(Math.pow(t.longitude - e .longitude, 2) + Math.pow(t.latitude - e.latitude, 2))), i = i && "number" == typeof i ? i : Xe; if (r <= i) return o.push(new Je.Cartographic(t.longitude, t.latitude)), o; for (var n = r / i, a = (t.longitude - e.longitude) / n, s = (t.latitude - e.latitude) / n, l = 0; l < n; l++) { var u = e.longitude + (l + 1) * a, c = e.latitude + (l + 1) * s; o.push(new Je.Cartographic(u, c)) } return o.push(new Je.Cartographic(t.longitude, t.latitude, t.height)), o }, Ke.prototype.InterpolateLineCartographicxp = function(e, t, i) { if (!e || !t) return null; if (!(e.longitude && e.latitude && t.longitude && t.latitude)) return null; var o = [], r = (o.push(new Je.Cartographic(e.longitude, e.latitude)), Math.sqrt(Math.pow(t.longitude - e .longitude, 2) + Math.pow(t.latitude - e.latitude, 2))), i = i && "number" == typeof i ? i : Xe; if (r <= i) return o.push(new Je.Cartographic(t.longitude, t.latitude)), o; for (var n = r / i, a = (t.longitude - e.longitude) / n, s = (t.latitude - e.latitude) / n, l = (t .height - e.height) / n, u = 0; u < n; u++) { var c = e.longitude + (u + 1) * a, h = e.latitude + (u + 1) * s, m = e.height + l * (u + 1); o.push(new Je.Cartographic(c, h, m)) } return o.push(new Je.Cartographic(t.longitude, t.latitude, t.height)), o }, Ke.prototype.InterpolateLineHeightCartographic = function(e, t) { if (!e || !t) return null; if (!(e.longitude && e.latitude && t.longitude && t.latitude)) return null; var i = [], o = (i.push(new Je.Cartographic(e.longitude, e.latitude, e.height)), Math.sqrt(Math.pow(t .longitude - e.longitude, 2) + Math.pow(t.latitude - e.latitude, 2))); if (o <= Xe) return i.push(new Je.Cartographic(t.longitude, t.latitude, t.height)), i; for (var r = o / Xe, n = (t.longitude - e.longitude) / r, a = (t.latitude - e.latitude) / r, s = (t .height - e.height) / r, l = 0; l < r; l++) { var u = e.longitude + (l + 1) * n, c = e.latitude + (l + 1) * a, h = e.height + (l + 1) * s; i.push(new Je.Cartographic(u, c, h)) } return i.push(new Je.Cartographic(t.longitude, t.latitude, t.height)), i }, Ke.prototype.InterpolateIndexLineHeightCartographic = function(e, t, i, o) { if (!e || !t) return null; if (!(e.longitude && e.latitude && t.longitude && t.latitude)) return null; var r = (t.longitude - e.longitude) / i, n = (t.latitude - e.latitude) / i, t = (t.height - e.height) / i, i = e.longitude + o * r, r = e.latitude + o * n, n = e.height + o * t; return new Je.Cartographic(i, r, n) }, Ke.prototype.InterpolateIndexLineHeightCartographicxp = function(e, t, i, o) { if (!e || !t) return null; if (!(e.longitude && e.latitude && t.longitude && t.latitude)) return null; var r = (t.longitude - e.longitude) / i, n = (t.latitude - e.latitude) / i, t = (t.height - e.height) / i, i = e.longitude + o * r, r = e.latitude + o * n, n = e.height + o * t; return new Je.Cartographic(i, r, n) }, Ke.prototype.Interpolate2IndexLineHeightCartographic = function(e, t, i, o) { if (!e || !t) return null; if (!(e.longitude && e.latitude && t.longitude && t.latitude)) return null; for (var r = [], n = (r.push(new Je.Cartographic(e.longitude, e.latitude, e.height)), (t.longitude - e .longitude) / i), a = (t.latitude - e.latitude) / i, s = (t.height - e.height) / i, l = 0; l < o; l++) { var u = e.longitude + (l + 1) * n, c = e.latitude + (l + 1) * a, h = e.height + (l + 1) * s; r.push(new Je.Cartographic(u, c, h)) } return r }, Ke.prototype.CartographicPointsTerrainData = function(e, t) { e.length && 0 < e.length && (e = Je.sampleTerrain(this._viewer.terrainProvider, 11, e), Je.when(e, function(e) { t(e) })) }, Ke.prototype.setVisibility = function(e) { if (0 < this._polylines.length) for (var t = 0; t < this._polylines.length; t++) this._polylines[t].show = e }, Ke.prototype.deleteObject = function() { if (0 < this._polylines.length) for (var e = 0; e < this._polylines.length; e++) this._viewer.entities.remove(this._polylines[e]) }, Object.defineProperties(Ke.prototype, { sight: { get: function() { return this.item.sight }, set: function(e) { this.item.sight = sight } } }), $e.prototype.start = function(t, e = {}) { if (this.end(), t) { var i, o = this._viewer.scene.primitives._primitives.findIndex(e => e.id && e.id.id === t.id); if (!(o < 0)) return o = 2 * this._viewer.scene.primitives.get(o).boundingSphere.radius / 3.63, i = Cesium.Transforms.eastNorthUpToFixedFrame(t.position.getValue()), (this.model = t) .heading || (t.heading = 0), t.pitch || (t.pitch = 0), t.roll || (t.roll = 0), this.axis = this._viewer.scene.primitives.add(Cesium.Model.fromGltf({ id: "modeEditAxis", modelMatrix: i, url: window.SmartEarthRootUrl + D.modelAxis, scale: o, minimumPixelSize: e.minimumPixelSize })), this.initEvent(), this } }, $e.prototype.initEvent = function() { this.editHandler && this.editHandler.destroy(), this.editHandler = new Cesium.ScreenSpaceEventHandler( this._viewer.scene.canvas); let i, o; this.editHandler.setInputAction(e => { i ? (o = e.position, this.originPosition = this.model.position.getValue(), this .originHeading = this.model.heading || 0, this.originPitch = this.model.pitch || 0, this.originRoll = this.model.roll || 0, this.startPosition = this._viewer.scene .pickPosition(o), this.defaultEvent(!1), this.setMouseStyle("edit")) : o = void 0 }, Cesium.ScreenSpaceEventType.LEFT_DOWN), this.editHandler.setInputAction(e => { o = void 0, this.defaultEvent(!0), this.setMouseStyle("default") }, Cesium.ScreenSpaceEventType.LEFT_UP), this.editHandler.setInputAction(e => { if (o) return this.mouseTooltip(i, e), void this.edit(i, o, e.endPosition); var t = this._viewer.scene.pick(e.endPosition); i = t && "modeEditAxis" === t.id ? "XArrow_1" === t.mesh.name ? "y" : "YArrow_1" === t.mesh .name ? "x" : "ZArrow_1" === t.mesh.name ? "z" : "ZAxis_1" === t.mesh.name ? "heading" : "XAxis_1" === t.mesh.name ? "pitch" : "YAxis_1" === t.mesh.name ? "roll" : void 0 : void 0, this.mouseTooltip(i, e) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) }, $e.prototype.defaultEvent = function(e) { let t = this._viewer.scene; t.screenSpaceCameraController.enableRotate = e, t.screenSpaceCameraController.enableTranslate = e, t .screenSpaceCameraController.enableZoom = e, t.screenSpaceCameraController.enableTilt = e, t .screenSpaceCameraController.enableLook = e }, $e.prototype.setMouseStyle = function(e) { "edit" === e ? (this.defaultMouseStyle = this._viewer.container.style.cursor, this._viewer.container .style.cursor = "crosshair") : "default" === e && (this._viewer.container.style.cursor = this .defaultMouseStyle || "default") }, $e.prototype.edit = function(i, o, r) { if (i) { var n = this.originPosition, a = this.startPosition; let t = this._core.toDegrees(n); var a = this._core.toDegrees(a), n = this._viewer.scene.cartesianToCanvasCoordinates(n), s = r.x - o.x, l = r.y - o.y; let e; if ("x" === i) { var u = s * (a.lon - t.lon) / (o.x - n.x); t.lon += u, e = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height), this.model.position = e, this.axis.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(e) } else if ("y" === i) { u = s * (a.lat - t.lat) / (o.x - n.x); t.lat += u, e = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height), this.model.position = e, this.axis.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(e) } else if ("z" === i) { s = a.height - t.height, u = l * Math.abs(s / (o.y - n.y)); t.height -= u, e = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height), this.model.position = e, this.axis.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(e), window .SmartEarthPopupData && window.SmartEarthPopupData.window && SmartEarthPopupData.window .document.querySelector('.model input[name="height"]') && (SmartEarthPopupData.window .document.querySelector('.model input[name="height"]').value = t.height.toFixed(2)) } else if ("heading" === i) { l = this.originHeading, s = this._core.arge(n, o, r, "+-", !0); this.setRotate("heading", l -= s), window.SmartEarthPopupData && window.SmartEarthPopupData .window && SmartEarthPopupData.window.document.querySelector( '.model input[name="heading"]') && (SmartEarthPopupData.window.document.querySelector( '.model input[name="heading"]').value = l) } else if ("pitch" === i) { u = (a.lon - t.lon) / (o.x - n.x); let e = this.originPitch; s = this._core.arge(n, o, r, "+-", !0); 0 < u ? e += s : e -= s, this.setRotate("pitch", e), window.SmartEarthPopupData && window .SmartEarthPopupData.window && SmartEarthPopupData.window.document.querySelector( '.model input[name="pitch"]') && (SmartEarthPopupData.window.document.querySelector( '.model input[name="pitch"]').value = e) } else if ("roll" === i) { l = (a.lat - t.lat) / (o.x - n.x); let e = this.originRoll; u = this._core.arge(n, o, r, "+-", !0); l < 0 ? e -= u : e += u, this.setRotate("roll", e), window.SmartEarthPopupData && window .SmartEarthPopupData.window && SmartEarthPopupData.window.document.querySelector( '.model input[name="roll"]') && (SmartEarthPopupData.window.document.querySelector( '.model input[name="roll"]').value = e) } } }, $e.prototype.setRotate = function(o, r) { if (this.model) { let e = this.model.heading, t = this.model.pitch, i = this.model.roll; "heading" === o ? this.model.heading = e = r : "pitch" === o ? this.model.pitch = t = r : "roll" === o && (this.model.roll = i = r), this.model.orientation = Cesium.Transforms .headingPitchRollQuaternion(this.model.position.getValue(), new Cesium.HeadingPitchRoll(Cesium .Math.toRadians(e), Cesium.Math.toRadians(t), Cesium.Math.toRadians(i))) } }, $e.prototype.mouseTooltip = function(e, t) { e ? (t = t.endPosition || t.position, "x" === e ? this.tooltip.showAt(t, "X方向平移") : "y" === e ? this .tooltip.showAt(t, "Y方向平移") : "z" === e ? this.tooltip.showAt(t, "Z方向平移") : "heading" === e ? this.tooltip.showAt(t, "绕Z轴旋转") : "pitch" === e ? this.tooltip.showAt(t, "绕Y轴旋转") : "roll" === e ? this.tooltip.showAt(t, "绕X轴旋转") : this.tooltip.show(!1)) : this.tooltip.show(!1) }, $e.prototype.end = function() { this.axis && this._viewer.scene.primitives.remove(this.axis), this.axis = void 0, this.editHandler && this.editHandler.destroy(), this.editHandler = void 0, this.model && (this.model.ModelEdit = void 0), this.model = void 0, this.tooltip && this.tooltip.show(!1) }, Ze.prototype.createDivPoint = function(e, t, i = {}) { var o, r = i.id || "DivPoint" + this._core.getuid(), t = (Array.isArray(t) ? 2 === t.length ? o = Cesium.Cartesian3.fromDegrees(t[0], t[1]) : 3 === t .length && (o = Cesium.Cartesian3.fromDegrees(t[0], t[1], t[2])) : t.x && t.y ? o = t instanceof Cesium.Cartesian3 ? t : Cesium.Cartesian3.fromDegrees(t.x, t.y, t.z) : t.lon && t .lat && (o = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height)), this.item = { id: r, show: !0, name: e, type: "default", offset: "l", position: o }, Object.assign(this.item, i), this._viewer.clock.onTick.addEventListener(this .updateDivPointEvent, this), { id: this.item.id, name: e, pId: i.GroupID || 0, type: "DivPoint", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, t.pId), this }, Ze.prototype.updateDivPointEvent = function() { if (this.item) { let o = this.item, r = document.getElementById(o.id), t = !1; if (o.show) { var n = this._viewer.scene.mapProjection.ellipsoid, i = this._viewer.scene.camera.positionWC; let e = new Cesium.EllipsoidalOccluder(n, i); e.isPointVisible(o.position) ? void 0 !== o.near || void 0 !== o.far ? (n = this._core .getPointToCameraDistance(this._viewer, o.position), i = o.near || 0, a = o.far || 1 / 0, i <= n && n <= a ? (r && (r.style.display = "block"), t = !0) : r && (r.style .display = "none")) : (r && (r.style.display = "block"), t = !0) : r && (r.style .display = "none"), e = void 0 } else r && (r.style.display = "none"); if (t) { i = this._viewer.scene.cartesianToCanvasCoordinates(o.position); if (!i) return; if (o.name || (o.name = "SmartEarth"), !r) { let i; if ("default" === o.type) if (o.description) { let e = o.description; n = this._core.isDOM(e); n && (e = ""); let t = ""; Array.isArray(e) ? e.forEach(e => { t += '
' + e + "
" }) : t = '
' + e + "
", i = `
${o.name}
${t}
`, $(this._viewer.container).append(i), r = document.getElementById(o.id), n && r .querySelector(".divpoint-data-li").append(o.description), o.onclick && (r .onclick = () => { o.onclick(o) }) } else i = `
${o.name}
`, $(this._viewer.container).append(i), r = document.getElementById(o.id), o .onclick && (r.onclick = () => { o.onclick(o) }); else { let e = o.description; var a = this._core.isDOM(e); a && (e = ""), i = `
${e}
`, $(this._viewer.container).append(i), r = document.getElementById(o.id), a && r .querySelector(".divpoint").append(o.description), o.onclick && (r.onclick = () => { o.onclick(o) }) } } let e = i.x, t = i.y - r.offsetHeight; "c" === o.offset ? e -= r.offsetWidth / 2 : "r" === o.offset ? e -= r.offsetWidth : Array .isArray(o.offset) && ("c" === o.offset[0] ? e -= r.offsetWidth / 2 : "r" === o.offset[0] ? e -= r.offsetWidth : "number" == typeof o.offset[0] && (e -= o.offset[0]), "number" == typeof o.offset[1] && (t -= o.offset[1])), r.style.transform = `matrix(1, 0, 0, 1, ${e}, ${t})` } o.update && o.update() } }, Ze.prototype.updateDivPoint = function(t, i = {}) { if (this.item) { Object.assign(this.item, i), this.item.name = t; let e = document.getElementById(this.item.id); e && e.remove() } }, Ze.prototype.deleteObject = function() { this._viewer.clock.onTick.removeEventListener(this.updateDivPointEvent, this); let e = document.getElementById(this.item.id); e && e.remove() }, Ze.prototype.setVisibility = function(e) { this.item && (this.item.show = e) }, Ze.prototype.getVisibility = function() { return this.item && this.item.show }, Ze.prototype.setTreeobj = function(e) { this.treeobj = e }, et.prototype.getPosition = function() { return this._viewer.camera.position }, et.prototype.getDegrees = function() { var e = this._viewer.camera.positionCartographic; return { lon: this._cesium.Math.toDegrees(e.longitude), lat: this._cesium.Math.toDegrees(e.latitude), height: e.height } }, et.prototype.getMousePosition = function(e, t) { var e = e.endPosition || e.position || e, i = (void 0 === this.defaultDepthTest && (this.defaultDepthTest = !!this._viewer.scene.globe .depthTestAgainstTerrain), this._viewer.scene.globe.depthTestAgainstTerrain = !0, this ._viewer.camera.getPickRay(e)), e = { position: this._viewer.scene.pickPosition(e) }; let o; if (o = e.position || this._viewer.scene.globe.pick(i, this._viewer.scene), this._viewer.scene.globe .depthTestAgainstTerrain = !!this.defaultDepthTest, this.defaultDepthTest = void 0, o) return o; console.log("未拾取到坐标!") }, et.prototype.getMouseDegrees = function(e, t) { e = this.getMousePosition(e, t); if (e) return this._core.toDegrees(e) }, tt.prototype.createPopupMessage = function(e) { var t = document.createElement("div"), i = (t.className = "kz", t.id = "kzmb", t.style.position = "absolute", t.style.width = "200px", t .style.height = "500px", t.style.padding = "15px", t.style.background = "rgba(0, 0, 0, 0.5)", t .style.color = "#fff", t.style.top = "0px", t.style.right = "0px", t.style.border = "solid 2px #358ABA", document.body.appendChild(t), document.createElement("div")), o = (t.id = "bt", i.style.overflow = "hidden", i.style.height = "45px", i.style.height = "100%", i .className = "layui-form-item", i.style.borderBottom = "solid 2px #358ABA", document .createElement("span")); o.textContent = e, i.appendChild(o), t.appendChild(i), this.getElement("bt", "kzmb") }, tt.prototype.createPlotting = function(e, t) { var i = document.createElement("main"), o = (i.id = "kzmb", i.style.position = "absolute", i.style.cursor = "auto", i.style.left = "0px", i .style.top = "0px;", i.className = "mainView", document.body.appendChild(i), document .createElement("button")), o = (o.id = "closeScene", o.setAttribute("aria-label", "Close"), o.innerHTML = "", o.onclick = closeScene, o.className = "myModal-close", i .appendChild(o), document.createElement("input")), r = (o.id = "objectTab1", o.type = "radio", o.setAttribute("checked", ""), o.name = "objectTab", document.createElement("label")), o = (r.setAttribute("for", "objectTab1"), r.id = "objectLabel1", r.className = "function-module-caption", r.innerHTML = "二维", i.appendChild(o), i.appendChild(r), document .createElement("input")), r = (o.id = "objectTab2", o.type = "radio", o.name = "objectTab", document.createElement("label")), o = (r.setAttribute("for", "objectTab2"), r.id = "objectLabel2", r.className = "function-module-caption", r.innerHTML = "三维", i.appendChild(o), i.appendChild(r), document .createElement("section")), r = (o.id = "objectContent1", i.appendChild(o), this.getBh(o, [{ title: "点", src: "../../static/image/point/points.png", onclick: "labelDraw()" }, { title: "线", src: "../../static/image/point/polyline.png", onclick: "polylineDraw()" }, { title: "多边形", src: "../../static/image/point/polygon_clampToGround.png", onclick: "polygonDraw()" }, { title: "矩形", src: "../../static/image/point/rectangle.png", onclick: "rectangleDraw()" }, { title: "圆", src: "../../static/image/point/Cricle.png", onclick: "circleDraw()" }]), document.createElement("section")); r.id = "objectContent2", i.appendChild(r); this.getBh(r, [{ title: "立方体", src: "../../static/image/point/extrudedRectangle.png", onclick: "boxDraw()" }, { title: "圆柱体", src: "../../static/image/point/extrudedCircle.png", onclick: "cylinderDraw()" }, { title: "圆锥体", src: "../../static/image/point/Cone.png", onclick: "coneDraw()" }, { title: "球体", src: "../../static/image/point/ellipsoid.png", onclick: "circleDraw()" }, { title: "多边体", src: "../../static/image/point/Multilateral.png", onclick: "multilateralDraw()" }]), this.getElement("kzmb", "kzmb") }, tt.prototype.getBh = function(e, t) { for (var i = "", i = "
", o = 0; o < t.length; o++) i = i + "
"; e.innerHTML = i += "
" }, tt.prototype.createMeasurement = function(e, t) { var i = document.createElement("div"), o = (i.className = "kz", i.id = "kzmb", i.style.position = "absolute", i.style.width = "330px", i .style.height = "500px", i.style.padding = "15px", i.style.background = "rgba(0, 0, 0, 0.5)", i .style.color = "#fff", i.style.top = "0px", i.style.right = "0px", i.style.border = "solid 2px #358ABA", document.body.appendChild(i), document.createElement("div")), r = (o.id = "bt", o.style.height = "100%", o.style.overflow = "hidden", o.style.height = "25px", o .className = "layui-form-item", o.style.borderBottom = "solid 2px #358ABA", document .createElement("span")), e = (r.textContent = e, o.appendChild(r), i.appendChild(o), document.createElement("div")), r = (e.className = "layui-tab-content", i.appendChild(e), document.createElement("div")), o = (r.className = "layui-tab-item layui-show", e.appendChild(r), document.createElement("div")), i = (o.className = "kind", r.appendChild(o), document.createElement("ul")), e = (o.appendChild(i), [{ img: "../../img/bh/labels.png", text: "垂直高度", onclick: MeasurementVd }, { img: "../../img/bh/labels.png", text: "海拔高度", onclick: MeasurementAltitude }, { img: "../../img/bh/labels.png", text: "空间距离", onclick: MeasurementSpaceD }, { img: "../../img/bh/labels.png", text: "水平距离", onclick: MeasurementHD }, { img: "../../img/bh/labels.png", text: "三维面积", onclick: MeasurementThreeDSurfaceArea }, { img: "../../img/bh/labels.png", text: "平面面积", onclick: MeasurementPlaneArea }, { img: "../../img/bh/labels.png", text: "角度测量", onclick: MeasurementAngle }]); this.getLi(i, e), "function" == typeof t && t(), this.getElement("bt", "kzmb") }, tt.prototype.getLi = function(e, t) { for (var i = 0; i < t.length; i++) { var o = document.createElement("li"); o.innerHTML = `

${t[i].text}

`, o.onclick = t[i].onclick, e .appendChild(o) } }, tt.prototype.getElement = function(e, t) { var r = 0, n = 0, e = document.getElementById(e), a = (e.style.cursor = "move", document.getElementById(t)), s = !1; e.onmousedown = function(e) { e = e || window.event; r = e.clientX - a.offsetLeft, n = e.clientY - a.offsetTop, s = !0 }, document.onmousemove = function(e) { var t, i, o; s && (t = (e = e || window.event).clientX - r, e = e.clientY - n, i = document.documentElement .clientWidth - a.offsetWidth, o = document.documentElement.clientHeight - a .offsetHeight, t < 0 ? t = 0 : i < t && (t = i), e < 0 ? e = 0 : o < e && (e = o), a .style.left = t + "px", a.style.top = e + "px") }, document.onmouseup = function() { s = !1 } }, tt.prototype.createPopupProp = function(e, t) { layuiLayer.close(SmartEarthPopupData.layerProp); var i, o = t.width, r = t.height, n = t.fn || {}, a = (SmartEarthPopupData.propType = t.type, null), s = null, l = null; for (i in n) a = "cancel" == i ? n[i] : a, s = "success" == i ? n[i] : s, l = "end" == i ? n[i] : l; SmartEarthPopupData.layerProp = layuiLayer.open({ title: e, type: 2, skin: "other-class", shade: t.shade || 0, shadeClose: !0, offset: t.offset || "r", resize: !1, area: ["number" == typeof o ? o + "px" : o, "number" == typeof r ? r + "px" : r], content: SmartEarthRootUrl + t.url, success: function(e, t) { s && "function" == typeof s && s(e, t) }, cancel: function() { a && "function" == typeof a && a() }, end: function() { l && "function" == typeof l && l() } }) }, tt.prototype.createModelLibrary = function(e) { layuiLayer.close(SmartEarthPopupData.ModelLibraryLayer); var t, i = (e = e || {}).width || 342, o = e.height || "90%", r = e.offset || "r", n = e.fn || {}, a = null, s = null, l = null; for (t in n) a = "cancel" == t ? n[t] : a, s = "success" == t ? n[t] : s, l = "end" == t ? n[t] : l; SmartEarthPopupData.ModelLibraryLayer = layuiLayer.open({ title: "模型库", type: 2, skin: "other-class", shade: 0, shadeClose: !0, offset: r, resize: !1, area: [i + "px", "number" == typeof o ? o + "px" : o], content: SmartEarthRootUrl + "Workers/Model/ModelLibrary.html", success: function(e, t) { s && "function" == typeof s && s(e, t) }, cancel: function() { a && "function" == typeof a && a() }, end: function() { l && "function" == typeof l && l() } }) }, it.prototype.createGroup = function(e, t, i) { if (0 != i && (null == i || "" == i) && (i = this._core.isnull(V.selectedItem) ? 0 : V.selectedItem.id, o = V.getSourceByName(this._tree, e))) return o.id; var o, r, n = V.getSourceById(this._tree, i); return n ? (o = V.getSourceByName(n.children, e)) ? o.id : (r = { id: this._core.getuid(), name: e, pId: i, checked: t, type: "group", item: this }, this.item = r, V.insertGroupId(r, i)) : (r = { id: this._core.getuid(), name: e, pId: i, type: "group", checked: t, item: this }, this.item = r, V.insertGroupId(r, i)) }, it.prototype.getVisibility = function() { return this.item.checked }, it.prototype.changeGroup = function(e, t) { V.changeGroup(e, t) }, it.prototype.starttemporaryItem = function() { return V.starttemporaryItem(this._viewer) }, it.prototype.pushtemporaryItem = function(e) { V.temporaryItem.obj.push(e) }, it.prototype.pushStateItem = function(e) { V.temporaryItem.operation = e }, it.prototype.endtemporaryItem = function() { V.endtemporaryItem() }, it.prototype.export = function() { return { type: "group", style: { name: this.item.name, pId: this.item.pId, id: this.item.id } } }; var ot = function(e, t) { if (Array.isArray(e)) return e; if (Symbol.iterator in Object(e)) { var i = t, o = [], r = !0, t = !1, n = void 0; try { for (var a, s = e[Symbol.iterator](); !(r = (a = s.next()).done) && (o.push(a.value), !i || o .length !== i); r = !0); } catch (e) { t = !0, n = e } finally { try { !r && s.return && s.return() } finally { if (t) throw n } } return o } throw new TypeError("Invalid attempt to destructure non-iterable instance") }, rt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; function nt(e) { if (Array.isArray(e)) { for (var t = 0, i = Array(e.length); t < e.length; t++) i[t] = e[t]; return i } return Array.from(e) } function v(e, t, i) { this._viewer = e, this._cesium = t, this._Cesium = i.Cesium, this._url = i.url, this._urlParams = i .urlParams, this._urlTemplate = this._url + "?" + this._serialize(this._urlParams), this._rectangle = i .rectangle, this._maximumLevel = i.maximumLevel || 19, this._minimumLevel = i.minimumLevel || 1, this ._tilingScheme = i.tilingScheme || new this._Cesium.GeographicTilingScheme, this._tileRangeByLevel = {}, this._moveEndTimestamp = null, this._isRemoved = !1, this._isCameraMoving = !1, this ._propertyToBeFiltered = null, this._valuesToBeFiltered = null, this._primitiveByTile = {}, this ._tileKeys = [], this._lowerLevelLimit = i.lowerLevelLimit || 1, this._upperLevelLimit = i .upperLevelLimit || null, this._cameraMoveEndHandler = this._cameraMoveEndHandler.bind(this), this ._cameraMoveStartHandler = this._cameraMoveStartHandler.bind(this), this.heightById = {}; for (var o = this._radianToDegree(this._rectangle.west), r = this._radianToDegree(this._rectangle.south), n = this._radianToDegree(this._rectangle.east), a = this._radianToDegree(this._rectangle.north), s = this._minimumLevel; s <= this._maximumLevel; s++) { var l = this._lonLatToTileInWGS84([o, r], s), u = this._lonLatToTileInWGS84([n, a], s), c = Math.min(l[0], u[0]), h = Math.max(l[0], u[0]), m = Math.min(l[1], u[1]), l = Math.max(l[1], u[1]); this._tileRangeByLevel[s] = { minCol: m, maxCol: l, minRow: c, maxRow: h } } this._tileRangeByLevel[0] = { minCol: 0, maxCol: 0, minRow: 0, maxRow: 0 }, this._primitiveCollection = new this._Cesium.PrimitiveCollection, this._stop = !1, this._core = new f, this.tooltip = this._core.CreateTooltip(), this._getPosition = new et(this._viewer, this._cesium) } function at(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._Provider = void 0, this._cache = !1, this._forceRefreshPrvimitive = null } function C(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._getPosition = new et(this._viewer, this._cesium), this._tree = V, this._popupmessage = new tt(this ._viewer, this._cesium), this.Legend = [], this.tooltip = this._core.CreateTooltip(), this.enty = null } function T(e, t, i) { this._viewer = e, this._cesium = t, this._quadtree = void 0, this._tilingScheme = i || new Cesium .GeographicTilingScheme, this._errorEvent = new Cesium.Event, this._reTilesKey = [], this._state = !0, this._client = !0, this._reTiles = [], this._normalTile = 16, this._minimumHeight = 0, this ._maximumHeight = 0, this._PrimitiveCollection = new Cesium.PrimitiveCollection, this ._levelZeroMaximumError = Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this ._tilingScheme), this.cartographicLimitRectangle = Cesium.Rectangle.clone(Cesium.Rectangle .MAX_VALUE), T.prototype.ready || Object.defineProperties(T.prototype, { quadtree: { get: function() { return this._quadtree }, set: function(e) { this._quadtree = e } }, ready: { get: function() { return !0 } }, tilingScheme: { get: function() { return this._tilingScheme } }, errorEvent: { get: function() { return this._errorEvent } } }), this._core = new f, this.tooltip = this._core.CreateTooltip(), this._getPosition = new et(this ._viewer, this._cesium) } function w(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._Provider = void 0, this.labelCollections1 = [], this.labelCollections2 = [], this .labelCollections = this._cesium.PointPrimitiveCollection(), this.gd = 0, this.item = { show: !0 }, this.model = [], this.Legend = [], this.sj = !0, this._cache = !1, this._forceRefreshPrvimitive = null } function st(e, t, i, o) { this.UrlTemplateGeojsonProvider = new t.UrlTemplateGeojsonProvider(i, 1), this.UrlTemplateGeojsonProvider .loadtitle = o, this.ent = e.imageryLayers.addImageryProvider(this.UrlTemplateGeojsonProvider) } function lt(e, t) { var n = e, a = t; this.project = function(e, t) { var i = t.xMax - t.xMin, o = t.yMin - t.yMax, r = Math.abs(e[0] - t.xMin), e = e[1] - t.yMax; return { x: r / i * n, y: e / o * a } }, this.unproject = function(e, t) { var i = t.xMax - t.xMin, t = t.yMin - t.yMax; return [e.x / n * i, e.y / a * t] }, this.getBoundingRect = function(e) { for (var t = Number.MAX_VALUE, i = { xMin: t, yMin: t, xMax: -t, yMax: -t }, o = 0, r = e.length; o < r; o++) { var n = e[o].getBoundingRect(), a = { x: n.xMin, y: n.yMin }, n = { x: n.xMax, y: n.yMax }; i.xMin = i.xMin < a.x ? i.xMin : a.x, i.yMin = i.yMin < a.y ? i.yMin : a.y, i.xMax = i.xMax > n .x ? i.xMax : n.x, i.yMax = i.yMax > n.y ? i.yMax : n.y } return i } } function b(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this.item = { show: !0 }, this._option = void 0, this._primitive = void 0, this._Provider = void 0, this.Legend = [], this .datas = [], this.models = 0, this.entity = null, this.primitve = [], this.probj = [], this .PrimitiveData = [], this.loadFinishKey = [], this.loadAllKey = [], this.PrimitiveObj = { key: "", data: {} }, this.start = 0, this.Primitivekey = [], this.tilesLength = 0, this.returnCount = 0, this ._primitiveByTile = {}, this._primitiveCollection = new this._cesium.PrimitiveCollection, this.img = null, this._defaultStyle = null, this._canvas = null, this._context = null, this._cache = !1, this ._forceRefreshPrvimitive = null } function ut(e) { if (Array.isArray(e)) { for (var t = 0, i = Array(e.length); t < e.length; t++) i[t] = e[t]; return i } return Array.from(e) } function ct(e, t) { var i = []; return (e.level >= t ? function(e, t, i) { for (var o = e, r = 0; r < 30; r++) { if (o.level == t) return i.push({ x: o.x, y: o.y, level: o.level }); o = o.parent } } : function e(t, i, o) { { if (t.level == i) return o.push({ x: t.x, y: t.y, level: t.level }), !0; if (t.level > i) return !1; for (var r = 0; r < t.children.length; r++) e(t.children[r], i, o) } return !0 })(e, t, i), i } v.prototype._serialize = function(e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : rt(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))): i .push(o(t) + "=" + o(e[t])) } return i.join("&") }, v.prototype._fetch = function(r) { var n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; return new Promise(function(t, i) { var o = new XMLHttpRequest; if (o.open(n.method || "GET", r), n.headers) for (var e in n.headers) o.setRequestHeader(e, n.headers[e]); o.onload = function() { if (4 === o.readyState && 200 === o.status) try { var e = JSON.parse(o.responseText); t(e) } catch (e) { i(new Error("INVALID RESPONSE")) } }, o.onerror = function(e) { i(e) }, o.onloadend = function(e) { 200 !== e.target.status && i(new Error("[" + e.target.status + "]request failed: " + r)) }, o.send(n.body || null) }) }, v.prototype._lonLatToTileInWGS84 = function(e, t) { var e = ot(e, 2), i = e[0], e = e[1]; return [Math.floor(Math.pow(2, t) * (90 - e) / 180), Math.floor(Math.pow(2, t) * (180 + i) / 180)] }, v.prototype._radianToDegree = function(e) { return e / Math.PI * 180 }, v.prototype._isTileInRange = function(e) { try { var t = this._tileRangeByLevel[e.level], i = t.minCol, o = t.maxCol, r = t.minRow, n = t.maxRow; return e.x >= i && e.x <= o && e.y >= r && e.y <= n } catch (e) { return !1 } }, v.prototype._cameraMoveStartHandler = function() { this._isCameraMoving = !0 }, v.prototype._loadTile = function(e) { var r = [], n = new this._Cesium.ColorGeometryInstanceAttribute(.75, .75, .75, 1), a = this; return e.features.forEach(function(e) { if (a._propertyToBeFiltered && Array.isArray(a._valuesToBeFiltered)) { var t = e.properties[a._propertyToBeFiltered]; if (a._valuesToBeFiltered.includes(t)) return } var o, t = e.geometry.type; "Polygon" === t || "MultiPolygon" === t ? (o = [], a.heightById[e.properties.house_id] = e .properties.height, e.geometry.coordinates.forEach(function(e, i) { o.push([]), e.forEach(function(e) { var t; 2 < e.length ? e.forEach(function(e) { var t; 2 <= e.length && (t = o[i]).push.apply(t, nt(e)) }) : (t = o[i]).push.apply(t, nt(e)) }); var e = new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3 .fromDegreesArray(o[i])), t = a._Cesium.BoundingSphere.fromPoints(e.positions).center, t = a._viewer.scene.globe.getHeight(a._Cesium.Cartographic .fromCartesian(t)) || 0, e = new a._Cesium.PolygonGeometry({ polygonHierarchy: e, height: t, vertexFormat: a._Cesium.PerInstanceColorAppearance .VERTEX_FORMAT, extrudedHeight: 1e3 }), t = new a._Cesium.GeometryInstance({ geometry: e, attributes: { color: n } }); r.push(t) })) : console.warn('GeoJSONVectorTileProvider: geometry type "' + e.geometry.type + '" detected, but is not going to be rendered') }), new this._Cesium.Primitive({ allowPicking: !1, appearance: new this._Cesium.PerInstanceColorAppearance({ translucent: !1 }), geometryInstances: r }) }, v.prototype._cameraMoveEndHandler = function() { if (!this._stop) { var o = this, r = Date.now(), e = this._viewer.scene.globe._surface._tilesToRender, t = e.map(function(e) { return e.level }), i = Math.min.apply(Math, nt(t)), n = Math.max.apply(Math, nt(t)); if (n < this._lowerLevelLimit) return o._tileKeys = [], o._removeObsoletePrimitives(o ._primitiveByTile, []), void(e = []); if (this._upperLevelLimit && i > this._upperLevelLimit) return o._tileKeys = [], o ._removeObsoletePrimitives(o._primitiveByTile, []), void(e = []); (e = 2 < n - i ? e.filter(function(e) { return e.level >= n - 2 }) : e).sort(function(e, t) { return -(e.level - t.level) }), e = e.filter(function(e) { return o._isTileInRange(e) }), this._upperLevelLimit && (e = this._refineTiles(e, this._upperLevelLimit)), this ._isCameraMoving = !1, this._moveEndTimestamp = r; var a = [], s = 0, l = 0; e.forEach(function(t) { var e, i = "z" + t.level + "x" + t.x + "y" + t.y; a.push(i), o._tileKeys.push(i), o._primitiveByTile[i] || (e = o._urlTemplate.replace( window.encodeURIComponent("{x}"), t.x).replace(window.encodeURIComponent( "{y}"), t.y).replace(window.encodeURIComponent("{z}"), t.level), s++, o ._fetch(e).then(function(e) { if (o._isRemoved) throw new Error("DISCARD"); if (o._isCameraMoving) throw new Error("DISCARD"); if (r !== o._moveEndTimestamp) throw new Error("DISCARD"); e = o._loadTile(e, t); o._primitiveCollection.add(e), o._primitiveByTile[i] = e, s <= ++l && (o ._tileKeys = a, o._removeObsoletePrimitives(o._primitiveByTile, a)) }).catch(function(e) { s <= ++l && (o._tileKeys = a, o._removeObsoletePrimitives(o ._primitiveByTile, a)), e.message })) }) } }, v.prototype._refineTiles = function(e, s) { var l = [], u = []; return e.forEach(function(e) { var t = "Z" + e.level + "X" + e.x + "Y" + e.y; if (e.level < s - 1) u.includes(t) || (l.push(e), u.push(t)); else if (e.level === s - 1) for (var i = 0; i < 2; i++) for (var o = 0; o < 2; o++) { var r = "Z" + (e.level + 1) + "X" + (2 * e.x + i) + "Y" + (2 * e.y + o); u.includes(r) || (l.push({ x: 2 * e.x + i, y: 2 * e.y + o, level: e.level + 1 }), u.push(r)) } else { var n, a = e.level - s; 0 == a ? u.includes(t) || (l.push(e), u.push(t)) : (t = 2 * a, a = Math.floor(e .x / t), t = Math.floor(e.y / t), u.includes(n = "Z" + s + "X" + a + "Y" + t) || (l.push({ x: a, y: t, level: s }), u.push(n))) } }), l }, v.prototype._removeObsoletePrimitives = function(e, t) { var i, o = []; for (i in 0 < t.length && (o = t), e) o.includes(i) || this._primitiveCollection.remove(e[i]) && delete e[i] }, v.prototype.addTo = function(e) { this._viewer = e, this._viewer.scene.primitives.add(this._primitiveCollection, this.availability), this ._isRemoved = !1, this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler), this ._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler), this ._cameraMoveEndHandler() }, v.prototype.remove = function() { if (this._viewer) { for (var e in this._primitiveByTile) this._viewer.scene.primitives.remove(this._primitiveByTile[e]); this._primitiveByTile = {}, this._viewer.camera.moveEnd.removeEventListener(this ._cameraMoveEndHandler), this._viewer.camera.moveStart.removeEventListener(this ._cameraMoveStartHandler), this._viewer = null, this._isRemoved = !0 } }, v.prototype.setStatus = function(e) { this._stop = e, this._primitiveCollection._availability && e ? this._primitiveCollection._availability = void 0 : this.availability && !e && (this._primitiveCollection._availability = this.availability) }, v.prototype.isRemoved = function() { return this._isRemoved }, v.prototype.filterBy = function(e, t, i) { this._propertyToBeFiltered = e, this._valuesToBeFiltered = t }, v.prototype.removeFilter = function() { this._propertyToBeFiltered = null, this._valuesToBeFiltered = null }, v.prototype.edit = function(e, r) { let u = this, c = this._viewer; if (r = r || {}, this.editHandler && (this.editHandler.destroy(), this.editHandler = void 0), e = void 0 === e ? !0 : e) { var h, m, d, p; this.editHandler = new this._cesium.ScreenSpaceEventHandler(c.scene.canvas), this.isEditting = !1; let n; return this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView)) u.isEditting && (a(), u.defaultEvent(!1)); else { var i = t.position, o = c.scene.pick(i); if ((!o || !o.id || o.id.treeID === u.treeID) && o && o.id && (o .id instanceof Cesium.Entity || o.id.VectorType)) { let e = o.id; u.isEditting || 0 != V.states ? (e != h || "point" !== e.VectorType && "billboard" !== e.VectorType && "label" !== e.VectorType && "model" !== e.VectorType) && "_height_point" != e.name && "_edit_point" != e.name && "_move_point" != e.name && "_add_point" != e.name && "_size_point" != e .name || (c.container.style.cursor = "crosshair", u.defaultEvent(!1), "_height_point" == e.name ? (d = { windowPosition: i, originHeight: u._cesium.Cartographic.fromCartesian(e.position .getValue()).height }, n = "_height_point") : "_move_point" == e.name ? n = "_move_point" : "point" === e.VectorType || "billboard" === e.VectorType || "label" === e.VectorType || "model" === e.VectorType ? (u.tooltip.showAt(t.position, "释放后完成修改"), n = "_move_point", "model" === e.VectorType && (e .show = !1)) : "_edit_point" == e.name ? n = "_edit_point" : "_add_point" == e.name ? n = "_add_point" : "_size_point" == e.name && ( n = "_size_point"), m = e) : (r.callBack && r.callBack.start && r .callBack.start(e), p = e.VectorType, (h = u.createEditEntity(p, e .VectorStyle)).feature = e, h.treeID = u.treeID, u .getSimpleGraphicData(p, h), "point" === p || "billboard" === p || "label" === p || "model" === p ? (u.isEditting = !0, u.tooltip.showAt(t .position, "拖拽修改位置")) : (u.isEditting = !0, SmartEarthPopupData .editGraphic.updataEditPoint(), SmartEarthPopupData.editGraphic .setTreeID(u.treeID)), u.setStatus(!0), V.editVector = !0, u ._primitiveCollection.show = !1) } } }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView)) u.isEditting && (a(), u.defaultEvent(!1)); else { var r = c.scene.pick(t.endPosition); if ((!r || !r.id || r.id.treeID === u.treeID) && (u._cesium.defined(r) ? u .isEditting && !m ? "point" !== p && "billboard" !== p && "label" !== p && "model" !== p || r.id != h ? r.id && "_edit_point" === r.id.name && h .pottingPoint ? ("polyline" === p || "wall" === p) && 2 < h.pottingPoint .length || "polygon" === p && 3 < h.pottingPoint.length ? u.tooltip.showAt(t .endPosition, "拖拽修改位置,右键删除点") : u.tooltip.showAt(t.endPosition, "拖拽修改位置") : !r.id || "_move_point" !== r.id.name && "_size_point" !== r .id.name ? r.id && "_add_point" === r.id.name ? u.tooltip.showAt(t .endPosition, "拖拽增加节点") : r.id && "_height_point" === r.id.name ? u .tooltip.showAt(t.endPosition, "拖拽修改高度") : r.id == h && u.tooltip.show(!1) : u.tooltip.showAt(t.endPosition, "拖拽修改位置") : u.tooltip.showAt(t.endPosition, "拖拽修改位置,右键删除") : u.isEditting || 0 !== V.states || (r.id && r.id .VectorType ? u.tooltip.showAt(t.endPosition, "点击激活编辑") : u.tooltip .show(!1)) : 0 != V.states || m || u.tooltip.show(!1), u.isEditting && m )) { u.tooltip.showAt(t.endPosition, "释放后完成修改"); let i = u._getPosition.getMousePosition(t); if (i || "_height_point" === n) if ("_edit_point" === n) { m.position = i; r = V.editPointID.edit.indexOf(m.id); if (void 0 !== h[p].height ? (l = u.toDegrees(i), h.pottingPoint[r] = Cesium.Cartesian3.fromDegrees(l.lon, l.lat, h[p].height .getValue()), m.position = h.pottingPoint[r]) : h .pottingPoint[r] = i, 0 < V.editPointID.add.length) { if (0 < r) { let i = c.entities.getById(V.editPointID.add[r - 1]); if (i) { let e = c.entities.getById(V.editPointID.edit[r - 1]), t = c.entities.getById(V.editPointID.edit[r]); i.position = Cesium.Cartesian3.midpoint(e.position .getValue(), t.position.getValue(), new Cesium .Cartesian3) } } if (r < h.pottingPoint.length - 1) { let i = c.entities.getById(V.editPointID.add[r]); if (i) { let e = c.entities.getById(V.editPointID.edit[r]), t = c.entities.getById(V.editPointID.edit[r + 1]); i.position = Cesium.Cartesian3.midpoint(e.position .getValue(), t.position.getValue(), new Cesium .Cartesian3) } } if ("polygon" === p && (0 === r || r === h.pottingPoint.length - 1)) { let i = c.entities.getById(V.editPointID.add[V.editPointID.add .length - 1]); if (i) { let e = c.entities.getById(V.editPointID.edit[0]), t = c.entities.getById(V.editPointID.edit[h.pottingPoint .length - 1]); i.position = Cesium.Cartesian3.midpoint(e.position .getValue(), t.position.getValue(), new Cesium .Cartesian3) } } } let e = h.pottingPoint.concat([]), t = new u._cesium.Cartesian3; var l = e.length; e.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= l, t.y /= l, t.z /= l, V.editPointID.move && (V .editPointID.move.position = t), "polyline" !== p && "wall" !== p && "polygon" !== p && "rectangle" !== p || SmartEarthPopupData .editGraphic.setValue("positions", e) } else if ("_height_point" === n) { r = V.editPointID.height.indexOf(m.id); let e = c.entities.getById(V.editPointID.edit[r]), i = ("ellipse" !== p && "cylinder" !== p && "box" !== p || (e = V .editPointID.move), u.toDegrees(e.position.getValue())); l = d.originHeight - i.height, r = c.scene.cartesianToCanvasCoordinates(e .position.getValue()), t = (d.windowPosition.y - t.endPosition.y) * l / Math.abs(r.y - d.windowPosition.y); let o = Math.abs(l + t); V.editPointID.height.forEach(e => { let t = c.entities.getById(e); t && (e = t.position.getValue(), e = u.toDegrees(e), t .position = u._cesium.Cartesian3.fromDegrees(e.lon, e .lat, o + i.height)) }), h[p].extrudedHeight ? h[p].extrudedHeight = o + i.height : "box" === p ? SmartEarthPopupData.editGraphic.setValue("height", o) : "cylinder" === p && SmartEarthPopupData.editGraphic.setValue("length", o) } else if ("_add_point" === n) { var r = V.editPointID.add.indexOf(m.id), l = (c.entities.remove(m), c.entities.add({ name: "_edit_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } })), t = (V.editPointID.edit.splice(r + 1, 0, l.id), h.pottingPoint.splice( r + 1, 0, i.clone()), Cesium.Cartesian3.midpoint(h.pottingPoint[ r], h.pottingPoint[r + 1], new Cesium.Cartesian3)), t = c.entities.add({ name: "_add_point", position: t, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), e = Cesium.Cartesian3.midpoint(h.pottingPoint[r + 1], h.pottingPoint[r + 2 === h.pottingPoint.length ? 0 : r + 2], new Cesium.Cartesian3), e = c.entities.add({ name: "_add_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), r = (V.editPointID.add.splice(r, 1, t.id, e.id), SmartEarthPopupData .editGraphic.setTreeID(u.treeID), m = l, n = "_edit_point", h .pottingPoint.concat([])); if ("polyline" === p || "polygon" === p) SmartEarthPopupData.editGraphic .setValue("positions", r); else if ("wall" === p) { SmartEarthPopupData.editGraphic.setValue("positions", r); let e = SmartEarthPopupData.editGraphic.getValue("minimumHeights"), t = SmartEarthPopupData.editGraphic.getValue("maximumHeights"); e.push(e[0]), t.push(t[0]), SmartEarthPopupData.editGraphic.setValue( "minimumHeights", e), SmartEarthPopupData.editGraphic.setValue( "maximumHeights", t) } } else if ("_size_point" === n) { t = V.editPointID.move.position.getValue(), e = u._cesium.Cartesian3 .distance(t, i); "ellipse" === p || "cylinder" === p || "ellipsoid" === p && h.isSphere ? SmartEarthPopupData.editGraphic.setValue("radius", e) : "box" === p && ( l = 90 === m.angle ? "long" : "width", SmartEarthPopupData .editGraphic.setValue(l, 2 * e)) } else if ("point" === p || "billboard" === p || "label" === p || "model" === p) m.position = i; else { r = u.toDegrees(i), t = (d = m.position.getValue(), u.toDegrees(d)); let n = r.lon - t.lon, a = r.lat - t.lat, s = r.height - t.height; m.position = i, h[p].height && (l = u.toDegrees(i).height, h[p].height = l, h.thisHeight = l), h.pottingPoint.forEach((e, t) => { let i, o, r = c.entities.getById(V.editPointID.edit[t]); if (r = r || c.entities.getById(V.editPointID.size[t]), i = r ? u.toDegrees(r.position.getValue()) : u.toDegrees(e), o = u ._cesium.Cartesian3.fromDegrees(i.lon + n, i.lat + a, i .height + s), e.x = o.x, e.y = o.y, e.z = o.z, r && (r .position = o), 0 < V.editPointID.add.length && V .editPointID.add[t]) { let e = c.entities.getById(V.editPointID.add[t]); e && (i = u.toDegrees(e.position.getValue()), e.position = u ._cesium.Cartesian3.fromDegrees(i.lon + n, i.lat + a, i.height + s)) } }); e = h.pottingPoint.concat([]); "polyline" === p || "wall" === p || "polygon" === p || "rectangle" === p ? SmartEarthPopupData.editGraphic.setValue("positions", e) : "ellipse" === p ? (h.pottingPoint[1] = i, h.position = i.clone()) : "box" === p ? (h .pottingPoint[2] = i, r = h.box.dimensions.getValue(), t = u .toDegrees(i), h.position = Cesium.Cartesian3.fromDegrees(t.lon, t .lat, t.height + r.z / 2)) : "cylinder" === p ? (h.pottingPoint[ 1] = i, l = h.cylinder.length.getValue(), e = u.toDegrees(h .pottingPoint[1]), h.position = Cesium.Cartesian3.fromDegrees(e .lon, e.lat, e.height + l / 2)) : "ellipsoid" === p && (h .pottingPoint[h.pottingPoint.length - 1] = i, h.position = i.clone() ) } } } }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.editHandler.setInputAction(e => { Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView) ? u.isEditting && (a(), u.defaultEvent(!1)) : (m && "model" === m.VectorType && (m.show = !0), m && r.callBack && r.callBack .updata && r.callBack.updata(m.name, h), c.container.style.cursor = "default", m = void 0, u.defaultEvent(!0)) }, this._cesium.ScreenSpaceEventType.LEFT_UP), this.editHandler.setInputAction(e => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView)) u.isEditting && (a(), u.defaultEvent(!1)); else { e = c.scene.pick(e.position); if ((!e || !e.id || e.id.treeID === u.treeID) && u._cesium.defined(e) && 0 == V .states) { e = e.id; if (!e.VectorType && -1 < V.editPointID.edit.indexOf(e.id) && (("polyline" === p || "wall" === p) && 2 < V.editPointID.edit.length || "polygon" === p && 3 < V.editPointID.edit.length)) { var i = V.editPointID.edit.indexOf(e.id); if (c.entities.removeById(e.id), V.editPointID.edit.splice(i, 1), h .pottingPoint.splice(i, 1), 0 < V.editPointID.add.length) if (V.editPointID.add[i]) { if (c.entities.removeById(V.editPointID.add[i]), V.editPointID.add .splice(i, 1), 0 <= i - 1) { let e = c.entities.getById(V.editPointID.add[i - 1]); e && (e.position = Cesium.Cartesian3.midpoint(h.pottingPoint[i - 1], h.pottingPoint[i === h.pottingPoint.length ? 0 : i], new Cesium.Cartesian3)) } else if (i - 1 == -1 && "polygon" === p) { let e = c.entities.getById(V.editPointID.add[V.editPointID.add .length - 1]); e && (e.position = Cesium.Cartesian3.midpoint(h.pottingPoint[0], h.pottingPoint[h.pottingPoint.length - 1], new Cesium.Cartesian3)) } } else c.entities.removeById(V.editPointID.add[i - 1]), V.editPointID .add.pop(); let t = new u._cesium.Cartesian3; e = h.pottingPoint.length, i = (h.pottingPoint.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= e, t.y /= e, t.z /= e, V.editPointID.move && (V .editPointID.move.position = t), h.pottingPoint.concat([])); if ("polyline" === p || "polygon" === p) SmartEarthPopupData.editGraphic .setValue("positions", i); else if ("wall" === p) { SmartEarthPopupData.editGraphic.setValue("positions", i); let e = SmartEarthPopupData.editGraphic.getValue("minimumHeights"), t = SmartEarthPopupData.editGraphic.getValue("maximumHeights"); e.pop(), t.pop(), SmartEarthPopupData.editGraphic.setValue( "minimumHeights", e), SmartEarthPopupData.editGraphic.setValue( "maximumHeights", t) } u.tooltip.show(!1), r.callBack && r.callBack.updata && r.callBack.updata( m && m.name, h) } } } }, this._cesium.ScreenSpaceEventType.RIGHT_DOWN), a(), { endThisEdit: a, getEditData: function() { return { entity: h } } }; function a() { u.defaultEvent(!0), V.editPointID.edit.forEach(e => { c.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { c.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { c.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { c.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && c.entities.remove(V.editPointID.move), V .editPointID.move = void 0, h && c.entities.remove(h), p = h = void 0, SmartEarthPopupData .editGraphic = {}, u.isEditting = !1, u.setStatus(!1), V.editVector = !1, u ._primitiveCollection.show = !0, u.delButton(!1) } } else a() }, v.prototype.createEditEntity = function(e, i) { let o; var r = this; let n = this._viewer; if ("polygon" === e) { let e = i.positions; var a = r._core.defaultValue(i.height, void 0); let t; t = i.hierarchy || (e = i.haveZ ? r._cesium.Cartesian3.fromDegreesArrayHeights(e) : r._cesium .Cartesian3.fromDegreesArray(e), new r._cesium.PolygonHierarchy(e)), (o = n.entities.add({ polygon: { hierarchy: new r._cesium.CallbackProperty(function() { return t }, !1), extrudedHeight: r._core.defaultValue(i.extrudedHeight, void 0), height: a, material: new r._cesium.ImageMaterialProperty({ image: r._core.defaultValue(i.image, null), repeat: r._core.defaultValue(i.repeat, new r._cesium.Cartesian2(1, 1)), color: i.material }), shadows: r._cesium.ShadowMode.ENABLED, fill: !0 } })).VectorType = "polygon" } else if ("polyline" === e) { let e = i.positions; e = i.haveZ ? r._cesium.Cartesian3.fromDegreesArrayHeights(e) : r._cesium.Cartesian3 .fromDegreesArray(e), (o = n.entities.add({ polyline: { positions: new r._cesium.CallbackProperty(function() { return e }, !1), clampToGround: r._core.defaultValue(i.clampToGround, !1), material: new Cesium.PolylineOutlineMaterialProperty({ color: i.material, outlineWidth: r._core.defaultValue(i.outlineWidth, 0), outlineColor: r._cesium.Color.fromCssColorString(r._core .defaultValue(i.outlineColor, "rgba(255,255,255,0.6)")) }), width: r._core.defaultValue(i.width, 3) } })).VectorType = "polyline" } else if ("wall" === e) { let e = i.positions; e = i.haveZ ? r._cesium.Cartesian3.fromDegreesArrayHeights(e) : r._cesium.Cartesian3 .fromDegreesArray(e), (o = n.entities.add({ wall: { positions: new r._cesium.CallbackProperty(function() { return e }, !1), minimumHeights: i.minimumHeights, maximumHeights: i.maximumHeights, material: i.material, outline: !0, outlineWidth: r._core.defaultValue(i.outlineWidth, 0), outlineColor: i.outlineColor } })).VectorType = "wall" } else "label" === e ? (o = n.entities.add({ position: i.position, label: { text: i.text, font: i.font, scale: i.scale, style: i.style, fillColor: i.fillColor, outlineColor: i.outlineColor, outlineWidth: i.outlineWidth, showBackground: i.showBackground, backgroundColor: i.backgroundColor, heightReference: i.heightReference, horizontalOrigin: i.horizontalOrigin, verticalOrigin: i.verticalOrigin, scaleByDistance: i.scaleByDistance, distanceDisplayCondition: i.distanceDisplayCondition } })).VectorType = "label" : "billboard" === e && ((o = n.entities.add({ position: i.position, billboard: { rotation: i.rotation, width: i.width, height: i.height, image: i.image, color: i.color, scale: i.scale, heightReference: i.heightReference, horizontalOrigin: i.horizontalOrigin, verticalOrigin: i.verticalOrigin, scaleByDistance: i.scaleByDistance, distanceDisplayCondition: i.distanceDisplayCondition } })).VectorType = "billboard"); return o }, v.prototype.delButton = function(e, t, i) { if (e) { let e = document.getElementById("DeleteMilitaryStandardDelete"); e || ((e = document.createElement("button")).id = "DeleteMilitaryStandardDelete", e.innerText = "删除对象", e.style.cssText = `height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`, this._viewer.container.appendChild(e)), e.style.display = "block", e.style .top = t.y + "px", e.style.left = t.x + "px", e.onclick = i } else { let e = document.getElementById("DeleteMilitaryStandardDelete"); e && (e.style.display = "none", e.onclick = null) } }, v.prototype.defaultEvent = function(e) { let t = this._viewer.scene; t.screenSpaceCameraController.enableRotate = e, t.screenSpaceCameraController.enableTranslate = e, t .screenSpaceCameraController.enableZoom = e, t.screenSpaceCameraController.enableTilt = e, t .screenSpaceCameraController.enableLook = e }, v.prototype.getEntityTypeAndObject = function(e) { let t = { type: "", object: null }; return e && (e.billboard ? (t.type = "billboard", t.object = e.billboard) : e.box ? (t.type = "box", t .object = e.box) : e.corridor ? (t.type = "corridor", t.object = e.corridor) : e.cylinder ? (t.type = "cylinder", t.object = e.cylinder) : e.ellipse ? (t.type = "ellipse", t.object = e .ellipse) : e.ellipsoid ? (t.type = "ellipsoid", t.object = e.ellipsoid) : e.label ? (t .type = "label", t.object = e.label) : e.model ? (t.type = "model", t.object = e.model) : e .path ? (t.type = "path", t.object = e.path) : e.plane ? (t.type = "plane", t.object = e .plane) : e.point ? (t.type = "point", t.object = e.point) : e.polygon ? (t.type = "polygon", t .object = e.polygon) : e.polyline ? (t.type = "polyline", t.object = e.polyline) : e .polylineVolume ? (t.type = "polylineVolume", t.object = e.polylineVolume) : e.rectangle ? (t .type = "rectangle", t.object = e.rectangle) : e.wall && (t.type = "wall", t.object = e .wall)), t }, v.prototype.toDegrees = function(e) { e = this._cesium.Cartographic.fromCartesian(e); return { lon: this._cesium.Math.toDegrees(e.longitude), lat: this._cesium.Math.toDegrees(e.latitude), height: e.height } }, v.prototype.getSimpleGraphicData = function(e, n) { let a = this, s = this._viewer; var t, i; function o(e) { SmartEarthPopupData.editGraphic.fillColor = l("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")"), SmartEarthPopupData.editGraphic.alpha = 100 * e.alpha } function r(e) { SmartEarthPopupData.editGraphic.outlineColor = l("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")"), SmartEarthPopupData.editGraphic.outlineAlpha = 100 * e.alpha } function l(e) { let t = e; if (/^(rgb|RGB)/.test(t)) { let e = t.replace(/(rgb|RGB)*/g, ""); var o = (e = e.replace("(", "").replace(")", "")).split(","); let i = "#"; for (let t = 0; t < o.length; t++) { let e = Number(o[t]).toString(16); "0" === (e = 1 === e.length ? "0" + e : e) && (e += e), i += e } return i = 7 !== i.length ? t : i } if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) return t; var i = t.replace(/#/, "").split(""); if (6 === i.length) return t; if (3 === i.length) { let t = "#"; for (let e = 0; e < i.length; e += 1) t += i[e] + i[e]; return t } } SmartEarthPopupData.editGraphic = { entity: n, type: e, graphic: n[e], getValue: function(e) { return "position" === e || "name" === e || "id" === e ? this.entity[e] && (this.entity[ e].getValue ? this.entity[e].getValue() : this.entity[e]) : "radius" === e ? "ellipse" === this.type ? this.graphic.semiMajorAxis.getValue() : "ellipsoid" === this.type ? this.graphic.radii.getValue().x : "cylinder" === this.type ? this .graphic.bottomRadius.getValue() : void 0 : "pHeight" !== e ? "repeat" === e ? this .graphic.material[e] && (this.graphic.material[e].getValue ? this.graphic.material[ e].getValue() : this.graphic.material[e]) : this.graphic[e] && (this.graphic[e] .getValue ? this.graphic[e].getValue() : this.graphic[e]) : this.getValue( "position") ? (e = this.getValue("position"), Cesium.Cartographic.fromCartesian( e).height) : void 0 }, changeHeightPoint: function(i) { 0 < V.editPointID.height.length && V.editPointID.height.forEach(e => { let t = s.entities.getById(e); t && (e = t.position.getValue(), e = a.toDegrees(e), t.position = Cesium .Cartesian3.fromDegrees(e.lon, e.lat, i)) }) }, changeEditPoint: function(i) { 0 < V.editPointID.edit.length && V.editPointID.edit.forEach(e => { let t = s.entities.getById(e); t && ("clampToGround" === i ? t.point.heightReference = 1 : (t.point .heightReference = 0, e = t.position.getValue(), e = a .toDegrees(e), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, i))) }), 0 < V.editPointID.size.length && V.editPointID.size.forEach(e => { let t = s.entities.getById(e); t && ("clampToGround" === i ? t.point.heightReference = 1 : (t.point .heightReference = 0, e = t.position.getValue(), e = a .toDegrees(e), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, i))) }), 0 < V.editPointID.add.length && V.editPointID.add.forEach(e => { let t = s.entities.getById(e); t && ("clampToGround" === i ? t.point.heightReference = 1 : (t.point .heightReference = 0, e = t.position.getValue(), e = a .toDegrees(e), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, i))) }); let e = V.editPointID.move; var t; e && ("clampToGround" === i ? e.point.heightReference = 1 : (e.point.heightReference = 0, t = e.position.getValue(), t = a.toDegrees(t), e.position = Cesium .Cartesian3.fromDegrees(t.lon, t.lat, i))) }, clearAllEditPoint: function() { V.editPointID.edit.forEach(e => { s.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { s.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { s.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { s.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && s.entities.remove(V.editPointID .move), V.editPointID.move = void 0 }, setTreeID: function(i) { V.editPointID.edit.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.height.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.add.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.size.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.move && (V.editPointID.move.treeID = i) } }, "billboard" === e || "point" === e || "label" === e || "model" === e ? ((i = SmartEarthPopupData .editGraphic.getValue("color") || SmartEarthPopupData.editGraphic.getValue("fillColor")) ? o(i) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData.editGraphic .alpha = 60), (i = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? r(i) : ( SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic .outlineAlpha = 60), "label" === e && ((i = SmartEarthPopupData.editGraphic.getValue( "backgroundColor")) ? (i = i, SmartEarthPopupData.editGraphic.backgroundColor = l( "rgb(" + 255 * i.red + "," + 255 * i.green + "," + 255 * i.blue + ")"), SmartEarthPopupData.editGraphic.backgroundAlpha = 100 * i.alpha) : (SmartEarthPopupData .editGraphic.backgroundColor = "#000000", SmartEarthPopupData.editGraphic .backgroundAlpha = 80)), SmartEarthPopupData.editGraphic.setValue = function(e, t) { if ("position" === e || "name" === e) this.entity[e] = t; else { if ("color" === e || "outlineColor" === e || "backgroundColor" === e || "fillColor" === e) t = Cesium.Color.fromCssColorString(t); else if ("fontSize" === e) { let e = this.getValue("font"); (e = e.split(" "))[0] = t, t = e.join(" ") } else { if ("alpha" === e) return void("label" === this.type ? this.graphic.fillColor._value .alpha = t : this.graphic.color._value.alpha = t); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = t); if ("backgroundAlpha" === e) return void(this.graphic.backgroundColor._value.alpha = t); if ("pHeight" === e && this.getValue("position")) { var i = this.getValue("position"); let e = Cesium.Cartographic.fromCartesian(i); return e.height = t, void(this.entity.position = Cesium.Cartographic .toCartesian(e)) } } this.graphic[e] = t } }) : "polyline" === e ? ((i = SmartEarthPopupData.editGraphic.getValue("material")).color ? o(i .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), i.outlineColor ? r(i.outlineColor) : (SmartEarthPopupData .editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(e, t) { if ("name" === e) this.entity[e] = t; else { if ("color" === e || "outlineColor" === e) return t = Cesium.Color.fromCssColorString( t), void(this.graphic.material[e] = t); "outlineWidth" === e ? this.graphic.material[e] = t : "alpha" === e ? this.graphic .material.color._value.alpha = t : "outlineAlpha" === e ? this.graphic.material .outlineColor._value.alpha = t : this.graphic[e] = "positions" === e ? new Cesium .CallbackProperty(function() { return t }, !1) : t } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e = this.getValue("positions"); return this.entity.pottingPoint = e }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); let t = this.getPottingPoint(); if (t) { let o = new Cesium.Cartesian3; t.forEach((e, t) => { var i = s.entities.add({ name: "_edit_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this .graphic.heightReference.getValue() } }); V.editPointID.edit.push(i.id), o.x += e.x, o.y += e.y, o.z += e.z }), o.x /= t.length, o.y /= t.length, o.z /= t.length, V.editPointID.move = s .entities.add({ name: "_move_point", position: o, point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); for (let e = 0; e < t.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "_add_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); V.editPointID.add.push(i.id) } } }) : "polygon" === e ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color ? o(t .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? r(t) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData .editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(e, i) { if ("name" === e) this.entity[e] = i; else { if ("color" === e || "outlineColor" === e) { if (i = Cesium.Color.fromCssColorString(i), "color" === e) return void(this.graphic .material.color = i) } else { if ("image" === e || "repeat" === e) return void(this.graphic.material[e] = i); if ("alpha" === e) return void(this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = i); if ("positions" === e) return void(this.graphic.hierarchy = new Cesium .CallbackProperty(function() { return new Cesium.PolygonHierarchy(i) }, !1)); if ("hierarchy" === e) return void(this.graphic.hierarchy = new Cesium .CallbackProperty(function() { return i }, !1)); function t(e, t, i) { i ? (e.perPositionHeight = !1, e.heightReference = Cesium.HeightReference .CLAMP_TO_GROUND) : (e.perPositionHeight = !0, e.heightReference = Cesium.HeightReference.NONE), 0 < V.editPointID.edit.length && !i && t .forEach((e, t) => { let i = s.entities.getById(V.editPointID.edit[t]); i && (t = i.position.getValue(), e.x = t.x, e.y = t.y, e.z = t.z) }), e.hierarchy = new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(t) }, !1) } if ("clampToGround" === e) return this.graphic.hierarchy instanceof Cesium .CallbackProperty ? (this.graphic.hierarchy = this.graphic.hierarchy .getValue(), setTimeout(() => { t(this.graphic, this.entity.pottingPoint, i) }, 100)) : t(this.graphic, this.entity.pottingPoint, i), void(0 < V .editPointID.add.length && V.editPointID.add.forEach(e => { let t = s.entities.getById(e); t && (t.point.heightReference = i ? 1 : 0) })); "extrudedHeight" === e ? this.changeHeightPoint(i) : "height" === e && this .changeEditPoint(i) } this.graphic[e] = i } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { let e = this.getValue("hierarchy"), t = e.positions.concat([]); if (void 0 !== this.getValue("height")) { let i = this.getValue("height"); t.forEach(e => { var t = a.toDegrees(e), t = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, i); e.x = t.x, e.y = t.y, e.z = t.z }) } return this.entity.pottingPoint = t }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); let t = this.getPottingPoint(); if (t) { let o = new Cesium.Cartesian3; t.forEach((e, t) => { var i = s.entities.add({ name: "_edit_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this .graphic.heightReference.getValue() } }); V.editPointID.edit.push(i.id), o.x += e.x, o.y += e.y, o.z += e.z }), o.x /= t.length, o.y /= t.length, o.z /= t.length, V.editPointID.move = s .entities.add({ name: "_move_point", position: o, point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); for (let e = 0; e < t.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "_add_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); V.editPointID.add.push(i.id) } var e = Cesium.Cartesian3.midpoint(t[0], t[t.length - 1], new Cesium.Cartesian3), e = s.entities.add({ name: "_add_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); V.editPointID.add.push(e.id) } }) : "ellipse" === e || "cylinder" === e || n.isSphere ? ((t = SmartEarthPopupData.editGraphic .getValue("material")).color ? o(t.color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData.editGraphic.alpha = 60), (t = SmartEarthPopupData.editGraphic .getValue("outlineColor")) ? r(t) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic.outlineAlpha = 60), SmartEarthPopupData .editGraphic.setValue = function(e, i) { if ("name" === e) this.entity[e] = i; else { if ("color" === e || "outlineColor" === e) { if (i = Cesium.Color.fromCssColorString(i), "color" === e) return void(this.graphic .material.color = i) } else { if ("image" === e || "repeat" === e) return void(this.graphic.material[e] = i); if ("alpha" === e) return void(this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = i); if ("semiMajorAxis" === e) return void(this.graphic.semiMajorAxis = new Cesium .CallbackProperty(function() { return i }, !1)); if ("semiMinorAxis" === e) return void(this.graphic.semiMinorAxis = new Cesium .CallbackProperty(function() { return i }, !1)); if ("radii" === e) return void(this.graphic.radii = new Cesium.CallbackProperty( function() { return i }, !1)); if ("topRadius" === e) return void(this.graphic.topRadius = new Cesium .CallbackProperty(function() { return i }, !1)); if ("bottomRadius" === e) return void(this.graphic.bottomRadius = new Cesium .CallbackProperty(function() { return i }, !1)); if ("radius" === e) { "ellipse" === this.type ? (this.graphic.semiMajorAxis = new Cesium .CallbackProperty(function() { return i }, !1), this.graphic.semiMinorAxis = new Cesium.CallbackProperty( function() { return i }, !1)) : "ellipsoid" === this.type ? null !== this.graphic.material .image.getValue() ? this.graphic.radii = new Cesium.Cartesian3(i, i, i) : this.graphic.radii = new Cesium.CallbackProperty(function() { return new Cesium.Cartesian3(i, i, i) }, !1) : "cylinder" === this.type && (this.graphic.bottomRadius = new Cesium .CallbackProperty(function() { return i }, !1), this.entity.changeTop && (this.graphic.topRadius = new Cesium .CallbackProperty(function() { return i }, !1))); var o = V.editPointID.move.position.getValue(), r = a.GetPositionFromA_D(o, i, 90); let e = s.entities.getById(V.editPointID.size[0]), t = (e.position = r, n.pottingPoint[0] = r, n.pottingPoint[n.pottingPoint .length - 1] = o, s.entities.getById(V.editPointID.height[0])); return void(t && (o = a.toDegrees(r), r = a._cesium.Cartographic.fromCartesian(t .position.getValue()), t.position = a._cesium.Cartesian3 .fromDegrees(o.lon, o.lat, r.height))) } if ("cylinder" === this.type && "length" === e) return this.graphic.length = i, o = a.toDegrees(this.entity.pottingPoint[1]), this.entity.position = Cesium .Cartesian3.fromDegrees(o.lon, o.lat, o.height + i / 2), void this .changeHeightPoint(o.height + i); function t(e, t, i) { i ? (void 0 === e.thisHeight && (e.thisHeight = t.height && t.height .getValue()), t.height = void 0, t.heightReference = Cesium.HeightReference .CLAMP_TO_GROUND) : (t.height = e.thisHeight, t.heightReference = Cesium .HeightReference.NONE); let o = t.semiMinorAxis.getValue(); t.semiMinorAxis = new Cesium.CallbackProperty(function() { return o }, !1), t.semiMajorAxis = new Cesium.CallbackProperty(function() { return o }, !1) } if ("ellipse" === this.type && "clampToGround" === e) return this.graphic .semiMinorAxis instanceof Cesium.CallbackProperty ? (this.graphic .semiMinorAxis = this.graphic.semiMinorAxis.getValue(), this.graphic .semiMajorAxis = this.graphic.semiMajorAxis.getValue(), setTimeout( () => { t(this.entity, this.graphic, i) }, 100)) : t(this.entity, this.graphic, i), void(i ? this .changeEditPoint("clampToGround") : this.changeEditPoint(this.entity .thisHeight)); "ellipse" === this.type && "extrudedHeight" === e ? this.changeHeightPoint(i) : "ellipse" === this.type && "height" === e && (this.changeEditPoint(i), this .entity.thisHeight = i) } this.graphic[e] = i } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e, t, i = this.getValue("radius"); let o = this.getValue("position"); return "ellipse" === this.type || this.entity.isSphere ? ("ellipse" === this.type && void 0 !== this.getValue("height") && (e = this.getValue("height"), t = a.toDegrees( o), o = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, e)), t = a .GetPositionFromA_D(o, i, 90), this.entity.pottingPoint = [t, o], [t, o]) : (e = a .toDegrees(o), o = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height - this .getValue("length") / 2), t = a.GetPositionFromA_D(o, i, 90), this.entity .pottingPoint = [t, o], [t, o]) }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); var t = this.getPottingPoint(); if (t) { let e = s.entities.add({ name: "_size_point", position: t[0], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); e.angle = 90, V.editPointID.size.push(e.id), V.editPointID.move = s.entities.add({ name: "_move_point", position: t[1], point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }) } }) : "rectangle" === e ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color ? o(t .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? r(t) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData .editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(e, t) { if ("name" === e) this.entity[e] = t; else { if ("color" === e || "outlineColor" === e) { if (t = Cesium.Color.fromCssColorString(t), "color" === e) return void(this.graphic .material.color = t) } else { if ("image" === e || "repeat" === e) return void(this.graphic.material[e] = t); if ("alpha" === e) return void(this.graphic.material.color._value.alpha = t); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = t); if ("positions" === e) return void(this.graphic.coordinates = new Cesium .CallbackProperty(function() { return Cesium.Rectangle.fromCartesianArray(t) }, !1)); if ("coordinates" === e) return void(this.graphic.coordinates = new Cesium .CallbackProperty(function() { return t }, !1)); function i(e, t, i) { i ? (void 0 === e.thisHeight && (e.thisHeight = t.height && t.height .getValue()), t.height = void 0, t.heightReference = Cesium.HeightReference .CLAMP_TO_GROUND) : (t.height = e.thisHeight, t.heightReference = Cesium .HeightReference.NONE); let o = t.coordinates.getValue(); t.coordinates = new Cesium.CallbackProperty(function() { return o }, !1) } if ("clampToGround" === e) return this.graphic.coordinates instanceof Cesium .CallbackProperty ? (this.graphic.coordinates = this.graphic.coordinates .getValue(), setTimeout(() => { i(this.entity, this.graphic, t) }, 100)) : i(this.entity, this.graphic, t), void(t ? this .changeEditPoint("clampToGround") : this.changeEditPoint(this.entity .thisHeight)); "extrudedHeight" === e ? this.changeHeightPoint(t) : "height" === e && (this .changeEditPoint(t), this.entity.thisHeight = t) } this.graphic[e] = t } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e = this.getValue("coordinates"); let t, i, o = this.getValue("height"); return i = (void 0 !== o ? t = Cesium.Cartesian3.fromRadians(e.west, e.north, o) : (o = s .scene.sampleHeight(new Cesium.Cartographic(e.west, e.north, 0), [this.entity]), t = Cesium.Cartesian3.fromRadians(e.west, e.north, o), o = s.scene.sampleHeight( new Cesium.Cartographic(e.east, e.south, 0), [this.entity])), Cesium .Cartesian3.fromRadians(e.east, e.south, o)), this.entity.pottingPoint = [t, i], [t, i ] }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); let e = this.getPottingPoint(); if (e) { let o = new Cesium.Cartesian3; e.forEach((e, t) => { var i = s.entities.add({ name: "_edit_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this .graphic.heightReference.getValue() } }); V.editPointID.edit.push(i.id), o.x += e.x, o.y += e.y, o.z += e.z }), o.x /= e.length, o.y /= e.length, o.z /= e.length, V.editPointID.move = s .entities.add({ name: "_move_point", position: o, point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }) } }) : "box" === e ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color ? o(t .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? r(t) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData .editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(t, i) { if ("name" === t) this.entity[t] = i; else { if ("color" === t || "outlineColor" === t) { if (i = Cesium.Color.fromCssColorString(i), "color" === t) return void(this.graphic .material.color = i) } else { if ("image" === t || "repeat" === t) return void(this.graphic.material[t] = i); if ("alpha" === t) return void(this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === t) return void(this.graphic.outlineColor._value.alpha = i); if ("long" === t || "width" === t || "height" === t) { let e = this.getValue("dimensions"); if ("long" === t ? e.x = i : "width" === t ? e.y = i : e.z = i, this.graphic .dimensions = new Cesium.CallbackProperty(function() { return e }, !1), "long" === t || "width" === t) { var o = "long" === t ? 90 : 180, r = "long" === t ? 0 : 1, n = V.editPointID.move.position.getValue(), o = a.GetPositionFromA_D(n, i / 2, o); let e = s.entities.getById(V.editPointID.size[r]); e.position = o, this.entity.pottingPoint[r] = o, this.entity.pottingPoint[ this.entity.pottingPoint.length - 1] = n } else { r = a.toDegrees(V.editPointID.move.position.getValue()); this.entity.position = Cesium.Cartesian3.fromDegrees(r.lon, r.lat, r .height + i / 2), this.changeHeightPoint(r.height + i) } return } if ("dimensions" === t) return void(this.graphic.dimensions = new Cesium .CallbackProperty(function() { return i }, !1)) } this.graphic[t] = i } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e = this.getValue("dimensions"), t = this.getValue("position"), i = a.toDegrees(t), t = Cesium.Cartesian3.fromDegrees(i.lon, i.lat, i.height - e.z / 2), i = a.GetPositionFromA_D(t, e.x / 2, 90), e = a.GetPositionFromA_D(t, e.y / 2, 180); return this.entity.pottingPoint = [i, e, t], [i, e, t] }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); var i = this.getPottingPoint(); if (i) { let e = s.entities.add({ name: "_size_point", position: i[0], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), t = (e.angle = 90, s.entities.add({ name: "_size_point", position: i[1], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } })); t.angle = 180, V.editPointID.size.push(e.id), V.editPointID.size.push(t.id), V .editPointID.move = s.entities.add({ name: "_move_point", position: i[2], point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }) } }) : "corridor" === e || "ellipsoid" === e && !n.isSphere || "path" === e || "plane" === e || "polylineVolume" === e || "wall" !== e || ((t = SmartEarthPopupData.editGraphic.getValue( "material")).color ? o(t.color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData.editGraphic.alpha = 60), (e = SmartEarthPopupData.editGraphic.getValue( "outlineColor")) ? r(e) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic .setValue = function(e, t) { if ("name" === e) this.entity[e] = t; else { if ("color" === e) return t = Cesium.Color.fromCssColorString(t), void(this.graphic .material[e] = t); "alpha" === e ? this.graphic.material.color._value.alpha = t : "outlineAlpha" === e ? this.graphic.outlineColor._value.alpha = t : this.graphic[e] = "positions" === e ? new Cesium.CallbackProperty(function() { return t }, !1) : t } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e = this.getValue("positions"); return this.entity.pottingPoint = e }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); let t = this.getPottingPoint(); if (t) { let i = new Cesium.Cartesian3, o = this.getValue("minimumHeights"); t.forEach((e, t) => { e = Cesium.Cartographic.fromCartesian(e), e = Cesium.Cartesian3.fromRadians( e.longitude, e.latitude, o[t]), t = s.entities.add({ name: "_edit_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this .graphic.heightReference.getValue() } }); V.editPointID.edit.push(t.id), i.x += e.x, i.y += e.y, i.z += e.z }), i.x /= t.length, i.y /= t.length, i.z /= t.length, V.editPointID.move = s .entities.add({ name: "_move_point", position: i, point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); for (let e = 0; e < t.length - 1; e++) { var r = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), r = s.entities.add({ name: "_add_point", position: r, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); V.editPointID.add.push(r.id) } } }) }, at.prototype.createBillboardPointGeoJsonFeatureLayer = function(e, t, l, i, u) { null == t && console.log("geojson is required"); var o = this._cesium.GeoJsonDataSource.load(t), c = this, o = (o.then(function(e) { for (var t = { show: !0, position: c._cesium.Cartesian3.ZERO, pixelOffset: c._cesium.Cartesian2.ZERO, eyeOffset: c._cesium.Cartesian3.ZERO, heightReference: c._cesium.HeightReference.NONE, horizontalOrigin: c._cesium.HorizontalOrigin.CENTER, verticalOrigin: c._cesium.VerticalOrigin.CENTER, scale: 1, image: "", imageSubRegion: void 0, color: c._cesium.Color.WHITE, id: void 0, rotation: 0, alignedAxis: c._cesium.Cartesian3.ZERO, width: void 0, height: void 0, scaleByDistance: void 0, translucencyByDistance: void 0, pixelOffsetScaleByDistance: void 0, sizeInMeters: !1, distanceDisplayCondition: void 0 }, i = (c._core.isnull(l) || c._core.isnull(l.color) || /^\[/.test(l.color) && "[" == l.color.charAt(0) && "]" == l.color.charAt(l.color.length - 1) || (c ._core.isHtmlColor(l.color) ? l.color = c._color.colorFromHtmlColor(l .color) : (/^rgb/.test(l.color) && (l.color = c._color .rgbaStringToRgbaObj(l.color)), 1 < l.color.r && (l.color.r = l .color.r / 255), 1 < l.color.g && (l.color.g = l.color.g / 255), 1 < l.color.b && (l.color.b = l.color.b / 255), 1 < l.color.a && (l .color.a = l.color.a / 255), l.color = c._color.createColor(l .color.r, l.color.g, l.color.b, l.color.a))), c._core.extend(t, l, !0)), t = (c._core.isnull(l.near) && (l.near = 0), c._core.isnull(l .far) && (l.far = 999999999), parseFloat(l.near)), o = parseFloat(l.far), r = (new c._cesium.DistanceDisplayCondition(t, o), new c._cesium .BillboardCollection), n = e.entities.values, a = 0; a < n.length; a++) { var s = n[a]; i.position = s.position._value, r.add(i) } t = c._viewer.scene.primitives.add(r); "function" == typeof u && u(t) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "billboardLayer", item: this, url: t, style: options }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, at.prototype.createBillboardGeoJsonFeatureLayerProvider = function(e, t, n, i, o, r) { var a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, s = new v(this._viewer, this._cesium, a), l = (this._Provider = s, this), s = (s._loadTile = function(e) { var t = { show: !0, position: l._cesium.Cartesian3.ZERO, pixelOffset: l._cesium.Cartesian2.ZERO, eyeOffset: l._cesium.Cartesian3.ZERO, heightReference: l._cesium.HeightReference.NONE, horizontalOrigin: l._cesium.HorizontalOrigin.CENTER, verticalOrigin: l._cesium.VerticalOrigin.CENTER, scale: 1, image: "", imageSubRegion: void 0, color: l._cesium.Color.WHITE, id: void 0, rotation: 0, alignedAxis: l._cesium.Cartesian3.ZERO, width: void 0, height: void 0, scaleByDistance: void 0, translucencyByDistance: void 0, pixelOffsetScaleByDistance: void 0, sizeInMeters: !1, distanceDisplayCondition: void 0 }, i = (l._core.isnull(n) || l._core.isnull(n.color) || /^\[/.test(n.color) && "[" == n .color.charAt(0) && "]" == n.color.charAt(n.color.length - 1) || (l._core .isHtmlColor(n.color) ? n.color = l._color.colorFromHtmlColor(n.color) : (/^rgb/ .test(n.color) && (n.color = l._color.rgbaStringToRgbaObj(n.color)), 1 < n .color.r && (n.color.r = n.color.r / 255), 1 < n.color.g && (n.color.g = n .color.g / 255), 1 < n.color.b && (n.color.b = n.color.b / 255), 1 < n .color.a && (n.color.a = n.color.a / 255), n.color = l._color.createColor(n .color.r, n.color.g, n.color.b, n.color.a))), l._core.extend(t, n, !0)), t = (l._core.isnull(n.near) && (n.near = 0), l._core.isnull(n.far) && (n.far = 999999999), parseFloat(n.near)), o = parseFloat(n.far), r = (new l._cesium.DistanceDisplayCondition(t, o), new l._cesium.BillboardCollection); return e.features.forEach(function(e) { var t; i.id = e, /^\[/.test(i.pointHeight) && /\]$/.test(i.pointHeight) ? (t = i .pointHeight.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e .properties[t]), e.geometry.coordinates.push(t), i.position = l ._cesium.Cartesian3.fromDegreesArrayHeights(e.geometry.coordinates)[0] ) : i.pointHeight ? (t = parseFloat(i.pointHeight), e.geometry .coordinates.push(t), i.position = l._cesium.Cartesian3 .fromDegreesArrayHeights(e.geometry.coordinates)[0]) : i.position = l ._cesium.Cartesian3.fromDegreesArray(e.geometry.coordinates)[0], i.id .treeID = n.id, i.id.VectorType = "billboard", i.id.VectorStyle = { position: i.position, pointHeight: t, rotation: i.rotation, width: i.width, height: i.height, image: i.image, color: i.color, scale: i.scale, heightReference: i.heightReference, horizontalOrigin: i.horizontalOrigin, verticalOrigin: i.verticalOrigin, scaleByDistance: i.scaleByDistance, distanceDisplayCondition: i.distanceDisplayCondition }, r.add(i) }), r }, n && n.time && (s.availability = new l._cesium.TimeIntervalCollection([new l._cesium .TimeInterval({ start: n.time.start ? l._cesium.JulianDate.fromDate(new Date(n.time .start)) : l._cesium.Iso8601.MINIMUM_VALUE, stop: n.time.end ? l._cesium.JulianDate.fromDate(new Date(n.time.end)) : l ._cesium.Iso8601.MAXIMUM_VALUE }) ])), this.item = s._primitiveCollection, s.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + n .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "imageLayer", item: this, url: a.url, style: n }); return this._Provider.treeID = n.id, this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull( i) ? 0 : i), "function" == typeof r && r(this.item), this }, at.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, at.prototype.setRefresh = function(e) { try { this._Provider && this._Provider.setStatus(e) } catch (e) {} }, at.prototype.setVisibility = function(e) { this.item.show = e, this._Provider && this._Provider.setStatus(!e), e || this.item.removeAll() }, at.prototype.deleteObject = function() { if (null != this._Provider && this._Provider.setStatus(!1), null != this.items && null != this.items && 0 < this.items.length) for (var e = 0; e < this.items.length; e++) this._viewer.scene.primitives.remove(this.items[e]); else this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) {} }, at.prototype.setTreeobj = function(e) { this.treeobj = e }, at.prototype.edit = function(e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider .edit(e, t) }, at.prototype.forceRefresh = function() { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) this._Provider.quadtree ._levelZeroTiles[e].freeResources() } catch (e) {} }, C.prototype.createGeojsonFeatureLayer = function(e, t, i, o, r, s) { var n = t.url, a = t.maxLevel, l = t.minLevel, u = this._core.StyleContrastGeoJson(i, this._cesium), c = (null == n && console.log("geojson is required"), null), c = n.then ? n : this._cesium.GeoJsonDataSource.load(n), h = (this._viewer.dataSources.add(c), this), c = (!this.setNearAndFar && a && l && (this.setNearAndFar = !0, this.Level = 0, this._viewer.scene .preRender.addEventListener(function() { h.isShow && h.item && (h.Level = h.getLevel(), h.Level >= l && h.Level <= a && !h .item.show ? h.item.show = !0 : (h.Level < l || h.Level > a) && (h.item .show = !1)) })), c.then(function(e) { for (var t = (h.item = e).entities.values, i = 0; i < t.length; i++) { var o, r, n, a = t[i]; null != u.point && ((o = u.point).color = h._color.VectorColorTransformation(o .color, a), o.outlineColor = h._color.VectorColorTransformation(o .outlineColor, a), null != o.pointHeight && (a.position._value = h._core .setheight(a.position._value, o.pointHeight, h._cesium, h._viewer), delete o.pointHeight), a.point = new h._cesium.PointGraphics(o)), null != u .label && ((o = u.label).fillColor = h._color.VectorColorTransformation(o .fillColor, a), o.outlineColor = h._color.VectorColorTransformation(o .outlineColor, a), null != o.pointHeight && (a.position._value = h._core .setheight(a.position._value, o.pointHeight, h._cesium, h._viewer), delete o.pointHeight), a.label = new h._cesium.LabelGraphics(o)), null != u .billboard && ((r = u.billboard).color = h._color.VectorColorTransformation(r .color, a), null != r.pointHeight && (a.position._value = h._core .setheight(a.position._value, r.pointHeight, h._cesium, h._viewer), delete r.pointHeight), a.billboard = new h._cesium.BillboardGraphics(r)), null != u.polyline && ((r = u.polyline).material = h._color .VectorColorTransformation(r.material, a), r.positions = a.polyline .positions, null != r.pointHeight && (a.position._value = h._core .setpolylineheight(a.position._value, r.pointHeight, h._cesium, h ._viewer), delete r.pointHeight), a.polyline = new h._cesium .PolylineGraphics(r)), null != u.polygon && ((n = u.polygon).hierarchy = a .polygon.hierarchy, n.material = h._color.VectorColorTransformation(n .material, a), n.outlineColor = h._color.VectorColorTransformation(n .outlineColor, a), n.outlineColor && (n.outline = !0), a.polygon = new h ._cesium.PolygonGraphics(n)) } "function" == typeof s && s(e) }), this._core.isnull(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), r ? h.isShow = !0 : h.setVisibility(!1), { id: u.id, name: e, checked: r, pId: this._core.isnull(o) ? 0 : o, type: "datasource", item: this, url: n, style: u, treeData: { name: e, geoOptions: t, styleOption: i, GroupID: o, checked: r, disFnc: s } }); return this.setTreeobj(c), this._tree.insertGroupId(c, this._core.isnull(o) ? 0 : o), this }, C.prototype.createGeojsonKmlFeatureLayer = function(e, t, i, o, r) { var n = t, a = { camera: this._viewer.scene.camera, canvas: this._viewer.scene.canvas }, n = (this._viewer.dataSources.add(this._cesium.KmlDataSource.load(t, a)), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a.id), o || this .setVisibility(!1), { id: a.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "datasource", item: this, url: n, style: a, treeData: { name: e, geoOptions: t, styleOption: "", GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), this }, C.prototype.createGeoJsonFeatureLayerAlawys = function(e, t, s, i, l) { var u, o = { id: this._core.getuid(), layertype: "", text: "", font: "16px", fillColor: this._cesium.WHITE, outlineColor: this._cesium.BLACK, outlineWidth: "1.0", scale: "1.0", maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, icon: "" }, c = (this._core.isnull(s) || this._core.isnull(s.fillColor) || "[" == s.fillColor.toString().charAt( 0) && "]" == s.fillColor.toString().charAt(s.fillColor.length - 1) || (this._core .isHtmlColor(s.fillColor) ? s.fillColor = this._color.colorFromHtmlColor(s.fillColor) : s .fillColor = this._color.createColor(s.fillColor.r, s.fillColor.g, s.fillColor.b, s .fillColor.a)), this._core.isnull(s) || this._core.isnull(s.outlineColor) || "[" == s .outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor .length - 1) || (this._core.isHtmlColor(s.outlineColor) ? s.outlineColor = this._color .colorFromHtmlColor(s.outlineColor) : s.outlineColor = this._color.createColor(s .outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a)), this._core .extend(o, s, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), h = (this._viewer.dataSources.add(o), this), o = (s && s.time && (u = new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({ start: s.time.start ? h._cesium.JulianDate.fromDate(new Date(s.time .start)) : h._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? h._cesium.JulianDate.fromDate(new Date(s.time.end)) : h ._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function(e) { for (var t = (h.item = e).entities.values, i = 0; i < t.length; i++) { var o, r = t[i], n = (c.id = h._core.extendgl(r, s.id, c.id), c.text = h._core.extendgl(r, s .text, c.text), c.font = h._core.extendgl(r, s.font, c.font), c .fillColor = h._core.extendgl(r, s.fillColor, c.fillColor), c.outlineColor = h._core.extendgl(r, s.outlineColor, c.outlineColor), c.outlineWidth = parseInt(h._core.extendgl(r, s.outlineWidth, c.outlineWidth)), c.scale = parseFloat(h._core.extendgl(r, s.scale, c.scale)), c.image = h._core .extendgl(r, s.image, c.image), c.icon = h._core.extendgl(r, s.icon, c .icon), parseFloat(h._core.extendgl(r, c.minDistanceDisplay || c.near))), a = parseFloat(h._core.extendgl(r, c.maxDistanceDisplay || c.far)), n = new h._cesium.DistanceDisplayCondition(n, a); r.billboard && (c ? (h._core.isUrl(r.properties[c.icon]) || h._core.isUrl(c .icon)) && !h._core.isnull(r.properties[c.text]) || !h._core.isnull(c .text) ? (o = "fillColor:" + 255 * c.fillColor.red + "," + 255 * c.fillColor .green + "," + 255 * c.fillColor.blue + ";outlineColor:" + 255 * c .outlineColor.red + "," + 255 * c.outlineColor.green + "," + 255 * c .outlineColor.blue, h.Legend.push(o), r.label = { id: "my label", text: h._core.isnull(r.properties[c.text]) ? c.text : r.properties[c .text] + "", font: c.font + " sans-serif", fillColor: c.fillColor, outlineColor: c.outlineColor, outlineWidth: c.outlineWidth, scale: parseFloat(c.scale), distanceDisplayCondition: n }, r.billboard = { image: h._core.isUrl(r.properties[c.icon]) ? r.properties[c.icon] : c.icon, distanceDisplayCondition: n }) : h._core.isnull(c.icon) ? h._core.isnull(r.properties[c.text]) && h ._core.isnull(c.text) ? (o = "color:" + 255 * c.fillColor.red + "," + 255 * c.fillColor.green + "," + 255 * c.fillColor.blue, h.Legend.push(o), r .billboard = void 0, r.point = new h._cesium.PointGraphics({ color: h._cesium.Color.RED, pixelSize: 10, distanceDisplayCondition: n })) : (r.billboard = void 0, o = "fillColor:" + 255 * c.fillColor.red + "," + 255 * c.fillColor.green + "," + 255 * c.fillColor.blue + ";outlineColor:" + 255 * c.outlineColor.red + "," + 255 * c.outlineColor .green + "," + 255 * c.outlineColor.blue, h.Legend.push(o), r.label = { id: "my label", text: h._core.isnull(r.properties[c.text]) ? c.text : r.properties[c .text] + "", font: c.font + " sans-serif", fillColor: c.fillColor, outlineColor: c.outlineColor, outlineWidth: c.outlineWidth, scale: parseFloat(c.scale), distanceDisplayCondition: n }) : r.billboard = { image: h._core.isUrl(r.properties[c.icon]) ? r.properties[c.icon] : c .icon, distanceDisplayCondition: n } : r.polygon ? r.polygon.distanceDisplayCondition = n : r.polyline && (r .polyline.distanceDisplayCondition = n), u && (r.availability = u)) } "function" == typeof l && l(e) }), this._core.isnull(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + c.id), { id: c.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t, style: c, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: !0, disFnc: l } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.createGeoJsonFeatureLayer = function(t, e, i, o, r, n) { var a = this._cesium.GeoJsonDataSource.load(e), s = this; return a.then(function(e) { e = e.entities.values[0]; /^point.fid/.test(e._id) || null != e.point ? s.createPointGeojsonFeatureLayer(t, a, i, o, r, n) : /^polygon.fid/.test(e._id) || null != e.polygon ? s .createPolygonGeoJsonFeatureLayer(t, a, i, o, r, n) : /^line.fid/.test(e._id) || null != e.polyline ? s.createPolylineGeoJsonFeatureLayer(t, a, i, o, r, n) : s .createGeoJsonFeatureLayerAlawys(t, a, i, o, n) }), this }, C.prototype.createPointGeojsonFeatureLayer = function(e, t, s, i, l, u) { var c, o = { color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1), height: 0, pointHeight: 0, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, h = (this._core.isnull(s) || this._core.isnull(s.color) || "[" == s.color.toString().charAt(0) && "]" == s.color.toString().charAt(s.color.length - 1) || (this._core.isHtmlColor(s.color) ? s .color = this._color.colorFromHtmlColor(s.color) : (/^rgb/.test(s.color) && (s.color = this ._color.rgbaStringToRgbaObj(s.color)), 1 < s.color.r && (s.color.r = s.color.r / 255), 1 < s.color.g && (s.color.g = s.color.g / 255), 1 < s.color.b && (s.color.b = s.color.b / 255), 1 < s.color.a && (s.color.a = s.color.a / 255), s.color = this ._color.createColor(s.color.r, s.color.g, s.color.b, s.color.a))), this._core.isnull( s) || this._core.isnull(s.outlineColor) || "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (this._core.isHtmlColor(s .outlineColor) ? s.outlineColor = this._color.colorFromHtmlColor(s.outlineColor) : ( /^rgb/.test(s.outlineColor) && (s.outlineColor = this._color.rgbaStringToRgbaObj(s .outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s .outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = this._color.createColor(s .outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))), this._core .extend(o, s, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), m = (this._viewer.dataSources.add(o), this), o = (s && s.time && (c = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time .start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function(e) { for (var t = (m.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (h.color = m._core.extendgl(o, s.color, h.color), h.pixelSize = parseInt(m ._core.extendgl(o, s.pixelSize, h.pixelSize)), h.outlineColor = m._core .extendgl(o, s.outlineColor, h.outlineColor), h.outlineWidth = parseFloat(m ._core.extendgl(o, s.outlineWidth, h.outlineWidth)), h.show = m._core .extendgl(o, s.show, h.show), h.height = parseFloat(m._core.extendgl(o, s .height, h.height)), h.scaleByDistance = m._core.extendgl(o, s .scaleByDistance, h.scaleByDistance), parseFloat(m._core.extendgl(o, h .minDistanceDisplay || h.near))), n = parseFloat(m._core.extendgl(o, h.maxDistanceDisplay || h.far)), r = new m._cesium.DistanceDisplayCondition(r, n), n = "color:" + 255 * h.color.red + "," + 255 * h.color.green + "," + 255 * h .color.blue + ";outlineColor:" + 255 * h.outlineColor.red + "," + 255 * h .outlineColor.green + "," + 255 * h.outlineColor.blue, n = (m.Legend.push(n), h.distanceDisplayCondition = r, h.pointHeight = m._core .extendgl(o, s.pointHeight, h.pointHeight), h.pointHeight = parseFloat(h .pointHeight), m._viewer.scene.globe.ellipsoid, m._cesium.Cartographic .fromCartesian(o.position._value)), r = m._cesium.Math.toDegrees(n.longitude), a = m._cesium.Math.toDegrees(n.latitude), n = h.pointHeight || n.height, r = new m._cesium.Cartesian3.fromDegrees(r, a, n), a = (o.position._value = r, o.point = new m._cesium.PointGraphics(h), o .billboard = void 0, { positions: r }); o.description = a, c && (o.availability = c) } l || m.setVisibility(!1), "function" == typeof u && u(e) }), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), { id: h.id, name: e, checked: l, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t, style: h, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: l, disFnc: u } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.createModelGeojsonFeatureLayer = function(e, t, i = {}, o, n, a) { var s, r = { color: Cesium.Color.fromCssColorString(i.color || "#ffffff"), url: window.SmartEarthRootUrl + D.testModel, scale: 1, minimumPixelSize: 0, height: 0, far: 5e3, near: 0 }, l = this._core.extend(r, i, !0), r = (null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t), u = (this._viewer.dataSources.add(r), i && i.time && (s = new this._cesium.TimeIntervalCollection([ new this._cesium.TimeInterval({ start: i.time.start ? this._cesium.JulianDate.fromDate(new Date(i.time .start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: i.time.end ? this._cesium.JulianDate.fromDate(new Date(i.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE }) ])), parseFloat(l.near)), c = parseFloat(l.far), h = new Cesium.DistanceDisplayCondition(u, c), u = (r.then(e => { for (var t = (this.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = this._core.toDegrees(o.position.getValue()), r = (l.height && (r.height = l.height), new Cesium.Cartesian3.fromDegrees(r.lon, r.lat, r.height)); o.position = r, o.model = new Cesium.ModelGraphics({ uri: l.url, distanceDisplayCondition: h, ...l }), o.billboard = void 0, o.point = void 0, s && (o.availability = s) } n || this.setVisibility(!1), "function" == typeof a && a(e) }), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), { id: l.id, name: e, checked: n, pId: this._core.isnull(o) ? 0 : o, type: "pointLayer", item: this, url: t, style: l, treeData: { name: e, geoOptions: t, styleOption: i, GroupID: o, checked: n, disFnc: a } }); return this.setTreeobj(u), this._tree.insertGroupId(u, this._core.isnull(o) ? 0 : o), this }, C.prototype.createCirclePointGeoJsonFeatureLayer = function(e, t, a, i, s) { var o = { semiMajorAxis: 1, semiMinorAxis: 1, height: 0, heightReference: this._cesium.HeightReference.NONE, extrudedHeight: 0, extrudedHeightReference: this._cesium.HeightReference.NONE, show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, l = (this._core.isnull(a) || this._core.isnull(a.outlineColor) || "[" == a.outlineColor.toString() .charAt(0) && "]" == a.outlineColor.toString().charAt(a.outlineColor.length - 1) || (this._core .isHtmlColor(a.outlineColor) ? a.outlineColor = this._color.colorFromHtmlColor(a .outlineColor) : (/^rgb/.test(a.outlineColor) && (a.outlineColor = this._color .rgbaStringToRgbaObj(a.outlineColor)), 1 < a.outlineColor.r && (a.outlineColor.r = a .outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor.g = a.outlineColor .g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor.a / 255), a.outlineColor = this ._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor .a))), this._core.isnull(a) || this._core.isnull(a.material) || "[" == a.material .toString().charAt(0) && "]" == a.material.toString().charAt(a.material.length - 1) || "(" == a .material.toString().charAt(0) && ")" == a.material.toString().charAt(a.material.length - 1) || (this._core.isHtmlColor(a.material) ? a.material = this._color.colorFromHtmlColor(a.material) : (/^rgb/.test(a.material) && (a.material = this._color.rgbaStringToRgbaObj(a.material)), 1 < a.material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a .material.a && (a.material.a = a.material.a / 255), a.material = this._color .createColor(a.material.r, a.material.g, a.material.b, a.material.a))), this._core .isnull(a) || this._core.isnull(a.radius) || (o.semiMajorAxis = a.radius, o.semiMinorAxis = a .radius), (void 0)._core.isnull(a.near) && (a.near = 0), (void 0)._core.isnull(a.far) && (a .far = 999999999), this._core.extend(o, a, !0)), o = (null == t && console.log("geojson is required"), this._cesium.GeoJsonDataSource.load(t)), u = (this._viewer.dataSources.add(o), this), o = (o.then(function(e) { for (var t = (u.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (l.semiMajorAxis = parseFloat(u._core.extendgl(o, a.semiMajorAxis, l .semiMajorAxis)), l.semiMinorAxis = parseFloat(u._core.extendgl(o, a .semiMinorAxis, l.semiMinorAxis)), l.height = parseFloat(u._core .extendgl(o, a.height, l.height)), l.heightReference = u._core.extendgl( o, a.heightReference, l.heightReference), l.extrudedHeight = parseFloat( u._core.extendgl(o, a.extrudedHeight, l.extrudedHeight)), l .extrudedHeightReference = u._core.extendgl(o, a.extrudedHeightReference, l .extrudedHeightReference), l.show = u._core.extendgl(o, a.show, l.show), l.fill = u._core.extendgl(o, a.fill, l.fill), l.material = u._core.extendgl( o, a.material, l.material), l.outline = u._core.extendgl(o, a.outline, l .outline), l.outlineColor = u._core.extendgl(o, a.outlineColor, l .outlineColor), l.outlineWidth = parseFloat(u._core.extendgl(o, a .outlineWidth, l.outlineWidth)), l.scaleByDistance = u._core.extendgl(o, a.scaleByDistance, l.scaleByDistance), "material:" + 255 * l.material .red + "," + 255 * l.material.green + "," + 255 * l.material.blue + ";outlineColor:" + 255 * l.outlineColor.red + "," + 255 * l.outlineColor .green + "," + 255 * l.outlineColor.blue), r = (u.Legend.push(r), parseFloat(u._core.extendgl(o, l.near))), n = parseFloat(u._core.extendgl(o, l.far)), r = new u._cesium.DistanceDisplayCondition(r, n); l.distanceDisplayCondition = r, o.billboard = void 0, o.ellipse = new u._cesium .EllipseGraphics(l) } "function" == typeof s && s(e) }), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), { id: l.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "layer", item: this, url: t, style: l, treeData: { name: e, geoOptions: t, styleOption: a, GroupID: i, checked: !0, disFnc: s } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.createModelPointGeoJsonFeatureLayer = function(e, t, s, i, l, u) { var c, o = { uri: "", show: !0, scale: 1, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, lightColor: void 0, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1), color: this._cesium.Color.WHITE, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, h = this, m = (this._core.isnull(s) || this._core.isnull(s.color) || (this._core.isHtmlColor(s.color) ? s .color = this._color.colorFromHtmlColor(s.color) : (/^rgb/.test(s.color) && (s.color = this ._color.rgbaStringToRgbaObj(s.color)), 1 < s.color.r && (s.color.r = s.color.r / 255), 1 < s.color.g && (s.color.g = s.color.g / 255), 1 < s.color.b && (s.color.b = s.color.b / 255), 1 < s.color.a && (s.color.a = s.color.a / 255), s.color = this ._color.createColor(s.color.r, s.color.g, s.color.b, s.color.a))), h._core.isnull(s .near) && (s.near = 0), h._core.isnull(s.far) && (s.far = 999999999), this._core.extend(o, s, !0)), o = (null == t && console.log("geojson is required"), this._cesium.GeoJsonDataSource.load(t)), o = (this._viewer.dataSources.add(o), s && s.time && (c = new h._cesium.TimeIntervalCollection([ new h._cesium.TimeInterval({ start: s.time.start ? h._cesium.JulianDate.fromDate(new Date(s.time .start)) : h._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? h._cesium.JulianDate.fromDate(new Date(s.time.end)) : h ._cesium.Iso8601.MAXIMUM_VALUE }) ])), o.then(function(e) { for (var t = (h.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (m.uri = h._core.extendgl(o, s.uri, m.uri), m.scale = parseFloat(h._core .extendgl(o, s.scale, m.scale)), m.incrementallyLoadTextures = h._core .extendgl(o, s.incrementallyLoadTextures, m.incrementallyLoadTextures), m .runAnimations = h._core.extendgl(o, s.runAnimations, m.runAnimations), m .clampAnimations = h._core.extendgl(o, s.clampAnimations, m .clampAnimations), m.shadows = h._core.extendgl(o, s.shadows, m.shadows), m .heightReference = h._core.extendgl(o, s.heightReference, m .heightReference), m.lightColor = h._core.extendgl(o, s.lightColor, m .lightColor), m.scaleByDistance = h._core.extendgl(o, s.scaleByDistance, m.scaleByDistance), m.color = h._core.extendgl(o, s.color, m.color), m .height ? m.height = parseFloat(h._core.extendgl(o, s.height, m.height)) : m .height = void 0, parseFloat(h._core.extendgl(o, s.near, m.near))), n = parseFloat(h._core.extendgl(o, s.far, m.far)), a = "color:" + 255 * m.color.red + "," + 255 * m.color.green + "," + 255 * m .color.blue, a = (h.Legend.push(a), new h._cesium.DistanceDisplayCondition(r, n)); m.distanceDisplayCondition = a, o.billboard = void 0, o.model = new h._cesium .ModelGraphics(m), m.height && (r = h._cesium.Cartographic.fromCartesian(o .position._value), n = h._cesium.Math.toDegrees(r.longitude), a = h ._cesium.Math.toDegrees(r.latitude), o.position = h._cesium.Cartesian3 .fromDegrees(n, a, m.height)), c && (o.availability = c) } "function" == typeof u && u(e), l || h.setVisibility(!1) }), this._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), { id: m.id, name: e, checked: l, pId: this._core.isnull(i) ? 0 : i, type: "modelLayer", item: this, url: t, style: m, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: !0, disFnc: u } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.createLabelPointGeoJsonFeatureLayer = function(l, e, u, t, c, h) { var m, i = { Name: "", text: "test", font: " 30px sans-serif", style: this._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(15, 15), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.RELATIVE_TO_GROUND, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1), pointHeight: 0, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, addHeight: 0 }, d = this, p = (this._core.isnull(u) || this._core.isnull(u.fillColor) || (this._core.isHtmlColor(u .fillColor) ? u.fillColor = this._color.colorFromHtmlColor(u.fillColor) : (/^rgb/.test(u .fillColor) && (u.fillColor = this._color.rgbaStringToRgbaObj(u.fillColor)), 1 < u .fillColor.r && (u.fillColor.r = u.fillColor.r / 255), 1 < u.fillColor.g && (u.fillColor .g = u.fillColor.g / 255), 1 < u.fillColor.b && (u.fillColor.b = u.fillColor.b / 255), 1 < u.fillColor.a && (u.fillColor.a = u.fillColor.a / 255), u.fillColor = this ._color.createColor(u.fillColor.r, u.fillColor.g, u.fillColor.b, u.fillColor.a))), this ._core.isnull(u) || this._core.isnull(u.outlineColor) || (this._core.isHtmlColor(u .outlineColor) ? u.outlineColor = this._color.colorFromHtmlColor(u.outlineColor) : (/^rgb/ .test(u.outlineColor) && (u.outlineColor = this._color.rgbaStringToRgbaObj(u .outlineColor)), 1 < u.outlineColor.r && (u.outlineColor.r = u.outlineColor.r / 255), 1 < u.outlineColor.g && (u.outlineColor.g = u.outlineColor.g / 255), 1 < u .outlineColor.b && (u.outlineColor.b = u.outlineColor.b / 255), 1 < u.outlineColor.a && (u.outlineColor.a = u.outlineColor.a / 255), u.outlineColor = this._color.createColor(u .outlineColor.r, u.outlineColor.g, u.outlineColor.b, u.outlineColor.a))), this._core .isnull(u) || this._core.isnull(u.backgroundColor) || (this._core.isHtmlColor(u .backgroundColor) ? u.backgroundColor = this._color.colorFromHtmlColor(u.backgroundColor) : (/^rgb/.test(u.backgroundColor) && (u.backgroundColor = this._color.rgbaStringToRgbaObj(u .backgroundColor)), 1 < u.backgroundColor.r && (u.backgroundColor.r = u .backgroundColor.r / 255), 1 < u.backgroundColor.g && (u.backgroundColor.g = u .backgroundColor.g / 255), 1 < u.backgroundColor.b && (u.backgroundColor.b = u .backgroundColor.b / 255), 1 < u.backgroundColor.a && (u.backgroundColor.a = u .backgroundColor.a / 255), u.backgroundColor = this._color.createColor(u .backgroundColor.r, u.backgroundColor.g, u.backgroundColor.b, u.backgroundColor.a))), d ._core.isnull(u.near) && (u.near = 0), d._core.isnull(u.far) && (u.far = 999999999), u && u .time && (m = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: u.time.start ? this._cesium.JulianDate.fromDate(new Date(u.time .start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: u.time.end ? this._cesium.JulianDate.fromDate(new Date(u.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), this._core.extend(i, u, !0)), i = (null == e && console.log("geojson is required"), this._cesium.GeoJsonDataSource.load(e)), d = (this._viewer.dataSources.add(i), this), i = (i.then(function(e) { var t = (d.item = e).entities.values; d._core.isnull(p.font_size) && (p.font_size = "30px"), d._core.isnull(p.font_family) && (p.font_family = " sans-serif"), -1 == p.font_size.toString().indexOf("px") ? p .font = p.font_size + "px " + p.font_family : p.font = p.font_size + " " + p .font_family; for (var i = 0; i < t.length; i++) { var o = t[i], r = (p.font = d._core.extendgl(o, u.font, p.font), p.style = parseInt(d._core .extendgl(o, p.style, p.style)), p.fillColor = d._core.extendgl(o, u .fillColor, p.fillColor), p.outlineColor = d._core.extendgl(o, u .outlineColor, p.outlineColor), p.outlineWidth = parseFloat(d._core .extendgl(o, u.outlineWidth, p.outlineWidth)), p.show = d._core .extendgl(o, u.show, p.show), p.showBackground = d._core.extendgl(o, u .showBackground, p.showBackground), p.backgroundColor = d._core .extendgl(o, u.backgroundColor, p.backgroundColor), p.backgroundPadding = d ._core.extendgl(o, u.backgroundPadding, p.backgroundPadding), p.scale = parseFloat(d._core.extendgl(o, u.scale, p.scale)), p.horizontalOrigin = d ._core.extendgl(o, u.horizontalOrigin, p.horizontalOrigin), p.pointHeight = parseFloat(d._core.extendgl(o, u.pointHeight, p.pointHeight)), p.text = d ._core.extendgl(o, u.text, p.text).toString(), parseFloat(d._core.extendgl( o, p.near))), n = parseFloat(d._core.extendgl(o, p.far)), r = new d._cesium.DistanceDisplayCondition(r, n), a = (p.distanceDisplayCondition = r, null != p.image && null != p.image && 0 < p .image.length ? (o.billboard.image = p.image, o.billboard.scale = p.scale, o .billboard.color = p.fillColor, o.billboard.verticalOrigin = p .verticalOrigin, o.billboard.horizontalOrigin = p.horizontalOrigin, o .billboard.disableDepthTestDistance = p.disableDepthTestDistance, o .billboard.heightReference = p.heightReference, o.billboard .distanceDisplayCondition = p.distanceDisplayCondition) : "ellipsoidlayer" == p.layertype ? (o.billboard = void 0, o.name = l, a = { show: !0, radii: new d._cesium.Cartesian3(p.long_axis, p.short_axis, p .long_axis), material: d._cesium.Color.fromRandom({ alpha: 1 }) }, o.ellipsoid = new d._cesium.EllipsoidGraphics(a), o.ellipsoid .heightReference = p.heightReference, o.ellipsoid.material = url) : (o .billboard = void 0, n = { Name: p.Name, text: p.text, font: p.font, style: p.stylet, ...p }, r = "fillColor:" + 255 * p.fillColor.red + "," + 255 * p.fillColor .green + "," + 255 * p.fillColor.blue + ";outlineColor:" + 255 * p .outlineColor.red + "," + 255 * p.outlineColor.green + "," + 255 * p .outlineColor.blue, d.Legend.push(r), o.label = new d._cesium .LabelGraphics(n), m && (o.availability = m)), d._viewer.scene.globe .ellipsoid), r = d._cesium.Cartographic.fromCartesian(o.position._value), n = d._cesium.Math.toDegrees(r.longitude), s = d._cesium.Math.toDegrees(r.latitude), r = (p.pointHeight || r.height) + p.addHeight, n = new d._cesium.Cartesian3.fromDegrees(n, s, r), s = { positions: o.position._value = n }; o.description = s } c || d.setVisibility(!1), "function" == typeof h && h(e) }), this._core.isnull(p.id) && (p.id = this._core.getuid()), this._core.isnull(l) && (l = "新建街景" + p.id), { id: p.id, name: l, checked: c, pId: this._core.isnull(t) ? 0 : t, type: "labelPointLayer", item: this, url: e, style: p, treeData: { name: l, geoOptions: e, styleOption: u, GroupID: t, checked: c, disFnc: h } }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(t) ? 0 : t), this }, C.prototype.createStreetscapeGeoJsonFeatureLayer = function(e, t, u, i, c, h) { var m, o = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !0, width: 1, show: !0, material: this._cesium.Color.RED, height: 30, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, d = this, p = (this._core.isnull(u) || this._core.isnull(u.material) || "[" == u.material.toString().charAt( 0) && "]" == u.material.toString().charAt(u.material.length - 1) || "(" == u.material.toString() .charAt(0) && ")" == u.material.toString().charAt(u.material.length - 1) || (this._core .isHtmlColor(u.material) ? u.material = this._color.colorFromHtmlColor(u.material) : (/^rgb/ .test(u.material) && (u.material = this._color.rgbaStringToRgbaObj(u.material)), 1 < u .material.r && (u.material.r = u.material.r / 255), 1 < u.material.g && (u.material.g = u.material.g / 255), 1 < u.material.b && (u.material.b = u.material.b / 255), 1 < u .material.a && (u.material.a = u.material.a / 255), u.material = this._color .createColor(u.material.r, u.material.g, u.material.b, u.material.a)), "1" == u .arcType || 1 == u.arcType ? u.material = new Cesium.PolylineDashMaterialProperty({ color: u.material }) : u.material = u.material), d._core.isnull(u.near) && (u.near = 0), d._core.isnull(u .far) && (u.far = 999999999), this._core.extend(o, u, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), o = (this._viewer.dataSources.add(o, { camera: this._viewer.scene.camera, canvas: this._viewer.scene.canvas, clampToGround: !0 }), u && u.time && (m = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: u.time.start ? this._cesium.JulianDate.fromDate(new Date(u.time .start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: u.time.end ? this._cesium.JulianDate.fromDate(new Date(u.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function(e) { for (var t = (d.item = e).entities.values, i = 0; i < t.length; i++) { var o, r, n = t[i], a = (p.arcType = d._core.extendgl(n, u.arcType, p.arcType), p.clampToGround = d ._core.extendgl(n, u.clampToGround, p.clampToGround), p.width = parseFloat(d ._core.extendgl(n, u.width, p.width)), p.show = d._core.extendgl(n, u .show, p.show), p.material = d._core.extendgl(n, u.material, p .material), p.height = parseFloat(d._core.extendgl(n, u.height, p.height)), parseFloat(d._core.extendgl(n, p.near))), s = parseFloat(d._core.extendgl(n, p.far)), a = new d._cesium.DistanceDisplayCondition(a, s), l = (p.distanceDisplayCondition = a, n.polyline.arcType = !0, 0 == p .heightReference ? n.polyline.arcType = 0 : n.polyline.arcType = 1, n .polyline.clampToGround = p.clampToGround, n.polyline.width = p.width, n .polyline.height = p.height, n.polyline.show = p.show, n.polyline.material = p.material, n.polyline.distanceDisplayCondition = a, []), s = (n.polyline.positions._value.forEach(function(e) { p.height ? (r = d._cesium.Cartographic.fromCartesian(e), o = d ._cesium.Math.toDegrees(r.longitude), r = d._cesium.Math .toDegrees(r.latitude), l.push(d._cesium.Cartesian3 .fromDegrees(o, r, p.height))) : l.push(e) }), n.polyline.positions = l, m && (n.availability = m), "material:" + 255 * p.material.red + "," + 255 * p.material.green + "," + 255 * p.material.blue ); d.Legend.push(s) } c || d.setVisibility(!1), "function" == typeof h && h(e) }), this._core.isnull(p.id) && (p.id = this._core.getuid()), this._core.isnull(e) && (e = "新建街景" + p.id), { id: p.id, name: e, checked: c, pId: this._core.isnull(i) ? 0 : i, type: "Streetscape", item: this, url: t, style: p, treeData: { name: e, geoOptions: t, styleOption: u, GroupID: i, checked: c, disFnc: h } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.createEllipsoidlayerPointGeoJsonFeatureLayer = function(e, t, a, i, s) { var o = { Name: "", text: "", font: " 30px sans-serif", style: this._cesium.LabelStyle.OUTLINE, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, l = (this._core.isnull(a) || this._core.isnull(a.fillColor) || "[" == a.fillColor.toString().charAt( 0) && "]" == a.fillColor.toString().charAt(a.fillColor.length - 1) || "(" == a.material .toString().charAt(0) && ")" == a.material.toString().charAt(a.material.length - 1) || (this ._core.isHtmlColor(a.fillColor) ? a.fillColor = this._color.colorFromHtmlColor(a .fillColor) : (/^rgb/.test(a.fillColor) && (a.fillColor = this._color.rgbaStringToRgbaObj(a .fillColor)), 1 < a.fillColor.r && (a.fillColor.r = a.fillColor.r / 255), 1 < a .fillColor.g && (a.fillColor.g = a.fillColor.g / 255), 1 < a.fillColor.b && (a.fillColor .b = a.fillColor.b / 255), 1 < a.fillColor.a && (a.fillColor.a = a.fillColor.a / 255), a.fillColor = this._color.createColor(a.fillColor.r, a.fillColor.g, a .fillColor.b, a.fillColor.a))), this._core.isnull(a) || this._core.isnull(a .outlineColor) || "[" == a.outlineColor.toString().charAt(0) && "]" == a.outlineColor .toString().charAt(a.outlineColor.length - 1) || (this._core.isHtmlColor(a.outlineColor) ? a .outlineColor = this._color.colorFromHtmlColor(a.outlineColor) : (/^rgb/.test(a .outlineColor) && (a.outlineColor = this._color.rgbaStringToRgbaObj(a .outlineColor)), 1 < a.outlineColor.r && (a.outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor.g = a.outlineColor.g / 255), 1 < a.outlineColor .b && (a.outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a .outlineColor.a = a.outlineColor.a / 255), a.outlineColor = this._color.createColor( a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), this ._core.isnull(a) || this._core.isnull(a.backgroundColor) || "[" == a.backgroundColor.toString() .charAt(0) && "]" == a.backgroundColor.toString().charAt(a.backgroundColor.length - 1) || (this ._core.isHtmlColor(a.backgroundColor) ? a.backgroundColor = this._color.colorFromHtmlColor(a .backgroundColor) : (/^rgb/.test(a.backgroundColor) && (a.backgroundColor = this._color .rgbaStringToRgbaObj(a.backgroundColor)), 1 < a.backgroundColor.r && (a .backgroundColor.r = a.backgroundColor.r / 255), 1 < a.backgroundColor.g && (a .backgroundColor.g = a.backgroundColor.g / 255), 1 < a.backgroundColor.b && (a .backgroundColor.b = a.backgroundColor.b / 255), 1 < a.backgroundColor.a && (a .backgroundColor.a = a.backgroundColor.a / 255), a.backgroundColor = this._color .createColor(a.backgroundColor.r, a.backgroundColor.g, a.backgroundColor.b, a .backgroundColor.a))), (void 0)._core.isnull(a.near) && (a.near = 0), (void 0)._core .isnull(a.far) && (a.far = 999999999), this._core.extend(o, a, !0)), o = (null == t && console.log("geojson is required"), this._cesium.GeoJsonDataSource.load(t)), u = (this._viewer.dataSources.add(o), this), o = (o.then(function(e) { var t = (u.item = e).entities.values; u._core.isnull(a.font_size) && (a.font_size = "30px"), u._core.isnull(a.font_family) && (a.font_family = " sans-serif"), l.font = a.font_size + "px " + a.font_family; for (var i = 0; i < t.length; i++) { l.text = u._core.extendgl(entity, a.text, l.text), l.font = u._core.extendgl(entity, a.font, l.font), l.stylet = u._core.extendgl(entity, a.stylet, l.stylet), l .fillColor = u._core.extendgl(entity, a.fillColor, l.fillColor), l .outlineColor = u._core.extendgl(entity, a.outlineColor, l.outlineColor), l .outlineWidth = parseFloat(u._core.extendgl(entity, a.outlineWidth, l .outlineWidth)), l.show = u._core.extendgl(entity, a.show, l.show), l .showBackground = u._core.extendgl(entity, a.showBackground, l.showBackground), l.backgroundColor = u._core.extendgl(entity, a.backgroundColor, l .backgroundColor), l.backgroundPadding = u._core.extendgl(entity, a .backgroundPadding, l.backgroundPadding), l.scale = parseFloat(u._core .extendgl(entity, a.scale, l.scale)), l.horizontalOrigin = u._core.extendgl( entity, a.horizontalOrigin, l.horizontalOrigin), l.pointheight = parseFloat( u._core.extendgl(entity, a.pointheight, l.pointheight)); var o = parseFloat(u._core.extendgl(entity, l.near)), r = parseFloat(u._core.extendgl(entity, l.far)), n = "fillColor:" + 255 * l.fillColor.red + "," + 255 * l.fillColor.green + "," + 255 * l.fillColor.blue + ";outlineColor:" + 255 * l.outlineColor.red + "," + 255 * l.outlineColor.green + "," + 255 * l.outlineColor.blue, n = (u.Legend.push(n), new u._cesium.DistanceDisplayCondition(o, r)); l.distanceDisplayCondition = n, entity.ellipsoid.radii = new _this._cesium .Cartesian3(a.long_axis, a.short_axis, a.short_axis), entity.label = new u ._cesium.LabelGraphics(l), entity.label.text = null == entity.properties[a .text] ? a.text : entity.properties[a.text]._value, l.pointheight && (o = u ._cesium.Cartographic.fromCartesian(entity.position._value), r = u._cesium .Math.toDegrees(o.longitude), n = u._cesium.Math.toDegrees(o.latitude), entity.position = u._cesium.Cartesian3.fromDegrees(r, n, l.pointheight)) } "function" == typeof s && s(e) }), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), { id: l.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t, style: l, treeData: { name: e, geoOptions: t, styleOption: a, GroupID: i, checked: !0, disFnc: s } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.createBillboardGeoJsonFeature = function(e, t, s, i, l, u) { var c, o = { image: "", show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: 2, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, h = (this._core.isnull(s) || this._core.isnull(s.color) || "[" == s.color.toString().charAt(0) && "]" == s.color.toString().charAt(s.color.length - 1) || (this._core.isHtmlColor(s.color) ? s .color = this._color.colorFromHtmlColor(s.color) : (/^rgb/.test(s.color) && (s.color = this ._color.rgbaStringToRgbaObj(s.color)), 1 < s.color.r && (s.color.r = s.color.r / 255), 1 < s.color.g && (s.color.g = s.color.g / 255), 1 < s.color.b && (s.color.b = s.color.b / 255), 1 < s.color.a && (s.color.a = s.color.a / 255), s.color = this ._color.createColor(s.color.r, s.color.g, s.color.b, s.color.a))), this._core.extend(o, s, !0)), o = (null == t && console.log("geojson is required"), this._cesium.GeoJsonDataSource.load(t)), m = (this._viewer.dataSources.add(o), this), o = (m._core.isnull(s.near) && (s.near = 0), m._core.isnull(s.far) && (s.far = 999999999), s && s .time && (c = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time .start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function(e) { for (var t = (m.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (h.image = m._core.extendgl(o, s.image, h.image), h.show = m._core.extendgl( o, s.show, h.show), h.scale = parseFloat(m._core.extendgl(o, s.scale, h .scale)), h.horizontalOrigin = m._core.extendgl(o, s.horizontalOrigin, h .horizontalOrigin), h.verticalOrigin = m._core.extendgl(o, s .verticalOrigin, h.verticalOrigin), h.eyeOffset = m._core.extendgl(o, s .eyeOffset, h.eyeOffset), h.pixelOffset = m._core.extendgl(o, s .pixelOffset, h.pixelOffset), h.alignedAxis = m._core.extendgl(o, s .alignedAxis, h.alignedAxis), h.rotation = m._core.extendgl(o, s .rotation, h.rotation), h.width ? h.width = parseFloat(m._core.extendgl( o, s.width, h.width)) : h.width = void 0, h.height ? h.height = parseFloat(m._core.extendgl(o, s.height, h.height)) : h.height = void 0, h .color = m._core.extendgl(o, s.color, h.color), "color:" + 255 * h.color .red + "," + 255 * h.color.green + "," + 255 * h.color.blue + ";image:" + h .image), r = (m.Legend.push(r), parseFloat(m._core.extendgl(o, h.near))), n = parseFloat(m._core.extendgl(o, h.far)), r = new m._cesium.DistanceDisplayCondition(r, n), n = (h.distanceDisplayCondition = r, o.billboard = void 0, o.billboard = new m ._cesium.BillboardGraphics(h), m._viewer.scene.globe.ellipsoid, m._cesium .Cartographic.fromCartesian(o.position._value)), r = m._cesium.Math.toDegrees(n.longitude), a = m._cesium.Math.toDegrees(n.latitude), r = (n = s.pointHeight || n.height, new m._cesium.Cartesian3.fromDegrees(r, a, n)), a = { positions: o.position._value = r }; o.description = a, c && (o.availability = c) } l || m.setVisibility(!1), "function" == typeof u && u(e) }), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), { id: h.id, name: e, checked: l, pId: this._core.isnull(i) ? 0 : i, type: "imageLayer", item: this, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: l, disFnc: u } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.createPolylineGeoJsonFeatureLayer = function(e, t, a, i, s, l) { var u, o = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !0, width: 1, show: !0, material: this._cesium.Color.WHITE, height: 30, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, c = this, h = (this._core.isnull(a) || this._core.isnull(a.material) || "[" == a.material.toString().charAt( 0) && "]" == a.material.toString().charAt(a.material.length - 1) || "(" == a.material.toString() .charAt(0) && ")" == a.material.toString().charAt(a.material.length - 1) || (this._core .isHtmlColor(a.material) ? a.material = this._color.colorFromHtmlColor(a.material) : (/^rgb/ .test(a.material) && (a.material = this._color.rgbaStringToRgbaObj(a.material)), 1 < a .material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a .material.a && (a.material.a = a.material.a / 255), a.material = this._color .createColor(a.material.r, a.material.g, a.material.b, a.material.a))), c._core.isnull(a .near) && (a.near = 0), c._core.isnull(a.far) && (a.far = 999999999), this._core.extend(o, a, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), o = (this._viewer.dataSources.add(o, { camera: this._viewer.scene.camera, canvas: this._viewer.scene.canvas, clampToGround: !0 }), a && a.time && (u = new c._cesium.TimeIntervalCollection([new c._cesium.TimeInterval({ start: a.time.start ? c._cesium.JulianDate.fromDate(new Date(a.time .start)) : c._cesium.Iso8601.MINIMUM_VALUE, stop: a.time.end ? c._cesium.JulianDate.fromDate(new Date(a.time.end)) : c ._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function(e) { for (var t = (c.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (h.arcType = c._core.extendgl(o, a.arcType, h.arcType), h.clampToGround = c ._core.extendgl(o, a.clampToGround, h.clampToGround), h.width = parseFloat(c ._core.extendgl(o, a.width, h.width)), h.show = c._core.extendgl(o, a .show, h.show), h.material = c._core.extendgl(o, a.material, h .material), h.height = parseFloat(c._core.extendgl(o, a.height, h.height)), parseFloat(c._core.extendgl(o, h.near))), n = parseFloat(c._core.extendgl(o, h.far)), r = new c._cesium.DistanceDisplayCondition(r, n), n = (h.distanceDisplayCondition = r, c._viewer.scene.globe.ellipsoid, o.polyline .clampToGround = h.clampToGround, o.polyline.width = h.width, o.polyline .show = h.show, o.polyline.material = h.material, o.polyline .distanceDisplayCondition = r, o.polyline.distanceDisplayCondition = r, u && (o.availability = u), "material:" + 255 * h.material.red + "," + 255 * h .material.green + "," + 255 * h.material.blue); c.Legend.push(n) } s || c.setVisibility(!1), "function" == typeof l && l(e) }), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), { id: h.id, name: e, checked: s, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t, style: h, treeData: { name: e, geoOptions: t, styleOption: a, GroupID: i, checked: s, disFnc: l } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.createpolylineVolumeGeojsonFeatureLayer = function(e, t, d, i, p, g) { var _, o = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, radius: .5, radiusScale: 1 }, f = (this._core.isnull(d) || this._core.isnull(d.material) || "[" == d.material.toString().charAt( 0) && "]" == d.material.toString().charAt(d.material.length - 1) || "(" == d.material.toString() .charAt(0) && ")" == d.material.toString().charAt(d.material.length - 1) || (this._core .isHtmlColor(d.material) ? d.material = this._color.colorFromHtmlColor(d.material) : (/^rgb/ .test(d.material) && (d.material = this._color.rgbaStringToRgbaObj(d.material)), 1 < d .material.r && (d.material.r = d.material.r / 255), 1 < d.material.g && (d.material.g = d.material.g / 255), 1 < d.material.b && (d.material.b = d.material.b / 255), 1 < d .material.a && (d.material.a = d.material.a / 255), d.material = this._color .createColor(d.material.r, d.material.g, d.material.b, d.material.a))), this._core .extend(o, d, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), y = (this._viewer.dataSources.add(o), this), o = (f.shape = this.computeCircle(d.radius), d && d.time && (_ = new y._cesium .TimeIntervalCollection([new y._cesium.TimeInterval({ start: d.time.start ? y._cesium.JulianDate.fromDate(new Date(d.time .start)) : y._cesium.Iso8601.MINIMUM_VALUE, stop: d.time.end ? y._cesium.JulianDate.fromDate(new Date(d.time.end)) : y ._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function(e) { var t, i, o = (y.item = e).entities.values, r = (y._core.isnull(d.near) && (d.near = 0), y._core.isnull(d.far) && (d.far = 999999999), parseFloat(d.near)), n = parseFloat(d.far), a = new y._cesium.DistanceDisplayCondition(r, n); if (f.distanceDisplayCondition = a, "string" == typeof f.radius && -1 < f.radius .indexOf("[") && -1 < f.radius.indexOf("]")) { let e; f.radius = f.radius.replace("[", ""), f.radius = f.radius.replace("]", ""), o[0] && o[0].properties[f.radius] ? (e = o[0].properties[f.radius].getValue()) .indexOf && (-1 < e.indexOf("*") || -1 < e.indexOf("x") || -1 < e.indexOf( "X")) ? (-1 < e.indexOf("*") ? e = e.split("*") : -1 < e.indexOf("X") ? e = e .split("X") : -1 < e.indexOf("x") && (e = e.split("x")), t = parseFloat(e[ 0]) * f.radiusScale, i = parseFloat(e[1]) * f.radiusScale, f.shape = [ new y._cesium.Cartesian2(-t, -i), new y._cesium.Cartesian2(t, -i), new y ._cesium.Cartesian2(t, i), new y._cesium.Cartesian2(-t, i) ]) : f.shape = y._core.computeCircle(e * f.radiusScale) : f.shape = y._core .computeCircle(.5) } else "0" == f.slttype || 0 == f.slttype ? f.shape = y._core.computeCircle(f.radius) : "1" == f.slttype || 1 == f.slttype ? f.shape = y._core.starPositions(f.number, f .exradius, f.inradius) : "2" != f.slttype && 2 != f.slttype || (t = f .orth_width / 2, i = f.orth_height / 2, f.shape = [new y._cesium.Cartesian2(-t, -i), new y._cesium.Cartesian2(t, -i), new y._cesium.Cartesian2(t, i), new y._cesium.Cartesian2(-t, i) ]); for (var s = 0; s < o.length; s++) { var l, u, c = o[s], h = (f.show = y._core.extendgl(c, d.show, f.show), f.shape = y._core.extendgl(c, d.shape, f.shape), f.cornerType = y._core.extendgl(c, d.cornerType, f .cornerType), f.granularity = y._core.extendgl(c, d.granularity, f .granularity), f.fill = y._core.extendgl(c, d.fill, f.fill), f .material = y._core.extendgl(c, d.material, f.material), f.outline = y._core .extendgl(c, d.outline, f.outline), f.outlineColor = y._core.extendgl(c, d .outlineColor, f.outlineColor), f.outlineWidth = parseFloat(y._core .extendgl(c, d.outlineWidth, f.outlineWidth)), f.shadows = y._core .extendgl(c, d.shadows, f.shadows), []), m = (c.polyline.positions._value.forEach(function(e) { f.height ? (u = y._cesium.Cartographic.fromCartesian(e), l = y ._cesium.Math.toDegrees(u.longitude), u = y._cesium.Math .toDegrees(u.latitude), h.push(y._cesium.Cartesian3 .fromDegrees(l, u, f.height))) : h.push(e) }), c.polylineVolume = new y._cesium.PolylineVolumeGraphics({ positions: h, show: f.show, shape: f.shape, cornerType: f.cornerType, fill: f.fill, outline: f.outline, outlineWidth: f.outlineWidth, material: f.material, distanceDisplayCondition: a }), "material:" + 255 * f.material.red + "," + 255 * f.material.green + "," + 255 * f.material.blue); y.Legend.push(m), c.polyline = void 0, _ && (c.availability = _) } p || y.setVisibility(!1), "function" == typeof g && g(e) }), this._core.isnull(f.id) && (f.id = this._core.getuid()), this._core.isnull(e) && (e = "新建管状图层" + f.id), { id: f.id, name: e, checked: p, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: t, style: f, treeData: { name: e, geoOptions: t, styleOption: d, GroupID: i, checked: p, disFnc: g } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.createpolylineVolumeGeojsonPrimitiveLayer = function(e, t, a, i, s, l) { var o = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, radius: .5, height: 0, radiusScale: 1 }, c = (this._core.isnull(a) || this._core.isnull(a.material) || "[" == a.material.toString().charAt( 0) && "]" == a.material.toString().charAt(a.material.length - 1) || "(" == a.material.toString() .charAt(0) && ")" == a.material.toString().charAt(a.material.length - 1) || (this._core .isHtmlColor(a.material) ? a.material = this._color.colorFromHtmlColor(a.material) : (/^rgb/ .test(a.material) && (a.material = this._color.rgbaStringToRgbaObj(a.material)), 1 < a .material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a .material.a && (a.material.a = a.material.a / 255), a.material = this._color .createColor(a.material.r, a.material.g, a.material.b, a.material.a))), this._core .extend(o, a, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), h = this; a && a.time && new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({ start: a.time.start ? h._cesium.JulianDate.fromDate(new Date(a.time.start)) : h ._cesium.Iso8601.MINIMUM_VALUE, stop: a.time.end ? h._cesium.JulianDate.fromDate(new Date(a.time.end)) : h._cesium .Iso8601.MAXIMUM_VALUE })]); let m = new Cesium.PrimitiveCollection, d = { allowPicking: !0, appearance: new h._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders("vertexShaderSource"), fragmentShaderSource: h._core.Shaders("fragmentShaderSource") }), shadows: c.shadows, geometryInstances: void 0 }; o.then(function(e) { var t, i, o = (h.item = e).entities.values, e = (h._core.isnull(a.near) && (a.near = 0), h._core.isnull(a.far) && (a.far = 999999999), parseFloat(a.near)), r = parseFloat(a.far), e = new h._cesium.DistanceDisplayCondition(e, r); if (c.distanceDisplayCondition = e, "string" == typeof c.radius && -1 < c.radius.indexOf( "[") && -1 < c.radius.indexOf("]")) { let e; c.radius = c.radius.replace("[", ""), c.radius = c.radius.replace("]", ""), o[0] && o[0] .properties[c.radius] ? (e = o[0].properties[c.radius].getValue()).indexOf && (-1 < e.indexOf("*") || -1 < e.indexOf("x") || -1 < e.indexOf("X")) ? (-1 < e.indexOf( "*") ? e = e.split("*") : -1 < e.indexOf("X") ? e = e.split("X") : -1 < e .indexOf("x") && (e = e.split("x")), t = parseFloat(e[0]) * c.radiusScale, i = parseFloat(e[1]) * c.radiusScale, c.shape = [new h._cesium.Cartesian2(-t, -i), new h._cesium.Cartesian2(t, -i), new h._cesium.Cartesian2(t, i), new h ._cesium.Cartesian2(-t, i) ], c.radius = i) : (c.shape = h._core.computeCircle(e * c.radiusScale), c .connect && (c.connectRadius = e * c.radiusScale * 1.1, c.connectRadius2 = e * c .radiusScale * 1.2, c.connectShape1 = h._core.computeCircle(c .connectRadius), c.connectShape2 = h._core.computeCircle(c.connectRadius2)), c.radius = e * c.radiusScale) : (c.shape = h._core.computeCircle(.5), c.radius = .5, c.connect && (c.connectRadius = 1.1 * c.radius, c.connectRadius2 = 1.2 * c .radius, c.connectShape1 = h._core.computeCircle(c.connectRadius), c .connectShape2 = h._core.computeCircle(c.connectRadius2))) } else "0" == c.slttype || 0 == c.slttype ? (c.shape = h._core.computeCircle(c.radius), c .connect && (c.connectRadius = 1.1 * c.radius, c.connectRadius2 = 1.2 * c.radius, c .connectShape1 = h._core.computeCircle(c.connectRadius), c.connectShape2 = h ._core.computeCircle(c.connectRadius2))) : "1" == c.slttype || 1 == c.slttype ? c.shape = h._core.starPositions(c.number, c.exradius, c.inradius) : "2" != c.slttype && 2 != c.slttype || (t = c.orth_width / 2, i = c.orth_height / 2, c.shape = [new h._cesium .Cartesian2(-t, -i), new h._cesium.Cartesian2(t, -i), new h._cesium.Cartesian2( t, i), new h._cesium.Cartesian2(-t, i) ], c.radius = i); c.show = h._core.extendgl(o[0], a.show, c.show), c.shape = h._core.extendgl(o[0], a.shape, c .shape), c.cornerType = h._core.extendgl(o[0], a.cornerType, c.cornerType), c .granularity = h._core.extendgl(o[0], a.granularity, c.granularity), c.fill = h._core .extendgl(o[0], a.fill, c.fill), c.material = h._core.extendgl(o[0], a.material, c .material), c.outline = h._core.extendgl(o[0], a.outline, c.outline), c .outlineColor = h._core.extendgl(o[0], a.outlineColor, c.outlineColor), c.outlineWidth = parseFloat(h._core.extendgl(o[0], a.outlineWidth, c.outlineWidth)), c.shadows = h._core .extendgl(o[0], a.shadows, c.shadows); for (var n = 0; n < o.length; n++) !async function(e) { var t, i, o = [], r = (e.polyline && e.polyline.positions._value.forEach(function(e) { c.height ? (i = h._cesium.Cartographic.fromCartesian(e), t = h ._cesium.Math.toDegrees(i.longitude), i = h._cesium.Math .toDegrees(i.latitude), o.push(h._cesium.Cartesian3 .fromDegrees(t, i, c.height - c.radius))) : o.push( e) }), e.polyline = void 0, { polylinePositions: o, shapePositions: c.shape, cornerType: c.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }), r = new h._cesium.PolylineVolumeGeometry(r), r = new h._cesium.GeometryInstance({ id: e, geometry: r, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute.fromColor(c .material) } }); d.geometryInstances = r, m.add(new h._cesium.Primitive(d)), c.connect && 1 < o .length && async function(n, a) { let s = []; if (!(a.length <= 1)) { var l = c.height - c.connectRadius, u = c.height - c.connectRadius2; let e = h._core.getPointFromTwoPointCenter([a[0], a[1]], 2 * c .connectRadius, l), t = h._core.getPointFromTwoPointCenter([a[0], a[1]], 2 * c .connectRadius2, u), i = h._core.getPointFromTwoPointCenter([a[a.length - 1], a[a .length - 2]], 2 * c.connectRadius, l), o = h._core.getPointFromTwoPointCenter([a[a.length - 1], a[a .length - 2]], 2 * c.connectRadius2, u); a[0].x == a[1].x && a[2] && (e = h._core .getPointFromTwoPointCenter([a[0], a[2]], 2 * c .connectRadius, l), t = h._core .getPointFromTwoPointCenter([a[0], a[2]], 2 * c .connectRadius2, u)), a[a.length - 1].x == a[a .length - 2].x && a[a.length - 3] && (i = h._core .getPointFromTwoPointCenter([a[a.length - 1], a[a .length - 3]], 2 * c.connectRadius, l), o = h._core .getPointFromTwoPointCenter([a[a.length - 1], a[a .length - 3]], 2 * c.connectRadius2, u)); l = new h._cesium.PolylineVolumeGeometry({ polylinePositions: [a[0], e], shapePositions: c.connectShape1, cornerType: c.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }), u = (s.push(l), new h._cesium.PolylineVolumeGeometry({ polylinePositions: [e, t], shapePositions: c.connectShape2, cornerType: c.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } })), l = (s.push(u), new h._cesium.PolylineVolumeGeometry({ polylinePositions: [a[a.length - 1], i], shapePositions: c.connectShape1, cornerType: c.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } })), u = (s.push(l), new h._cesium.PolylineVolumeGeometry({ polylinePositions: [i, o], shapePositions: c.connectShape2, cornerType: c.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } })); s.push(u); let r = []; s.forEach(e => { e = new h._cesium.GeometryInstance({ id: n, geometry: e, attributes: { color: new h._cesium .ColorGeometryInstanceAttribute .fromColor(c.material) } }); r.push(e) }); l = new Cesium.EllipsoidGeometry({ vertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 }, stackPartitions: 16, slicePartitions: 16, radii: new Cesium.Cartesian3(c.connectRadius, c .connectRadius, c.connectRadius) }), u = new Cesium.GeometryInstance({ geometry: l, modelMatrix: Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(a[ 0]), new Cesium.Cartesian3(0, 0, c .connectRadius), new Cesium.Matrix4), attributes: { color: Cesium.ColorGeometryInstanceAttribute .fromColor(c.material) } }), u = (r.push(u), new Cesium.GeometryInstance({ geometry: l, modelMatrix: Cesium.Matrix4 .multiplyByTranslation(Cesium.Transforms .eastNorthUpToFixedFrame(a[a.length - 1]), new Cesium.Cartesian3(0, 0, c .connectRadius), new Cesium.Matrix4 ), attributes: { color: Cesium.ColorGeometryInstanceAttribute .fromColor(c.material) } })); r.push(u), d.geometryInstances = r, m.add(new h._cesium .Primitive(d)) } }(e, o); r = "material:" + 255 * c.material.red + "," + 255 * c.material.green + "," + 255 * c.material.blue; h.Legend.push(r) }(o[n]); h._viewer.scene.primitives.add(m), h.item = m, s || h.setVisibility(!1), "function" == typeof l && l(m) }), this._core.isnull(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建管状图层" + c.id); o = { id: c.id, name: e, checked: s, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: t, style: c, treeData: { name: e, geoOptions: t, styleOption: a, GroupID: i, checked: s, disFnc: l } }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.computeCircle = function(e) { this._core.isnull(e) && (e = 4); for (var t = [], i = 0; i < 360; i++) { var o = Cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, C.prototype.createWallGeoFeatureLayer = function(e, t, u, i, c, h) { var m, o = { positions: [], minimumHeights: [], maximumHeights: [], granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, d = (this._core.isnull(u) || this._core.isnull(u.material) || "[" == u.material.toString().charAt( 0) && "]" == u.material.toString().charAt(u.material.length - 1) || (this._core.isHtmlColor(u .material) ? u.material = this._color.colorFromHtmlColor(u.material) : (/^rgb/.test(u .material) && (u.material = this._color.rgbaStringToRgbaObj(u.material)), 1 < u .material.r && (u.material.r = u.material.r / 255), 1 < u.material.g && (u.material.g = u.material.g / 255), 1 < u.material.b && (u.material.b = u.material.b / 255), 1 < u .material.a && (u.material.a = u.material.a / 255), u.material = this._color .createColor(u.material.r, u.material.g, u.material.b, u.material.a))), this._core.isnull( u) || this._core.isnull(u.outlineColor) || "[" == u.outlineColor.toString().charAt(0) && "]" == u.outlineColor.toString().charAt(u.outlineColor.length - 1) || (this._core.isHtmlColor(u .outlineColor) ? u.outlineColor = this._color.colorFromHtmlColor(u.outlineColor) : ( /^rgb/.test(u.outlineColor) && (u.outlineColor = this._color.rgbaStringToRgbaObj(u .outlineColor)), 1 < u.outlineColor.r && (u.outlineColor.r = u.outlineColor.r / 255), 1 < u.outlineColor.g && (u.outlineColor.g = u.outlineColor.g / 255), 1 < u .outlineColor.b && (u.outlineColor.b = u.outlineColor.b / 255), 1 < u.outlineColor.a && (u.outlineColor.a = u.outlineColor.a / 255), u.outlineColor = this._color.createColor(u .outlineColor.r, u.outlineColor.g, u.outlineColor.b, u.outlineColor.a))), this._core .extend(o, u, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), p = (this._viewer.dataSources.add(o), this), o = (u && u.time && (m = new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({ start: u.time.start ? p._cesium.JulianDate.fromDate(new Date(u.time .start)) : p._cesium.Iso8601.MINIMUM_VALUE, stop: u.time.end ? p._cesium.JulianDate.fromDate(new Date(u.time.end)) : p ._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function(e) { var t = (p.item = e).entities.values, i = (p._core.isnull(u.near) && (u.near = 0), p._core.isnull(u.far) && (u.far = 999999999), parseFloat(u.near)), o = parseFloat(u.far), r = new p._cesium.DistanceDisplayCondition(i, o); d.distanceDisplayCondition = r; for (var n = 0; n < t.length; n++) { var a = t[n], s = (d.granularity = p._core.extendgl(a, u.granularity, d.granularity), d.fill = p._core.extendgl(a, u.fill, d.fill), d.material = p._core.extendgl(a, u .material, d.material), d.outline = p._core.extendgl(a, u.outline, d .outline), d.outlineColor = p._core.extendgl(a, u.outlineColor, d .outlineColor), d.outlineWidth = parseFloat(p._core.extendgl(a, u .outlineWidth, d.outlineWidth)), d.shadows = p._core.extendgl(a, u .shadows, d.shadows), a.polyline.positions._value.length), l = new Array(s), s = new Array(s), s = (l.fill(d.minimumHeights), s.fill(d.maximumHeights), a.wall = new p._cesium .WallGraphics({ positions: a.polyline.positions._value, maximumHeights: s, minimumHeights: l, outline: d.outline, fill: d.fill, material: d.material, outlineColor: d.outlineColor, outlineWidth: d.outlineWidth, shadows: d.shadows, distanceDisplayCondition: r }), "material:" + 255 * d.material.red + "," + 255 * d.material.green + "," + 255 * d.material.blue + ";outlineColor:" + 255 * d.outlineColor.red + "," + 255 * d.outlineColor.green + "," + 255 * d.outlineColor.blue); p.Legend.push(s), a.polyline = void 0, m && (a.availability = m) } c || p.setVisibility(!1), "function" == typeof h && h(e) }), this._core.isnull(d.id) && (d.id = this._core.getuid()), this._core.isnull(e) && (e = "新建墙图层" + d.id), { id: d.id, name: e, checked: c, pId: this._core.isnull(i) ? 0 : i, type: "polylineWallLayer", item: this, url: t, style: d, treeData: { name: e, geoOptions: t, styleOption: u, GroupID: i, checked: c, disFnc: h } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, C.prototype.createterrainProvider = function(e, t, i, o) { var t = this._core.extend({ url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" }, t, !0), r = new this._cesium.CesiumTerrainProvider(t); return this._viewer.terrainProvider = r, this.item = r, "function" == typeof o && o(dataSource), this ._core.isnull(t.id) && (t.id = this._core.getuid()), this._tree.insertGroupId({ id: t.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "terrainProvider", item: this }, this._core.isnull(i) ? 0 : i), this }, C.prototype.createPolygonGeoJsonFeatureLayers = function(e, t, s, i, o, l) { var r = { height: 0, extrudedHeight: 0, heightReference: this._cesium.HeightReference.NONE, show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, stRotation: 0, granularity: this._cesium.Math.RADIANS_PER_DEGREE, perPositionHeight: !1, closeTop: !0, closeBottom: !0, shadows: this._cesium.ShadowMode.ENABLED, clampToGround: !0 }, u = (this._core.isnull(s) || this._core.isnull(s.material) || "[" == s.material.toString().charAt( 0) && "]" == s.material.toString().charAt(s.material.length - 1) || "(" == s.material.toString() .charAt(0) && ")" == s.material.toString().charAt(s.material.length - 1) || (this._core .isHtmlColor(s.material) ? s.material = this._color.colorFromHtmlColor(s.material) : (/^rgb/ .test(s.material) && (s.material = this._color.rgbaStringToRgbaObj(s.material)), 1 < s .material.r && (s.material.r = s.material.r / 255), 1 < s.material.g && (s.material.g = s.material.g / 255), 1 < s.material.b && (s.material.b = s.material.b / 255), 1 < s .material.a && (s.material.a = s.material.a / 255), s.material = this._color .createColor(s.material.r, s.material.g, s.material.b, s.material.a))), this._core .isnull(s) || this._core.isnull(s.outlineColor) || "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (this._core.isHtmlColor(s .outlineColor) ? s.outlineColor = this._color.colorFromHtmlColor(s.outlineColor) : ( /^rgb/.test(s.outlineColor) && (s.outlineColor = this._color.rgbaStringToRgbaObj(s .outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s .outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = this._color.createColor(s .outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))), s.checked = o, this._core.extend(r, s, !0)), r = (null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t), c = (this._viewer.dataSources.add(r), this), r = (r.then(function(e) { var t = (c.item = e).entities.values, i = (c._core.isnull(s.near) && (s.near = 0), c._core.isnull(s.far) && (s.far = 999999999), parseFloat(s.near)), o = parseFloat(s.far), r = new c._cesium.DistanceDisplayCondition(i, o); u.distanceDisplayCondition = r; for (var n = 0; n < t.length; n++) { var a = t[n], a = (u.height = parseFloat(c._core.extendgl(a, s.height, u.height)), u .extrudedHeight = parseFloat(c._core.extendgl(a, s.extrudedHeight, u .extrudedHeight)), u.heightReference = c._core.extendgl(a, s .heightReference, u.heightReference), u.show = c._core.extendgl(a, s .show, u.show), u.fill = c._core.extendgl(a, s.fill, u.fill), u .material = c._core.extendgl(a, s.material, u.material), u.outline = c._core .extendgl(a, s.outline, u.outline), u.outlineColor = c._core.extendgl(a, s .outlineColor, u.outlineColor), u.outlineWidth = parseFloat(c._core .extendgl(a, s.outlineWidth, u.outlineWidth)), u.stRotation = parseInt(c ._core.extendgl(a, s.stRotation, u.stRotation)), u.granularity = c._core .extendgl(a, s.granularity, u.granularity), u.shadows = c._core.extendgl(a, s.shadows, u.shadows), a.polygon.height = u.height, a.polygon .extrudedHeight = u.extrudedHeight, a.polygon.heightReference = u .heightReference, a.polygon.show = u.show, a.polygon.fill = u.fill, a .polygon.material = u.material, a.polygon.outline = u.outline, a.polygon .outlineColor = u.outlineColor, a.polygon.outlineWidth = u.outlineWidth, a .polygon.stRotation = u.stRotation, a.polygon.granularity = u.granularity, a .polygon.distanceDisplayCondition = r, a.polygon.perPositionHeight = u .perPositionHeight, a.polygon.closeTop = u.closeTop, a.polygon.closeBottom = u.closeBottom, a.polygon.shadows = u.shadows, "material:" + 255 * u.material .red + "," + 255 * u.material.green + "," + 255 * u.material.blue + ";outlineColor:" + 255 * u.outlineColor.red + "," + 255 * u.outlineColor .green + "," + 255 * u.outlineColor.blue); c.Legend.push(a) } "function" == typeof l && l(e), s.checked || c.setVisibility(!1) }), this._core.isnull(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), { id: u.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t, style: u, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: o, disFnc: l } }); return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i), this }, C.prototype.createPolygonGeoJsonFeatureLayer = function(e, t, l, i, o, u) { var c, r = { height: 0, show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, stRotation: 0, shadows: this._cesium.ShadowMode.ENABLED, clampToGround: !0, classificationType: this._cesium.ClassificationType.BOTH, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, h = (this._core.isnull(l) || this._core.isnull(l.material) || (-1 != l.material.indexOf("type") ? "checker" == l.material.type ? l.material = new this._cesium.CheckerboardMaterialProperty({ evenColor: l.material.evenColor, oddColor: l.material.oddColor, repeat: l.material.repeat }) : "stripe" == l.material.type ? l.material = new this._cesium.StripeMaterialProperty({ evenColor: l.material.evenColor, oddColor: l.material.oddColor, repeat: l.material.repeat, offset: l.material.repeat, orientation: l.material.repeat }) : "grid" == l.material.type && (l.material = new this._cesium.GridMaterialProperty({ color: l.material.color, cellAlpha: l.material.cellAlpha, lineCount: l.material.lineCount, lineThickness: l.material.lineThickness })) : this._core.isHtmlColor(l.material) ? l.material = this._color.colorFromHtmlColor(l .material) : -1 != l.material.indexOf("[") || "(" == l.material.toString().charAt(0) && ")" == l.material.toString().charAt(l.material.length - 1) || (/^rgb/.test(l.material) && (l .material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l.material.r && (l .material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material .g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l.material .a && (l.material.a = l.material.a / 255), l.material = this._color.createColor(l .material.r, l.material.g, l.material.b, l.material.a))), this._core.isnull(l) || this._core.isnull(l.outlineColor) || (this._core.isHtmlColor(l.outlineColor) ? l.outlineColor = this._color.colorFromHtmlColor(l.outlineColor) : (/^rgb/.test(l.outlineColor) && (l .outlineColor = this._color.rgbaStringToRgbaObj(l.outlineColor)), 1 < l.outlineColor .r && (l.outlineColor.r = l.outlineColor.r / 255), 1 < l.outlineColor.g && (l .outlineColor.g = l.outlineColor.g / 255), 1 < l.outlineColor.b && (l.outlineColor .b = l.outlineColor.b / 255), 1 < l.outlineColor.a && (l.outlineColor.a = l .outlineColor.a / 255), l.outlineColor = this._color.createColor(l.outlineColor.r, l .outlineColor.g, l.outlineColor.b, l.outlineColor.a))), this._core.extend(r, l, !0) ), r = (l.checked = o, null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t, { clampToGround: !0 }), m = (this._viewer.dataSources.add(r), this), r = (l && l.time && (c = new m._cesium.TimeIntervalCollection([new m._cesium.TimeInterval({ start: l.time.start ? m._cesium.JulianDate.fromDate(new Date(l.time .start)) : m._cesium.Iso8601.MINIMUM_VALUE, stop: l.time.end ? m._cesium.JulianDate.fromDate(new Date(l.time.end)) : m ._cesium.Iso8601.MAXIMUM_VALUE })])), r.then(function(e) { var t = (m.item = e).entities.values, i = (m._core.isnull(l.near) && (l.near = 0), m._core.isnull(l.far) && (l.far = 999999999), parseFloat(l.near)), o = parseFloat(l.far), r = new m._cesium.DistanceDisplayCondition(i, o); h.distanceDisplayCondition = r; for (var n = 0; n < t.length; n++) { var a = t[n], s = (h.height = parseFloat(m._core.extendgl(a, l.height, h.height)), h.height != h.height && (h.height = void 0), h.extrudedHeight = m._core.extendgl(a, l .extrudedHeight, h.extrudedHeight), h.heightReference = m._core .extendgl(a, l.heightReference, h.heightReference), h.show = m._core .extendgl(a, l.show, h.show), h.fill = m._core.extendgl(a, l.fill, h.fill), h.material = m._core.extendgl(a, l.material, h.material), void 0 !== h .extrudedHeight && (h.extrudedHeight = parseFloat(h.extrudedHeight)), h .outline = m._core.extendgl(a, l.outline, h.outline), h.outlineColor = m ._core.extendgl(a, l.outlineColor, h.outlineColor), h.outlineWidth = parseFloat(m._core.extendgl(a, l.outlineWidth, h.outlineWidth)), h .stRotation = m._core.extendgl(a, l.stRotation, h.stRotation), h .granularity = m._core.extendgl(a, l.granularity, h.granularity), h .distanceDisplayCondition = m._core.extendgl(a, l.distanceDisplayCondition, h.distanceDisplayCondition), h.perPositionHeight = m._core.extendgl(a, l .perPositionHeight, h.perPositionHeight), h.closeTop = m._core.extendgl( a, l.closeTop, h.closeTop), h.closeBottom = m._core.extendgl(a, l .closeBottom, h.closeBottom), h.shadows = m._core.extendgl(a, l.shadows, h.shadows), h.classificationType = m._core.extendgl(a, l .classificationType, h.classificationType), a.polygon._hierarchy._value .positions, a.polygon.extrudedHeightReference = h.extrudedHeightReference, a .polygon.heightReference = h.heightReference, 1 != h.heightReference && (a .polygon.height = h.height, h.height && (a.polygon.perPositionHeight = ! 1)), 1 != h.extrudedHeightReference && (a.polygon.extrudedHeight = h .extrudedHeight), a.polygon.show = h.show, a.polygon.fill = h.fill, a .polygon.material = h.material, a.polygon.outline = h.outline, a.polygon .outlineColor = h.outlineColor, a.polygon.outlineWidth = h.outlineWidth, a .polygon.stRotation = h.stRotation, a.polygon.granularity = h.granularity, a .polygon.distanceDisplayCondition = r, a.polygon.closeTop = h.closeTop, a .polygon.closeBottom = h.closeBottom, a.polygon.shadows = h.shadows, a .polygon.classificationType = h.classificationType, "material:" + 255 * h .material.red + "," + 255 * h.material.green + "," + 255 * h.material.blue + ";outlineColor:" + 255 * h.outlineColor.red + "," + 255 * h.outlineColor .green + "," + 255 * h.outlineColor.blue); m.Legend.push(s), c && (a.availability = c) } l.checked ? m.isShow = !0 : m.setVisibility(!1), "function" == typeof u && u(e) }), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), { id: h.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t, style: h, treeData: { name: e, geoOptions: t, styleOption: l, GroupID: i, checked: o, disFnc: u } }); return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i), this }, C.prototype.createGeoJsonDataSource = function(e, t, i, o, r) { var t = this._cesium.GeoJsonDataSource.load(t, i), n = (this._viewer.dataSources.add(t), this); return t.then(function(e) { n.item = e, "function" == typeof r && r(e) }), this._tree.insertGroupId({ id: this._core.getuid(), name: e, pId: this._core.isnull(o) ? 0 : o, type: "layer", item: this }, this._core.isnull(o) ? 0 : o), this }, C.prototype.deleteObject = function() { this._viewer.dataSources.remove(this.item) }, C.prototype.getLevel = function() { var e, t = this._viewer.camera; return t && t.positionCartographic && t.positionCartographic.height ? (e = this._viewer.scene.globe .getHeight(t.positionCartographic) || 0, t = t.positionCartographic.height - e, Math.round( 80955.31 / (1 + Math.pow(t / 91610.74, 7096758e-11)) - 40467.74)) : 0 }, C.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t }, treeData: this.treeobj.treeData } }, C.prototype.setVisibility = function(e) { this.isShow = e, null != this.item && (this.item.show = e) }, C.prototype.getVisibility = function() { return this.item.show }, C.prototype.getProperties = function() { var e = []; if (this.item.entities.values) { var t = this.item.entities.values[0]; if (t.properties) for (var i = 0; i < t.properties.propertyNames.length; i++) e.push({ value: "[" + t.properties.propertyNames[i] + "]", label: t.properties.propertyNames[i] }) } return e }, C.prototype.getTypes = function() { var e; if (this.item.entities.values) return e = this.item.entities.values[0], /^point.fid/.test(e._id) || null != e.point ? [{ label: "文本标签", value: "labelLayer" }, { label: "图片标签", value: "billboardLayer" }, { label: "点标签", value: "pointLayer" }, { label: "模型", value: "modelLayer" }, { label: "圆", value: "circleLayer" }] : /^polygon.fid/.test(e._id) || null != e.polygon ? [{ label: "面", value: "polygonLayer" }] : /^line.fid/.test(e._id) || null != e.polyline ? [{ label: "线", value: "polylineLayer" }] : void 0 }, C.prototype.getType = function() { var e; if (this.item.entities.values) return null != (e = this.item.entities.values[0]).label && e.label.show ? { label: "文本标签", value: "labelLayer" } : null != e.model && e.model.show ? { label: "模型", value: "modelLayer" } : null != e.billboard && e.billboard.show ? { label: "图片标签", value: "billboardLayer" } : null != e.ellipse && e.ellipse.show ? { label: "圆", value: "circleLayer" } : /^polygon.fid/.test(e._id) || null != e.polygon ? { label: "面", value: "polygonLayer" } : /^line.fid/.test(e._id) || null != e.polyline ? { label: "线", value: "polylineLayer" } : null != e.polylineVolume && e.polylineVolume.show ? { label: "扫掠体", value: "polylineVolume" } : null != e.wall && null != e.wall ? { label: "墙", value: "polylineWall" } : { label: "点标签", value: "pointLayer" } }, C.prototype.getLegend = function() { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, C.prototype.getFirstDataSourceItem = function() { if (this.item.entities.values) return this.item.entities.values[0] }, C.prototype.setTreeobj = function(e) { this.treeobj = e }, C.prototype.setItem = function(e) { this.item = e }, Object.defineProperties(C.prototype, { labelText: { set: y.debounce(function(e) { var t = e; if (!this._core.isnull(e)) { var i = this.item.entities.values; if (i && 0 < i.length) for (var o = 0; o < i.length; o++) if (/^\[/.test(e) && (t = e.replace(/\[/, "").replace(/\]/, ""), t = i[ o].properties[t]._value), i[o].label) { i[o].label.text = t; try { i[o].point.show = !1 } catch (e) {} } else { try { i[o].point.show = !1 } catch (e) {} i[o].label = new this._cesium.LabelGraphics({ text: t, font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE }) } } }, 500) }, labelStyles: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.style = e } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.style : void 0 } }, labelFont: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = 16; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[0]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++) t[r].label.font = o + "px " + e } } }, 500) }, labelFontSize1: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = "sans-serif"; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[1]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++) t[r].label.font = e + "px " + o } } }, 500) }, labelFontSize: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if (e = e.toString().replace(/px/g, ""), (!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.font = e + "px sans-serif" } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? parseFloat(e[0].label.font) : void 0 } }, labelFillColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.fillColor = e } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? (e = e[0].label.fillColor, this._color.toHtmlColor("rgb(" + 255 * e ._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelOutlineColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.outlineColor = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, labelOutlineWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].label .outlineWidth = e } }, 200), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.outlineWidth; if (e) return e._value } } }, labelBackgroundColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.backgroundColor = e } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? (e = e[0].label.backgroundColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value .blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelBackground: { set: y.debounce(function(e) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.showBackground = e }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.background : void 0 } }, labelScale: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].label.scale = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.scale; if (e) return e._value } } }, labelHorizontalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.horizontalOrigin = parseInt(e) } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.horizontalOrigin; if (e) return e._value } } }, labelVerticalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.verticalOrigin = parseInt(e) } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.verticalOrigin; if (e) return e._value } } }, labelHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.heightReference = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.heightReference; if (e) return e._value } } }, labelDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].label.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, parseInt(e)), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(i, 1, parseInt(e), 0) } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label .distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, labelDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].label.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(parseInt(e), i), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(parseInt(e), 1, i, 0) } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label .distanceDisplayCondition._value.near : 0 : void 0 } }, labelHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } }, labelShow: { set: y.debounce(function(e) { var t = this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) !t[i].label && e ? (t[i].point && (t[i].point .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].label = new this._cesium .LabelGraphics({ text: "label", font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE })) : (t[i].label && (t[i].label.show = e), t[i].point && (t[i].point .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.show : void 0 } }, pointColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) t[i].point.color = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, pointShow: { set: y.debounce(function(e) { var t = this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) !t[i].point && e ? (t[i].label && (t[i].label .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].point = new this._cesium .PointGraphics({ color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0 })) : (t[i].point && (t[i].point.show = e), t[i].label && (t[i].label .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) return e && 0 < e.length && e[0].point ? e[0].point.show : void 0 } }, pointPixelSize: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].point.pixelSize = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.pixelSize; if (e) return e._value } } }, pointOutlineColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) t[i].point.outlineColor = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, pointOutlineWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].point .outlineWidth = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.outlineWidth; if (e) return e._value } } }, pointHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) t[i].point.heightReference = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.heightReference; if (e) return e._value } } }, pointDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].point.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e), t[o].point.scaleByDistance = new this ._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) return e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point .distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, pointDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].point.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(e, i), t[o].point.scaleByDistance = new this ._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) return e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point .distanceDisplayCondition._value.near : 0 : void 0 } }, pointHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } }, modelShow: { set: y.debounce(function(e) { var t = this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) t[i].label && (t[i].label.show = !e), t[i] .point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = ! e), !t[i].model && e ? t[i].model = new this._cesium.ModelGraphics({ show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE }) : (t[i].model && (t[i].model.show = e), t[i].label && (t[i].label .show = !e), t[i].point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) return e && 0 < e.length && e[0].model ? e[0].model.show : void 0 } }, modelUri: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length) for (var i, o = 0; o < t.length; o++) t[o].model ? t[o].model.uri = e : ( /^\[/.test(e) && (e = 1 < (i = e.split("[")).length ? i[0] + i[1] .replace(/\[/, "").replace(/\]/, "") : (e = e.replace(/\[/, "") .replace(/\]/, ""), t[o].properties[e])), t[o].model = new this._cesium.ModelGraphics({ uri: e, show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE })) } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.uri; if (e) return e._value } } }, modelScale: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { e = parseFloat(e); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].model.scale = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.scale; if (e) return e._value } } }, modelShadows: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.shadows = e } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) return e && 0 < e.length && e[0].model ? e[0].model.shadows : void 0 } }, modelHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.heightReference = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.heightReference; if (e) return e._value } } }, modelDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].model.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e) } }, 500), get: function() { var e = this.item.entities.values; e && !/^point.fid/.test(e[0]._id) && null == e[0].model || e && 0 < e.length && e[0] .model && (e[0].model.distanceDisplayCondition ? e[0].model.distanceDisplayCondition ._value.far : Number.MAX_VALUE) } }, modelDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].model.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(e, i) } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) return e && 0 < e.length && e[0].model ? e[0].model.distanceDisplayCondition ? e[0].model .distanceDisplayCondition._value.near : 0 : void 0 } }, modelColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.color = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, modelLightColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.lightColor = e } }, 100), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.lightColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, modelHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } }, billboardShow: { set: y.debounce(function(e) { var t = this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) !t[i].billboard && e ? (t[i].point && (t[i] .point.show = !e), t[i].label && (t[i].label.show = !e), t[i] .model && (t[i].model.show = !e), t[i].billboard = new this._cesium .BillboardGraphics({ show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE })) : (t[i].billboard && (t[i].billboard.show = e), t[i].point && (t[i] .point.show = !e), t[i].label && (t[i].label.show = !e), t[i] .billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.show : void 0 } }, billboardImage: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length) for (var i, o = 0; o < t.length; o++) /^\[/.test(e) && (e = 1 < (i = e .split("[")).length ? i[0] + i[1].replace(/\[/, "").replace( /\]/, "") : (e = e.replace(/\[/, "").replace(/\]/, ""), t[o] .properties[e])), t[o].billboard ? t[o].billboard.image = e : t[o] .billboard = new this._cesium.BillboardGraphics({ image: e, show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE }) } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.image; if (e) return e._value } } }, billboardScale: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.scale = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.scale; if (e) return e._value } } }, billboardHorizontalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.horizontalOrigin = e } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.horizontalOrigin : void 0 } }, billboardVerticalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.verticalOrigin = e } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.verticalOrigin : void 0 } }, billboardWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.width = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.width; if (e) return e._value } } }, billboardHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.height = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.height; if (e) return e._value } } }, billboardColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.color = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, billboardHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].billboard.heightReference = e } }, 500), get: function() { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].model) { e = e[0].billboard.heightReference; if (e) return e._value } } }, billboardDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].billboard.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e), t[o].billboard.scaleByDistance = new this._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0] .billboard.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, billboardDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].billboard.distanceDisplayCondition = new this ._cesium.DistanceDisplayCondition(e, i), t[o].billboard .scaleByDistance = new this._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function() { var e = this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0] .billboard.distanceDisplayCondition._value.near : 0 : void 0 } }, billboardPHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } }, polylineShow: { set: y.debounce(function(e) { var t = this.item.entities.values; if (/^line.fid/.test(t[0]._id) && t && 0 < t.length && t[0].polyline) for (var i = 0; i < t.length; i++) t[i].polyline && (t[i].polyline.show = e) }, 500), get: function() { var e = this.item.entities.values; if (/^line.fid/.test(e[0]._id) || null != e[0].polyline) return e && 0 < e.length && e[ 0].polyline ? e[0].polyline.b : void 0 } }, polylineWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { e = parseFloat(e); var t = this.item.entities.values; if ((/^line.fid/.test(t[0]._id) || null != t[0].polyline) && t && 0 < t .length && t[0].polyline) for (var i = 0; i < t.length; i++) t[i].polyline.width = e } }, 500), get: function() { var e = this.item.entities.values; if ((/^line.fid/.test(e[0]._id) || null != e[0].polyline) && e && 0 < e.length && e[0] .polyline) { e = e[0].polyline.width; if (e) return e._value } } }, polylinemMterial: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((/^line.fid/.test(t[0]._id) || null != t[0].polyline) && t && 0 < t .length && t[0].polyline) for (var i = 0; i < t.length; i++) t[i].polyline.material = e } }, 500), get: function() { var e = this.item.entities.values; if ((/^line.fid/.test(e[0]._id) || null != e[0].polyline) && e && 0 < e.length && e[0] .polyline) { e = e[0].polyline.material; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, polylinemArcType: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^line.fid/.test(t[0]._id) || null != t[0].polyline) && t && 0 < t .length && t[0].polyline) for (var i = 0; i < t.length; i++) t[i].polyline.arcType = e } }, 500), get: function() { var e = this.item.entities.values; if ((/^line.fid/.test(e[0]._id) || null != e[0].polyline) && e && 0 < e.length && e[0] .polyline) { e = e[0].polyline.arcType; if (e) return e._value } } }, polylineDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^line.fid/.test(t[0]._id) || null != t[0].polyline) && t && 0 < t .length && t[0].polyline) for (var i = t[0].polyline.distanceDisplayCondition ? t[0].polyline .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].polyline.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e) } }, 500), get: function() { var e = this.item.entities.values; if (/^line.fid/.test(e[0]._id) || null != e[0].polyline) return e && 0 < e.length && e[ 0].polyline ? e[0].polyline.distanceDisplayCondition ? e[0].polyline .distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, polylineDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^line.fid/.test(t[0]._id) || null != t[0].polyline) && t && 0 < t .length && t[0].polyline) for (var i = t[0].polyline.distanceDisplayCondition ? t[0].polyline .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].polyline.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(e, i) } }, 500), get: function() { var e = this.item.entities.values; if (/^line.fid/.test(e[0]._id) || null != e[0].polyline) return e && 0 < e.length && e[ 0].polyline ? e[0].polyline.distanceDisplayCondition ? e[0].polyline .distanceDisplayCondition._value.near : 0 : void 0 } }, polygonShow: { set: y.debounce(function(e) { var t = this.item.entities.values; if (/^polygon.fid/.test(t[0]._id) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++) t[i].polygon && (t[i].polygon.show = e) }, 500), get: function() { var e = this.item.entities.values; if (/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) return e && 0 < e.length && e[0].polygon ? e[0].polygon.b : void 0 } }, polygonHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t .length && t[0].polygon) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].polygon.height = e } }, 500), get: function() { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0] .polygon) { e = e[0].polygon.height; if (e) return e._value } } }, polygonHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t .length && t[0].polygon) for (var i = 0; i < t.length; i++) t[i].polygon.heightReference = e } }, 500), get: function() { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0] .polygon) { e = e[0].polygon.heightReference; if (e) return e._value } } }, polygonExtrudedHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t .length && t[0].polygon) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].polygon .extrudedHeight = e } }, 500), get: function() { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0] .polygon) { e = e[0].polygon.extrudedHeight; if (e) return e._value } } }, polygonExtrudedHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t .length && t[0].polygon) for (var i = 0; i < t.length; i++) t[i].polygon.extrudedHeightReference = e } }, 500), get: function() { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0] .polygon) { e = e[0].polygon.extrudedHeightReference; if (e) return e._value } } }, polygonFill: { set: y.debounce(function(e) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++) t[i].polygon.fill = e }, 500), get: function() { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0] .polygon) { e = e[0].polygon.fill; if (e) return e._value } } }, polygonMaterial: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t .length && t[0].polygon) for (var i = 0; i < t.length; i++) t[i].polygon.material = e } }, 500), get: function() { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0] .polygon) { e = e[0].polygon.material; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, polygonOutline: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t .length && t[0].polygon) for (var i = 0; i < t.length; i++) t[i].polygon.outline = e } }, 500), get: function() { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0] .polygon) { e = e[0].polygon.outline; if (e) return e._value } } }, polygonOutlineColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t .length && t[0].polygon) for (var i = 0; i < t.length; i++) t[i].polygon.outlineColor = e } }, 500), get: function() { var e = this.item.entities.values; if (/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) return e && 0 < e.length && e[0].polygon ? (e = e[0].polygon.outlineColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value .blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, polygonOutlineWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t .length && t[0].polygon) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].polygon .outlineWidth = e } }, 500), get: function() { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0] .polygon) { e = e[0].polygon.outlineWidth; if (e) return e._value } } }, polygonDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t .length && t[0].polygon) for (var i = t[0].polygon.distanceDisplayCondition ? t[0].polygon .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].polygon.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e) } }, 500), get: function() { var e = this.item.entities.values; if (/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) return e && 0 < e.length && e[0].polygon ? e[0].polygon.distanceDisplayCondition ? e[0].polygon .distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, polygonDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t .length && t[0].polygon) for (var i = t[0].polygon.distanceDisplayCondition ? t[0].polygon .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].polygon.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(e, i) } }, 500), get: function() { var e = this.item.entities.values; if (/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) return e && 0 < e.length && e[0].polygon ? e[0].polygon.distanceDisplayCondition ? e[0].polygon .distanceDisplayCondition._value.near : 0 : void 0 } } }), T.prototype.update = function(e) { this._quadtree.beginFrame(e), this._quadtree.render(e), this._quadtree.endFrame(e) }, T.prototype.static = function(e) { this.cs = e }, T.prototype.initialize = function(e) {}, T.prototype.beginUpdate = function(e) {}, T.prototype .endUpdate = function(e) {}, T.prototype.getLevelMaximumGeometricError = function(e) { return this._levelZeroMaximumError / (1 << e) }, T.prototype.loadTile = function(e, t) {}, T.prototype.computeTileVisibility = function(e, t, i) { var o = this.computeDistanceToTile(e, t); if (e._distance = o, t.fog.enabled && 1 <= Cesium.Math.fog(o, t.fog.density)) return Cesium.Visibility .NONE; o = e.data; if (o.tileBoundingRegion, void 0 === o.boundingVolumeSourceTile) return Cesium.Visibility.PARTIAL; var r = t.cullingVolume, n = o.orientedBoundingBox; !n && o.renderedMesh && (n = o.renderedMesh.boundingSphere3D), o.clippedByBoundaries = !1; a = e.rectangle, (s = this.cartographicLimitRectangle).west < s.east || (s = Rectangle.clone(s, splitCartographicLimitRectangleScratch), 0 < Rectangle.center(a, rectangleCenterScratch) .longitude ? s.east = CesiumMath.PI : s.west = -CesiumMath.PI); var a = s, s = new Cesium.Rectangle, a = Cesium.Rectangle.simpleIntersection(a, e.rectangle, s); if (!a) return Visibility.NONE; if (Cesium.Rectangle.equals(a, e.rectangle) || (o.clippedByBoundaries = !0), t.mode, Cesium.SceneMode .SCENE3D, !n) return Cesium.Intersect.INTERSECTING; s = this._clippingPlanes; if (s && s.enabled) { a = s.computeIntersectionWithBoundingVolume(n); if (e.isClipped = a !== Intersect.INSIDE, a === Cesium.Intersect.OUTSIDE) return Cesium.Visibility .NONE } s = r.computeVisibility(n); if (s === Cesium.Intersect.OUTSIDE) return Cesium.Visibility.NONE; e = t.mode === Cesium.SceneMode.SCENE3D && t.camera.frustum instanceof Cesium.OrthographicFrustum; return t.mode !== Cesium.SceneMode.SCENE3D || e || !i || !(a = o.occludeePointInScaledSpace) || i .ellipsoid.isScaledSpacePointVisible(a) ? s : Cesium.Visibility.NONE }, T.prototype.canRefine = function(e, t, i) { return e.level <= this._normalTile + 1 }, T.prototype.showTileThisFrame = function(e, t, i, o) { this._availability && (this._state = this.isAvailable(t.time)), e.data.geometryPrimitive && this ._state && this._client && "function" == typeof e.data.geometryPrimitive.update && (e.data .geometryPrimitive instanceof Cesium.Cesium3DTileset || e.data.geometryPrimitive.update(t, i, o) ) }, T.prototype.computeDistanceToTile = function(e, t) { c = this._maximumHeight, n = this._minimumHeight, s = e, this.terrainProvider, void 0 === (r = s .data) && (r = s.data = new Cesium.GlobeSurfaceTile), s._minimumHeight && (n = s._minimumHeight), s ._maximumHeight && (c = s._maximumHeight), void 0 === r.tileBoundingRegion && (r .tileBoundingRegion = new Cesium.TileBoundingRegion({ computeBoundingVolumes: !1, rectangle: s.rectangle, ellipsoid: s.tilingScheme.ellipsoid, minimumHeight: n || 0, maximumHeight: c || 0 })); var i, o, r = e.data, n = r.tileBoundingRegion; if (void 0 === s) return 9999999999; r.boundingVolumeSourceTile !== s && (r.boundingVolumeSourceTile = s, (c = e.rectangle) && c.width < Cesium.Math.PI_OVER_TWO + Cesium.Math.EPSILON5 && (r.orientedBoundingBox = Cesium .OrientedBoundingBox.fromRectangle(e.rectangle, n.minimumHeight, n.maximumHeight, e .tilingScheme.ellipsoid, r.orientedBoundingBox), r.occludeePointInScaledSpace = (s = this, c = r.orientedBoundingBox.center, l = e.rectangle, u = n.maximumHeight, i = r .occludeePointInScaledSpace, a = (s = s.quadtree._occluders.ellipsoid).ellipsoid, o = [ new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium .Cartesian3 ], Cesium.Cartesian3.fromRadians(l.west, l.south, u, a, o[0]), Cesium.Cartesian3 .fromRadians(l.east, l.south, u, a, o[1]), Cesium.Cartesian3.fromRadians(l.west, l .north, u, a, o[2]), Cesium.Cartesian3.fromRadians(l.east, l.north, u, a, o[3]), s .computeHorizonCullingPoint(c, o, i)))); var a, s, l = n.minimumHeight, u = n.maximumHeight, c = (r.boundingVolumeSourceTile !== e && (a = t.camera.positionCartographic.height, s = Math.abs(a - l), Math.abs(a - u) < s ? (n.minimumHeight = l, n.maximumHeight = l) : (n .minimumHeight = u, n.maximumHeight = u)), n.distanceToCamera(t)); return n.minimumHeight = l, n.maximumHeight = u, c }, T.prototype.isDestroyed = function() { return !1 }, T.prototype.destroy = function() { return Cesium.destroyObject(this) }, T.prototype.remove = function() { this.destroy() }, T.prototype.setStatus = function(e) { this._state = e, this._client = e }, T.prototype.edit = function(e, r) { let u = this, c = this._viewer; if (r = r || {}, this.editHandler && (this.editHandler.destroy(), this.editHandler = void 0), e = void 0 === e ? !0 : e) { var h, m, d, p; this.editHandler = new this._cesium.ScreenSpaceEventHandler(c.scene.canvas), this.isEditting = !1; let n; return this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView)) u.isEditting && (a(), u.defaultEvent(!1)); else { var i = t.position, o = c.scene.pick(i); if ((!o || !o.id || o.id.treeID === u.treeID) && o && o.id && (o .id instanceof Cesium.Entity || o.id.VectorType)) { let e = o.id; u.isEditting || 0 != V.states ? (e != h || "point" !== e.VectorType && "billboard" !== e.VectorType && "label" !== e.VectorType && "model" !== e.VectorType) && "_height_point" != e.name && "_edit_point" != e.name && "_move_point" != e.name && "_add_point" != e.name && "_size_point" != e .name || (c.container.style.cursor = "crosshair", u.defaultEvent(!1), "_height_point" == e.name ? (d = { windowPosition: i, originHeight: u._cesium.Cartographic.fromCartesian(e.position .getValue()).height }, n = "_height_point") : "_move_point" == e.name ? n = "_move_point" : "point" === e.VectorType || "billboard" === e.VectorType || "label" === e.VectorType || "model" === e.VectorType ? (u.tooltip.showAt(t.position, "释放后完成修改"), n = "_move_point", "model" === e.VectorType && (e .show = !1)) : "_edit_point" == e.name ? n = "_edit_point" : "_add_point" == e.name ? n = "_add_point" : "_size_point" == e.name && ( n = "_size_point"), m = e) : (r.callBack && r.callBack.start && r .callBack.start(e), p = e.VectorType, (h = u.createEditEntity(p, e .VectorStyle)).feature = e, h.treeID = u.treeID, u .getSimpleGraphicData(p, h), "point" === p || "billboard" === p || "label" === p || "model" === p ? (u.isEditting = !0, u.tooltip.showAt(t .position, "拖拽修改位置")) : (u.isEditting = !0, SmartEarthPopupData .editGraphic.updataEditPoint(), SmartEarthPopupData.editGraphic .setTreeID(u.treeID)), u.setStatus(!1), V.editVector = !0) } } }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView)) u.isEditting && (a(), u.defaultEvent(!1)); else { var r = c.scene.pick(t.endPosition); if ((!r || !r.id || r.id.treeID === u.treeID) && (u._cesium.defined(r) ? u .isEditting && !m ? "point" !== p && "billboard" !== p && "label" !== p && "model" !== p || r.id != h ? r.id && "_edit_point" === r.id.name && h .pottingPoint ? "polyline" === p && 2 < h.pottingPoint.length || "polygon" === p && 3 < h.pottingPoint.length ? u.tooltip.showAt(t .endPosition, "拖拽修改位置,右键删除点") : u.tooltip.showAt(t.endPosition, "拖拽修改位置") : !r.id || "_move_point" !== r.id.name && "_size_point" !== r .id.name ? r.id && "_add_point" === r.id.name ? u.tooltip.showAt(t .endPosition, "拖拽增加节点") : r.id && "_height_point" === r.id.name ? u .tooltip.showAt(t.endPosition, "拖拽修改高度") : r.id == h && u.tooltip.show(!1) : u.tooltip.showAt(t.endPosition, "拖拽修改位置") : u.tooltip.showAt(t.endPosition, "拖拽修改位置,右键删除") : u.isEditting || 0 !== V.states || (r.id && r.id .VectorType ? u.tooltip.showAt(t.endPosition, "点击激活编辑") : u.tooltip .show(!1)) : 0 != V.states || m || u.tooltip.show(!1), u.isEditting && m )) { u.tooltip.showAt(t.endPosition, "释放后完成修改"); let i = u._getPosition.getMousePosition(t); if (i || "_height_point" === n) if ("_edit_point" === n) { m.position = i; r = V.editPointID.edit.indexOf(m.id); if (void 0 !== h[p].height ? (l = u.toDegrees(i), h.pottingPoint[r] = Cesium.Cartesian3.fromDegrees(l.lon, l.lat, h[p].height .getValue()), m.position = h.pottingPoint[r]) : h .pottingPoint[r] = i, 0 < V.editPointID.add.length) { if (0 < r) { let i = c.entities.getById(V.editPointID.add[r - 1]); if (i) { let e = c.entities.getById(V.editPointID.edit[r - 1]), t = c.entities.getById(V.editPointID.edit[r]); i.position = Cesium.Cartesian3.midpoint(e.position .getValue(), t.position.getValue(), new Cesium .Cartesian3) } } if (r < h.pottingPoint.length - 1) { let i = c.entities.getById(V.editPointID.add[r]); if (i) { let e = c.entities.getById(V.editPointID.edit[r]), t = c.entities.getById(V.editPointID.edit[r + 1]); i.position = Cesium.Cartesian3.midpoint(e.position .getValue(), t.position.getValue(), new Cesium .Cartesian3) } } if ("polygon" === p && (0 === r || r === h.pottingPoint.length - 1)) { let i = c.entities.getById(V.editPointID.add[V.editPointID.add .length - 1]); if (i) { let e = c.entities.getById(V.editPointID.edit[0]), t = c.entities.getById(V.editPointID.edit[h.pottingPoint .length - 1]); i.position = Cesium.Cartesian3.midpoint(e.position .getValue(), t.position.getValue(), new Cesium .Cartesian3) } } } let e = h.pottingPoint.concat([]), t = new u._cesium.Cartesian3; var l = e.length; e.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= l, t.y /= l, t.z /= l, V.editPointID.move && (V .editPointID.move.position = t), "polyline" !== p && "polygon" !== p && "rectangle" !== p || SmartEarthPopupData .editGraphic.setValue("positions", e) } else if ("_height_point" === n) { r = V.editPointID.height.indexOf(m.id); let e = c.entities.getById(V.editPointID.edit[r]), i = ("ellipse" !== p && "cylinder" !== p && "box" !== p || (e = V .editPointID.move), u.toDegrees(e.position.getValue())); l = d.originHeight - i.height, r = c.scene.cartesianToCanvasCoordinates(e .position.getValue()), t = (d.windowPosition.y - t.endPosition.y) * l / Math.abs(r.y - d.windowPosition.y); let o = Math.abs(l + t); V.editPointID.height.forEach(e => { let t = c.entities.getById(e); t && (e = t.position.getValue(), e = u.toDegrees(e), t .position = u._cesium.Cartesian3.fromDegrees(e.lon, e .lat, o + i.height)) }), h[p].extrudedHeight ? h[p].extrudedHeight = o + i.height : "box" === p ? SmartEarthPopupData.editGraphic.setValue("height", o) : "cylinder" === p && SmartEarthPopupData.editGraphic.setValue("length", o) } else if ("_add_point" === n) { var r = V.editPointID.add.indexOf(m.id), l = (c.entities.remove(m), c.entities.add({ name: "_edit_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } })), t = (V.editPointID.edit.splice(r + 1, 0, l.id), h.pottingPoint.splice( r + 1, 0, i.clone()), Cesium.Cartesian3.midpoint(h.pottingPoint[ r], h.pottingPoint[r + 1], new Cesium.Cartesian3)), t = c.entities.add({ name: "_add_point", position: t, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), e = Cesium.Cartesian3.midpoint(h.pottingPoint[r + 1], h.pottingPoint[r + 2 === h.pottingPoint.length ? 0 : r + 2], new Cesium.Cartesian3), e = c.entities.add({ name: "_add_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), r = (V.editPointID.add.splice(r, 1, t.id, e.id), SmartEarthPopupData .editGraphic.setTreeID(u.treeID), m = l, n = "_edit_point", h .pottingPoint.concat([])); "polyline" !== p && "polygon" !== p || SmartEarthPopupData.editGraphic .setValue("positions", r) } else if ("_size_point" === n) { t = V.editPointID.move.position.getValue(), e = u._cesium.Cartesian3 .distance(t, i); "ellipse" === p || "cylinder" === p || "ellipsoid" === p && h.isSphere ? SmartEarthPopupData.editGraphic.setValue("radius", e) : "box" === p && ( l = 90 === m.angle ? "long" : "width", SmartEarthPopupData .editGraphic.setValue(l, 2 * e)) } else if ("point" === p || "billboard" === p || "label" === p || "model" === p) m.position = i; else { r = u.toDegrees(i), t = (d = m.position.getValue(), u.toDegrees(d)); let n = r.lon - t.lon, a = r.lat - t.lat, s = r.height - t.height; m.position = i, h[p].height && (l = u.toDegrees(i).height, h[p].height = l, h.thisHeight = l), h.pottingPoint.forEach((e, t) => { let i, o, r = c.entities.getById(V.editPointID.edit[t]); if (r = r || c.entities.getById(V.editPointID.size[t]), i = r ? u.toDegrees(r.position.getValue()) : u.toDegrees(e), o = u ._cesium.Cartesian3.fromDegrees(i.lon + n, i.lat + a, i .height + s), e.x = o.x, e.y = o.y, e.z = o.z, r && (r .position = o), 0 < V.editPointID.add.length && V .editPointID.add[t]) { let e = c.entities.getById(V.editPointID.add[t]); e && (i = u.toDegrees(e.position.getValue()), e.position = u ._cesium.Cartesian3.fromDegrees(i.lon + n, i.lat + a, i.height + s)) } }); e = h.pottingPoint.concat([]); "polyline" === p || "polygon" === p || "rectangle" === p ? SmartEarthPopupData.editGraphic.setValue("positions", e) : "ellipse" === p ? (h.pottingPoint[1] = i, h.position = i.clone()) : "box" === p ? (h .pottingPoint[2] = i, r = h.box.dimensions.getValue(), t = u .toDegrees(i), h.position = Cesium.Cartesian3.fromDegrees(t.lon, t .lat, t.height + r.z / 2)) : "cylinder" === p ? (h.pottingPoint[ 1] = i, l = h.cylinder.length.getValue(), e = u.toDegrees(h .pottingPoint[1]), h.position = Cesium.Cartesian3.fromDegrees(e .lon, e.lat, e.height + l / 2)) : "ellipsoid" === p && (h .pottingPoint[h.pottingPoint.length - 1] = i, h.position = i.clone() ) } } } }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.editHandler.setInputAction(e => { Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView) ? u.isEditting && (a(), u.defaultEvent(!1)) : (m && "model" === m.VectorType && (m.show = !0), m && r.callBack && r.callBack .updata && r.callBack.updata(m.name, h), c.container.style.cursor = "default", m = void 0, u.defaultEvent(!0)) }, this._cesium.ScreenSpaceEventType.LEFT_UP), this.editHandler.setInputAction(e => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView)) u.isEditting && (a(), u.defaultEvent(!1)); else { e = c.scene.pick(e.position); if ((!e || !e.id || e.id.treeID === u.treeID) && u._cesium.defined(e) && 0 == V .states) { e = e.id; if (!e.VectorType && -1 < V.editPointID.edit.indexOf(e.id) && ("polyline" === p && 2 < V.editPointID.edit.length || "polygon" === p && 3 < V .editPointID.edit.length)) { var i = V.editPointID.edit.indexOf(e.id); if (c.entities.removeById(e.id), V.editPointID.edit.splice(i, 1), h .pottingPoint.splice(i, 1), 0 < V.editPointID.add.length) if (V.editPointID.add[i]) { if (c.entities.removeById(V.editPointID.add[i]), V.editPointID.add .splice(i, 1), 0 <= i - 1) { let e = c.entities.getById(V.editPointID.add[i - 1]); e && (e.position = Cesium.Cartesian3.midpoint(h.pottingPoint[i - 1], h.pottingPoint[i === h.pottingPoint.length ? 0 : i], new Cesium.Cartesian3)) } else if (i - 1 == -1 && "polygon" === p) { let e = c.entities.getById(V.editPointID.add[V.editPointID.add .length - 1]); e && (e.position = Cesium.Cartesian3.midpoint(h.pottingPoint[0], h.pottingPoint[h.pottingPoint.length - 1], new Cesium.Cartesian3)) } } else c.entities.removeById(V.editPointID.add[i - 1]), V.editPointID .add.pop(); let t = new u._cesium.Cartesian3; e = h.pottingPoint.length, i = (h.pottingPoint.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= e, t.y /= e, t.z /= e, V.editPointID.move && (V .editPointID.move.position = t), h.pottingPoint.concat([])); "polyline" !== p && "polygon" !== p || SmartEarthPopupData.editGraphic .setValue("positions", i), u.tooltip.show(!1), r.callBack && r.callBack .updata && r.callBack.updata(m && m.name, h) } } } }, this._cesium.ScreenSpaceEventType.RIGHT_DOWN), a(), { endThisEdit: a, getEditData: function() { return { entity: h } } }; function a() { u.defaultEvent(!0), V.editPointID.edit.forEach(e => { c.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { c.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { c.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { c.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && c.entities.remove(V.editPointID.move), V .editPointID.move = void 0, h && c.entities.remove(h), p = h = void 0, SmartEarthPopupData .editGraphic = {}, u.isEditting = !1, u.setStatus(!0), V.editVector = !1, u.delButton(!1) } } else a() }, T.prototype.createEditEntity = function(e, i) { let o; var r = this; let n = this._viewer; if ("polygon" === e) { let e = i.positions; var a = r._core.defaultValue(i.height, void 0); let t; t = i.hierarchy || (e = i.haveZ ? r._cesium.Cartesian3.fromDegreesArrayHeights(e) : r._cesium .Cartesian3.fromDegreesArray(e), new r._cesium.PolygonHierarchy(e)), (o = n.entities.add({ polygon: { hierarchy: new r._cesium.CallbackProperty(function() { return t }, !1), extrudedHeight: r._core.defaultValue(i.extrudedHeight, void 0), height: a, material: new r._cesium.ImageMaterialProperty({ image: r._core.defaultValue(i.image, null), repeat: r._core.defaultValue(i.repeat, new r._cesium.Cartesian2(1, 1)), color: i.material }), shadows: r._cesium.ShadowMode.ENABLED, fill: !0 } })).VectorType = "polygon" } else if ("polyline" === e) { let e = i.positions; e = i.haveZ ? r._cesium.Cartesian3.fromDegreesArrayHeights(e) : r._cesium.Cartesian3 .fromDegreesArray(e), (o = n.entities.add({ polyline: { positions: new r._cesium.CallbackProperty(function() { return e }, !1), clampToGround: r._core.defaultValue(i.clampToGround, !1), material: new Cesium.PolylineOutlineMaterialProperty({ color: i.material, outlineWidth: r._core.defaultValue(i.outlineWidth, 0), outlineColor: r._cesium.Color.fromCssColorString(r._core .defaultValue(i.outlineColor, "rgba(255,255,255,0.6)")) }), width: r._core.defaultValue(i.width, 3) } })).VectorType = "polyline" } else if ("wall" === e) { let e = i.positions; e = i.haveZ ? r._cesium.Cartesian3.fromDegreesArrayHeights(e) : r._cesium.Cartesian3 .fromDegreesArray(e), (o = n.entities.add({ wall: { positions: new r._cesium.CallbackProperty(function() { return e }, !1), minimumHeights: i.minimumHeights, maximumHeights: i.maximumHeights, material: i.material, outline: !0, outlineWidth: r._core.defaultValue(i.outlineWidth, 0), outlineColor: i.outlineColor } })).VectorType = "wall" } else "label" === e ? (o = n.entities.add({ position: i.position, label: { text: i.text, font: i.font, scale: i.scale, style: i.style, fillColor: i.fillColor, outlineColor: i.outlineColor, outlineWidth: i.outlineWidth, showBackground: i.showBackground, backgroundColor: i.backgroundColor, heightReference: i.heightReference, horizontalOrigin: i.horizontalOrigin, verticalOrigin: i.verticalOrigin, scaleByDistance: i.scaleByDistance, distanceDisplayCondition: i.distanceDisplayCondition } })).VectorType = "label" : "billboard" === e ? (o = n.entities.add({ position: i.position, billboard: { rotation: i.rotation, width: i.width, height: i.height, image: i.image, color: i.color, scale: i.scale, heightReference: i.heightReference, horizontalOrigin: i.horizontalOrigin, verticalOrigin: i.verticalOrigin, scaleByDistance: i.scaleByDistance, distanceDisplayCondition: i.distanceDisplayCondition } })).VectorType = "billboard" : "point" === e && ((o = n.entities.add({ position: i.position, point: { pixelSize: i.pixelSize, color: i.color, outlineWidth: i.outlineWidth, outlineColor: i.outlineColor, heightReference: i.heightReference, scaleByDistance: i.scaleByDistance, distanceDisplayCondition: i.distanceDisplayCondition } })).VectorType = "point"); return o }, T.prototype.delButton = function(e, t, i) { if (e) { let e = document.getElementById("DeleteMilitaryStandardDelete"); e || ((e = document.createElement("button")).id = "DeleteMilitaryStandardDelete", e.innerText = "删除对象", e.style.cssText = `height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`, this._viewer.container.appendChild(e)), e.style.display = "block", e .style.top = t.y + "px", e.style.left = t.x + "px", e.onclick = i } else { let e = document.getElementById("DeleteMilitaryStandardDelete"); e && (e.style.display = "none", e.onclick = null) } }, T.prototype.defaultEvent = function(e) { let t = this._viewer.scene; t.screenSpaceCameraController.enableRotate = e, t.screenSpaceCameraController.enableTranslate = e, t .screenSpaceCameraController.enableZoom = e, t.screenSpaceCameraController.enableTilt = e, t .screenSpaceCameraController.enableLook = e }, T.prototype.getEntityTypeAndObject = function(e) { let t = { type: "", object: null }; return e && (e.billboard ? (t.type = "billboard", t.object = e.billboard) : e.box ? (t.type = "box", t .object = e.box) : e.corridor ? (t.type = "corridor", t.object = e.corridor) : e.cylinder ? (t.type = "cylinder", t.object = e.cylinder) : e.ellipse ? (t.type = "ellipse", t.object = e .ellipse) : e.ellipsoid ? (t.type = "ellipsoid", t.object = e.ellipsoid) : e.label ? (t .type = "label", t.object = e.label) : e.model ? (t.type = "model", t.object = e.model) : e .path ? (t.type = "path", t.object = e.path) : e.plane ? (t.type = "plane", t.object = e .plane) : e.point ? (t.type = "point", t.object = e.point) : e.polygon ? (t.type = "polygon", t .object = e.polygon) : e.polyline ? (t.type = "polyline", t.object = e.polyline) : e .polylineVolume ? (t.type = "polylineVolume", t.object = e.polylineVolume) : e.rectangle ? (t .type = "rectangle", t.object = e.rectangle) : e.wall && (t.type = "wall", t.object = e .wall)), t }, T.prototype.toDegrees = function(e) { e = this._cesium.Cartographic.fromCartesian(e); return { lon: this._cesium.Math.toDegrees(e.longitude), lat: this._cesium.Math.toDegrees(e.latitude), height: e.height } }, T.prototype.getSimpleGraphicData = function(e, n) { let a = this, s = this._viewer; var t, i; function o(e) { SmartEarthPopupData.editGraphic.fillColor = l("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")"), SmartEarthPopupData.editGraphic.alpha = 100 * e.alpha } function r(e) { SmartEarthPopupData.editGraphic.outlineColor = l("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")"), SmartEarthPopupData.editGraphic.outlineAlpha = 100 * e.alpha } function l(e) { let t = e; if (/^(rgb|RGB)/.test(t)) { let e = t.replace(/(rgb|RGB)*/g, ""); var o = (e = e.replace("(", "").replace(")", "")).split(","); let i = "#"; for (let t = 0; t < o.length; t++) { let e = Number(o[t]).toString(16); "0" === (e = 1 === e.length ? "0" + e : e) && (e += e), i += e } return i = 7 !== i.length ? t : i } if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) return t; var i = t.replace(/#/, "").split(""); if (6 === i.length) return t; if (3 === i.length) { let t = "#"; for (let e = 0; e < i.length; e += 1) t += i[e] + i[e]; return t } } SmartEarthPopupData.editGraphic = { entity: n, type: e, graphic: n[e], getValue: function(e) { return "position" === e || "name" === e || "id" === e ? this.entity[e] && (this.entity[ e].getValue ? this.entity[e].getValue() : this.entity[e]) : "radius" === e ? "ellipse" === this.type ? this.graphic.semiMajorAxis.getValue() : "ellipsoid" === this.type ? this.graphic.radii.getValue().x : "cylinder" === this.type ? this .graphic.bottomRadius.getValue() : void 0 : "pHeight" !== e ? "repeat" === e ? this .graphic.material[e] && (this.graphic.material[e].getValue ? this.graphic.material[ e].getValue() : this.graphic.material[e]) : this.graphic[e] && (this.graphic[e] .getValue ? this.graphic[e].getValue() : this.graphic[e]) : this.getValue( "position") ? (e = this.getValue("position"), Cesium.Cartographic.fromCartesian( e).height) : void 0 }, changeHeightPoint: function(i) { 0 < V.editPointID.height.length && V.editPointID.height.forEach(e => { let t = s.entities.getById(e); t && (e = t.position.getValue(), e = a.toDegrees(e), t.position = Cesium .Cartesian3.fromDegrees(e.lon, e.lat, i)) }) }, changeEditPoint: function(i) { 0 < V.editPointID.edit.length && V.editPointID.edit.forEach(e => { let t = s.entities.getById(e); t && ("clampToGround" === i ? t.point.heightReference = 1 : (t.point .heightReference = 0, e = t.position.getValue(), e = a .toDegrees(e), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, i))) }), 0 < V.editPointID.size.length && V.editPointID.size.forEach(e => { let t = s.entities.getById(e); t && ("clampToGround" === i ? t.point.heightReference = 1 : (t.point .heightReference = 0, e = t.position.getValue(), e = a .toDegrees(e), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, i))) }), 0 < V.editPointID.add.length && V.editPointID.add.forEach(e => { let t = s.entities.getById(e); t && ("clampToGround" === i ? t.point.heightReference = 1 : (t.point .heightReference = 0, e = t.position.getValue(), e = a .toDegrees(e), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, i))) }); let e = V.editPointID.move; var t; e && ("clampToGround" === i ? e.point.heightReference = 1 : (e.point.heightReference = 0, t = e.position.getValue(), t = a.toDegrees(t), e.position = Cesium .Cartesian3.fromDegrees(t.lon, t.lat, i))) }, clearAllEditPoint: function() { V.editPointID.edit.forEach(e => { s.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { s.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { s.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { s.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && s.entities.remove(V.editPointID .move), V.editPointID.move = void 0 }, setTreeID: function(i) { V.editPointID.edit.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.height.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.add.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.size.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.move && (V.editPointID.move.treeID = i) } }, "billboard" === e || "point" === e || "label" === e || "model" === e ? ((i = SmartEarthPopupData .editGraphic.getValue("color") || SmartEarthPopupData.editGraphic.getValue("fillColor")) ? o(i) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData.editGraphic .alpha = 60), (i = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? r(i) : ( SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic .outlineAlpha = 60), "label" === e && ((i = SmartEarthPopupData.editGraphic.getValue( "backgroundColor")) ? (i = i, SmartEarthPopupData.editGraphic.backgroundColor = l( "rgb(" + 255 * i.red + "," + 255 * i.green + "," + 255 * i.blue + ")"), SmartEarthPopupData.editGraphic.backgroundAlpha = 100 * i.alpha) : (SmartEarthPopupData .editGraphic.backgroundColor = "#000000", SmartEarthPopupData.editGraphic .backgroundAlpha = 80)), SmartEarthPopupData.editGraphic.setValue = function(e, t) { if ("position" === e || "name" === e) this.entity[e] = t; else { if ("color" === e || "outlineColor" === e || "backgroundColor" === e || "fillColor" === e) t = Cesium.Color.fromCssColorString(t); else if ("fontSize" === e) { let e = this.getValue("font"); (e = e.split(" "))[0] = t, t = e.join(" ") } else { if ("alpha" === e) return void("label" === this.type ? this.graphic.fillColor._value .alpha = t : this.graphic.color._value.alpha = t); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = t); if ("backgroundAlpha" === e) return void(this.graphic.backgroundColor._value.alpha = t); if ("pHeight" === e && this.getValue("position")) { var i = this.getValue("position"); let e = Cesium.Cartographic.fromCartesian(i); return e.height = t, void(this.entity.position = Cesium.Cartographic .toCartesian(e)) } } this.graphic[e] = t } }) : "polyline" === e ? ((i = SmartEarthPopupData.editGraphic.getValue("material")).color ? o(i .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), i.outlineColor ? r(i.outlineColor) : (SmartEarthPopupData .editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(e, t) { if ("name" === e) this.entity[e] = t; else { if ("color" === e || "outlineColor" === e) return t = Cesium.Color.fromCssColorString( t), void(this.graphic.material[e] = t); "outlineWidth" === e ? this.graphic.material[e] = t : "alpha" === e ? this.graphic .material.color._value.alpha = t : "outlineAlpha" === e ? this.graphic.material .outlineColor._value.alpha = t : this.graphic[e] = "positions" === e ? new Cesium .CallbackProperty(function() { return t }, !1) : t } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e = this.getValue("positions"); return this.entity.pottingPoint = e }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); let t = this.getPottingPoint(); if (t) { let o = new Cesium.Cartesian3; t.forEach((e, t) => { var i = s.entities.add({ name: "_edit_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this .graphic.heightReference.getValue() } }); V.editPointID.edit.push(i.id), o.x += e.x, o.y += e.y, o.z += e.z }), o.x /= t.length, o.y /= t.length, o.z /= t.length, V.editPointID.move = s .entities.add({ name: "_move_point", position: o, point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); for (let e = 0; e < t.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "_add_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); V.editPointID.add.push(i.id) } } }) : "polygon" === e ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color ? o(t .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? r(t) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData .editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(e, i) { if ("name" === e) this.entity[e] = i; else { if ("color" === e || "outlineColor" === e) { if (i = Cesium.Color.fromCssColorString(i), "color" === e) return void(this.graphic .material.color = i) } else { if ("image" === e || "repeat" === e) return void(this.graphic.material[e] = i); if ("alpha" === e) return void(this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = i); if ("positions" === e) return void(this.graphic.hierarchy = new Cesium .CallbackProperty(function() { return new Cesium.PolygonHierarchy(i) }, !1)); if ("hierarchy" === e) return void(this.graphic.hierarchy = new Cesium .CallbackProperty(function() { return i }, !1)); function t(e, t, i) { i ? (e.perPositionHeight = !1, e.heightReference = Cesium.HeightReference .CLAMP_TO_GROUND) : (e.perPositionHeight = !0, e.heightReference = Cesium.HeightReference.NONE), 0 < V.editPointID.edit.length && !i && t .forEach((e, t) => { let i = s.entities.getById(V.editPointID.edit[t]); i && (t = i.position.getValue(), e.x = t.x, e.y = t.y, e.z = t.z) }), e.hierarchy = new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(t) }, !1) } if ("clampToGround" === e) return this.graphic.hierarchy instanceof Cesium .CallbackProperty ? (this.graphic.hierarchy = this.graphic.hierarchy .getValue(), setTimeout(() => { t(this.graphic, this.entity.pottingPoint, i) }, 100)) : t(this.graphic, this.entity.pottingPoint, i), void(0 < V .editPointID.add.length && V.editPointID.add.forEach(e => { let t = s.entities.getById(e); t && (t.point.heightReference = i ? 1 : 0) })); "extrudedHeight" === e ? this.changeHeightPoint(i) : "height" === e && this .changeEditPoint(i) } this.graphic[e] = i } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { let e = this.getValue("hierarchy"), t = e.positions.concat([]); if (void 0 !== this.getValue("height")) { let i = this.getValue("height"); t.forEach(e => { var t = a.toDegrees(e), t = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, i); e.x = t.x, e.y = t.y, e.z = t.z }) } return this.entity.pottingPoint = t }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); let t = this.getPottingPoint(); if (t) { let o = new Cesium.Cartesian3; t.forEach((e, t) => { var i = s.entities.add({ name: "_edit_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this .graphic.heightReference.getValue() } }); V.editPointID.edit.push(i.id), o.x += e.x, o.y += e.y, o.z += e.z }), o.x /= t.length, o.y /= t.length, o.z /= t.length, V.editPointID.move = s .entities.add({ name: "_move_point", position: o, point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); for (let e = 0; e < t.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "_add_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); V.editPointID.add.push(i.id) } var e = Cesium.Cartesian3.midpoint(t[0], t[t.length - 1], new Cesium.Cartesian3), e = s.entities.add({ name: "_add_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); V.editPointID.add.push(e.id) } }) : "ellipse" === e || "cylinder" === e || n.isSphere ? ((t = SmartEarthPopupData.editGraphic .getValue("material")).color ? o(t.color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData.editGraphic.alpha = 60), (t = SmartEarthPopupData.editGraphic .getValue("outlineColor")) ? r(t) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic.outlineAlpha = 60), SmartEarthPopupData .editGraphic.setValue = function(e, i) { if ("name" === e) this.entity[e] = i; else { if ("color" === e || "outlineColor" === e) { if (i = Cesium.Color.fromCssColorString(i), "color" === e) return void(this.graphic .material.color = i) } else { if ("image" === e || "repeat" === e) return void(this.graphic.material[e] = i); if ("alpha" === e) return void(this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = i); if ("semiMajorAxis" === e) return void(this.graphic.semiMajorAxis = new Cesium .CallbackProperty(function() { return i }, !1)); if ("semiMinorAxis" === e) return void(this.graphic.semiMinorAxis = new Cesium .CallbackProperty(function() { return i }, !1)); if ("radii" === e) return void(this.graphic.radii = new Cesium.CallbackProperty( function() { return i }, !1)); if ("topRadius" === e) return void(this.graphic.topRadius = new Cesium .CallbackProperty(function() { return i }, !1)); if ("bottomRadius" === e) return void(this.graphic.bottomRadius = new Cesium .CallbackProperty(function() { return i }, !1)); if ("radius" === e) { "ellipse" === this.type ? (this.graphic.semiMajorAxis = new Cesium .CallbackProperty(function() { return i }, !1), this.graphic.semiMinorAxis = new Cesium.CallbackProperty( function() { return i }, !1)) : "ellipsoid" === this.type ? null !== this.graphic.material .image.getValue() ? this.graphic.radii = new Cesium.Cartesian3(i, i, i) : this.graphic.radii = new Cesium.CallbackProperty(function() { return new Cesium.Cartesian3(i, i, i) }, !1) : "cylinder" === this.type && (this.graphic.bottomRadius = new Cesium .CallbackProperty(function() { return i }, !1), this.entity.changeTop && (this.graphic.topRadius = new Cesium .CallbackProperty(function() { return i }, !1))); var o = V.editPointID.move.position.getValue(), r = a.GetPositionFromA_D(o, i, 90); let e = s.entities.getById(V.editPointID.size[0]), t = (e.position = r, n.pottingPoint[0] = r, n.pottingPoint[n.pottingPoint .length - 1] = o, s.entities.getById(V.editPointID.height[0])); return void(t && (o = a.toDegrees(r), r = a._cesium.Cartographic.fromCartesian(t .position.getValue()), t.position = a._cesium.Cartesian3 .fromDegrees(o.lon, o.lat, r.height))) } if ("cylinder" === this.type && "length" === e) return this.graphic.length = i, o = a.toDegrees(this.entity.pottingPoint[1]), this.entity.position = Cesium .Cartesian3.fromDegrees(o.lon, o.lat, o.height + i / 2), void this .changeHeightPoint(o.height + i); function t(e, t, i) { i ? (void 0 === e.thisHeight && (e.thisHeight = t.height && t.height .getValue()), t.height = void 0, t.heightReference = Cesium.HeightReference .CLAMP_TO_GROUND) : (t.height = e.thisHeight, t.heightReference = Cesium .HeightReference.NONE); let o = t.semiMinorAxis.getValue(); t.semiMinorAxis = new Cesium.CallbackProperty(function() { return o }, !1), t.semiMajorAxis = new Cesium.CallbackProperty(function() { return o }, !1) } if ("ellipse" === this.type && "clampToGround" === e) return this.graphic .semiMinorAxis instanceof Cesium.CallbackProperty ? (this.graphic .semiMinorAxis = this.graphic.semiMinorAxis.getValue(), this.graphic .semiMajorAxis = this.graphic.semiMajorAxis.getValue(), setTimeout( () => { t(this.entity, this.graphic, i) }, 100)) : t(this.entity, this.graphic, i), void(i ? this .changeEditPoint("clampToGround") : this.changeEditPoint(this.entity .thisHeight)); "ellipse" === this.type && "extrudedHeight" === e ? this.changeHeightPoint(i) : "ellipse" === this.type && "height" === e && (this.changeEditPoint(i), this .entity.thisHeight = i) } this.graphic[e] = i } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e, t, i = this.getValue("radius"); let o = this.getValue("position"); return "ellipse" === this.type || this.entity.isSphere ? ("ellipse" === this.type && void 0 !== this.getValue("height") && (e = this.getValue("height"), t = a.toDegrees( o), o = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, e)), t = a .GetPositionFromA_D(o, i, 90), this.entity.pottingPoint = [t, o], [t, o]) : (e = a .toDegrees(o), o = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height - this .getValue("length") / 2), t = a.GetPositionFromA_D(o, i, 90), this.entity .pottingPoint = [t, o], [t, o]) }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); var t = this.getPottingPoint(); if (t) { let e = s.entities.add({ name: "_size_point", position: t[0], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }); e.angle = 90, V.editPointID.size.push(e.id), V.editPointID.move = s.entities.add({ name: "_move_point", position: t[1], point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }) } }) : "rectangle" === e ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color ? o(t .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? r(t) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData .editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(e, t) { if ("name" === e) this.entity[e] = t; else { if ("color" === e || "outlineColor" === e) { if (t = Cesium.Color.fromCssColorString(t), "color" === e) return void(this.graphic .material.color = t) } else { if ("image" === e || "repeat" === e) return void(this.graphic.material[e] = t); if ("alpha" === e) return void(this.graphic.material.color._value.alpha = t); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = t); if ("positions" === e) return void(this.graphic.coordinates = new Cesium .CallbackProperty(function() { return Cesium.Rectangle.fromCartesianArray(t) }, !1)); if ("coordinates" === e) return void(this.graphic.coordinates = new Cesium .CallbackProperty(function() { return t }, !1)); function i(e, t, i) { i ? (void 0 === e.thisHeight && (e.thisHeight = t.height && t.height .getValue()), t.height = void 0, t.heightReference = Cesium.HeightReference .CLAMP_TO_GROUND) : (t.height = e.thisHeight, t.heightReference = Cesium .HeightReference.NONE); let o = t.coordinates.getValue(); t.coordinates = new Cesium.CallbackProperty(function() { return o }, !1) } if ("clampToGround" === e) return this.graphic.coordinates instanceof Cesium .CallbackProperty ? (this.graphic.coordinates = this.graphic.coordinates .getValue(), setTimeout(() => { i(this.entity, this.graphic, t) }, 100)) : i(this.entity, this.graphic, t), void(t ? this .changeEditPoint("clampToGround") : this.changeEditPoint(this.entity .thisHeight)); "extrudedHeight" === e ? this.changeHeightPoint(t) : "height" === e && (this .changeEditPoint(t), this.entity.thisHeight = t) } this.graphic[e] = t } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e = this.getValue("coordinates"); let t, i, o = this.getValue("height"); return i = (void 0 !== o ? t = Cesium.Cartesian3.fromRadians(e.west, e.north, o) : (o = s .scene.sampleHeight(new Cesium.Cartographic(e.west, e.north, 0), [this.entity]), t = Cesium.Cartesian3.fromRadians(e.west, e.north, o), o = s.scene.sampleHeight( new Cesium.Cartographic(e.east, e.south, 0), [this.entity])), Cesium .Cartesian3.fromRadians(e.east, e.south, o)), this.entity.pottingPoint = [t, i], [t, i ] }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); let e = this.getPottingPoint(); if (e) { let o = new Cesium.Cartesian3; e.forEach((e, t) => { var i = s.entities.add({ name: "_edit_point", position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this .graphic.heightReference.getValue() } }); V.editPointID.edit.push(i.id), o.x += e.x, o.y += e.y, o.z += e.z }), o.x /= e.length, o.y /= e.length, o.z /= e.length, V.editPointID.move = s .entities.add({ name: "_move_point", position: o, point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }) } }) : "box" === e ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color ? o(t .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? r(t) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData .editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(t, i) { if ("name" === t) this.entity[t] = i; else { if ("color" === t || "outlineColor" === t) { if (i = Cesium.Color.fromCssColorString(i), "color" === t) return void(this.graphic .material.color = i) } else { if ("image" === t || "repeat" === t) return void(this.graphic.material[t] = i); if ("alpha" === t) return void(this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === t) return void(this.graphic.outlineColor._value.alpha = i); if ("long" === t || "width" === t || "height" === t) { let e = this.getValue("dimensions"); if ("long" === t ? e.x = i : "width" === t ? e.y = i : e.z = i, this.graphic .dimensions = new Cesium.CallbackProperty(function() { return e }, !1), "long" === t || "width" === t) { var o = "long" === t ? 90 : 180, r = "long" === t ? 0 : 1, n = V.editPointID.move.position.getValue(), o = a.GetPositionFromA_D(n, i / 2, o); let e = s.entities.getById(V.editPointID.size[r]); e.position = o, this.entity.pottingPoint[r] = o, this.entity.pottingPoint[ this.entity.pottingPoint.length - 1] = n } else { r = a.toDegrees(V.editPointID.move.position.getValue()); this.entity.position = Cesium.Cartesian3.fromDegrees(r.lon, r.lat, r .height + i / 2), this.changeHeightPoint(r.height + i) } return } if ("dimensions" === t) return void(this.graphic.dimensions = new Cesium .CallbackProperty(function() { return i }, !1)) } this.graphic[t] = i } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e = this.getValue("dimensions"), t = this.getValue("position"), i = a.toDegrees(t), t = Cesium.Cartesian3.fromDegrees(i.lon, i.lat, i.height - e.z / 2), i = a.GetPositionFromA_D(t, e.x / 2, 90), e = a.GetPositionFromA_D(t, e.y / 2, 180); return this.entity.pottingPoint = [i, e, t], [i, e, t] }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); var i = this.getPottingPoint(); if (i) { let e = s.entities.add({ name: "_size_point", position: i[0], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), t = (e.angle = 90, s.entities.add({ name: "_size_point", position: i[1], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } })); t.angle = 180, V.editPointID.size.push(e.id), V.editPointID.size.push(t.id), V .editPointID.move = s.entities.add({ name: "_move_point", position: i[2], point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic .heightReference.getValue() } }) } }) : "corridor" !== e && "ellipsoid" === e && n.isSphere }, w.prototype.createLabelPointGeoJsonFeatureLayer = function(e, t, s, i, l) { null == t && console.log("geojson is required"); var o = this._cesium.GeoJsonDataSource.load(t), u = this, o = (o.then(function(e) { for (var t = { Name: "", text: "", font: " 30px sans-serif", stylet: u._cesium.LabelStyle.OUTLINE, fillColor: u._cesium.Color.WHITE, outlineColor: u._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new u._cesium.Color(.165, .165, .165, .8), backgroundPadding: new u._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: u._cesium.HorizontalOrigin.CENTER, verticalOrigin: u._cesium.VerticalOrigin.CENTER, eyeOffset: u._cesium.Cartesian3.ZERO, pixelOffset: u._cesium.Cartesian2.ZERO, heightReference: u._cesium.HeightReference.NONE, scaleByDistance: new u._cesium.NearFarScalar(0, 0, 1, 1) }, i = (s.material, u._core.isnull(s) || u._core.isnull(s.fillColor) || /^\[/ .test(s.fillColor) && "[" == s.fillColor.toString().charAt(0) && "]" == s .fillColor.toString().charAt(s.fillColor.length - 1) || (u._core .isHtmlColor(s.fillColor) ? s.fillColor = u._color.colorFromHtmlColor(s .fillColor) : (/^rgb/.test(s.fillColor) && (s.fillColor = u._color .rgbaStringToRgbaObj(s.fillColor)), 1 < s.fillColor.r && (s .fillColor.r = s.fillColor.r / 255), 1 < s.fillColor.g && (s .fillColor.g = s.fillColor.g / 255), 1 < s.fillColor.b && (s .fillColor.b = s.fillColor.b / 255), 1 < s.fillColor.a && (s .fillColor.a = s.fillColor.a / 255), s.fillColor = u._color .createColor(s.fillColor.r, s.fillColor.g, s.fillColor.b, s .fillColor.a))), u._core.isnull(s) || u._core.isnull(s .material) || /^\[/.test(s.material) && "[" == s.material.toString().charAt( 0) && "]" == s.material.toString().charAt(s.material.length - 1) || (u ._core.isHtmlColor(s.material) ? s.material = u._color .colorFromHtmlColor(s.material) : (/^rgb/.test(s.material) && (s .material = u._color.rgbaStringToRgbaObj(s.material)), 1 < s .material.r && (s.material.r = s.fillColor.r / 255), 1 < s.material .g && (s.material.g = s.fillColor.g / 255), 1 < s.material.b && (s .material.b = s.material.b / 255), 1 < s.material.a && (s .material.a = s.material.a / 255), s.material = u._color .createColor(s.material.r, s.material.g, s.material.b, s.material.a) )), u._core.isnull(s) || u._core.isnull(s.outlineColor) || /^\[/ .test(s.outlineColor) && "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (u ._core.isHtmlColor(s.outlineColor) ? s.outlineColor = u._color .colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s .outlineColor = u._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = u._color.createColor(s.outlineColor.r, s .outlineColor.g, s.outlineColor.b, s.outlineColor.a))), u._core .isnull(s) || u._core.isnull(s.backgroundColor) || /^\[/.test(s .backgroundColor) && "[" == s.backgroundColor.toString().charAt(0) && "]" == s.backgroundColor.toString().charAt(s.backgroundColor.length - 1) || (u._core.isHtmlColor(s.backgroundColor) ? s.backgroundColor = u._color .colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s .backgroundColor) && (s.backgroundColor = u._color .rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor .r && (s.backgroundColor.r = s.backgroundColor.r / 255), 1 < s .backgroundColor.g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s .backgroundColor.b / 255), 1 < s.backgroundColor.a && (s .backgroundColor.a = s.backgroundColor.a / 255), s .backgroundColor = u._color.createColor(s.backgroundColor.r, s .backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a))), u._core.extend(t, s, !0)), o = (u.item = e).entities.values, t = (u._core .isnull(s.near) && (s.near = 0), u._core.isnull(s.far) && (s.far = 999999999), parseFloat(s.near)), e = parseFloat(s.far), t = new u ._cesium.DistanceDisplayCondition(t, e), r = (i.distanceDisplayCondition = t, u ._core.isnull(s.font_size) && (s.font_size = "30px"), u._core.isnull(s .font_family) && (s.font_family = " sans-serif"), i.font = parseFloat(s .font_size) + "px " + s.font_family, new u._cesium.LabelCollection), n = 0; n < o.length; n++) { var a = o[n], a = (i.position = a.position._value, i.text = "a label", "fillColor:" + 255 * i .fillColor.red + "," + 255 * i.fillColor.green + "," + 255 * i.fillColor .blue + ";outlineColor:" + 255 * i.outlineColor.red + "," + 255 * i .outlineColor.green + "," + 255 * i.outlineColor.blue); u.Legend.push(a), r.add(i) } e = u._viewer.scene.primitives.add(r); "function" == typeof l && l(e) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "labelPointLayer", item: this, url: t, style: options, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: !0, disFnc: l } }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createLabelPolymerizationGeoJsonFeatureLayer = function(e, t, c, i, h, m) { var o = { Name: "", text: "", font: " 30px sans-serif", style: this._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.RELATIVE_TO_GROUND, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1), maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, pointHeight: 0 }, d = this, p = (this._core.isnull(c) || this._core.isnull(c.fillColor) || (this._core.isHtmlColor(c .fillColor) ? c.fillColor = this._color.colorFromHtmlColor(c.fillColor) : (/^rgb/.test(c .fillColor) && (c.fillColor = this._color.rgbaStringToRgbaObj(c.fillColor)), 1 < c .fillColor.r && (c.fillColor.r = c.fillColor.r / 255), 1 < c.fillColor.g && (c.fillColor .g = c.fillColor.g / 255), 1 < c.fillColor.b && (c.fillColor.b = c.fillColor.b / 255), 1 < c.fillColor.a && (c.fillColor.a = c.fillColor.a / 255), c.fillColor = this ._color.createColor(c.fillColor.r, c.fillColor.g, c.fillColor.b, c.fillColor.a))), this ._core.isnull(c) || this._core.isnull(c.outlineColor) || (this._core.isHtmlColor(c .outlineColor) ? c.outlineColor = this._color.colorFromHtmlColor(c.outlineColor) : (/^rgb/ .test(c.outlineColor) && (c.outlineColor = this._color.rgbaStringToRgbaObj(c .outlineColor)), 1 < c.outlineColor.r && (c.outlineColor.r = c.outlineColor.r / 255), 1 < c.outlineColor.g && (c.outlineColor.g = c.outlineColor.g / 255), 1 < c .outlineColor.b && (c.outlineColor.b = c.outlineColor.b / 255), 1 < c.outlineColor.a && (c.outlineColor.a = c.outlineColor.a / 255), c.outlineColor = this._color.createColor(c .outlineColor.r, c.outlineColor.g, c.outlineColor.b, c.outlineColor.a))), this._core .isnull(c) || this._core.isnull(c.backgroundColor) || (this._core.isHtmlColor(c .backgroundColor) ? c.backgroundColor = this._color.colorFromHtmlColor(c.backgroundColor) : (/^rgb/.test(c.backgroundColor) && (c.backgroundColor = this._color.rgbaStringToRgbaObj(c .backgroundColor)), 1 < c.backgroundColor.r && (c.backgroundColor.r = c .backgroundColor.r / 255), 1 < c.backgroundColor.g && (c.backgroundColor.g = c .backgroundColor.g / 255), 1 < c.backgroundColor.b && (c.backgroundColor.b = c .backgroundColor.b / 255), 1 < c.backgroundColor.a && (c.backgroundColor.a = c .backgroundColor.a / 255), c.backgroundColor = this._color.createColor(c .backgroundColor.r, c.backgroundColor.g, c.backgroundColor.b, c.backgroundColor.a))), d ._core.isnull(c.near) && (c.near = 0), d._core.isnull(c.far) && (c.far = 999999999), this._core .extend(o, c, !0)), o = (this._viewer.scene.camera, this._viewer.scene.canvas, this._viewer.dataSources.add(this._cesium .GeoJsonDataSource.load(t))), d = this, o = (o.then(function(e) { var t = (d.item = e).entities.values; d._core.isnull(p.font_size) && (p.font_size = "30"), d._core.isnull(p.font_family) && (p .font_family = " sans-serif"), p.font = p.font_size + "px " + p.font_family; for (var i = 0; i < t.length; i++) { var o = t[i], r = (p.font = d._core.extendgl(o, c.font, p.font), p.style = parseInt(d._core .extendgl(o, p.stylet, p.style)), p.fillColor = d._core.extendgl(o, c .fillColor, p.fillColor), p.outlineColor = d._core.extendgl(o, c .outlineColor, p.outlineColor), p.outlineWidth = parseFloat(d._core .extendgl(o, c.outlineWidth, p.outlineWidth)), p.show = d._core .extendgl(o, c.show, p.show), p.showBackground = d._core.extendgl(o, c .showBackground, p.showBackground), p.backgroundColor = d._core .extendgl(o, c.backgroundColor, p.backgroundColor), p.backgroundPadding = d ._core.extendgl(o, c.backgroundPadding, p.backgroundPadding), p.scale = parseFloat(d._core.extendgl(o, c.scale, p.scale)), p.horizontalOrigin = d ._core.extendgl(o, c.horizontalOrigin, p.horizontalOrigin), p.pointHeight = parseFloat(d._core.extendgl(o, c.pointHeight, p.pointHeight)), p.text = d ._core.extendgl(o, c.text, p.text), parseFloat(d._core.extendgl(o, p.near)) ), n = parseFloat(d._core.extendgl(o, p.far)), r = new d._cesium.DistanceDisplayCondition(r, n), n = (p.distanceDisplayCondition = r, p.text = null == o.properties[p.text] ? p .text : o.properties[p.text]._value, o.billboard.color = d._cesium.Color .WHITE.withAlpha(0), o.label = new d._cesium.LabelGraphics(p), d._viewer .scene.globe.ellipsoid, d._cesium.Cartographic.fromCartesian(o.position ._value)), r = d._cesium.Math.toDegrees(n.longitude), a = d._cesium.Math.toDegrees(n.latitude), n = p.pointHeight || n.height, r = new d._cesium.Cartesian3.fromDegrees(r, a, n); o.position._value = r } e.clustering.enabled = !0, e.clustering.pixelRange = 45, e.clustering .minimumClusterSize = 3; for (var s, l = new d._cesium.PinBuilder, u = (l.fromText("50+", d._cesium.Color.RED, 48).toDataURL(), l.fromText("40+", d._cesium.Color.ORANGE, 48) .toDataURL(), l.fromText("30+", d._cesium.Color.YELLOW, 48).toDataURL(), l .fromText("20+", d._cesium.Color.GREEN, 48).toDataURL(), l.fromText("10+", d ._cesium.Color.BLUE, 48).toDataURL(), new Array(8)), i = 0; i < u.length; ++ i) u[i] = l.fromText("" + (i + 2), d._cesium.Color.VIOLET, 48).toDataURL(); s = d._cesium.defined(s) ? void s() : e.clustering.clusterEvent.addEventListener( function(e, t) { t.label.show = !1, t.point.show = !1, t.billboard.show = !0, t.billboard .id = t.label.id, t.billboard.verticalOrigin = d._cesium.VerticalOrigin .BOTTOM, 50 <= e.length ? t.billboard.image = l.fromText(e.length, d ._cesium.Color.RED, 48).toDataURL() : 40 <= e.length ? t.billboard .image = l.fromText(e.length, d._cesium.Color.ORANGE, 48).toDataURL() : 30 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium .Color.YELLOW, 48).toDataURL() : 20 <= e.length ? t.billboard .image = l.fromText(e.length, d._cesium.Color.GREEN, 48).toDataURL() : 10 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium .Color.BLUE, 48).toDataURL() : t.billboard.image = u[e.length - 2] }), s = e.clustering.pixelRange, e.clustering.pixelRange = 0, e.clustering .pixelRange = s, h || d.setVisibility(h), d._cesium.knockout.track({ pixelRange: 45, minimumClusterSize: 3 }), "function" == typeof m && m(ps) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: h, pId: this._core.isnull(i) ? 0 : i, type: "labelPointLayer", item: this, url: t, treeData: { name: e, geoOptions: t, styleOption: c, GroupID: i, checked: h, disFnc: m } }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createPointPolymerizationGeoJsonFeatureLayer = function(e, t, c, i, h, m) { var d, o = { color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, p = (this._core.isnull(c) || this._core.isnull(c.color) || "[" == c.color.toString().charAt(0) && "]" == c.color.toString().charAt(c.color.length - 1) || (this._core.isHtmlColor(c.color) ? c .color = this._color.colorFromHtmlColor(c.color) : (/^rgb/.test(c.color) && (c.color = this ._color.rgbaStringToRgbaObj(c.color)), 1 < c.color.r && (c.color.r = c.color.r / 255), 1 < c.color.g && (c.color.g = c.color.g / 255), 1 < c.color.b && (c.color.b = c.color.b / 255), 1 < c.color.a && (c.color.a = c.color.a / 255), c.color = this ._color.createColor(c.color.r, c.color.g, c.color.b, c.color.a))), this._core.isnull( c) || this._core.isnull(c.outlineColor) || "[" == c.outlineColor.toString().charAt(0) && "]" == c.outlineColor.toString().charAt(c.outlineColor.length - 1) || (this._core.isHtmlColor(c .outlineColor) ? c.outlineColor = this._color.colorFromHtmlColor(c.outlineColor) : ( /^rgb/.test(c.outlineColor) && (c.outlineColor = this._color.rgbaStringToRgbaObj(c .outlineColor)), 1 < c.outlineColor.r && (c.outlineColor.r = c.outlineColor.r / 255), 1 < c.outlineColor.g && (c.outlineColor.g = c.outlineColor.g / 255), 1 < c .outlineColor.b && (c.outlineColor.b = c.outlineColor.b / 255), 1 < c.outlineColor.a && (c.outlineColor.a = c.outlineColor.a / 255), c.outlineColor = this._color.createColor(c .outlineColor.r, c.outlineColor.g, c.outlineColor.b, c.outlineColor.a))), this._core .extend(o, c, !0)), o = (this._viewer.scene.camera, this._viewer.scene.canvas, this._viewer.dataSources.add(this._cesium .GeoJsonDataSource.load(t))), g = this, o = (c && c.time && (d = new g._cesium.TimeIntervalCollection([new g._cesium.TimeInterval({ start: c.time.start ? g._cesium.JulianDate.fromDate(new Date(c.time .start)) : g._cesium.Iso8601.MINIMUM_VALUE, stop: c.time.end ? g._cesium.JulianDate.fromDate(new Date(c.time.end)) : g ._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function(e) { for (var t = (g.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (p.color = g._core.extendgl(o, c.color, p.color), p.pixelSize = parseInt(g ._core.extendgl(o, c.pixelSize, p.pixelSize)), p.outlineColor = g._core .extendgl(o, c.outlineColor, p.outlineColor), p.outlineWidth = parseFloat(g ._core.extendgl(o, c.outlineWidth, p.outlineWidth)), p.show = g._core .extendgl(o, c.show, p.show), p.height = parseFloat(g._core.extendgl(o, c .height, p.height)), p.scaleByDistance = g._core.extendgl(o, c .scaleByDistance, p.scaleByDistance), parseFloat(g._core.extendgl(o, p .minDistanceDisplay))), n = parseFloat(g._core.extendgl(o, p.maxDistanceDisplay)), r = new g._cesium.DistanceDisplayCondition(r, n), n = (o.billboard.image = "", p.distanceDisplayCondition = r, o.point = new g ._cesium.PointGraphics(p), p.pointHeight = g._core.extendgl(o, c .pointHeight, p.pointHeight), p.pointHeight = parseFloat(p.pointHeight), g._viewer.scene.globe.ellipsoid, g._cesium.Cartographic.fromCartesian(o .position._value)), r = g._cesium.Math.toDegrees(n.longitude), a = g._cesium.Math.toDegrees(n.latitude), n = p.pointHeight || n.height, r = new g._cesium.Cartesian3.fromDegrees(r, a, n); o.position._value = r, d && (o.availability = d) } e.clustering.enabled = !0, e.clustering.pixelRange = 45, e.clustering .minimumClusterSize = 3; for (var s, l = new g._cesium.PinBuilder, u = (l.fromText("50+", g._cesium.Color.RED, 48).toDataURL(), l.fromText("40+", g._cesium.Color.ORANGE, 48) .toDataURL(), l.fromText("30+", g._cesium.Color.YELLOW, 48).toDataURL(), l .fromText("20+", g._cesium.Color.GREEN, 48).toDataURL(), l.fromText("10+", g ._cesium.Color.BLUE, 48).toDataURL(), new Array(8)), i = 0; i < u.length; ++ i) u[i] = l.fromText("" + (i + 2), g._cesium.Color.VIOLET, 48).toDataURL(); s = g._cesium.defined(s) ? void s() : e.clustering.clusterEvent.addEventListener( function(e, t) { t.label.show = !1, t.point.show = !1, t.billboard.show = !0, t.billboard .id = t.label.id, t.billboard.verticalOrigin = g._cesium.VerticalOrigin .BOTTOM, 50 <= e.length ? t.billboard.image = l.fromText(e.length, g ._cesium.Color.RED, 48).toDataURL() : 40 <= e.length ? t.billboard .image = l.fromText(e.length, g._cesium.Color.ORANGE, 48).toDataURL() : 30 <= e.length ? t.billboard.image = l.fromText(e.length, g._cesium .Color.YELLOW, 48).toDataURL() : 20 <= e.length ? t.billboard .image = l.fromText(e.length, g._cesium.Color.GREEN, 48).toDataURL() : 10 <= e.length ? t.billboard.image = l.fromText(e.length, g._cesium .Color.BLUE, 48).toDataURL() : t.billboard.image = u[e.length - 2] }), s = e.clustering.pixelRange, e.clustering.pixelRange = 0, e.clustering .pixelRange = s, h || g.setVisibility(h), g._cesium.knockout.track({ pixelRange: 45, minimumClusterSize: 3 }), "function" == typeof m && m(ps) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: h, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t, treeData: { name: e, geoOptions: t, styleOption: c, GroupID: i, checked: h, disFnc: m } }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype._cameraMoveEndHandler = function() { if (this._viewer.camera.getMagnitude() < this.gd) { if (this.sj) { this._viewer.scene.primitives.remove(this.labelCollections), this.labelCollections = new this ._cesium.LabelCollection; for (var e = 0; e < this.labelCollections1.length; e++) this.labelCollections.add(this .labelCollections1[e]); this._viewer.scene.primitives.add(this.labelCollections), this.sj = !1 } } else { this._viewer.scene.primitives.remove(this.labelCollections), new this._cesium.BillboardCollection; for (e = 0; e < this.labelCollections2.length; e++) this.BillboardCollections.add(this .labelCollections2[e]); this._viewer.scene.primitives.add(this.BillboardCollections), this.sj = !0 } }, w.prototype.createLabelpolymerizationGeoJsonFeatureLayer = function(e, t, i, o, r, n) { for (var a = t, s = (this._viewer.scene.primitives, this._cameraMoveEndHandler = this ._cameraMoveEndHandler.bind(this), this._viewer.camera.moveEnd.addEventListener(this ._cameraMoveEndHandler), this.gd = i.height, new this._cesium.BillboardCollection, {}), l = [], u = 0; u < a.length; u++) { var c = { position: new this._cesium.Cartesian3.fromDegrees(a[u].lng, a[u].lat, 100), text: a[u].name }, h = (this.labelCollections1.push(c), a[u]); if (s[h[i.adminname]]) for (var m = 0; m < l.length; m++) { var d = l[m]; if (d.adminname == h[i.adminname]) { d.data.push(h); break } } else l.push({ adminname: h[i.adminname], name: h.name, showBackground: !0, lat: h.lat, lng: h.lng, data: [h] }), s[h[i.adminname]] = h } for (var p, u = 0; u < l.length; u++) { c = { position: new this._cesium.Cartesian3.fromDegrees(l[u].lng, l[u].lat, 100), image: pinBuilder.fromText(l[u].data.length + "", this._cesium.Color.BLACK, 48).toDataURL() }; this.labelCollections2.push(c), this.BillboardCollections.add(c) } i && i.time && (p = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: i.time.start ? this._cesium.JulianDate.fromDate(new Date(i.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: i.time.end ? this._cesium.JulianDate.fromDate(new Date(i.time.end)) : this ._cesium.Iso8601.MAXIMUM_VALUE })])), this._viewer.scene.primitives.add(this.BillboardCollections, p) }, w.prototype.createLabelpolymerizationGeoJsonFeatureLayers = function(e, t, o, i, r, n) { var a = { height: 0, material: this._cesium.Color.WHITE, size: 50, fill: this._cesium.Color.RED, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = (this._core.isnull(o) || this._core.isnull(o.material) || "[" == o.material.toString().charAt( 0) && "]" == o.material.toString().charAt(o.material.length - 1) || (this._core.isHtmlColor(o .material) ? o.material = this._color.colorFromHtmlColor(o.material) : /^http/.test(o .material) || (/^rgb/.test(o.material) && (o.material = this._color.rgbaStringToRgbaObj( o.material)), 1 < o.material.r && (o.material.r = o.material.r / 255), 1 < o .material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o.material.a && (o.material.a = o.material.a / 255), o .material = this._color.createColor(o.material.r, o.material.g, o.material.b, o.material .a))), this._core.isnull(o) || this._core.isnull(o.fill) || "[" == o.fill.toString() .charAt(0) && "]" == o.fill.toString().charAt(o.fill.length - 1) || (this._core.isHtmlColor(o .fill) ? o.fill = this._color.colorFromHtmlColor(o.fill) : /^http/.test(o.fill) || ( /^rgb/.test(o.fill) && (o.fill = this._color.rgbaStringToRgbaObj(o.fill)), 1 < o.fill .r && (o.fill.r = o.fill.r / 255), 1 < o.fill.g && (o.fill.g = o.fill.g / 255), 1 < o .fill.b && (o.fill.b = o.fill.b / 255), 1 < o.fill.a && (o.fill.a = o.fill.a / 255), o .fill = this._color.createColor(o.fill.r, o.fill.g, o.fill.b, o.fill.a))), this._core .extend(a, o, !0)), u = this, c = (this._urlTemplate = t.url + "?" + this._core._serialize(s.urlParams), t.url + "?" + this._core ._serialize(s.urlParams)), a = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider._minimumHeight = parseFloat(l.height) || 0, this._Provider.loadTile = function(t, i) { if (i.state === Cesium.QuadtreeTileLoadState.START) { if (i.data = { lines: [], geometryPrimitive: void 0 }, !(i.level >= o.level_min && i.level < o.level_max && u.item.show)) return i .state = Cesium.QuadtreeTileLoadState.DONE, void(i.renderable = !0); var e = c.replace(window.encodeURIComponent("{x}"), i.x).replace(window .encodeURIComponent("{y}"), i.y).replace(window.encodeURIComponent("{z}"), i .level); u._cache && (e += "&" + u._core.getuid()), u._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { "" == cluster ? u.labelCollections = new u._cesium .PointPrimitiveCollection : u.labelCollections = new u._cesium .BillboardCollection; var o = new u._cesium.PinBuilder; if (null == e) return i.state = Cesium.QuadtreeTileLoadState.DONE, void(i.renderable = !0); e.features.forEach(function(e) { var t = (l.id = e).geometry.coordinates[2] || 0, i = (null != e.properties.height && (t = parseFloat( e.properties.height)), /^\[/.test(l .height) && /\]$/.test(l.height) ? (i = l.height .replace(/\[/, "").replace(/\]/, ""), t += parseFloat(e.properties[i])) : t += parseFloat(l.height) || 0, {}), t = new u._cesium.Cartesian3.fromDegrees(e.geometry .coordinates[0], e.geometry.coordinates[1], t), i = "" == cluster ? { id: e, color: l.material, position: t } : { position: t, image: o.fromText(e.count + "", l.fill, l.size) .toDataURL(), verticalOrigin: u._cesium.VerticalOrigin.BOTTOM }; u.labelCollections.add(i) }), 0 == e.features.length && (i.state = Cesium .QuadtreeTileLoadState.DONE, i.renderable = !0), i.data .geometryPrimitive = u.labelCollections, i.state = Cesium .QuadtreeTileLoadState.LOADING, i.state === Cesium .QuadtreeTileLoadState.LOADING && (i.data.geometryPrimitive .update(t, []), i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0) }, error: function() { null == i.count && (i.count = 0), i.count += 1, 2 <= i.count ? (i .state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = ! 0) : i.state = Cesium.QuadtreeTileLoadState.START } }), i.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), s = a.primitives, s = (o && o.time && (this._Provider._availability = new u._cesium.TimeIntervalCollection([new u ._cesium.TimeInterval({ start: o.time.start ? u._cesium.JulianDate.fromDate(new Date(o.time .start)) : u._cesium.Iso8601.MINIMUM_VALUE, stop: o.time.end ? u._cesium.JulianDate.fromDate(new Date(o.time.end)) : u ._cesium.Iso8601.MAXIMUM_VALUE }) ]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), s.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), r || this.setVisibility(!1), this._core.isnull(l.id) && (l.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: o, treeData: { name: e, geoOptions: t, styleOption: o, GroupID: i, checked: r, disFnc: n } }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item), this }, w.prototype.createLabelGeoJsonFeatureLayerProvider = function(e, t, s, i, o, r) { var n = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = this, u = (s.material, l._core.isnull(s) || l._core.isnull(s.fillColor) || /^\[/.test(s.fillColor) && "[" == s.fillColor.toString().charAt(0) && "]" == s.fillColor.toString().charAt(s.fillColor .length - 1) || (l._core.isHtmlColor(s.fillColor) ? s.fillColor = l._color .colorFromHtmlColor(s.fillColor) : (/^rgb/.test(s.fillColor) && (s.fillColor = l._color .rgbaStringToRgbaObj(s.fillColor)), 1 < s.fillColor.r && (s.fillColor.r = s .fillColor.r / 255), 1 < s.fillColor.g && (s.fillColor.g = s.fillColor.g / 255), 1 < s.fillColor.b && (s.fillColor.b = s.fillColor.b / 255), 1 < s.fillColor.a && (s .fillColor.a = s.fillColor.a / 255), s.fillColor = l._color.createColor(s.fillColor .r, s.fillColor.g, s.fillColor.b, s.fillColor.a))), l._core.isnull(s) || l._core .isnull(s.material) || /^\[/.test(s.material) && "[" == s.material.toString().charAt(0) && "]" == s.material.toString().charAt(s.material.length - 1) || (l._core.isHtmlColor(s.material) ? s.material = l._color.colorFromHtmlColor(s.material) : (/^rgb/.test(s.material) && (s .material = l._color.rgbaStringToRgbaObj(s.material)), 1 < s.material.r && (s .material.r = s.material.r / 255), 1 < s.material.g && (s.material.g = s.material .g / 255), 1 < s.material.b && (s.material.b = s.material.b / 255), 1 < s.material .a && (s.material.a = s.material.a / 255), s.material = l._color.createColor(s.material .r, s.material.g, s.material.b, s.material.a))), l._core.isnull(s) || l._core .isnull(s.outlineColor) || /^\[/.test(s.outlineColor) && "[" == s.outlineColor.toString() .charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (l._core .isHtmlColor(s.outlineColor) ? s.outlineColor = l._color.colorFromHtmlColor(s .outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = l._color .rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s .outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor .g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = l ._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor .a))), l._core.isnull(s) || l._core.isnull(s.backgroundColor) || /^\[/.test(s .backgroundColor) && "[" == s.backgroundColor.toString().charAt(0) && "]" == s .backgroundColor.toString().charAt(s.backgroundColor.length - 1) || (l._core.isHtmlColor(s .backgroundColor) ? s.backgroundColor = l._color.colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s.backgroundColor) && (s.backgroundColor = l._color.rgbaStringToRgbaObj(s .backgroundColor)), 1 < s.backgroundColor.r && (s.backgroundColor.r = s .backgroundColor.r / 255), 1 < s.backgroundColor.g && (s.backgroundColor.g = s .backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s .backgroundColor.b / 255), 1 < s.backgroundColor.a && (s.backgroundColor.a = s .backgroundColor.a / 255), s.backgroundColor = l._color.createColor(s .backgroundColor.r, s.backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a))), this._urlTemplate = t.url + "?" + this._core._serialize(n.urlParams), t.url + "?" + this._core ._serialize(n.urlParams)), n = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = s.level_max - 1, this._Provider._minimumHeight = parseFloat(s.height) || 0, this._Provider.loadTile = function(o, a) { if (a.state === Cesium.QuadtreeTileLoadState.START) { if (a.data = { lines: [], geometryPrimitive: void 0 }, !(a.level >= s.level_min && a.level < s.level_max && l.item.show)) return a .state = Cesium.QuadtreeTileLoadState.DONE, void(a.renderable = !0); var e = u.replace(window.encodeURIComponent("{x}"), a.x).replace(window .encodeURIComponent("{y}"), a.y).replace(window.encodeURIComponent("{z}"), a .level); l._cache && (e += "&" + l._core.getuid()), l._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return a.state = Cesium.QuadtreeTileLoadState.DONE, void(a.renderable = !0); var r, t = { Name: "", text: "", font: " 30px sans-serif", style: l._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: l._cesium.Color.WHITE, outlineColor: l._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new l._cesium.Color(.165, .165, .165, .8), backgroundPadding: new l._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: l._cesium.HorizontalOrigin.CENTER, verticalOrigin: l._cesium.VerticalOrigin.CENTER, eyeOffset: l._cesium.Cartesian3.ZERO, pixelOffset: l._cesium.Cartesian2.ZERO, heightReference: l._cesium.HeightReference.NONE, scaleByDistance: new l._cesium.NearFarScalar(0, 0, 1, 1), maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, n = l._core.extend(t, s, !0), t = (l._core.isnull(s.near) && (s.near = 0), l._core.isnull(s .far) && (s.far = 999999999), parseFloat(s.near)), i = parseFloat(s.far), t = new l._cesium.DistanceDisplayCondition(t, i); n.distanceDisplayCondition = t, l._core.isnull(s.font_size) && (s .font_size = "30px"), l._core.isnull(s.font_family) && (s .font_family = " sans-serif"), n.font = parseFloat(s .font_size) + "px " + s.font_family, r = new(null != n .image && null != n.image ? l._cesium.BillboardCollection : l._cesium.LabelCollection), e.features.forEach(function(e) { n.id = e; var t, i = n.pointHeight, o = (/^\[/.test(i) && /\]$/.test(i) ? (o = i .replace(/\[/, "").replace(/\]/, ""), i = parseFloat(e.properties[o])) : null != i && "" != i ? i = parseFloat(i) : null != e .properties.height && (i = parseFloat(e .properties.height)), n.position = new l ._cesium.Cartesian3.fromDegrees(e.geometry .coordinates[0], e.geometry.coordinates[1], i), /^\[/.test(s.fillColor) && /\]$/.test(s .fillColor) && (t = s.fillColor.replace( /\[/, "").replace(/\]/, ""), n .fillColor = e.properties[t], l._core .isHtmlColor(n.fillColor) ? n.fillColor = l ._color.colorFromHtmlColor(n.fillColor) : ( /^rgb/.test(n.fillColor) && (n .fillColor = l._color .rgbaStringToRgbaObj(n.fillColor)), 1 < n.fillColor.r && (n.fillColor.r = n .fillColor.r / 255), 1 < n.fillColor .g && (n.fillColor.g = n.fillColor.g / 255), 1 < n.fillColor.b && (n .fillColor.b = n.fillColor.b / 255), 1 < n.fillColor.a && (n.fillColor.a = n .fillColor.a / 255), n.fillColor = l ._color.createColor(n.fillColor.r, n .fillColor.g, n.fillColor.b, n .fillColor.a))), /^\[/.test(s .outlineColor) && /\]$/.test(s .outlineColor) && (t = s.outlineColor.replace( /\[/, "").replace(/\]/, ""), n .outlineColor = e.properties[t], l._core .isHtmlColor(n.outlineColor) ? n .outlineColor = l._color.colorFromHtmlColor( n.outlineColor) : (/^rgb/.test(n .outlineColor) && (n.outlineColor = l._color.rgbaStringToRgbaObj(n .outlineColor)), 1 < n .outlineColor.r && (n.outlineColor.r = n .outlineColor.r / 255), 1 < n .outlineColor.g && (n.outlineColor.g = n .outlineColor.g / 255), 1 < n .outlineColor.b && (n.outlineColor.b = n .outlineColor.b / 255), 1 < n .outlineColor.a && (n.outlineColor.a = n .outlineColor.a / 255), n .outlineColor = l._color.createColor(n .outlineColor.r, n.outlineColor.g, n .outlineColor.b, n.outlineColor.a)) ), "fillColor:" + 255 * n.fillColor.red + "," + 255 * n.fillColor.green + "," + 255 * n .fillColor.blue + ";outlineColor:" + 255 * n .outlineColor.red + "," + 255 * n.outlineColor .green + "," + 255 * n.outlineColor.blue); l.Legend.push(o), /^\[/.test(s.text) && /\]$/.test(s .text) && (t = s.text.replace(/\[/, "").replace( /\]/, ""), n.text = e.properties[t]), n.id .treeID = s.id, n.id.VectorType = "label", n.id .VectorStyle = { position: n.position, pointHeight: i, text: n.text, font: n.font, scale: n.scale, style: n.style, fillColor: n.fillColor, outlineColor: n.outlineColor, outlineWidth: n.outlineWidth, showBackground: n.showBackground, backgroundColor: n.backgroundColor, heightReference: n.heightReference, horizontalOrigin: n.horizontalOrigin, verticalOrigin: n.verticalOrigin, scaleByDistance: n.scaleByDistance, distanceDisplayCondition: n .distanceDisplayCondition }, r.add(n) }), 0 == e.features.length && (a.state = Cesium .QuadtreeTileLoadState.DONE, a.renderable = !0), a.data .geometryPrimitive = r, a.state = Cesium.QuadtreeTileLoadState .LOADING, a.state === Cesium.QuadtreeTileLoadState.LOADING && (a .data.geometryPrimitive.update(o, []), a.state = Cesium .QuadtreeTileLoadState.DONE, a.renderable = !0) }, error: function() { null == a.count && (a.count = 0), a.count += 1, 2 <= a.count ? (a .state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = ! 0) : a.state = Cesium.QuadtreeTileLoadState.START } }), a.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), a = n.primitives, a = (s && s.time && (this._Provider._availability = new l._cesium.TimeIntervalCollection([new l ._cesium.TimeInterval({ start: s.time.start ? l._cesium.JulianDate.fromDate(new Date(s.time .start)) : l._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? l._cesium.JulianDate.fromDate(new Date(s.time.end)) : l ._cesium.Iso8601.MAXIMUM_VALUE }) ]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), a.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(s.id) && (s.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + s.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: s.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: s, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: o, disFnc: r } }); return this._Provider.treeID = s.id, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull( i) ? 0 : i), "function" == typeof r && r(this.item), this }, w.prototype.createLabelImageGeoJsonFeatureLayerProvider = function(e, a, c, t, i, o) { var r = { url: a.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: a.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(a.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(a.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: a.upperLevelLimit, lowerLevelLimit: a.lowerLevelLimit, Cesium: this._cesium }, h = this, n = (c.material, h._core.isnull(c) || h._core.isnull(c.fillColor) || "string" != typeof c .fillColor || /^\[/.test(c.fillColor) && /\]$/.test(c.fillColor) || (h._core.isHtmlColor(c .fillColor) || /^rgb/.test(c.fillColor)) && (c.fillColor = Cesium.Color.fromCssColorString(c .fillColor)), h._core.isnull(c) || h._core.isnull(c.outlineColor) || "string" != typeof c .outlineColor || /^\[/.test(c.outlineColor) && /\]$/.test(c.outlineColor) || (h._core .isHtmlColor(c.outlineColor) || /^rgb/.test(c.outlineColor)) && (c.outlineColor = Cesium .Color.fromCssColorString(c.outlineColor)), h._core.isnull(c) || h._core.isnull(c.color) || "string" != typeof c.color || /^\[/.test(c.color) && /\]$/.test(c.color) || (h._core .isHtmlColor(c.color) || /^rgb/.test(c.color)) && (c.color = Cesium.Color .fromCssColorString(c.color)), h._core.isnull(c) || h._core.isnull(c.backgroundColor) || "string" != typeof c.backgroundColor || /^\[/.test(c.backgroundColor) && /\]$/.test(c .backgroundColor) || (h._core.isHtmlColor(c.backgroundColor) || /^rgb/.test(c .backgroundColor)) && (c.backgroundColor = Cesium.Color.fromCssColorString(c .backgroundColor)), h._core.isnull(c.font) && (h._core.isnull(c.font_size) && (c.font_size = "30px"), h._core.isnull(c.font_family) && (c.font_family = " sans-serif"), c.font = c .font_size + " " + c.font_family, c.bold && (c.font = "bold " + c.font), c.italic && (c .font = "italic " + c.font)), h._core.isnull(c.near) && (c.near = 0), h._core.isnull(c .far) && (c.far = 999999999), parseFloat(c.near)), s = parseFloat(c.far), l = new h._cesium.DistanceDisplayCondition(n, s), u = (c.distanceDisplayCondition = l, this._urlTemplate = a.url + "?" + this._core._serialize(r .urlParams), a.url + "?" + this._core._serialize(r.urlParams)); function m(e, t) { let i; var o, r; return i = (i = "string" == typeof t.value ? /^\[/.test(t.value) && /\]$/.test(t.value) ? (i = t .value.replace(/\[/, "").replace(/\]/, ""), e.properties[i]) : t.value : (r = (o = t .value).Condition, e = e.properties[r], o.Value[e])) || t.defaultValue, i = h._core .isHtmlColor(i) ? Cesium.Color.fromCssColorString(i) : i } function d() { return { name: "", text: "", font: " 30px sans-serif", style: h._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: h._cesium.Color.WHITE, outlineColor: h._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new h._cesium.Color(.165, .165, .165, .8), backgroundPadding: new h._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: h._cesium.HorizontalOrigin.CENTER, verticalOrigin: h._cesium.VerticalOrigin.CENTER, eyeOffset: h._cesium.Cartesian3.ZERO, pixelOffset: h._cesium.Cartesian2.ZERO, heightReference: h._cesium.HeightReference.NONE, scaleByDistance: new h._cesium.NearFarScalar(0, 0, 1, 1), maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 } } this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = c.level_max, this ._Provider._minimumHeight = parseFloat(c.height) || 0, h._core.xhr({ url: a.url + "?service=WMTS&request=GetCapabilities", type: "get", isXml: !0, success: function(r) { r = h._core.xml2json(r); let e = r.Contents && r.Contents.Layer; var n, r = e.filter(e => e.Identifier === a.layer)[0]; if (r) { let e = r.TileMatrixSetLink, t = r.WGS84BoundingBox; t && (r = t.LowerCorner.split(" "), n = t.UpperCorner.split(" "), h.item .boundingSphere = Cesium.BoundingSphere.fromPoints([Cesium.Cartesian3 .fromDegrees(r[0], r[1]), Cesium.Cartesian3.fromDegrees(n[0], n[ 1]) ])); let i = a.srs || "EPSG:4490", o = e.filter(e => e.TileMatrixSet === i)[0]; o && (h.TileMatrixLimits = {}, o.TileMatrixSetLimits && o.TileMatrixSetLimits .TileMatrixLimits.forEach(e => { let t = e.TileMatrix; var i = (t = t.split(":"))[t.length - 1]; h.TileMatrixLimits[i] = { maxCol: e.MaxTileCol, minCol: e.MinTileCol, maxRow: e.MaxTileRow, minRow: e.MinTileRow } })) } h.initThisProvider() } }), this.initThisProvider = () => { this.initThisProvider = void 0, this._Provider.loadTile = function(e, i) { if (i.state === Cesium.QuadtreeTileLoadState.START) { if (i.data = { lines: [], geometryPrimitive: void 0 }, !(i.level >= c.level_min && i.level <= c.level_max && h.item.show)) return i .state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0, void(h ._Provider.EntityCollection.show = !1); if (h.TileMatrixLimits) { var t = h.TileMatrixLimits[i.level]; if (t && (i.x > t.maxCol || i.x < t.minCol || i.y > t.maxRow || i.y < t.minRow)) return i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0, void y() } if (h._Provider.EntityCollection.isShow && (h._Provider.EntityCollection.show = !0), h._Provider.EntityCollection.childrenCollection[i.level + "-" + i.x + "-" + i.y] ) { let e = h._Provider.EntityCollection.childrenCollection[i.level + "-" + i.x + "-" + i.y]; return e.setVisibility(!0), i.data.geometryPrimitive = e, i.state = Cesium .QuadtreeTileLoadState.DONE, i.renderable = !0, void y() } t = u.replace(window.encodeURIComponent("{x}"), i.x).replace(window .encodeURIComponent("{y}"), i.y).replace(window.encodeURIComponent("{z}"), i .level); h._cache && (t += "&" + h._core.getuid()), h._core.xhr({ url: t, type: "get", dataType: "json", success: function(e) { if (!e || !e.features || !e.features.length) return i.state = Cesium.QuadtreeTileLoadState.DONE, void(i.renderable = ! 0); var a, s, t = d(), l = h._core.extend(t, c, !0); l.image && !l.text ? s = !0 : a = !(l.image || !l.text) || (!l .image || !l.text || (s = !0)); let u = new _(h._viewer, h._Provider.EntityCollection, i); !async function(e) { e.features.forEach(function(e, t) { u.isDestroy || !async function(e) { l.id = e.id; var t = l.pointHeight; "string" == typeof t && /^\[/ .test(t) && /\]$/.test(t) ? (i = t.replace(/\[/, "") .replace(/\]/, ""), t = parseFloat(e.properties[ i])) : null != t && "" != t ? t = parseFloat( t) : null != e.properties .height && (t = parseFloat(e .properties.height)); l.position = new h._cesium .Cartesian3.fromDegrees(e .geometry.coordinates[ 0], e.geometry .coordinates[1], t), "object" == typeof c.font && (l.font = m(e, c.font)); "string" == typeof c .fillColor && /^\[/.test(c .fillColor) && /\]$/ .test(c.fillColor) ? (o = c .fillColor.replace(/\[/, "").replace(/\]/, ""), l.fillColor = e .properties[o], (h._core .isHtmlColor(l .fillColor) || /^rgb/.test(l .fillColor)) && (l.fillColor = Cesium .Color .fromCssColorString( l.fillColor))) : "object" == typeof c .fillColor && c.fillColor .value && (l.fillColor = m( e, c.fillColor)); "string" == typeof c .outlineColor && /^\[/.test( c.outlineColor) && /\]$/ .test(c.outlineColor) ? (o = c.outlineColor.replace( /\[/, "").replace( /\]/, ""), l .outlineColor = e .properties[o], (h._core .isHtmlColor(l .outlineColor ) || /^rgb/ .test(l .outlineColor) ) && (l .outlineColor = Cesium.Color .fromCssColorString( l.outlineColor)) ) : "object" == typeof c .outlineColor && c .outlineColor.value && (l .outlineColor = m(e, c .outlineColor)); c.showBackground && ("string" == typeof c .backgroundColor && /^\[/.test(c .backgroundColor) && /\]$/.test(c .backgroundColor) ? (o = c.backgroundColor .replace(/\[/, "") .replace(/\]/, ""), l.backgroundColor = e.properties[o], (h ._core .isHtmlColor(l .backgroundColor ) || /^rgb/ .test(l .backgroundColor )) && (l .backgroundColor = Cesium.Color .fromCssColorString( l .backgroundColor ))) : "object" == typeof c .backgroundColor && c .backgroundColor .value && (l .backgroundColor = m(e, c .backgroundColor ))); var i = "fillColor:" + 255 * l .fillColor.red + "," + 255 * l.fillColor.green + "," + 255 * l.fillColor.blue + ";outlineColor:" + 255 * l .outlineColor.red + "," + 255 * l.outlineColor.green + "," + 255 * l.outlineColor .blue; h.Legend.push(i), "string" == typeof c.text && /^\[/.test( c.text) && /\]$/.test(c .text) ? (o = c.text .replace(/\[/, "") .replace(/\]/, ""), l .text = e.properties[o] ) : "object" == typeof c .text && (l.text = m(e, c .text)); { var o; "string" == typeof c .image && /^\[/.test(c .image) && /\]$/ .test(c.image) ? (o = c .image.replace(/\[/, "").replace( /\]/, ""), l .image = e .properties[o]) : "object" == typeof c .image && (l.image = m( e, c.image)) } let r = { position: l.position }; if (a) { let e = l; l.labelData && (e = Object .assign({}, l, l .labelData, !0) ), (l.offsetX || l .offsetY) && (e .pixelOffset = new Cesium .Cartesian2(l .offsetX || 0, l .offsetY || 0)), r.label = e } if (s) { let e = l; l.imageData && (e = Object .assign({}, l, l .imageData, !0) ), r.billboard = e } let n = new Cesium.Entity(r); n.feature = e, u.add(n) }(e) }) }(e), i.data.geometryPrimitive = u, h._Provider .EntityCollection.childrenCollection[i.level + "-" + i.x + "-" + i.y] = u, i.state = Cesium.QuadtreeTileLoadState .LOADING, i.state === Cesium.QuadtreeTileLoadState .LOADING && (i.state = Cesium.QuadtreeTileLoadState.DONE, i .renderable = !0), y() }, error: function() { i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0, y() } }), i.state = Cesium.QuadtreeTileLoadState.LOADING } y() } }; let p, g; function _(e, t, i) { this.viewer = e, this.collection = t, this.key = i.level + "-" + i.x + "-" + i.y, this.isDestroy = ! 1, this.values = [], this._time = void 0, this.show = !0 } this.saveDefaultVectorData = () => { g = h._core.extend({}, c, !0) }, this.restoreVector = () => { if (g && (c = g, h._Provider._normalTile = c.level_max, h._Provider && h._Provider .EntityCollection)) { var e = d(); let r = h._core.extend(e, c, !0), n, a; r.image && !r.text ? a = !0 : n = (!r.image && r.text || r.image && r.text && (a = !0), !0), h._Provider.EntityCollection.values.forEach(t => { var e = t.feature; void 0 !== r.pointHeight && (t.position = new Cesium.Cartesian3.fromDegrees(e .geometry.coordinates[0], e.geometry.coordinates[1], r.pointHeight)); let i; "string" == typeof r.text && /^\[/.test(r.text) && /\]$/.test(r.text) ? (i = r .text.replace(/\[/, "").replace(/\]/, ""), i = e.properties[i]) : "object" == typeof r.text && (i = m(e, r.text)); let o; if ("string" == typeof r.image && /^\[/.test(r.image) && /\]$/.test(r.image) ? ( o = r.image.replace(/\[/, "").replace(/\]/, ""), o = e.properties[o]) : "object" == typeof r.image && (o = m(e, r.image)), n) { let e = Object.assign({}, r); i && (e.text = i), r.labelData && (e = Object.assign(e, r.labelData)), (r .offsetX || r.offsetY) && (e.pixelOffset = new Cesium.Cartesian2(r .offsetX || 0, r.offsetY || 0)), t.label = e } else t.label = void 0; if (a) { let e = Object.assign({}, r); o && (e.image = o), r.imageData && (e = Object.assign(e, r.imageData)), t .billboard = e } else t.billboard = void 0 }) } g = void 0 }, this.updataVector = (a = {}) => { var e; (a.color || a.fillColor || a.outlineColor || a.backgroundColor) && (a.color && (a.color = Cesium .Color.fromCssColorString(a.color)), a.fillColor && (a.fillColor = Cesium.Color .fromCssColorString(a.fillColor)), a.outlineColor && (a.outlineColor = Cesium.Color .fromCssColorString(a.outlineColor)), a.backgroundColor && (a.backgroundColor = Cesium .Color.fromCssColorString(a.backgroundColor))), void 0 === a.near && void 0 === a.far || ( void 0 !== a.near && (n = parseFloat(a.near)), void 0 !== a.far && (s = parseFloat(a .far)), e = new Cesium.DistanceDisplayCondition(n, s), a.distanceDisplayCondition = e), void 0 === a.minimumLevel && void 0 === a.maximumLevel || (void 0 !== a .minimumLevel && (a.level_min = a.minimumLevel), void 0 !== a.maximumLevel && (a .level_max = a.maximumLevel)), c = h._core.extend(c, a, !0), h._Provider ._normalTile = c.level_max, c.font = c.font_size + " " + c.font_family, c.bold && (c.font = "bold " + c.font), c.italic && (c.font = "italic " + c.font), a.font = c.font, h ._Provider && h._Provider.EntityCollection && (clearTimeout(p), p = setTimeout(() => { let o, r, n; h._Provider.EntityCollection.values.forEach(e => { o = e.label, r = e.billboard, n = e.feature, void 0 !== a.height && (e.position = new Cesium.Cartesian3.fromDegrees(n.geometry .coordinates[0], n.geometry.coordinates[1], a.height)); let t; "string" == typeof a.text && /^\[/.test(a.text) && /\]$/.test(a .text) ? (t = a.text.replace(/\[/, "").replace(/\]/, ""), t = n.properties[t]) : "object" == typeof a.text && (t = m( n, a.text)); let i; "string" == typeof a.image && /^\[/.test(a.image) && /\]$/.test(a .image) ? (i = a.image.replace(/\[/, "").replace(/\]/, ""), i = n.properties[i]) : "object" == typeof a.image && (i = m( n, a.image)), o ? ((a.offsetX || a.offsetY) && (a .pixelOffset = new Cesium.Cartesian2(c.offsetX || 0, c .offsetY || 0)), Object.assign(o, a), t && (o.text = t), void 0 !== a.text && (o.show = !!a.text)) : a.text && (e .label = { ...c }, t && (e.label.text = t)), void 0 !== a.image && (r ? (r .image = a.image, r.show = !!a.image, i && (r.image = i) ) : a.image && (e.billboard = { image: i || a.image, disableDepthTestDistance: c .disableDepthTestDistance, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, pixelOffset: new Cesium.Cartesian2(0, 0) })) }) }, 100)) }, this._Provider.EntityCollection = new Cesium.EntityCollection, this._Provider.EntityCollection .isShow = !0, this._Provider.EntityCollection.childrenCollection = {}, _.prototype.update = function() { clearTimeout(this._time), this.setVisibility(!0), this._time = setTimeout(() => { this.setVisibility(!1) }, 500) }, _.prototype.add = function(e) { this.isDestroy || (this.viewer && this.viewer.entities.add(e), this.collection && this .collection.add(e), this.values.push(e.id)) }, _.prototype.setVisibility = function(i) { this.show = i, this.values.forEach(e => { let t = this.viewer.entities.getById(e); t && (t.show = i) }) }, _.prototype.destroy = function() { this.isDestroy = !0, this.add = () => {}, this.update = () => {}, this.values.forEach(e => { this.viewer && this.viewer.entities.removeById(e), this.collection && this .collection.removeById(e) }), delete this.collection.childrenCollection[this.key], this.collection = void 0, this .values = [], this.viewer = void 0, Cesium.destroyObject(this) }; let f; function y() { h._Provider.EntityCollection.show && (clearTimeout(f), f = setTimeout(function() { if (h._Provider.quadtree && h._Provider.quadtree._tilesToRender && h._Provider .quadtree._tilesToRender.length) { let t = []; for (var e in h._Provider.quadtree._tilesToRender.forEach(e => { t.push(e.level + "-" + e.x + "-" + e.y) }), h._Provider.EntityCollection.childrenCollection) t.indexOf(e) < 0 && h ._Provider.EntityCollection.childrenCollection[e].setVisibility(!1) } }, 500)) } this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); l = this._viewer.scene, r = l.primitives, c && c.time && (this._Provider._availability = new h._cesium .TimeIntervalCollection([new h._cesium.TimeInterval({ start: c.time.start ? h._cesium.JulianDate.fromDate(new Date(c.time.start)) : h ._cesium.Iso8601.MINIMUM_VALUE, stop: c.time.end ? h._cesium.JulianDate.fromDate(new Date(c.time.end)) : h ._cesium.Iso8601.MAXIMUM_VALUE })]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), r.add(this._primitive), l.primitivesQuadTrees && l.primitivesQuadTrees.push(this ._primitive), i || this.setVisibility(!1), this._core.isnull(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + c.id), this.west = a.minx, this.south = a.miny, this.east = a .maxx, this.north = a.maxy, r = { id: c.id, name: e, checked: !0, pId: this._core.isnull(t) ? 0 : t, type: "polygonLayer", item: this, url: a.url, style: c, treeData: { name: e, geoOptions: a, styleOption: c, GroupID: t, checked: i, disFnc: o } }; return this._Provider.treeID = c.id, this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull( t) ? 0 : t), "function" == typeof o && o(this.item), this }, w.prototype.createLabelImageGeoJsonFeatureLayerProvider1 = function(e, t, c, i, o, r) { var n = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, h = this, a = (c.material, { Name: "", text: "", font: " 30px sans-serif", style: h._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: h._cesium.Color.WHITE, outlineColor: h._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new h._cesium.Color(.165, .165, .165, .8), backgroundPadding: new h._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: h._cesium.HorizontalOrigin.CENTER, verticalOrigin: h._cesium.VerticalOrigin.CENTER, eyeOffset: h._cesium.Cartesian3.ZERO, pixelOffset: h._cesium.Cartesian2.ZERO, heightReference: h._cesium.HeightReference.NONE, scaleByDistance: new h._cesium.NearFarScalar(0, 0, 1, 1), maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }), s = (this._urlTemplate = t.url + "?" + this._core._serialize(n.urlParams), t.url + "?" + this._core ._serialize(n.urlParams)), n = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = 21, this ._Provider._minimumHeight = parseFloat(c.height) || 0, this._Provider.loadTile = function(i, o) { if (o.state === Cesium.QuadtreeTileLoadState.START) { if (o.data = { lines: [], geometryPrimitive: void 0 }, !(o.level >= c.level_min && o.level < c.level_max && h.item.show)) return o .state = Cesium.QuadtreeTileLoadState.DONE, void(o.renderable = !0); var e = s.replace(window.encodeURIComponent("{x}"), o.x).replace(window .encodeURIComponent("{y}"), o.y).replace(window.encodeURIComponent("{z}"), o .level); h._cache && (e += "&" + h._core.getuid()), h._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return o.state = Cesium.QuadtreeTileLoadState.DONE, void(o.renderable = !0); var s, l, t, u = h._core.extend(a, c, !0); u.font = c.font, u.image && !u.text ? l = new h._cesium .BillboardCollection({ scene: h._viewer.scene }) : (u.image || !u.text) && u.image && u.text ? (s = new h ._cesium.LabelCollection({ scene: h._viewer.scene }), l = new h._cesium.BillboardCollection({ scene: h._viewer.scene }), (t = new h._cesium.PrimitiveCollection).add(s), t.add(l) ) : s = new h._cesium.LabelCollection({ scene: h._viewer.scene }), e.features.forEach(function(e) { u.id = e; var t, i, o = u.pointHeight; if (/^\[/.test(o) && /\]$/.test(o) ? (t = o.replace( /\[/, "").replace(/\]/, ""), o = parseFloat( e.properties[t])) : null != o && "" != o ? o = parseFloat(o) : null != e.properties.height && (o = parseFloat(e.properties.height)), u.position = new h._cesium.Cartesian3.fromDegrees(e.geometry .coordinates[0], e.geometry.coordinates[1], o), c.fillColor) /^\[/.test(c.fillColor) && /\]$/.test(c .fillColor) && (i = c.fillColor.replace(/\[/, "").replace(/\]/, ""), u.fillColor = e .properties[i]), h._core.isHtmlColor(u .fillColor) ? u.fillColor = h._color .colorFromHtmlColor(u.fillColor) : (/^rgb/.test(u .fillColor) && (u.fillColor = h._color .rgbaStringToRgbaObj(u.fillColor)), 1 < u .fillColor.r && (u.fillColor.r = u.fillColor.r / 255), 1 < u.fillColor.g && (u.fillColor.g = u.fillColor.g / 255), 1 < u.fillColor.b && ( u.fillColor.b = u.fillColor.b / 255), 1 < u .fillColor.a && (u.fillColor.a = u.fillColor.a / 255), u.fillColor = h._color.createColor(u .fillColor.r, u.fillColor.g, u.fillColor.b, u.fillColor.a)); else if (c.fillColor && c.fillColor .Class instanceof Array) { for (var r = 0; r < c.fillColor.Class.length; r++) if ((a = (n = c.fillColor.Class[r]).Condition .replace("<", "").replace(">", "") .split("="))[0] = a[0].replace(/\[/, "") .replace(/\]/, "").replace(/\"/, "") .replace(/\"/, ""), a[1] = a[1].replace( /\"/, "").replace(/\"/, ""), e .properties[a[0]] == a[1]) { u.fillColor = n.Value, h._core.isHtmlColor(u .fillColor) ? u.fillColor = h._color .colorFromHtmlColor(u.fillColor) : ( /^rgb/.test(u.fillColor) && (u .fillColor = h._color .rgbaStringToRgbaObj(u .fillColor)), 1 < u .fillColor.r && (u.fillColor.r = u .fillColor.r / 255), 1 < u .fillColor.g && (u.fillColor.g = u .fillColor.g / 255), 1 < u .fillColor.b && (u.fillColor.b = u .fillColor.b / 255), 1 < u .fillColor.a && (u.fillColor.a = u .fillColor.a / 255), u .fillColor = h._color.createColor(u .fillColor.r, u.fillColor.g, u .fillColor.b, u.fillColor.a)); break } } else(c.fillColor && "{}" != c.fillColor.Class .toString() || style.fillColor && "{}" != style .fillColor.toString()) && (u.fillColor = c .fillColor.Value, h._core.isHtmlColor(u .fillColor) ? u.fillColor = h._color .colorFromHtmlColor(u.fillColor) : (/^rgb/.test( u.fillColor) && (u.fillColor = h._color .rgbaStringToRgbaObj(u.fillColor)), 1 < u.fillColor.r && (u.fillColor.r = u .fillColor.r / 255), 1 < u.fillColor .g && (u.fillColor.g = u.fillColor.g / 255), 1 < u.fillColor.b && (u.fillColor.b = u .fillColor.b / 255), 1 < u.fillColor .a && (u.fillColor.a = u.fillColor.a / 255), u.fillColor = h._color.createColor(u .fillColor.r, u.fillColor.g, u.fillColor .b, u.fillColor.a))); if (c.outlineColor) /^\[/.test(c.outlineColor) && /\]$/ .test(c.outlineColor) && (i = c.outlineColor .replace(/\[/, "").replace(/\]/, "").replace( /\"/, "").replace(/\"/, ""), u .outlineColor = e.properties[i], h._core .isHtmlColor(u.outlineColor) ? u.outlineColor = h._color.colorFromHtmlColor(u.outlineColor) : ( /^rgb/.test(u.outlineColor) && (u .outlineColor = h._color .rgbaStringToRgbaObj(u.outlineColor)), 1 < u.outlineColor.r && (u.outlineColor.r = u.outlineColor.r / 255), 1 < u .outlineColor.g && (u.outlineColor.g = u .outlineColor.g / 255), 1 < u .outlineColor.b && (u.outlineColor.b = u .outlineColor.b / 255), 1 < u .outlineColor.a && (u.outlineColor.a = u .outlineColor.a / 255), u.outlineColor = h._color.createColor(u.outlineColor.r, u .outlineColor.g, u.outlineColor.b, u .outlineColor.a))); else if (c.outlineColor && c.outlineColor .Class instanceof Array) { for (r = 0; r < c.fillColor.Class.length; r++) if ((a = (n = c.fillColor.Class[r]).Condition .replace("<", "").replace(">", "") .split("="))[0] = a[0].replace(/\[/, "") .replace(/\]/, "").replace(/\"/, "") .replace(/\"/, ""), a[1] = a[1].replace( /\"/, "").replace(/\"/, ""), e .properties[a[0]] == a[1]) { u.outlineColor = a.Value, h._core .isHtmlColor(u.outlineColor) ? u .outlineColor = h._color .colorFromHtmlColor(u.outlineColor) : ( /^rgb/.test(u.outlineColor) && (u .outlineColor = h._color .rgbaStringToRgbaObj(u .outlineColor)), 1 < u .outlineColor.r && (u.outlineColor .r = u.outlineColor.r / 255), 1 < u.outlineColor.g && (u .outlineColor.g = u.outlineColor .g / 255), 1 < u.outlineColor .b && (u.outlineColor.b = u .outlineColor.b / 255), 1 < u .outlineColor.a && (u.outlineColor .a = u.outlineColor.a / 255), u .outlineColor = h._color .createColor(u.outlineColor.r, u .outlineColor.g, u.outlineColor .b, u.outlineColor.a)); break } } else(c.outlineColor && "{}" != c.outlineColor.Class .toString() || c.outlineColorTe && "{}" != c .outlineColor.toString()) && (u.outlineColor = c .outlineColor.Value, h._core.isHtmlColor(u .outlineColor) ? u.outlineColor = h._color .colorFromHtmlColor(u.outlineColor) : (/^rgb/ .test(u.outlineColor) && (u.outlineColor = h ._color.rgbaStringToRgbaObj(u .outlineColor)), 1 < u.outlineColor .r && (u.outlineColor.r = u.outlineColor.r / 255), 1 < u.outlineColor.g && (u .outlineColor.g = u.outlineColor.g / 255 ), 1 < u.outlineColor.b && (u .outlineColor.b = u.outlineColor.b / 255 ), 1 < u.outlineColor.a && (u .outlineColor.a = u.outlineColor.a / 255 ), u.outlineColor = h._color .createColor(u.outlineColor.r, u .outlineColor.g, u.outlineColor.b, u .outlineColor.a))); if (c.backgroundColor) /^\[/.test(c.backgroundColor) && /\]$/.test(c.backgroundColor) && (i = c .backgroundColor.replace(/\[/, "").replace(/\]/, ""), u.backgroundColor = e.properties[i], h ._core.isHtmlColor(u.backgroundColor) ? u .backgroundColor = h._color.colorFromHtmlColor(u .backgroundColor) : (/^rgb/.test(u .backgroundColor) && (u .backgroundColor = h._color .rgbaStringToRgbaObj(u.backgroundColor) ), 1 < u.backgroundColor.r && (u .backgroundColor.r = u.backgroundColor .r / 255), 1 < u.backgroundColor.g && (u .backgroundColor.g = u.backgroundColor .g / 255), 1 < u.backgroundColor.b && (u .backgroundColor.b = u.backgroundColor .b / 255), 1 < u.backgroundColor.a && (u .backgroundColor.a = u.backgroundColor .a / 255), u.backgroundColor = h._color .createColor(u.backgroundColor.r, u .backgroundColor.g, u.backgroundColor.b, u.backgroundColor.a))); else if (c.backgroundColor && c.backgroundColor .Class instanceof Array) { for (r = 0; r < c.backgroundColor.Class.length; r++) if ((a = (n = c.backgroundColor.Class[r]) .Condition.replace("<", "").replace(">", "").split("="))[0] = a[0].replace( /\[/, "").replace(/\]/, "").replace( /\"/, "").replace(/\"/, ""), a[1] = a[1] .replace(/\"/, "").replace(/\"/, ""), e .properties[a[0]] == a[1]) { u.backgroundColor = getSGColor(a.Value), h ._core.isHtmlColor(u.backgroundColor) ? u.backgroundColor = h._color .colorFromHtmlColor(u.backgroundColor) : (/^rgb/.test(u.backgroundColor) && (u .backgroundColor = h._color .rgbaStringToRgbaObj(u .backgroundColor)), 1 < u .backgroundColor.r && (u .backgroundColor.r = u .backgroundColor.r / 255), 1 < u .backgroundColor.g && (u .backgroundColor.g = u .backgroundColor.g / 255), 1 < u .backgroundColor.b && (u .backgroundColor.b = u .backgroundColor.b / 255), 1 < u .backgroundColor.a && (u .backgroundColor.a = u .backgroundColor.a / 255), u .backgroundColor = h._color .createColor(u.backgroundColor.r, u .backgroundColor.g, u .backgroundColor.b, u .backgroundColor.a)); break } } else c.backgroundColor && "{}" != c.backgroundColor .Class.toString() ? (u.backgroundColor = getSGColor( c.backgroundColor.Value), h._core .isHtmlColor(u.backgroundColor) ? u .backgroundColor = h._color.colorFromHtmlColor(u .backgroundColor) : (/^rgb/.test(u .backgroundColor) && (u .backgroundColor = h._color .rgbaStringToRgbaObj(u.backgroundColor) ), 1 < u.backgroundColor.r && (u .backgroundColor.r = u.backgroundColor .r / 255), 1 < u.backgroundColor.g && (u .backgroundColor.g = u.backgroundColor .g / 255), 1 < u.backgroundColor.b && (u .backgroundColor.b = u.backgroundColor .b / 255), 1 < u.backgroundColor.a && (u .backgroundColor.a = u.backgroundColor .a / 255), u.backgroundColor = h._color .createColor(u.backgroundColor.r, u .backgroundColor.g, u.backgroundColor.b, u.backgroundColor.a))) : c .backgroundColor && "{}" != c.backgroundColor .toString() && (u.backgroundColor = c .backgroundColor.Value, h._core.isHtmlColor(u .backgroundColor) ? u.backgroundColor = h ._color.colorFromHtmlColor(u.backgroundColor) : (/^rgb/.test(u.backgroundColor) && (u .backgroundColor = h._color .rgbaStringToRgbaObj(u.backgroundColor) ), 1 < u.backgroundColor.r && (u .backgroundColor.r = u.backgroundColor .r / 255), 1 < u.backgroundColor.g && (u .backgroundColor.g = u.backgroundColor .g / 255), 1 < u.backgroundColor.b && (u .backgroundColor.b = u.backgroundColor .b / 255), 1 < u.backgroundColor.a && (u .backgroundColor.a = u.backgroundColor .a / 255), u.backgroundColor = h._color .createColor(u.backgroundColor.r, u .backgroundColor.g, u.backgroundColor.b, u.backgroundColor.a))); if (c.scale) /^\[/.test(c.scale) && /\]$/.test(c .scale) && (i = c.scale.replace(/\[/, "").replace( /\]/, ""), u.scale = e.properties[i]); else if (c.scale && c.scale.Class instanceof Array) for (r = 0; r < c.scale.Class.length; r++)(a = (n = c.scale.Class[r]).Condition.replace("<", "").replace(">", "").split("="))[0] = a[0] .replace(/\[/, "").replace(/\]/, "").replace( /\"/, "").replace(/\"/, ""), a[1] = a[1] .replace(/\"/, "").replace(/\"/, ""), e .properties[a[0]] == a[1] && (u.scale = n .Value); else c.scale && "{}" != c.scale.Class.toString() ? u .scale = c.scale.Value : c.scale && "[object Object]" != c.scale.toString() && "{}" != c .scale.toString() && (u.scale = c.scale); if (/^\[/.test(c.text) && /\]$/.test(c.text) || c .textTe ? c.textTe ? c.text .Class instanceof Object ? (t = c.text.Class.Value .replace(/\[/, "").replace(/\]/, "").replace( /\"/, "").replace(/\"/, ""), u.text = e .properties[t]) : (i = (c.text && c.text .Class && "{}" != c.text.Class.toString() ? c.text.Class.Value : c.text).replace(/\[/, "").replace(/\]/, "").replace(/\"/, "") .replace(/\"/, ""), u.text = e.properties[i]) : c.text && "[object Object]" != c.text.toString() && "{}" != c.text.toString() ? u.text = c.text : (i = c .text.Class.Value.replace(/\[/, "").replace( /\]/, "").replace(/\"/, "").replace(/\"/, ""), u.text = e.properties[i]) : c.text && "[object Object]" != c.text.toString() && "{}" != c .text.toString() && (u.text = c.text), (u = u .labelData ? h._core.extend(u, u.labelData, ! 0) : u).verticalOrigin = Cesium.VerticalOrigin .CENTER, u.horizontalOrigin = Cesium .HorizontalOrigin.LEFT, s && s.add(u), c.image && c .image.Class instanceof Array) { for (var n, a, r = 0; r < c.image.Class.length; r++) if ((a = (n = c.image.Class[r]).Condition .replace("<", "").replace(">", "") .split("="))[0] = a[0].replace(/\[/, "") .replace(/\]/, "").replace(/\"/, "") .replace(/\"/, ""), a[1] = a[1].replace( /\"/, "").replace(/\"/, ""), e .properties[a[0]] == a[1]) { u.image = n.Value; break } } else c.image && c.image.Class && "{}" != c.image.Class .toString() ? (i = c.image.Class.Value.replace(/\[/, "").replace(/\]/, "").replace(/\"/, "") .replace(/\"/, ""), u.image = e.properties[i]) : c.image && "[object Object]" != c.image .toString() && "{}" != c.image.toString() && (u.image = c.image); o = y.cloneDeep(u); o.verticalOrigin = Cesium.VerticalOrigin.CENTER, o .horizontalOrigin = Cesium.HorizontalOrigin.RIGHT, l && l.add(o) }), 0 == e.features.length && (o.state = Cesium .QuadtreeTileLoadState.DONE, o.renderable = !0), o.data .geometryPrimitive = t || l || s, o.state === Cesium .QuadtreeTileLoadState.LOADING && (o.data.geometryPrimitive .update(i, []), o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0) }, error: function() { o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0 } }), o.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), l = n.primitives, l = (c && c.time && (this._Provider._availability = new h._cesium.TimeIntervalCollection([new h ._cesium.TimeInterval({ start: c.time.start ? h._cesium.JulianDate.fromDate(new Date(c.time .start)) : h._cesium.Iso8601.MINIMUM_VALUE, stop: c.time.end ? h._cesium.JulianDate.fromDate(new Date(c.time.end)) : h ._cesium.Iso8601.MAXIMUM_VALUE }) ]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), l.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(c.id) && (c.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + c.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: c.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: c, treeData: { name: e, geoOptions: t, styleOption: c, GroupID: i, checked: o, disFnc: r } }); return this._Provider.treeID = c.id, this.setTreeobj(l), this._tree.insertGroupId(l, this._core.isnull( i) ? 0 : i), "function" == typeof r && r(this.item), this }, w.prototype.createSXTLabelGeoJsonFeatureLayerProvider = function(e, t, s, i, o, r) { var n = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = this, u = (s.material, { show: !0, position: l._cesium.Cartesian3.ZERO, pixelOffset: l._cesium.Cartesian2.ZERO, eyeOffset: l._cesium.Cartesian3.ZERO, heightReference: l._cesium.HeightReference.NONE, horizontalOrigin: l._cesium.HorizontalOrigin.CENTER, verticalOrigin: l._cesium.VerticalOrigin.CENTER, scale: 1, image: "", imageSubRegion: void 0, color: l._cesium.Color.WHITE, id: void 0, rotation: 0, alignedAxis: l._cesium.Cartesian3.ZERO, scaleByDistance: void 0, translucencyByDistance: void 0, pixelOffsetScaleByDistance: void 0, sizeInMeters: !1, distanceDisplayCondition: void 0 }), c = (s.width && (u.width = s.width), s.height && (u.height = s.height), s.image && (u.image = s .image), this._urlTemplate = t.url + "?" + this._core._serialize(n.urlParams), t.url + "?" + this._core._serialize(n.urlParams)), n = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = s.level_max - 1, this._Provider._minimumHeight = parseFloat(s.height) || 0, this._Provider.loadTile = function(n, a) { if (a.state === Cesium.QuadtreeTileLoadState.START) { if (a.data = { lines: [], geometryPrimitive: void 0 }, !(a.level >= s.level_min && a.level <= s.level_max && l.item.show)) return a .state = Cesium.QuadtreeTileLoadState.DONE, void(a.renderable = !0); var e = c.replace(window.encodeURIComponent("{x}"), a.x).replace(window .encodeURIComponent("{y}"), a.y).replace(window.encodeURIComponent("{z}"), a .level); l._cache && (e += "&" + l._core.getuid()), l._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return a.state = Cesium.QuadtreeTileLoadState.DONE, void(a.renderable = !0); var t; if (a.level == parseInt(s.level_max) - 1) "function" == typeof initSXTData && (t = initSXTData(e)); else { t = new Cesium.BillboardCollection; for (var i of e.features) { var o = i.geometry.coordinates[0], i = i.geometry.coordinates[1], r = s.pointHeight ? parseFloat(s.pointHeight) : 0; u.position = Cesium.Cartesian3.fromDegrees(o, i, r), t.add( u) } } 0 == e.features.length && (a.state = Cesium.QuadtreeTileLoadState .DONE, a.renderable = !0), a.data.geometryPrimitive = t, a .state = Cesium.QuadtreeTileLoadState.LOADING, a.state === Cesium.QuadtreeTileLoadState.LOADING && "function" == typeof a .data.geometryPrimitive.update ? (a.data.geometryPrimitive .update(n, []), a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0) : (a.data.geometryPrimitive.destroy = function() {}, a.data.geometryPrimitive.update = function() {}) }, error: function() { null == a.count && (a.count = 0), a.count += 1, 2 <= a.count ? (a .state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = ! 0) : a.state = Cesium.QuadtreeTileLoadState.START } }), a.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), a = n.primitives, a = (s && s.time && (this._Provider._availability = new l._cesium.TimeIntervalCollection([new l ._cesium.TimeInterval({ start: s.time.start ? l._cesium.JulianDate.fromDate(new Date(s.time .start)) : l._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? l._cesium.JulianDate.fromDate(new Date(s.time.end)) : l ._cesium.Iso8601.MAXIMUM_VALUE }) ]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), a.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(s.id) && (s.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + s.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: s.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: s, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, w.prototype.createCustomCallbackGeoJsonFeatureLayerProvider = function(e, t, r, i, o, n, a) { var s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = this, u = (r.material, l._cesium.Cartesian3.ZERO, l._cesium.Cartesian2.ZERO, l._cesium.Cartesian3.ZERO, l ._cesium.HeightReference.NONE, l._cesium.HorizontalOrigin.CENTER, l._cesium.VerticalOrigin .CENTER, l._cesium.Color.WHITE, l._cesium.Cartesian3.ZERO, r.width, r.height, r.image, this ._urlTemplate = t.url + "?" + this._core._serialize(s.urlParams), t.url + "?" + this._core ._serialize(s.urlParams)), s = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = r.level_max - 1, this._Provider._minimumHeight = parseFloat(r.height) || 0, this._Provider.loadTile = function(i, o) { if (o.state === Cesium.QuadtreeTileLoadState.START) { if (o.data = { lines: [], geometryPrimitive: void 0 }, !(o.level >= r.level_min && o.level <= r.level_max && l.item.show)) return o .state = Cesium.QuadtreeTileLoadState.DONE, void(o.renderable = !0); var e = u.replace(window.encodeURIComponent("{x}"), o.x).replace(window .encodeURIComponent("{y}"), o.y).replace(window.encodeURIComponent("{z}"), o .level); l._cache && (e += "&" + l._core.getuid()), l._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return o.state = Cesium.QuadtreeTileLoadState.DONE, void(o.renderable = !0); var t; "function" == typeof n && (t = n(e)), 0 == e.features.length && (o .state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = ! 0), o.data.geometryPrimitive = t, o.state = Cesium .QuadtreeTileLoadState.LOADING, o.state === Cesium .QuadtreeTileLoadState.LOADING && "function" == typeof o.data .geometryPrimitive.update ? (o.data.geometryPrimitive.update(i, []), o.state = Cesium.QuadtreeTileLoadState.DONE, o .renderable = !0) : (o.data.geometryPrimitive.destroy = function() {}, o.data.geometryPrimitive.update = function() {}) }, error: function() { null == o.count && (o.count = 0), o.count += 1, 2 <= o.count ? (o .state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = ! 0) : o.state = Cesium.QuadtreeTileLoadState.START } }), o.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), c = s.primitives, c = (r && r.time && (this._Provider._availability = new l._cesium.TimeIntervalCollection([new l ._cesium.TimeInterval({ start: r.time.start ? l._cesium.JulianDate.fromDate(new Date(r.time .start)) : l._cesium.Iso8601.MINIMUM_VALUE, stop: r.time.end ? l._cesium.JulianDate.fromDate(new Date(r.time.end)) : l ._cesium.Iso8601.MAXIMUM_VALUE }) ]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), c.add(this._primitive), s.primitivesQuadTrees && s.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(r.id) && (r.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + r.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: r.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: r, treeData: { name: e, geoOptions: t, styleOption: r, GroupID: i, checked: o, disFnc: a } }); return this.setTreeobj(c), this._tree.insertGroupId(c, this._core.isnull(i) ? 0 : i), "function" == typeof a && a(this.item), this }, w.prototype.createLabelRichtextGeoJsonFeatureLayerProvider = function(e, t, h, i, m, d) { null == t && console.log("geojson is required"); var o = this._cesium.GeoJsonDataSource.load(t), p = (this._viewer.dataSources.add(o), this), g = new this._cesium.PointPrimitiveCollection, o = (p.optiontext = [], o.then(function(e) { for (var t, i = (p.item = e).entities.values, o = 0; o < i.length; o++) { var r, n, a = i[o], a = (r = /^\[/.test(h.text) && /\]$/.test(h.text) ? (r = h.text.replace(/\[/, "").replace(/\]/, ""), a.properties[r]._value) : h.text, p.optiontext .push(r), a.billboard = void 0, p._viewer.scene.globe.ellipsoid, p._cesium .Cartographic.fromCartesian(a.position._value)), a = [p._cesium.Math.toDegrees(a.longitude), p._cesium.Math.toDegrees(a .latitude), h.pointHeight || a.height ], s = p._core.getuid(); a instanceof Array ? 2 === a.length ? n = p._cesium.Cartesian3.fromDegrees(a[0], a[ 1]) : 3 === a.length && (n = p._cesium.Cartesian3.fromDegrees(a[0], a[1], a[ 2])) : n = a.z ? p._cesium.Cartesian3.fromDegrees(a.x, a.y, a.z) : p._cesium .Cartesian3.fromDegrees(a.x, a.y), g.add({ id: "DivPoint" + s, position: n, color: p._cesium.Color.YELLOW, description: h.text }) } h && h.time && (t = new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({ start: h.time.start ? p._cesium.JulianDate.fromDate(new Date(h .time.start)) : p._cesium.Iso8601.MINIMUM_VALUE, stop: h.time.end ? p._cesium.JulianDate.fromDate(new Date(h.time .end)) : p._cesium.Iso8601.MAXIMUM_VALUE })])), p.item = g, p.pointPrimitive = p._viewer.scene.primitives.add(g, t); var l, u, c = !0; p.pointPrimitive.update = function() { for (var e, t, i = 0; i < p.pointPrimitive.length; i++) { if (e = p.pointPrimitive.get(i), u = e.position, !(u = p._viewer.scene .cartesianToCanvasCoordinates(u))) return; (l = document.getElementById(e.id)) || (t = '
\n
' + p.optiontext[i] + "
\n
", $(".cesium-viewer") .append(t), l = document.getElementById(e.id)), e.description ? l.style .transform = "matrix(1, 0, 0, 1, " + u.x + ", " + (u.y - 157) + ")" : l .style.transform = "matrix(1, 0, 0, 1, " + u.x + ", " + (u.y - 134) + ")", l && (l.style.display = p.pointPrimitive.show ? "block" : "none") } c && (m || p.setVisibility(!1), c = !1) }, "function" == typeof d && d(e) }), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "富文本"), { id: h.id, name: e, checked: m, pId: this._core.isnull(i) ? 0 : i, type: "DivPoint", item: this, url: t, style: h, treeData: { name: e, geoOptions: t, styleOption: h, GroupID: i, checked: m, disFnc: d } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer = function(e, t, s, i, l, o) { var r = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, u = this, r = new v(this._viewer, this._cesium, r), r = ((this._Provider = r)._loadTile = function(e) { var o, r, n = new u._cesium.PointPrimitiveCollection, a = (u.optiontext = [], e.features.forEach(function(e) { var t, i = options.pointHeight, i = (null != e.properties.height && (i = parseFloat(e.properties .height) + i), /^\[/.test(options.pointHeight) && /\]$/.test( options.pointHeight) && (t = options.pointHeight.replace(/\[/, "").replace(/\]/, ""), i = parseFloat(e.properties[t])), s .position = new u._cesium.Cartesian3.fromDegrees(e.geometry .coordinates[0], e.geometry.coordinates[1], i), /^\[/.test(s .text) && /\]$/.test(s.text) && (t = s.text.replace(/\[/, "") .replace(/\]/, ""), s.text = e.properties[t]), u._core.getuid() ); n.add({ id: "DivPoint" + i, position: Cartesian3, color: u._cesium.Color.YELLOW, description: s.text }), u.optiontext.push(option.text) }), u.pointPrimitive = u._viewer.scene.primitives.add(n), !0); return u.pointPrimitive.update = function() { for (var e, t, i = 0; i < u.pointPrimitive.length; i++) { if (e = u.pointPrimitive.get(i), r = e.position, !(r = u._viewer.scene .cartesianToCanvasCoordinates(r))) return; (o = document.getElementById(e.id)) || (t = '
\n
' + u.optiontext[i] + "
\n
", $(".cesium-viewer").append( t), o = document.getElementById(e.id)), e.description ? o.style.transform = "matrix(1, 0, 0, 1, " + r.x + ", " + (r.y - 157) + ")" : o.style.transform = "matrix(1, 0, 0, 1, " + r.x + ", " + (r.y - 134) + ")" } a && (l || u.setVisibility(!1), a = !1) }, u.item = n, "" }, r.addTo(this._viewer), l || this.setVisibility(!1), this._core.isnull(s.id) && (s.id = this ._core.getuid()), this._core.isnull(e) && (e = "富文本" + s.id), this.west = t.minx, this .south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: s.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "DivPoint", item: this, url: t.url, style: s, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: l, disFnc: o } }); return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i), "function" == typeof o && o(this.item), this }, w.prototype.createModelGeoJsonFeatureLayerProvider = function(e, t, s, i, o, r) { var n = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, Cesium: this._cesium }, l = this, u = (s.material, l._core.isnull(s) || l._core.isnull(s.color) || /^\[/.test(s.color) && "[" == s .color.toString().charAt(0) && "]" == s.color.toString().charAt(s.color.length - 1) || (l._core .isHtmlColor(s.color) ? s.color = l._color.colorFromHtmlColor(s.color) : (/^rgb/.test(s .color) && (s.color = l._color.rgbaStringToRgbaObj(s.color)), 1 < s.color.r && (s .color.r = s.color.r / 255), 1 < s.color.g && (s.color.g = s.color.g / 255), 1 < s .color.b && (s.color.b = s.color.b / 255), 1 < s.color.a && (s.color.a = s.color.a / 255), s.color = l._color.createColor(s.color.r, s.color.g, s.color.b, s.color.a))), this._urlTemplate = t.url + "?" + this._core._serialize(n.urlParams), t.url + "?" + this._core ._serialize(n.urlParams)), n = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = s.level_max - 1, this._Provider._minimumHeight = parseFloat(s.height) || 0, this._Provider.loadTile = function(n, a) { if (a.state === Cesium.QuadtreeTileLoadState.START) { if (a.data = { lines: [], geometryPrimitive: void 0 }, !(a.level >= s.level_min && a.level < s.level_max && l.item.show)) return a .state = Cesium.QuadtreeTileLoadState.DONE, void(a.renderable = !0); var e = u.replace(window.encodeURIComponent("{x}"), a.x).replace(window .encodeURIComponent("{y}"), a.y).replace(window.encodeURIComponent("{z}"), a .level); l._cache && (e += "&" + l._core.getuid()), l._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return a.state = Cesium.QuadtreeTileLoadState.DONE, void(a.renderable = !0); var t = { url: "", modelMatrix: l._cesium.Transforms.eastNorthUpToFixedFrame( origin), color: l._cesium.Color.DARKSALMON, scale: 2 }, o = l._core.extend(t, s, !0), t = (l._core.isnull(s.near) && (s.near = 0), l._core.isnull(s .far) && (s.far = 999999999), parseFloat(s.near)), i = parseFloat(s.far), t = new l._cesium.DistanceDisplayCondition(t, i), r = (o.distanceDisplayCondition = t, new l._cesium .PrimitiveCollection); e.features.forEach(function(e) { o.id = e; var t = o.height, i = (null != e.properties.height && (t = parseFloat( e.properties.height)), /^\[/.test(o .height) && /\]$/.test(o.height) && (i = o .height.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e.properties[i])), o .modelMatrix = l._cesium.Transforms .eastNorthUpToFixedFrame(l._cesium.Cartesian3 .fromDegrees(e.geometry.coordinates[0], e .geometry.coordinates[1], t)), l._cesium .Model.fromGltf({ id: e, url: o.uri, color: o.color, modelMatrix: o.modelMatrix, scale: o.scale, heightReference: parseInt(o .heightReference), distanceDisplayCondition: o .distanceDisplayCondition })); r.add(i) }), 0 == e.features.length && (a.state = Cesium .QuadtreeTileLoadState.DONE, a.renderable = !0), a.data .geometryPrimitive = r, a.state = Cesium.QuadtreeTileLoadState .LOADING, a.state === Cesium.QuadtreeTileLoadState.LOADING && (a .data.geometryPrimitive.update(n, []), a.state = Cesium .QuadtreeTileLoadState.DONE, a.renderable = !0) }, error: function() { null == a.count && (a.count = 0), a.count += 1, 2 <= a.count ? (a .state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = ! 0) : a.state = Cesium.QuadtreeTileLoadState.START } }), a.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), n = (n.primitives.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(s.id) && (s.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + s.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: s.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: s, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, w.prototype.createPointGeoJsonFeatureLayerProvider = function(e, t, s, i, o, r) { var n = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = this, u = (l._core.isnull(s) || l._core.isnull(s.color) || /^\[/.test(s.color) && "[" == s.color .toString().charAt(0) && "]" == s.color.toString().charAt(s.color.length - 1) || (l._core .isHtmlColor(s.color) ? s.color = l._color.colorFromHtmlColor(s.color) : (/^rgb/.test(s .color) && (s.color = l._color.rgbaStringToRgbaObj(s.color)), 1 < s.color.r && (s .color.r = s.color.r / 255), 1 < s.color.g && (s.color.g = s.color.g / 255), 1 < s .color.b && (s.color.b = s.color.b / 255), 1 < s.color.a && (s.color.a = s.color.a / 255), s.color = l._color.createColor(s.color.r, s.color.g, s.color.b, s.color.a))), l._core.isnull(s) || l._core.isnull(s.outlineColor) || /^\[/.test(s.outlineColor) && "[" == s .outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor .length - 1) || (l._core.isHtmlColor(s.outlineColor) ? s.outlineColor = l._color .colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = l ._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s .outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor .g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s .outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor .a / 255), s.outlineColor = l._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))), this._urlTemplate = t.url + "?" + this._core ._serialize(n.urlParams), t.url + "?" + this._core._serialize(n.urlParams)), n = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = s.level_max - 1, this._Provider._minimumHeight = parseFloat(s.height) || 0, this._Provider.loadTile = function(o, a) { if (a.state === Cesium.QuadtreeTileLoadState.START) { if (a.data = { lines: [], geometryPrimitive: void 0 }, !(a.level >= s.level_min && a.level < s.level_max && l.item.show)) return a .state = Cesium.QuadtreeTileLoadState.DONE, void(a.renderable = !0); var e = u.replace(window.encodeURIComponent("{x}"), a.x).replace(window .encodeURIComponent("{y}"), a.y).replace(window.encodeURIComponent("{z}"), a .level); l._cache && (e += "&" + l._core.getuid()), l._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return a.state = Cesium.QuadtreeTileLoadState.DONE, void(a.renderable = !0); var t = { Name: "", text: "", font: " 30px sans-serif", pixelSize: 10, style: l._cesium.LabelStyle.OUTLINE, fillColor: l._cesium.Color.WHITE, outlineColor: l._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new l._cesium.Color(.165, .165, .165, .8), backgroundPadding: new l._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: l._cesium.HorizontalOrigin.CENTER, verticalOrigin: l._cesium.VerticalOrigin.CENTER, eyeOffset: l._cesium.Cartesian3.ZERO, pixelOffset: l._cesium.Cartesian2.ZERO, heightReference: l._cesium.HeightReference.NONE, scaleByDistance: new l._cesium.NearFarScalar(0, 0, 1, 1) }, r = (s.material, l._core.isnull(s) || l._core.isnull(s .backgroundColor) || /^\[/.test(s.backgroundColor) && "[" == s.backgroundColor.toString().charAt(0) && "]" == s .backgroundColor.toString().charAt(s.backgroundColor .length - 1) || (l._core.isHtmlColor(s .backgroundColor) ? s.backgroundColor = l._color .colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s .backgroundColor) && (s.backgroundColor = l ._color.rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor.r && (s.backgroundColor.r = s .backgroundColor.r / 255), 1 < s.backgroundColor .g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s .backgroundColor.b = s.backgroundColor.b / 255), 1 < s.backgroundColor.a && (s.backgroundColor.a = s .backgroundColor.a / 255), s.backgroundColor = l ._color.createColor(s.backgroundColor.r, s .backgroundColor.g, s.backgroundColor.b, s .backgroundColor.a))), l._core.extend(t, s, !0) ), t = (l._core.isnull(s.near) && (s.near = 0), l._core.isnull(s .far) && (s.far = 999999999), parseFloat(s.near)), i = parseFloat(s.far), t = new l._cesium.DistanceDisplayCondition(t, i), n = (r.distanceDisplayCondition = t, l._core.isnull(s .font_size) && (s.font_size = "30px"), l._core.isnull(s .font_family) && (s.font_family = " sans-serif"), r .font = parseFloat(s.font_size) + "px " + s.font_family, new l._cesium.PointPrimitiveCollection); e.features.forEach(function(e) { r.id = e; var t = 0, i = (/^\[/.test(r.pointHeight) && /\]$/.test(r .pointHeight) ? (i = r.pointHeight.replace( /\[/, "").replace(/\]/, ""), t = parseFloat(e.properties[i])) : void 0 !== r .pointHeight && "" !== r.pointHeight ? t = parseFloat(r.pointHeight) : null != e.properties .height && (t = parseFloat(e.properties .height)), /^\[/.test(s.color) && /\]$/.test(s .color) && (o = s.color.replace(/\[/, "") .replace(/\]/, ""), r.color = e.properties[ o], l._core.isHtmlColor(r.color) ? r .color = l._color.colorFromHtmlColor(r .color) : (/^rgb/.test(r.color) && (r .color = l._color .rgbaStringToRgbaObj(r.color)), 1 < r.color.r && (r.color.r = r.color.r / 255), 1 < r.color.g && (r.color.g = r.color.g / 255), 1 < r.color.b && ( r.color.b = r.color.b / 255), 1 < r .color.a && (r.color.a = r.color.a / 255), r.color = l._color .createColor(r.color.r, r.color.g, r .color.b, r.color.a))), /^\[/.test(s .outlineColor) && /\]$/.test(s .outlineColor) && (o = s.outlineColor.replace( /\[/, "").replace(/\]/, ""), r .outlineColor = e.properties[o], l._core .isHtmlColor(r.outlineColor) ? r .outlineColor = l._color.colorFromHtmlColor( r.outlineColor) : (/^rgb/.test(r .outlineColor) && (r.outlineColor = l._color.rgbaStringToRgbaObj(r .outlineColor)), 1 < r .outlineColor.r && (r.outlineColor.r = r .outlineColor.r / 255), 1 < r .outlineColor.g && (r.outlineColor.g = r .outlineColor.g / 255), 1 < r .outlineColor.b && (r.outlineColor.b = r .outlineColor.b / 255), 1 < r .outlineColor.a && (r.outlineColor.a = r .outlineColor.a / 255), r .outlineColor = l._color.createColor(r .outlineColor.r, r.outlineColor.g, r .outlineColor.b, r.outlineColor.a)) ), r.position = new l._cesium.Cartesian3 .fromDegrees(e.geometry.coordinates[0], e .geometry.coordinates[1], t), r.text = e .properties.name, { show: r.show, position: r.position, pixelSize: r.pixelSize, color: r.color, outlineColor: r.outlineColor, outlineWidth: r.outlineWidth, id: e }), o = "color:" + 255 * r.color.red + "," + 255 * r .color.green + "," + 255 * r.color.blue + ";outlineColor:" + 255 * r.outlineColor.red + "," + 255 * r.outlineColor.green + "," + 255 * r .outlineColor.blue; l.Legend.push(o), n.add(i) }), 0 == e.features.length && (a.state = Cesium .QuadtreeTileLoadState.DONE, a.renderable = !0), a.data .geometryPrimitive = n, a.state = Cesium.QuadtreeTileLoadState .LOADING, a.state === Cesium.QuadtreeTileLoadState.LOADING && (a .data.geometryPrimitive.update(o, []), a.state = Cesium .QuadtreeTileLoadState.DONE, a.renderable = !0) }, error: function() { null == a.count && (a.count = 0), a.count += 1, 2 <= a.count ? (a .state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = ! 0) : a.state = Cesium.QuadtreeTileLoadState.START } }), a.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), n = (n.primitives.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(s.id) && (s.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + s.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: s.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: s, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, w.prototype.setTreeobj = function(e) { this.treeobj = e }, w.prototype.getLegend = function() { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, w.prototype.deleteObject = function() { if (this._viewer.scene.primitives.remove(this.item), this.probj && 0 < this.probj.length && (this ._viewer.scene.primitives.remove(this.probj[0]), this.probj.pop()), null != this.img && this ._viewer.imageryLayers.remove(this.img), this.primitve && 0 < this.primitve.length) { for (var e = 0; e < this.primitve.length; e++) this._viewer.scene.primitives.remove(this.primitve[ e]); this.primitve = [] } this.loadAllKey && 0 < this.loadAllKey.length && (this.loadAllKey = []); try { this._Provider.remove() } catch (e) {} if (null != this._Provider && this._Provider.setStatus(!1), null != this.items && null != this.items && 0 < this.items.length) for (e = 0; e < this.items.length; e++) this._viewer.scene.primitives.remove(this.items[e]); else this._viewer.scene.primitives.remove(this.item); if (this.treeobj && "DivPoint" === this.treeobj.type && this.item && null != this.item ._pointPrimitives && null != this.item._pointPrimitives) for (e = 0; e < this.item._pointPrimitives.length; e++) { var t = document.getElementById(this.item._pointPrimitives[e].id); t && t.remove() } try { this._Provider.remove() } catch (e) {} }, w.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t }, treeData: this.treeobj.treeData } }, w.prototype.setRefresh = function(e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) {} }, w.prototype.setVisibility = function(e) { try { if (this.loadAllKey = [], null != this.item && null != this.item.show && (this.item.show = e), null != this.img && (this.img.show = e), this.primitve && 0 < this.primitve.length) for (var t = 0; t < this.primitve.length; t++) this.primitve[t].show = e; if (this._Provider && this._Provider.setStatus && void 0 !== this._Provider._state && this._Provider .setStatus(e), this._Provider && this._Provider.EntityCollection && (e || (this._Provider .EntityCollection.show = e), this._Provider.EntityCollection.isShow = e), this.probj && 0 < this.probj.length) for (t = 0; t < this.probj.length; t++) this.probj[t].show = e } catch (e) {} if (null != this.treeobj && "DivPoint" === this.treeobj.type && this.item && null != this.item ._pointPrimitives && null != this.item._pointPrimitives) for (t = 0; t < this.item._pointPrimitives.length; t++) { var i = document.getElementById(this.item._pointPrimitives[t].id); i && (i.style.display = e ? "block" : "none") } null != this.item && (this.item.show = e), this._Provider && void 0 !== this._Provider._stop && this ._Provider.setStatus(!e) }, w.prototype.edit = function(e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider .edit(e, t) }, w.prototype.forceRefresh = function() { try { this._cache = !0, this._forceRefreshPrvimitive || (this._forceRefreshPrvimitive = y.cloneDeep(this ._primitive)); var e = y.cloneDeep(this._forceRefreshPrvimitive); this._viewer.scene.primitives.remove(this._primitive), this._viewer.scene.primitives.add(e), this .edit(this.isEditting, this.editoption) } catch (e) {} }, Object.defineProperties(w.prototype, { labelText: { set: y.debounce(function(e) { var t = e; if (!this._core.isnull(e)) { var i = this.item.entities && this.item.entities.values; if (i && 0 < i.length) for (var o = 0; o < i.length; o++) if (/^\[/.test(e) && (t = e.replace(/\[/, "").replace(/\]/, ""), t = i[ o].properties[t]._value), i[o].label) { i[o].label.text = t; try { i[o].point.show = !1 } catch (e) {} } else { try { i[o].point.show = !1 } catch (e) {} i[o].label = new this._cesium.LabelGraphics({ text: t, font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE }) } } }, 500) }, labelStyles: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.style = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.style : void 0 } }, labelFont: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = 16; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[0]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++) t[r].label.font = o + "px " + e } } }, 500) }, labelFontSize1: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = "sans-serif"; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[1]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++) t[r].label.font = e + "px " + o } } }, 500) }, labelFontSize: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), (!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.font = e + "px sans-serif" } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? parseFloat(e[0].label.font) : void 0 } }, labelFillColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.fillColor = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? (e = e[0].label.fillColor, this._color.toHtmlColor("rgb(" + 255 * e ._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelOutlineColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.outlineColor = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, labelOutlineWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].label .outlineWidth = e } }, 200), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.outlineWidth; if (e) return e._value } } }, labelBackgroundColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.backgroundColor = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? (e = e[0].label.backgroundColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value .blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelBackground: { set: y.debounce(function(e) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.showBackground = e }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.background : void 0 } }, labelScale: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].label.scale = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.scale; if (e) return e._value } } }, labelHorizontalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.horizontalOrigin = parseInt(e) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.horizontalOrigin; if (e) return e._value } } }, labelVerticalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.verticalOrigin = parseInt(e) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.verticalOrigin; if (e) return e._value } } }, labelHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.heightReference = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.heightReference; if (e) return e._value } } }, labelDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].label.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, parseInt(e)), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(i, 1, parseInt(e), 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label .distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, labelDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].label.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(parseInt(e), i), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(parseInt(e), 1, i, 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label .distanceDisplayCondition._value.near : 0 : void 0 } }, labelHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } }, labelShow: { set: y.debounce(function(e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) !t[i].label && e ? (t[i].point && (t[i].point .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].label = new this._cesium .LabelGraphics({ text: "label", font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE })) : (t[i].label && (t[i].label.show = e), t[i].point && (t[i].point .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.show : void 0 } }, modelShow: { set: y.debounce(function(e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) t[i].label && (t[i].label.show = !e), t[i] .point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = ! e), !t[i].model && e ? t[i].model = new this._cesium.ModelGraphics({ show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE }) : (t[i].model && (t[i].model.show = e), t[i].label && (t[i].label .show = !e), t[i].point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) return e && 0 < e.length && e[0].model ? e[0].model.show : void 0 } }, modelUri: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length) for (var i, o = 0; o < t.length; o++) t[o].model ? t[o].model.uri = e : ( /^\[/.test(e) && (e = 1 < (i = e.split("[")).length ? i[0] + i[1] .replace(/\[/, "").replace(/\]/, "") : (e = e.replace(/\[/, "") .replace(/\]/, ""), t[o].properties[e])), t[o].model = new this._cesium.ModelGraphics({ uri: e, show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE })) } }, 500) }, modelScale: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { e = parseFloat(e); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].model.scale = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.scale; if (e) return e._value } } }, modelShadows: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.shadows = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) return e && 0 < e.length && e[0].model ? e[0].model.shadows : void 0 } }, modelHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.heightReference = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.heightReference; if (e) return e._value } } }, modelDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].model.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; e && !/^point.fid/.test(e[0]._id) && null == e[0].model || e && 0 < e.length && e[0] .model && (e[0].model.distanceDisplayCondition ? e[0].model.distanceDisplayCondition ._value.far : Number.MAX_VALUE) } }, modelDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].model.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(e, i) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) return e && 0 < e.length && e[0].model ? e[0].model.distanceDisplayCondition ? e[0].model .distanceDisplayCondition._value.near : 0 : void 0 } }, modelColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.color = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, modelLightColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.lightColor = e } }, 100), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.lightColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, modelHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } }, pointColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) t[i].point.color = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, pointShow: { set: y.debounce(function(e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) !t[i].point && e ? (t[i].label && (t[i].label .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].point = new this._cesium .PointGraphics({ color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0 })) : (t[i].point && (t[i].point.show = e), t[i].label && (t[i].label .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) return e && 0 < e.length && e[0].point ? e[0].point.show : void 0 } }, pointPixelSize: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].point.pixelSize = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.pixelSize; if (e) return e._value } } }, pointOutlineColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) t[i].point.outlineColor = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, pointOutlineWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].point .outlineWidth = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.outlineWidth; if (e) return e._value } } }, pointHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) t[i].point.heightReference = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.heightReference; if (e) return e._value } } }, pointDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].point.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e), t[o].point.scaleByDistance = new this ._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) return e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point .distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, pointDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].point.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(e, i), t[o].point.scaleByDistance = new this ._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) return e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point .distanceDisplayCondition._value.near : 0 : void 0 } }, pointHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } }, billboardShow: { set: y.debounce(function(e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) !t[i].billboard && e ? (t[i].point && (t[i] .point.show = !e), t[i].label && (t[i].label.show = !e), t[i] .model && (t[i].model.show = !e), t[i].billboard = new this._cesium .BillboardGraphics({ show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE })) : (t[i].billboard && (t[i].billboard.show = e), t[i].point && (t[i] .point.show = !e), t[i].label && (t[i].label.show = !e), t[i] .billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.show : void 0 } }, billboardImage: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length) for (var i, o = 0; o < t.length; o++) /^\[/.test(e) && (e = 1 < (i = e .split("[")).length ? i[0] + i[1].replace(/\[/, "").replace( /\]/, "") : (e = e.replace(/\[/, "").replace(/\]/, ""), t[o] .properties[e])), t[o].billboard ? t[o].billboard.image = e : t[o] .billboard = new this._cesium.BillboardGraphics({ image: e, show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE }) } }, 500) }, billboardScale: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.scale = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.scale; if (e) return e._value } } }, billboardHorizontalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.horizontalOrigin = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.horizontalOrigin : void 0 } }, billboardVerticalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.verticalOrigin = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.verticalOrigin : void 0 } }, billboardWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.width = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.width; if (e) return e._value } } }, billboardHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.height = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.height; if (e) return e._value } } }, billboardColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.color = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, billboardHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].billboard.heightReference = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].model) { e = e[0].billboard.heightReference; if (e) return e._value } } }, billboardDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].billboard.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e), t[o].billboard.scaleByDistance = new this._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0] .billboard.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, billboardDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].billboard.distanceDisplayCondition = new this ._cesium.DistanceDisplayCondition(e, i), t[o].billboard .scaleByDistance = new this._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0] .billboard.distanceDisplayCondition._value.near : 0 : void 0 } }, billboardPHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } } }); var ht = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; function mt(i, o, r, n, a, e, s, l) { var u = 0, c = []; if (e.map(function(e) { var t; !s || u <= 0 ? (t = 0, i.beginPath(), e.map(function(e) { e = o.project(e, r); 0 == t ? i.moveTo(n + e.x, a + e.y) : i.lineTo(n + e.x, a + e.y), t++ }), s && (i.closePath(), i.fill()), l && i.stroke()) : c.push(e), u++ }), s) return c; c = null } function dt(e, t, i) { this._viewer = e, this._cesium = t, this._tree = i } function pt(e, t) { this._viewer = e, this._cesium = t, this.item = { show: !0 }, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._flyTo = new dt(this._viewer, this._cesium, this._tree), this._Provider = void 0, this.Legend = [], this .model = [], this._cache = !1, this._forceRefreshPrvimitive = null, this._forceRefreshProvider = null } function S(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._createGroup = new it, this.model = [], this.heading = this._cesium.Math.toRadians( 0), this.pitch = this._cesium.Math.toRadians(0), this.roll = this._cesium.Math.toRadians(0), this .rotate = 10, this.state = 0, this.modelPointArr = [], this.modifyModel = null, this.modifyPoint = null, this.modifyHandler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.objId = Number((new Date).getTime() + "" + Number(1e3 * Math.random()).toFixed(0)), this.position = null, this .tempPoints = [], this.scale = 0, this.Radius = 20 } function gt(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._Provider = void 0, this._primitive = void 0, this._taskProcessor = new this ._cesium.TaskProcessor("vectorTileProvider"), this.model = [], this.Legend = [], this._ajax = null, this .datas = null } b.prototype._serialize = function(e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : ht(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))): i .push(o(t) + "=" + o(e[t])) } return i.join("&") }, b.prototype.createHistogramVectorGeoJsonFeatureLayer = function(e, t, r, i, o, n) { var a = { radius: 50, height: 100, scale: 1, defaultColor: "#ffffff", showLabel: !0, label: { showBackground: !1, fillColor: "#ffffff", outlineColor: "#000000", backgroundColor: "rgba(0,0,0,0.5)", style: 2, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, outlineWidth: 1, font: "20px 微软雅黑" }, alpha: .5, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit }; r.label && (a.label = this._core.extend(a.label, r.label, !0), delete r.label); let g = this._core.extend(a, r, !0); null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"); let _, f = (Array.isArray(g.color) && (_ = { name: g.color[0].name, value: { ">": {}, "<": {} } }, g.color.forEach(e => { var t; e.value.indexOf && -1 < e.value.indexOf(">") ? (t = e.value.split(">"), _.value[">"] [t[1]] = Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha)) : e .value.indexOf && -1 < e.value.indexOf("<") ? (t = e.value.split("<"), _.value[ "<"][t[1]] = Cesium.Color.fromCssColorString(e.color).withAlpha(g .alpha)) : _.value[e.value] = Cesium.Color.fromCssColorString(e.color) .withAlpha(g.alpha) })), Cesium.Color.fromCssColorString(g.defaultColor).withAlpha(g.alpha)); var l = this, y = { text: "", ...g.label, fillColor: Cesium.Color.fromCssColorString(g.label.fillColor), outlineColor: Cesium.Color.fromCssColorString(g.label.outlineColor), backgroundColor: Cesium.Color.fromCssColorString(g.label.backgroundColor) }, u = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s .urlParams)), a = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = r.level_max - 1, this._Provider._minimumHeight = 0, this._Provider.loadTile = function(t, e) { var i = t, o = e, p = l; if (o.state === Cesium.QuadtreeTileLoadState.START) { if (o.data = { lines: [], geometryPrimitive: void 0 }, !(o.level >= r.level_min && o.level < r.level_max && p.item.show)) return void(o .state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0); { t = u.replace(window.encodeURIComponent("{x}"), o.x).replace(window .encodeURIComponent("{y}"), o.y).replace(window.encodeURIComponent("{z}"), o .level); p._cache && (t += "&" + p._core.getuid()); let m = [], d = new Cesium.LabelCollection, e = Cesium.GeoJsonDataSource.load(t); e.then(e => { let t = e.entities.values; if (!t || !t.length) return o.state = Cesium.QuadtreeTileLoadState.DONE, void(o.renderable = !0); let h = new Cesium.PrimitiveCollection; t.forEach(e => { var t = e.properties.getValue(); let i = g.height; t && "string" == typeof g.height && /^\[/.test(g.height) && /\]$/.test(g.height) && (o = g.height.replace(/\[/, "") .replace(/\]/, ""), i = t[o] || 100); var o = i * g.scale; let r; if (t && "string" == typeof g.color && /^\[/.test(g .color) && /\]$/.test(g.color)) { var n = t[g.color.replace(/\[/, "").replace(/\]/, "")] || g.defaultColor; r = Cesium.Color.fromCssColorString(n).withAlpha(g .alpha) } else if (_ && t[_.name]) { var a = t[_.name]; if (_.value[a]) r = _.value[a]; else { for (var s in _.value[">"]) if (a > s) { r = _.value[">"][s]; break } if (!r) for (var l in _.value["<"]) if (a < l) { r = _.value["<"][l]; break } } } r = r || f.clone(); let u; e.polygon ? (n = e.polygon.hierarchy.getValue().positions, u = Cesium.BoundingSphere.fromPoints(n).center, n = new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium .PolygonHierarchy(n), height: 0, extrudedHeight: 0, vertexFormat: Cesium.VertexFormat.DEFAULT, perPositionHeight: !1 }), n = new Cesium.GeometryInstance({ id: t, geometry: n, attributes: { color: new Cesium .ColorGeometryInstanceAttribute .fromColor(r) } }), m.push(n)) : (e.point || e.billboard) && (u = e .position.getValue()); n = new Cesium.GeometryInstance({ geometry: new Cesium.EllipseGeometry({ extrudedHeight: o, center: u, semiMinorAxis: g.radius, semiMajorAxis: g.radius, vertexFormat: Cesium.VertexFormat .POSITION_AND_ST }), id: t }); let c = Cesium.Material.fromType("Color"); c.uniforms.color = r.withAlpha(1); e = new p._cesium.Primitive({ geometryInstances: n, appearance: new Cesium .EllipsoidSurfaceAppearance({ material: c }), shadows: g.shadows }); h.add(e), g.showLabel && (t = p._core.toDegrees(u), y.text = i + "", y.position = Cesium.Cartesian3.fromDegrees(t .lon, t.lat, 1.1 * o), d.add(y)) }), m.length && (e = new p._cesium.GroundPrimitive({ geometryInstances: m, appearance: new p._cesium.PerInstanceColorAppearance({ translucent: g.alpha < 1 }), classificationType: p._cesium.ClassificationType.BOTH, shadows: g.shadows }), h.add(e)), g.showLabel && h.add(d), p.probj.push(h), o.data .geometryPrimitive = h, o.state = Cesium.QuadtreeTileLoadState .LOADING, o.state === Cesium.QuadtreeTileLoadState.LOADING && (o .data.geometryPrimitive.update(i, []), o.state = Cesium .QuadtreeTileLoadState.DONE, o.renderable = !0) }, e => { null == o.count && (o.count = 0), o.count += 1, 2 <= o.count ? (o .state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0) : o.state = Cesium.QuadtreeTileLoadState.START }) } o.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new l._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 5 }), this._viewer.scene), s = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(g.id) && (g.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + g.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: g.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: r, treeData: { name: e, geoOptions: t, styleOption: r, GroupID: i, checked: o, disFnc: n } }); return this._Provider.treeID = s.id, this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull( i) ? 0 : i), "function" == typeof n && n(this.item), this }, b.prototype.createLaycolorVectorGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit }; let c = this._core.extend({ type: "2D", height: 100, scale: 1, defaultColor: "#ffffff", alpha: .5, level_max: 20, level_min: 10 }, i, !0); null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"); let h, m = (Array.isArray(c.color) && (h = { name: c.color[0].name, value: { ">": {}, "<": {} } }, c.color.forEach(e => { var t; e.value.indexOf && -1 < e.value.indexOf(">") ? (t = e.value.split(">"), h.value[">"] [t[1]] = Cesium.Color.fromCssColorString(e.color).withAlpha(c.alpha)) : e .value.indexOf && -1 < e.value.indexOf("<") ? (t = e.value.split("<"), h.value[ "<"][t[1]] = Cesium.Color.fromCssColorString(e.color).withAlpha(c .alpha)) : h.value[e.value] = Cesium.Color.fromCssColorString(e.color) .withAlpha(c.alpha) })), Cesium.Color.fromCssColorString(c.defaultColor).withAlpha(c.alpha)); var s = this, l = (this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), t.url + "?" + this._serialize(a .urlParams)), a = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider._minimumHeight = 0, this._Provider.loadTile = function(t, e) { var o = t, r = e, n = s; if (r.state === Cesium.QuadtreeTileLoadState.START) { if (r.data = { lines: [], geometryPrimitive: void 0 }, !(r.level >= i.level_min && r.level < i.level_max && n.item.show)) return void(r .state = Cesium.QuadtreeTileLoadState.DONE, r.renderable = !0); { t = l.replace(window.encodeURIComponent("{x}"), r.x).replace(window .encodeURIComponent("{y}"), r.y).replace(window.encodeURIComponent("{z}"), r .level); n._cache && (t += "&" + n._core.getuid()); let u = [], e = Cesium.GeoJsonDataSource.load(t); e.then(e => { let t = e.entities.values; if (!t || !t.length) return r.state = Cesium.QuadtreeTileLoadState.DONE, void(r.renderable = !0); t.forEach(e => { var t = e.properties.getValue(); let i, o; "3D" === c.type && (i = c.height, t && "string" == typeof c .height && /^\[/.test(c.height) && /\]$/.test(c .height) && (n = c.height.replace(/\[/, "") .replace(/\]/, ""), i = t[n] || 100), o = i * c .scale); let r; if (t && "string" == typeof c.color && /^\[/.test(c .color) && /\]$/.test(c.color)) { var n = t[c.color.replace(/\[/, "").replace(/\]/, "")] || c.defaultColor; r = Cesium.Color.fromCssColorString(n).withAlpha(c .alpha) } else if (h && t[h.name]) { var a = t[h.name]; if (h.value[a]) r = h.value[a]; else { for (var s in h.value[">"]) if (a > s) { r = h.value[">"][s]; break } if (!r) for (var l in h.value["<"]) if (a < l) { r = h.value["<"][l]; break } } } r = r || m.clone(), e.polygon && (n = e.polygon.hierarchy .getValue().positions, e = new Cesium .PolygonGeometry({ polygonHierarchy: new Cesium .PolygonHierarchy(n), height: 0, extrudedHeight: "3D" === c.type ? o : 0, vertexFormat: Cesium.VertexFormat.DEFAULT, perPositionHeight: !1 }), n = new Cesium.GeometryInstance({ id: t, geometry: e, attributes: { color: new Cesium .ColorGeometryInstanceAttribute .fromColor(r) } }), u.push(n)) }); let i; if (u.length) { let e = "3D" === c.type ? Cesium.Primitive : Cesium.GroundPrimitive; i = new e({ geometryInstances: u, appearance: new n._cesium.PerInstanceColorAppearance({ translucent: c.alpha < 1 }), classificationType: n._cesium.ClassificationType.BOTH, shadows: c.shadows }) } n.probj.push(i), r.data.geometryPrimitive = i, r.state = Cesium .QuadtreeTileLoadState.LOADING, r.state === Cesium .QuadtreeTileLoadState.LOADING && (r.data.geometryPrimitive.update( o, []), r.state = Cesium.QuadtreeTileLoadState.DONE, r .renderable = !0) }, e => { null == r.count && (r.count = 0), r.count += 1, 2 <= r.count ? (r .state = Cesium.QuadtreeTileLoadState.DONE, r.renderable = !0) : r.state = Cesium.QuadtreeTileLoadState.START }) } r.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new s._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 5 }), this._viewer.scene), a = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), r || this.setVisibility(!1), this._core.isnull(c.id) && (c.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + c.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: c.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i, treeData: { name: e, geoOptions: t, styleOption: i, GroupID: o, checked: r, disFnc: n } }); return this._Provider.treeID = a.id, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull( o) ? 0 : o), "function" == typeof n && n(this.item), this }, b.prototype.createVector3DTilesFeatureLayer = function(e, t, n, i, o, r) { var a = { color: "#ffffff", level_max: 20, level_min: 10, tilingScheme: new Cesium.WebMercatorTilingScheme }, s = (t.url, t._x || 0), l = t._y || 0; t.upperLevelLimit, t.lowerLevelLimit; let u = this._core.extend(a, n, !0); null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"); var c = this, h = (this._urlTemplate = t.url, t.url), a = (this._Provider = new T(this._viewer, this._cesium, u.tilingScheme), this._Provider ._normalTile = n.level_max - 1, this._Provider._minimumHeight = 0, this._Provider.loadTile = function(t, e) { var i = t, o = e, r = c; if (o.state === Cesium.QuadtreeTileLoadState.START) { if (o.data = { lines: [], geometryPrimitive: void 0 }, !(o.level >= n.level_min && o.level < n.level_max && r.item.show)) return void(o .state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0); { t = h.replace("{x}", o.x - s).replace("{y}", o.y - l).replace("{z}", o.level); r._cache && (t += "&" + r._core.getuid()); let e = new Cesium.Cesium3DTileset({ url: t, ...u }); e.readyPromise.then(function(e) { r.probj.push(e), o.data.geometryPrimitive = e, r._viewer.scene .primitives.add(e), o.state = Cesium.QuadtreeTileLoadState.LOADING, o.state === Cesium.QuadtreeTileLoadState.LOADING && (o.data .geometryPrimitive.update(i, []), o.state = Cesium .QuadtreeTileLoadState.DONE, o.renderable = !0) }).otherwise(function(e) { null == o.count && (o.count = 0), o.count += 1, 2 <= o.count ? (o .state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0) : o.state = Cesium.QuadtreeTileLoadState.START }) } o.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new c._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 5 }), this._viewer.scene), a = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(u.id) && (u.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), { id: u.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "modelLayer", item: this, url: t.url, style: n }); return this._Provider.treeID = a.id, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull( i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.createVector3DTilesFeatureLayerRelease = function(e, t, n, i, o, r) { var a = { color: "#ffffff", level_max: 20, level_min: 10, tilingScheme: new Cesium.WebMercatorTilingScheme }, s = (t.url, t._x || 0), l = t._y || 0; t.upperLevelLimit, t.lowerLevelLimit; let u = this._core.extend(a, n, !0); null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"); var c = this, h = (c.models = 0, this._urlTemplate = t.url, t.url), a = (this._Provider = new T(this._viewer, this._cesium, u.tilingScheme), this._Provider ._normalTile = n.level_max - 1, this._Provider._minimumHeight = 0, this._Provider.loadTile = function(t, e) { var i = t, o = e, r = c; if (o.state === Cesium.QuadtreeTileLoadState.START) { if (o.data = { lines: [], geometryPrimitive: void 0 }, !(o.level >= n.level_min && o.level < n.level_max && r.item.show)) return void(o .state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0); { t = h.replace("{x}", o.x - s).replace("{y}", o.y - l).replace("{z}", 18); r._cache && (t += "&" + r._core.getuid()); let e = new Cesium.Cesium3DTileset({ url: t, ...u }); e.readyPromise.then(function(e) { function t(e) { Cesium.defined(e) && e.freeResources() } o.freeResources = function() { o.state = 0, o.renderable = !1, o.upsampledFromParent = !1, Cesium.defined(o.data) && Cesium.defined(o.data .freeResources) && o.data.freeResources(), Cesium .defined(this.data) && Cesium.defined(this.data .geometryPrimitive) && 18 <= o._level && (this.data .geometryPrimitive.destroy(), this.data .geometryPrimitive = void 0), t(o._southwestChild), o ._southwestChild = void 0, t(o._southeastChild), o ._southeastChild = void 0, t(o._northwestChild), o ._northwestChild = void 0, t(o._northeastChild), o ._northeastChild = void 0 }, r.probj.push(e), r._viewer.scene.primitives.add(e), o.state = Cesium.QuadtreeTileLoadState.LOADING, o.state === Cesium .QuadtreeTileLoadState.LOADING && (o.data.geometryPrimitive.update( i, []), o.state = Cesium.QuadtreeTileLoadState.DONE, o .renderable = !0) }).otherwise(function(e) { null == o.count && (o.count = 0), o.count += 1, 2 <= o.count ? (o .state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0) : o.state = Cesium.QuadtreeTileLoadState.START }) } o.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new c._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 5 }), this._viewer.scene), a = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(u.id) && (u.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), { id: u.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "modelLayer", item: this, url: t.url, style: n }); return this._Provider.treeID = a.id, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull( i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.VectorGeoJsonFeatureLayer = function(e, t, g, i, o, r) { var n = this._core.VectorSlice(t, this._cesium), n = new v(this._viewer, this._cesium, n), _ = this, n = ((this._Provider = n)._loadTile = function(e) { var t = new _._cesium.PrimitiveCollection, u = new _._cesium.PointPrimitiveCollection, c = new _._cesium.LabelCollection, h = new _._cesium.BillboardCollection, m = [], d = [], p = -1; return e.features.forEach(function(e) { var t, i = []; if (null != g.lable && null == e.geometry.coordinates[0][0] && (o = 0, null != g .lable.height && /^\[/.test(g.lable.height) && /\]$/.test(g.lable .height) && (l = g.lable.height.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[l])), (t = _._core.StyleContrast( "lable", g.lable, _._cesium)).fillColor = _._color .VectorColorTransformation(t.fillColor, e), t.outlineColor = _._color .VectorColorTransformation(t.outlineColor, e), t.backgroundColor = _ ._color.VectorColorTransformation(t.backgroundColor, e), t.text = _ ._core.Analysis(t.text, e), t.position = new _._cesium.Cartesian3 .fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], o), c .add(t)), null != g.billboard && null == e.geometry.coordinates[0][0] && (o = 0, null != (s = g.billboard).height && /^\[/.test(s.height) && /\]$/ .test(s.height) && (l = s.height.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[l])), (r = _._core.StyleContrast( "billboard", s, _._cesium)).position = new _._cesium.Cartesian3 .fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], o), h .add(r)), null != g.point && null == e.geometry.coordinates[0][0] && ( o = 0, null != (s = g.point).height && /^\[/.test(s.height) && /\]$/ .test(s.height) && (l = s.height.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[l])), (r = _._core.StyleContrast( "point", s, _._cesium)).position = new _._cesium.Cartesian3 .fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], o), r .color = _._color.VectorColorTransformation(r.color, e), r .outlineColor = _._color.VectorColorTransformation(r.outlineColor, e), u .add(r)), null != g.polyline) { var o = 0, r = (null != (s = g.polyline).height && /^\[/.test(s.height) && /\]$/ .test(s.height) && (l = s.height.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[l])), _._core.StyleContrast( "polyline", s, _._cesium)); if (p = r.classificationType, delete r.classificationType, Array.isArray(e .geometry.coordinates) && 0 < e.geometry.coordinates.length) if (Array.isArray(e.geometry.coordinates[0][0])) for (var n = 0; n < e.geometry.coordinates.length; n++) { i = _._core.coordinate(i = [], e.geometry.coordinates[n]), r .positions = _._cesium.Cartesian3.fromDegreesArray(i); var a = _._core.createPolyline(r, p, e, _._cesium); m.push(a) } else { i = _._core.coordinate(i, e.geometry.coordinates), r.positions = _._cesium.Cartesian3.fromDegreesArray(i); a = _._core.createPolyline(r, p, e, _._cesium); m.push(a) } } if (null != g.polygon) { var s, l, o = 0; if (null != (s = g.polygon).height && /^\[/.test(s.height) && /\]$/.test(s .height) && (l = s.height.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[l])), (r = _._core.StyleContrast("polygon", s, _._cesium)).material = _._color.VectorColorTransformation(r .material, e), p = r.classificationType, delete r .classificationType, Array.isArray(e.geometry.coordinates) && 0 < e .geometry.coordinates.length) if (Array.isArray(e.geometry.coordinates[0][0])) for (n = 0; n < e.geometry.coordinates.length; n++) { i = [], e.geometry.coordinates[n].pop(), i = _._core.coordinate( i, e.geometry.coordinates[n]), r.polygonHierarchy = new _._cesium.PolygonHierarchy(_._cesium.Cartesian3 .fromDegreesArray(i)); a = _._core.createPolygon(r, p, e, _._cesium); d.push(a) } else { i = _._core.coordinate(i, e.geometry.coordinates), r .polygonHierarchy = new _._cesium.PolygonHierarchy(_._cesium .Cartesian3.fromDegreesArray(i)); a = _._core.createPolygon(r, p, e, _._cesium); d.push(a) } } }), t.add(c), t.add(h), t.add(u), 0 < m.length && (-1 != p ? t.add(new _._cesium .GroundPolylinePrimitive({ geometryInstances: m, classificationType: p, appearance: new _._cesium.PolylineMaterialAppearance })) : t.add(new _._cesium.Primitive({ geometryInstances: m, appearance: new _._cesium.PolylineMaterialAppearance }))), 0 < d.length && (-1 != p ? t.add(new _._cesium.GroundPrimitive({ geometryInstances: d, classificationType: p, appearance: new _._cesium.PerInstanceColorAppearance({ translucent: !0, vertexShaderSource: _._core.Shaders("vertexShaderSource"), fragmentShaderSource: _._core.Shaders( "fragmentShaderSource") }) })) : t.add(new _._cesium.Primitive({ geometryInstances: d, appearance: new _._cesium.PerInstanceColorAppearance({ translucent: !0, vertexShaderSource: _._core.Shaders("vertexShaderSource"), fragmentShaderSource: _._core.Shaders( "fragmentShaderSource") }) }))), t }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this ._core.isnull(g.id) && (g.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + g .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: g.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "Vector", item: this, url: t.url, style: g, treeData: { name: e, geoOptions: t, styleOption: g, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp = function(e, t, i, o, r, n) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, m = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.toString().charAt( 0) && "]" == i.material.toString().charAt(i.material.length - 1) || (this._core.isHtmlColor(i .material) ? i.material = this._color.colorFromHtmlColor(i.material) : (/^rgb/.test(i .material) && (i.material = this._color.rgbaStringToRgbaObj(i.material)), 1 < i .material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i .material.a && (i.material.a = i.material.a / 255), i.material = this._color .createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this ._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, d = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s .urlParams)), a = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider.loadTile = function(e, t) { var u = e, c = t, h = l; if (c.state === Cesium.QuadtreeTileLoadState.START) { if (c.data = { lines: [], geometryPrimitive: void 0 }, !(c.level >= i.level_min && c.level < i.level_max && h.item.show)) return void(c .state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = !0); e = d.replace(window.encodeURIComponent("{x}"), c.x).replace(window.encodeURIComponent( "{y}"), c.y).replace(window.encodeURIComponent("{z}"), c.level); h._cache && (e += "&" + h._core.getuid()), h._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return c.state = Cesium.QuadtreeTileLoadState.DONE, void(c.renderable = !0); var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[ t]) : n.push(e[t]) } function t() { var e, t; /^\[/.test(h._option.extrudedHeight) && /\]$/.test(h._option .extrudedHeight) && (e = h._option.extrudedHeight .replace(/\[/, "").replace(/\]/, ""), m.extrudedHeight = parseFloat(a.properties[e])), m.material = h._option .material, /^\[/.test(h._option.material) && /\]$/.test(h ._option.material) ? (e = h._option.material.replace( /\[/, "").replace(/\]/, ""), m.material = a .properties[e], h._core.isHtmlColor(m.material) ? m .material = h._color.colorFromHtmlColor(m.material) : ( /^rgb/.test(m.material) && (m.material = h._color .rgbaStringToRgbaObj(m.material)), 1 < m .material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material .green = m.material.green / 255), 1 < m.material .blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material .alpha / 255), m.material = h._color .createColor(m.material.red, m.material.green, m .material.blue, m.material.alpha))) : (h._option .material && (m.material = h._option.material), m .material && (h._core.isHtmlColor(m.material) ? m .material = h._color.colorFromHtmlColor(m .material) : (/^rgb/.test(m.material) && (m .material = h._color.rgbaStringToRgbaObj(m .material)), 1 < m.material.red && (m .material.red = m.material.red / 255), 1 < m .material.green && (m.material.green = m .material.green / 255), 1 < m.material .blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material .a = m.material.alpha / 255), m.material = h ._color.createColor(m.material.red, m.material .green, m.material.blue, m.material.alpha))) ), 2 <= n.length && (e = h._cesium.Cartesian3 .fromDegreesArray(n), m.polygonHierarchy = new h._cesium .PolygonHierarchy(e), e = new h._cesium.PolygonGeometry( m), e = new h._cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new h._cesium .ColorGeometryInstanceAttribute .fromColor(m.material) } }), t = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m.material.blue, h.Legend .push(t), i.push(e)) } h.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry .coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++) n = [], a.geometry.coordinates[s].pop(), o(a .geometry.coordinates[s]), t(); else o(a.geometry.coordinates), t() } 0 == i.length && (c.state = Cesium.QuadtreeTileLoadState.DONE, c .renderable = !0); var l = new h._cesium.Primitive({ geometryInstances: i, appearance: new h._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders( "vertexShaderSource"), fragmentShaderSource: h._core.Shaders( "fragmentShaderSource") }), shadows: h._option.shadows }); c.data.geometryPrimitive = l, c.state = Cesium.QuadtreeTileLoadState .LOADING, c.state === Cesium.QuadtreeTileLoadState.LOADING && (c .data.geometryPrimitive.update(u, []), c.state = Cesium .QuadtreeTileLoadState.DONE, c.renderable = !0) }, error: function() { null == c.count && (c.count = 0), c.count += 1, 2 <= c.count ? (c .state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = ! 0) : c.state = Cesium.QuadtreeTileLoadState.START } }), c.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new l._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), s = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), r || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: m.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i, treeData: { name: e, geoOptions: t, styleOption: i, GroupID: o, checked: r, disFnc: n } }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, b.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1ss = function(e, t, l, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, u = (this._core.isnull(l) || this._core.isnull(l.material) || "[" == l.material.toString().charAt( 0) && "]" == l.material.toString().charAt(l.material.length - 1) || (this._core.isHtmlColor(l .material) ? l.material = this._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l .material) && (l.material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l .material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l .material.a && (l.material.a = l.material.a / 255), l.material = this._color .createColor(l.material.r, l.material.g, l.material.b, l.material.a))), this._option = this ._core.extend(n, l, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), m = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, d = this, n = (this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this ._viewer, this._cesium), this._Provider._normalTile = l.level_max - 1, this._Provider .loadTile = function(e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && d.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= l.level_min && t.level < l.level_max && d.item.show) { var o = y.filter(u, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) return t.data .geometryPrimitive = new d._cesium.Primitive({ geometryInstances: o[0].data, appearance: new d._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: d._cesium.ShadowMode.ENABLED }), t.state = d._cesium.QuadtreeTileLoadState.LOADING, void(t.state === d ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && ( t.state = d._cesium.QuadtreeTileLoadState.DONE), t .renderable = !0)); if (0 < d.PrimitiveData.length) for (var r = 0; r < d.PrimitiveData.length; r++) if (d.PrimitiveData[r].key == i) return void(d.Primitivekey.includes(i) || d .Primitivekey.push(i)); if (!d.Primitivekey.includes(i)) { d.Primitivekey.push(i), u.push({ level: t.level, x: t.x, y: t.y, data: void 0 }); for (var o = d._option.level_min + (d._option.level_max - d._option.level_min) / 2, n = ct(t, o), r = 0; r < n.length; r++) { var a = n[r], s = "z" + a.level + "x" + a.x + "y" + a.y; d.loadAllKey.includes(s) || (d.loadAllKey.push(s), function(c) { var e = d._urlTemplate.replace(window.encodeURIComponent("{x}"), c.x).replace(window.encodeURIComponent("{y}"), c.y) .replace(window.encodeURIComponent("{z}"), c.level), h = (d.tilesLength++, d._cache && (e += "&" + d._core .getuid()), "z" + c.level + "x" + c.x + "y" + c.y); d._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array .isArray(e[t]) ? o(e[t]) : s.push(e[ t]) } function t() { var e, t; /^\[/.test(d._option.extrudedHeight) && /\]$/.test(d._option .extrudedHeight) && (e = d._option .extrudedHeight.replace(/\[/, "").replace(/\]/, ""), m .extrudedHeight = parseFloat(l .properties[e])), m .material = d._option.material, /^\[/.test(d._option.material) && /\]$/.test(d._option.material) ? ( e = d._option.material.replace( /\[/, "").replace(/\]/, ""), m.material = l.properties[e], d ._core.isHtmlColor(m.material) ? m.material = d._color .colorFromHtmlColor(m .material) : (/^rgb/.test(m .material) && (m .material = d._color .rgbaStringToRgbaObj(m .material)), 1 < m .material.red && (m.material .red = m.material.red / 255), 1 < m.material .green && (m.material .green = m.material .green / 255), 1 < m .material.blue && (m .material.blue = m .material.blue / 255), 1 < m.material.alpha && (m .material.a = m.material .alpha / 255), m .material = d._color .createColor(m.material.red, m.material.green, m .material.blue, m .material.alpha))) : (d ._option.material && (m .material = d._option .material), m.material && (d ._core.isHtmlColor(m .material) ? m .material = d._color .colorFromHtmlColor(m .material) : (/^rgb/ .test(m.material) && (m .material = d._color .rgbaStringToRgbaObj( m.material)), 1 < m.material.red && (m .material.red = m .material.red / 255 ), 1 < m.material .green && (m.material .green = m.material .green / 255), 1 < m .material.blue && (m .material.blue = m .material.blue / 255 ), 1 < m.material .alpha && (m.material .a = m.material .alpha / 255), m .material = d._color .createColor(m.material .red, m.material .green, m.material .blue, m.material .alpha)))), 2 <= s .length && (e = d._cesium.Cartesian3 .fromDegreesArray(s), m .polygonHierarchy = new d ._cesium.PolygonHierarchy(e), e = new d._cesium .PolygonGeometry(m), e = new d ._cesium.GeometryInstance({ id: l, geometry: e, attributes: { color: new d._cesium .ColorGeometryInstanceAttribute .fromColor(m .material) } }), t = "material:" + 255 * m .material.red + "," + 255 * m .material.green + "," + 255 * m .material.blue, d.Legend.push( t), i.push(e)) } d.Legend = []; for (var r, n, a = 0; a < e.features .length; a++) { var s = [], l = e.features[a]; if (Array.isArray(l.geometry .coordinates) && 0 < l.geometry .coordinates.length) if (Array.isArray(l.geometry .coordinates[0][0])) for (var u = 0; u < l.geometry .coordinates.length; u++) s = [], l.geometry .coordinates[u].pop(), o(l .geometry.coordinates[u] ), t(); else o(l.geometry.coordinates), t() } 0 < i.length && (r = new d._cesium .Primitive({ geometryInstances: i, appearance: new d._cesium .PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: d ._core .Shaders( "vertexShaderSource" ), fragmentShaderSource: d ._core .Shaders( "fragmentShaderSource" ) }), shadows: d._option.shadows }), n = { level: c.level, key: h, data: r }, d.probj.push(r), d.loadFinishKey .push(h), d.PrimitiveData.push(n), d ._viewer.scene.primitives.add(r), d .returnCount++) }, error: function() {}, complete: function(e, t) {} }) }(a)) } } } else t.state = d._cesium.QuadtreeTileLoadState.LOADING, t.state === d._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = d._cesium .QuadtreeTileLoadState.DONE), t.renderable = !0) } }, this._primitive = new d._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), a = (n.primitives.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: m.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: l, treeData: { name: e, geoOptions: t, styleOption: l, GroupID: i, checked: o, disFnc: r } }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, b.prototype.VolumeVectorGeoJsonFeatureLayerGis = function(e, t, a, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = (t.url, t.layer, t.upperLevelLimit, t.lowerLevelLimit, this._cesium.Rectangle.fromDegrees(t .minx, t.miny, t.maxx, t.maxy), this._cesium, this._core.isnull(a) || this._core.isnull(a .material) || "[" == a.material.toString().charAt(0) && "]" == a.material.toString().charAt( a.material.length - 1) || (this._core.isHtmlColor(a.material) ? a.material = this._color .colorFromHtmlColor(a.material) : (/^rgb/.test(a.material) && (a.material = this._color .rgbaStringToRgbaObj(a.material)), 1 < a.material.r && (a.material.r = a.material .r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material .b && (a.material.b = a.material.b / 255), 1 < a.material.a && (a.material.a = a .material.a / 255), a.material = this._color.createColor(a.material.r, a.material.g, a.material.b, a.material.a))), this._option = this._core.extend(n, a, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), l = [], m = { id: t.id, polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, d = this, n = (this._urlTemplate = t.url + "/" + window.encodeURIComponent("{z}") + "/" + window .encodeURIComponent("{x}") + "/" + window.encodeURIComponent("{reverseY}") + ".json", this ._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = a.level_max - 1, this._Provider.loadTile = function(e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && d.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= a.level_min && t.level < a.level_max && d.item.show) { var o = y.filter(s, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) return t.data .geometryPrimitive = new d._cesium.Primitive({ geometryInstances: o[0].data, appearance: new d._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: d._cesium.ShadowMode.ENABLED }), t.state = d._cesium.QuadtreeTileLoadState.LOADING, void(t.state === d ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && ( t.state = d._cesium.QuadtreeTileLoadState.DONE), t .renderable = !0)); if (0 < d.PrimitiveData.length) for (var r = 0; r < d.PrimitiveData.length; r++) if (d.PrimitiveData[r].key == i) return void(d.Primitivekey.includes(i) || d .Primitivekey.push(i)); d.Primitivekey.includes(i) || (d.Primitivekey.push(i), s.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), o = (c = t).tilingScheme.getNumberOfYTilesAtLevel(c.level) - c.y - 1, n = d._urlTemplate.replace(window.encodeURIComponent("{x}"), c.x).replace( window.encodeURIComponent("{reverseY}"), o).replace(window .encodeURIComponent("{z}"), c.level), d.tilesLength++, h = "z" + c .level + "x" + c.x + "y" + c.y, d._cache && (n += "&" + d._core.getuid()), 0 < y.filter(l, function(e) { return e.url == n }).length || (l.push({ url: n }), d._core.xhr({ url: n, type: "get", dataType: "json", success: function(e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[ t]) ? o(e[t]) : n.push(e[t]) } function t() { m.extrudedHeight = parseFloat(d._option .extrudedHeight), /^\[/.test(d._option .extrudedHeight) && /\]$/.test(d._option .extrudedHeight) && (t = d._option .extrudedHeight.replace(/\[/, "").replace( /\]/, ""), m.extrudedHeight = 3 * parseFloat(a.properties[t])), m.material = d ._option.material, /^\[/.test(d._option .material) && /\]$/.test(d._option .material) ? (t = d._option.material.replace( /\[/, "").replace(/\]/, ""), m .material = a.properties[t], d._core .isHtmlColor(m.material) ? m.material = d ._color.colorFromHtmlColor(m.material) : ( /^rgb/.test(m.material) && (m.material = d._color.rgbaStringToRgbaObj(m .material)), 1 < m.material .red && (m.material.red = m.material .red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m .material.blue = m.material.blue / 255), 1 < m.material.alpha && (m .material.a = m.material.alpha / 255 ), m.material = d._color .createColor(m.material.red, m.material .green, m.material.blue, m.material .alpha))) : (d._option.material && ( m.material = d._option.material), m .material && (d._core.isHtmlColor(m .material) ? m.material = d._color .colorFromHtmlColor(m.material) : ( /^rgb/.test(m.material) && (m .material = d._color .rgbaStringToRgbaObj(m.material) ), 1 < m.material.red && (m .material.red = m.material.red / 255), 1 < m.material.green && (m .material.green = m.material .green / 255), 1 < m.material .blue && (m.material.blue = m .material.blue / 255), 1 < m .material.alpha && (m.material.a = m .material.alpha / 255), m .material = d._color.createColor(m .material.red, m.material.green, m.material.blue, m.material .alpha)))); var e, t = d._cesium.Color.WHITE; 2 <= n.length && (e = d._cesium.Cartesian3 .fromDegreesArray(n), m.polygonHierarchy = new d._cesium.PolygonHierarchy(e), e = new d ._cesium.PolygonGeometry(m), e = new d ._cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new d._cesium .ColorGeometryInstanceAttribute .fromColor(t) } }), t = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m .material.blue, d.Legend.push(t), i.push(e)) } d.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a .geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates .length; s++) n = [], a.geometry .coordinates[s].pop(), o(a.geometry .coordinates[s]), t(); else o(a.geometry.coordinates), t() } var l = new d._cesium.Primitive({ geometryInstances: i, appearance: new d._cesium .PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: d._core .Shaders( "vertexShaderSource"), fragmentShaderSource: d._core .Shaders( "fragmentShaderSource") }), shadows: d._option.shadows }), u = (d.probj.push(l), { level: c.level, key: h, data: l }); d.loadFinishKey.push(h), d.PrimitiveData.push(u), d ._viewer.scene.primitives.add(l), d.returnCount++; try { 2 == d.probj.length && (d._viewer.scene.primitives .remove(d.probj[0]), d.probj.pop()) } catch (e) {} }, error: function() { var e = d.Primitivekey.indexOf(h); - 1 < e && d .Primitivekey.splice(e, 1), s = y.remove(s, function(e) { return e.x == c.x && e.y == c.y && e .level == c.level }) }, complete: function(e, t) { c.state = d._cesium.QuadtreeTileLoadState.LOADING, c .state === d._cesium.QuadtreeTileLoadState .LOADING && (c.data.geometryPrimitive && (c.state = d._cesium.QuadtreeTileLoadState.DONE), c .renderable = !0) } }))) } else t.state = d._cesium.QuadtreeTileLoadState.LOADING, t.state === d._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = d._cesium .QuadtreeTileLoadState.DONE), t.renderable = !0) } var c, n, h }, this._primitive = new d._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), n = (n.primitives.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: m.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: a, treeData: { name: e, geoOptions: t, styleOption: a, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.PointVectorGeoJsonFeatureLayerGis = function(e, t, h, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, a = (this._option = this._core.extend(n, h, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), n = { id: t.id, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, arcType: this._cesium.ArcType.GEODESIC }, m = this, n = (this._urlTemplate = t.url + "/{z}/{x}/{reverseY}.json", this._Provider = {}, this._Provider1 = new st(this._viewer, this._cesium, { url: this._urlTemplate }, function(e) { if (m.Level = m.getLevel(), m.Level < m._option.level_min) { if (0 < m.primitve.length) { for (var t = 0; t < m.primitve.length; t++) m._viewer.scene.primitives.remove(m .primitve[t]); m.primitve = [] } if (0 < m.probj.length) { for (t = 0; t < m.probj.length; t++) m._viewer.scene.primitives.remove(m.probj[ t]); m.probj = [] } a = [] } else { var s = new m._cesium.PrimitiveCollection, l = new m._cesium.PointPrimitiveCollection, u = new m._cesium.LabelCollection, c = new m._cesium.BillboardCollection, i = (e.templateValues.z, e.templateValues.x, e.templateValues.reverseY, e .data = { lines: [], geometryPrimitive: void 0 }, e.url.replace("png", "json")); 0 < y.filter(a, function(e) { return e.url == i }).length || 1 != m.start && (a.push({ url: i }), m._core.xhr({ url: i, type: "get", dataType: "json", success: function(e) { if (0 != e.features.length) { m.Legend = []; for (var t = 0; t < e.features.length; t++) { var n = [], a = e.features[t]; if (Array.isArray(a.geometry.coordinates) && 0 < a .geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var i = 0; i < a.geometry.coordinates .length; i++) n = [], a.geometry .coordinates[i].pop(), o(a.geometry .coordinates[i]), r(); else o(a.geometry.coordinates), r() } 0 < u.length && s.add(u), 0 < c.length && s.add(c), 0 < l.length && s.add(l), m.primitve.push(s), m.probj .push(s), m._viewer.scene.primitives.add(s), m .returnCount++; try { 2 == m.probj.length && (m._viewer.scene.primitives .remove(m.probj[0]), m.probj.pop()) } catch (e) {} } function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[t]) : n.push(e[t]) } function r() { var e, t, i, o, r; null != h.lable && (t = 0, null != h.lable.height && /^\[/.test(h.lable.height) && /\]$/.test(h.lable .height) && (o = h.lable.height.replace( /\[/, "").replace(/\]/, ""), t = parseFloat(a.properties[o])), (e = m._core .StyleContrast("lable", h.lable, m._cesium)) .fillColor = m._color.VectorColorTransformation( e.fillColor, a), e.outlineColor = m._color .VectorColorTransformation(e.outlineColor, a), e .backgroundColor = m._color .VectorColorTransformation(e.backgroundColor, a), e.text = m._core.Analysis(e.text, a), e .position = new m._cesium.Cartesian3 .fromDegrees(n[0], n[1], t), u.add(e)), null != h.billboard && (t = 0, null != (i = h.billboard) .height && /^\[/.test(i.height) && /\]$/.test(i .height) && (o = i.height.replace(/\[/, "") .replace(/\]/, ""), t = parseFloat(a .properties[o])), (r = m._core .StyleContrast("billboard", i, m._cesium)) .position = new m._cesium.Cartesian3 .fromDegrees(n[0], n[1], t), c.add(r)), null != h.point && (t = 0, null != (i = h.point).height && /^\[/.test(i.height) && /\]$/.test(i.height) && (o = i.height.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(a.properties[o])), (r = m._core.StyleContrast("point", i, m._cesium) ).position = new m._cesium.Cartesian3 .fromDegrees(n[0], n[1], t), r.color = m._color .VectorColorTransformation(r.color, a), r .outlineColor = m._color .VectorColorTransformation(r.outlineColor, a), l .add(r)) } } })) } }), this.img = this._Provider1.ent, o || this.setVisibility(!1), this._core.isnull(n.id) && (n .id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: h, treeData: { name: e, geoOptions: t, styleOption: h, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.PolylineVectorGeoJsonFeatureLayerGis = function(e, t, c, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, a = (this._option = this._core.extend(n, c, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), n = { id: t.id, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, arcType: this._cesium.ArcType.GEODESIC }, h = this, n = (this._urlTemplate = t.url + "/{z}/{x}/{reverseY}.json", this._Provider = {}, this._Provider1 = new st(this._viewer, this._cesium, { url: this._urlTemplate }, function(e) { if (h.Level = h.getLevel(), h.Level < h._option.level_min) { if (0 < h.primitve.length) { for (var t = 0; t < h.primitve.length; t++) h._viewer.scene.primitives.remove(h .primitve[t]); h.primitve = [] } if (0 < h.probj.length) { for (t = 0; t < h.probj.length; t++) h._viewer.scene.primitives.remove(h.probj[ t]); h.probj = [] } a = [] } else { var u = -1, i = (e.templateValues.z, e.templateValues.x, e.templateValues.reverseY, e .data = { lines: [], geometryPrimitive: void 0 }, e.url.replace("png", "json")); 0 < y.filter(a, function(e) { return e.url == i }).length || 1 != h.start && (a.push({ url: i }), h._core.xhr({ url: i, type: "get", dataType: "json", success: function(e) { if (0 != e.features.length) { var i = []; h.Legend = []; for (var t = 0; t < e.features.length; t++) { var o = [], r = e.features[t]; if (Array.isArray(r.geometry.coordinates) && 0 < r .geometry.coordinates.length) if (Array.isArray(r.geometry.coordinates[0][0])) for (var n = 0; n < r.geometry.coordinates .length; n++) o = [], r.geometry .coordinates[n].pop(), s(r.geometry .coordinates[n]), l(); else s(r.geometry.coordinates), l() } var a = new h._cesium.Primitive({ geometryInstances: i, appearance: new h._cesium .PolylineColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: h._option.shadows, classificationType: u }); h.probj.push(a), h.primitve.push(a), h._viewer.scene .primitives.add(a), h.returnCount++; try { 2 == h.probj.length && (h._viewer.scene.primitives .remove(h.probj[0]), h.probj.pop()) } catch (e) {} } function s(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? s(e[t]) : o.push(e[t]) } function l() { var e = c, t = (null != e.height && /^\[/.test(e.height) && /\]$/.test(e.height) && (t = e.height.replace( /\[/, "").replace(/\]/, ""), parseFloat( r.properties[t])), h._core.StyleContrast( "polyline", e, h._cesium)); u = t.classificationType, delete t.classificationType, t .material = h._option.material, /^\[/.test(h._option .material) && /\]$/.test(h._option.material) ? ( e = h._option.material.replace(/\[/, "") .replace(/\]/, ""), t.material = r.properties[ e], h._core.isHtmlColor(t.material) ? t .material = h._color.colorFromHtmlColor(t .material) : (/^rgb/.test(t.material) && (t .material = h._color .rgbaStringToRgbaObj(t.material)), 1 < t .material.red && (t.material.red = t .material.red / 255), 1 < t.material .green && (t.material.green = t.material .green / 255), 1 < t.material.blue && (t .material.blue = t.material.blue / 255), 1 < t.material.alpha && (t.material.a = t .material.alpha / 255), t.material = h ._color.createColor(t.material.red, t .material.green, t.material.blue, t .material.alpha))) : (h._option .material && (t.material = h._option.material), t.material && (h._core.isHtmlColor(t.material) ? t.material = h._color.colorFromHtmlColor(t .material) : (/^rgb/.test(t.material) && (t.material = h._color .rgbaStringToRgbaObj(t.material)), 1 < t.material.red && (t.material.red = t.material.red / 255), 1 < t .material.green && (t.material.green = t .material.green / 255), 1 < t .material.blue && (t.material.blue = t .material.blue / 255), 1 < t .material.alpha && (t.material.a = t .material.alpha / 255), t.material = h._color.createColor(t.material.red, t .material.green, t.material.blue, t .material.alpha)))), 2 <= o .length && (t.positions = h._cesium.Cartesian3 .fromDegreesArray(o), e = new h._cesium .GeometryInstance({ id: r, geometry: new h._cesium .PolylineGeometry(t), attributes: { color: new h._cesium .ColorGeometryInstanceAttribute .fromColor(t.material) } }), t = "material:" + 255 * t.material.red + "," + 255 * t.material.green + "," + 255 * t .material.blue, h.Legend.push(t), i.push(e)) } } })) } }), this.img = this._Provider1.ent, o || this.setVisibility(!1), this._core.isnull(n.id) && (n .id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: c, treeData: { name: e, geoOptions: t, styleOption: c, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.VolumeVectorGeoJsonFeatureLayerGisOptimization = function(e, t, i, o, r, n) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = (t.url, t.layer, t.upperLevelLimit, t.lowerLevelLimit, this._cesium.Rectangle.fromDegrees(t .minx, t.miny, t.maxx, t.maxy), this._cesium, this._core.isnull(i) || this._core.isnull(i .material) || "[" == i.material.toString().charAt(0) && "]" == i.material.toString().charAt( i.material.length - 1) || (this._core.isHtmlColor(i.material) ? i.material = this._color .colorFromHtmlColor(i.material) : (/^rgb/.test(i.material) && (i.material = this._color .rgbaStringToRgbaObj(i.material)), 1 < i.material.r && (i.material.r = i.material .r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material .b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i .material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), u = { id: t.id, polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, c = this, a = (this._urlTemplate = t.url + "/{z}/{x}/{reverseY}.json", this._Provider = {}, this._Provider1 = new st(this._viewer, this._cesium, { url: this._urlTemplate }, function(e) { if (c.Level = c.getLevel(), c.Level < c._option.level_min) { if (0 < c.primitve.length) { for (var t = 0; t < c.primitve.length; t++) c._viewer.scene.primitives.remove(c .primitve[t]); c.primitve = [] } if (0 < c.probj.length) { for (t = 0; t < c.probj.length; t++) c._viewer.scene.primitives.remove(c.probj[ t]); c.probj = [] } s = [] } else { e.templateValues.z, e.templateValues.x, e.templateValues.reverseY, e.data = { lines: [], geometryPrimitive: void 0 }; var i = e.url.replace("png", "json"); 0 < y.filter(s, function(e) { return e.url == i }).length || 1 != c.start && (s.push({ url: i }), c._core.xhr({ url: i, type: "get", dataType: "json", success: function(e) { if (0 != e.features.length) { var t = []; c.Legend = []; for (var i = 0; i < e.features.length; i++) { var o = [], r = e.features[i]; if (Array.isArray(r.geometry.coordinates) && 0 < r .geometry.coordinates.length) if (Array.isArray(r.geometry.coordinates[0][0])) for (var n = 0; n < r.geometry.coordinates .length; n++) o = [], r.geometry .coordinates[n].pop(), s(r.geometry .coordinates[n]), l(); else s(r.geometry.coordinates), l() } var a = new c._cesium.Primitive({ geometryInstances: t, appearance: new c._cesium .PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: c._core .Shaders( "vertexShaderSource"), fragmentShaderSource: c._core .Shaders( "fragmentShaderSource") }), shadows: c._option.shadows }); c.primitve.push(a), c.probj.push(a), c._viewer.scene .primitives.add(a), c.returnCount++; try { 2 == c.probj.length && (c._viewer.scene.primitives .remove(c.probj[0]), c.probj.pop()) } catch (e) {} } function s(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? s(e[t]) : o.push(e[t]) } function l() { var e; u.extrudedHeight = c._option.extrudedHeight, /^\[/.test( c._option.extrudedHeight) && /\]$/.test(c ._option.extrudedHeight) && (e = c._option .extrudedHeight.replace(/\[/, "").replace(/\]/, ""), u.extrudedHeight = 3 * parseFloat(r .properties[e])), u.material = c._option .material, /^\[/.test(c._option.material) && /\]$/ .test(c._option.material) ? (e = c._option.material .replace(/\[/, "").replace(/\]/, ""), u .material = r.properties[e], c._core .isHtmlColor(u.material) ? u.material = c._color .colorFromHtmlColor(u.material) : (/^rgb/.test(u .material) && (u.material = c._color .rgbaStringToRgbaObj(u.material)), 1 < u .material.red && (u.material.red = u .material.red / 255), 1 < u.material .green && (u.material.green = u.material .green / 255), 1 < u.material.blue && (u .material.blue = u.material.blue / 255), 1 < u.material.alpha && (u.material.a = u .material.alpha / 255), u.material = c ._color.createColor(u.material.red, u .material.green, u.material.blue, u .material.alpha))) : (c._option .material && (u.material = c._option.material), u.material && (c._core.isHtmlColor(u.material) ? u.material = c._color.colorFromHtmlColor(u .material) : (/^rgb/.test(u.material) && (u.material = c._color .rgbaStringToRgbaObj(u.material)), 1 < u.material.red && (u.material.red = u.material.red / 255), 1 < u .material.green && (u.material.green = u .material.green / 255), 1 < u .material.blue && (u.material.blue = u .material.blue / 255), 1 < u .material.alpha && (u.material.a = u .material.alpha / 255), u.material = c._color.createColor(u.material.red, u .material.green, u.material.blue, u .material.alpha)))), 2 <= o .length && (e = c._cesium.Cartesian3 .fromDegreesArray(o), u.polygonHierarchy = new c ._cesium.PolygonHierarchy(e), e = new c._cesium .PolygonGeometry(u), e = new c._cesium .GeometryInstance({ id: r, geometry: e, attributes: { color: new c._cesium .ColorGeometryInstanceAttribute .fromColor(u.material) } }), u.material.red, u.material.green, u.material .blue, t.push(e)) } } })) } }), this.img = this._Provider1.ent, r || this.setVisibility(!1), this._core.isnull(u.id) && (u .id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: u.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i, treeData: { name: e, geoOptions: t, styleOption: i, GroupID: o, checked: r, disFnc: n } }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, b.prototype.VolumeVectorGeoJsonFeatureLayerClassOptimization = function(e, t, m, i, o, r) { var n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 999999, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, shadows: this._cesium.ShadowMode.ENABLED, show: !0 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, d = (this._core.isnull(m) || this._core.isnull(m.material) || "[" == m.material.toString().charAt( 0) && "]" == m.material.toString().charAt(m.material.length - 1) || (this._core.isHtmlColor(m .material) ? m.material = this._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m .material) && (m.material = this._color.rgbaStringToRgbaObj(m.material)), 1 < m .material.r && (m.material.r = m.material.r / 255), 1 < m.material.g && (m.material.g = m.material.g / 255), 1 < m.material.b && (m.material.b = m.material.b / 255), 1 < m .material.a && (m.material.a = m.material.a / 255), m.material = this._color .createColor(m.material.r, m.material.g, m.material.b, m.material.a))), this._core.extend(n, m, !0)), s = (null == t && console.log("geoOptions is required"), null == e && console.log( "layername is required"), []), p = this, n = (this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this ._viewer, this._cesium), this._Provider._normalTile = m.level_max - 1, this._Provider .loadTile = function(e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && p.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= m.level_min && t.level < m.level_max && p.item.show) { var o = y.filter(s, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) return t.data .geometryPrimitive = new p._cesium.Primitive({ geometryInstances: o[0].data, appearance: new p._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: p._cesium.ShadowMode.ENABLED }), t.state = p._cesium.QuadtreeTileLoadState.LOADING, void(t.state === p ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && ( t.state = p._cesium.QuadtreeTileLoadState.DONE), t .renderable = !0)); if (0 < p.PrimitiveData.length) for (var r = 0; r < p.PrimitiveData.length; r++) if (p.PrimitiveData[r].key == i) return void p.Primitivekey.push(i); p.Primitivekey.includes(i) || (p.Primitivekey.push(i), s.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), h = t, o = p._urlTemplate.replace(window.encodeURIComponent("{x}"), h.x) .replace(window.encodeURIComponent("{y}"), h.y).replace(window .encodeURIComponent("{z}"), h.level), p.tilesLength++, p._cache && (o += "&" + p._core.getuid()), p._core.xhr({ url: o, type: "get", dataType: "json", success: function(e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[t]) : (n.push(e[t]), 2 !== t || a || (a = !0)) } function t() { var e = a ? p._cesium.Cartesian3 .fromDegreesArrayHeights(n) : p._cesium.Cartesian3 .fromDegreesArray(n), t = (/^\[/.test(m.extrudedHeight) && /\]$/.test(m .extrudedHeight) && (t = m.extrudedHeight .replace(/\[/, "").replace(/\]/, ""), d .extrudedHeight = parseFloat(s.properties[ t])), d.extrudedHeight = parseFloat(d .extrudedHeight), 1 == d.heightReference && delete d.height, 1 == d .extrudedHeightReference && delete d .extrudedHeight, /^\[/.test(m.material) && /\]$/ .test(m.material) && (t = m.material.replace( /\[/, "").replace(/\]/, ""), d .material = s.properties[t], p._core .isHtmlColor(d.material) ? d.material = p ._color.colorFromHtmlColor(d.material) : ( /^rgb/.test(d.material) && (d.material = p._color.rgbaStringToRgbaObj(d .material)), 1 < d.material.r && (d.material.r = d.material.r / 255), 1 < d.material.g && (d.material.g = d .material.g / 255), 1 < d.material .b && (d.material.b = d.material.b / 255), 1 < d.material.a && (d .material.a = d.material.a / 255), d .material = p._color.createColor(d .material.r, d.material.g, d .material.b, d.material.a))), d .polygonHierarchy = new p._cesium .PolygonHierarchy(e), new p._cesium .PolygonGeometry(d)), e = (s.treeID = d.id, s.VectorType = "polygon", s .VectorStyle = { haveZ: a, extrudedHeight: d.extrudedHeight, positions: n, material: d.material }, new p._cesium.GeometryInstance({ id: s, geometry: t, attributes: { color: new p._cesium .ColorGeometryInstanceAttribute .fromColor(d.material) } })), t = "material:" + 255 * d.material.red + "," + 255 * d.material.green + "," + 255 * d.material.blue; p.Legend.push(t), i.push(e) } p.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = !1, s = e.features[r]; if (Array.isArray(s.geometry.coordinates) && 0 < s .geometry.coordinates.length) if (Array.isArray(s.geometry.coordinates[0][0])) for (var l = 0; l < s.geometry.coordinates .length; l++) n = [], s.geometry .coordinates[l].pop(), o(s.geometry .coordinates[l]), t(); else o(s.geometry.coordinates), t() } var u = new p._cesium.ClassificationPrimitive({ geometryInstances: i, appearance: new p._cesium .PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: p._core.Shaders( "vertexShaderSource"), fragmentShaderSource: p._core .Shaders("fragmentShaderSource") }), classificationType: d.classificationType, shadows: p._cesium.ShadowMode.ENABLED }), c = (p.PrimitiveObj.data = u, p.PrimitiveObj.key = p .Primitivekey[p.returnCount], { level: h.level, key: p.Primitivekey[p.returnCount], data: u }); p.loadFinishKey.push(p.Primitivekey[p.returnCount]), p .PrimitiveData.push(c), p._viewer.scene.primitives.add( u), p.returnCount++, p.returnCount >= p .tilesLength && (p.returnCount = 0, p.tilesLength = 0, p .Primitivekey = []) }, error: function() { s = y.remove(s, function(e) { return e.x == h.x && e.y == h.y && e.level == h .level }) }, complete: function(e, t) { h.state = p._cesium.QuadtreeTileLoadState.LOADING, h .state === p._cesium.QuadtreeTileLoadState.LOADING && (h .data.geometryPrimitive && (h.state = p._cesium .QuadtreeTileLoadState.DONE), h.renderable = !0) } })) } else t.state = p._cesium.QuadtreeTileLoadState.LOADING, t.state === p._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = p._cesium .QuadtreeTileLoadState.DONE), t.renderable = !0) } var h }, this._primitive = new p._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), a = n.primitives, a = (m && m.time && (this._Provider._availability = new p._cesium.TimeIntervalCollection([new p ._cesium.TimeInterval({ start: m.time.start ? p._cesium.JulianDate.fromDate(new Date(m.time .start)) : p._cesium.Iso8601.MINIMUM_VALUE, stop: m.time.end ? p._cesium.JulianDate.fromDate(new Date(m.time.end)) : p ._cesium.Iso8601.MAXIMUM_VALUE }) ]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), a.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(d.id) && (d.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + d.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: d.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: m, treeData: { name: e, geoOptions: t, styleOption: m, GroupID: i, checked: o, disFnc: r } }); return this._Provider.treeID = d.id, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull( i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization2 = function(e, t, i, o, r, n) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, h = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.toString().charAt( 0) && "]" == i.material.toString().charAt(i.material.length - 1) || (this._core.isHtmlColor(i .material) ? i.material = this._color.colorFromHtmlColor(i.material) : (/^rgb/.test(i .material) && (i.material = this._color.rgbaStringToRgbaObj(i.material)), 1 < i .material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i .material.a && (i.material.a = i.material.a / 255), i.material = this._color .createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this ._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), m = this, d = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s .urlParams)), a = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider.loadTile = function(e, t) { var l = e, u = t, c = m; if (u.state === Cesium.QuadtreeTileLoadState.START) { if (u.data = { lines: [], geometryPrimitive: void 0 }, !(u.level >= i.level_min && u.level < i.level_max && c.item.show)) return void(u .state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0); e = d.replace(window.encodeURIComponent("{x}"), u.x).replace(window.encodeURIComponent( "{y}"), u.y).replace(window.encodeURIComponent("{z}"), u.level); c._cache && (e += "&" + c._core.getuid()), c._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return u.state = Cesium.QuadtreeTileLoadState.DONE, void(u.renderable = !0); var i = new c._cesium.PrimitiveCollection; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[ t]) : n.push(e[t]) } function t() { var e, t; c._option.extrudedHeight && (h.extrudedHeight = c._option .extrudedHeight), /^\[/.test(c._option .extrudedHeight) && /\]$/.test(c._option.extrudedHeight) && (e = c._option.extrudedHeight.replace(/\[/, "").replace( /\]/, ""), h.extrudedHeight = parseFloat(a .properties[e])), h.material = c._option.material, /^\[/ .test(c._option.material) && /\]$/.test(c._option .material) ? (e = c._option.material.replace(/\[/, "") .replace(/\]/, ""), h.material = a.properties[e], c ._core.isHtmlColor(h.material) ? h.material = c._color .colorFromHtmlColor(h.material) : (/^rgb/.test(h .material) && (h.material = c._color .rgbaStringToRgbaObj(h.material)), 1 < h .material.red && (h.material.red = h.material.red / 255), 1 < h.material.green && (h.material .green = h.material.green / 255), 1 < h.material .blue && (h.material.blue = h.material.blue / 255), 1 < h.material.alpha && (h.material.a = h.material .alpha / 255), h.material = c._color .createColor(h.material.red, h.material.green, h .material.blue, h.material.alpha))) : (c._option .material && (h.material = c._option.material), h .material && (c._core.isHtmlColor(h.material) ? h .material = c._color.colorFromHtmlColor(h .material) : (/^rgb/.test(h.material) && (h .material = c._color.rgbaStringToRgbaObj(h .material)), 1 < h.material.red && (h .material.red = h.material.red / 255), 1 < h .material.green && (h.material.green = h .material.green / 255), 1 < h.material .blue && (h.material.blue = h.material.blue / 255), 1 < h.material.alpha && (h.material .a = h.material.alpha / 255), h.material = c ._color.createColor(h.material.red, h.material .green, h.material.blue, h.material.alpha))) ), 2 <= n.length && (e = c._cesium.Cartesian3 .fromDegreesArray(n), h.polygonHierarchy = new c._cesium .PolygonHierarchy(e), e = new c._cesium.PolygonGeometry( h), e = new c._cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new c._cesium .ColorGeometryInstanceAttribute .fromColor(h.material) } }), e = new c._cesium.ClassificationPrimitive({ geometryInstances: e, appearance: new c._cesium .PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: c._core.Shaders( "vertexShaderSource"), fragmentShaderSource: c._core .Shaders("fragmentShaderSource") }), classificationType: c._option.classificationType }), t = "material:" + 255 * h.material.red + "," + 255 * h.material.green + "," + 255 * h.material.blue, c.Legend .push(t), i.add(e)) } c.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry .coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++) n = [], a.geometry.coordinates[s].pop(), o(a .geometry.coordinates[s]), t(); else o(a.geometry.coordinates), t() } u.data.geometryPrimitive = i, u.state = Cesium.QuadtreeTileLoadState .LOADING, u.state === Cesium.QuadtreeTileLoadState.LOADING && (u .data.geometryPrimitive.update(l, []), u.state = Cesium .QuadtreeTileLoadState.DONE, u.renderable = !0) }, error: function() { null == u.count && (u.count = 0), u.count += 1, 2 <= u.count ? (u .state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = ! 0) : u.state = Cesium.QuadtreeTileLoadState.START } }), u.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new m._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), s = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), r || this.setVisibility(!1), this._core.isnull(h.id) && (h.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: h.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i, treeData: { name: e, geoOptions: t, styleOption: i, GroupID: o, checked: r, disFnc: n } }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, b.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization3 = function(e, t, i, o, r, n) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, m = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.toString().charAt( 0) && "]" == i.material.toString().charAt(i.material.length - 1) || (this._core.isHtmlColor(i .material) ? i.material = this._color.colorFromHtmlColor(i.material) : (/^rgb/.test(i .material) && (i.material = this._color.rgbaStringToRgbaObj(i.material)), 1 < i .material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i .material.a && (i.material.a = i.material.a / 255), i.material = this._color .createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this ._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, d = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s .urlParams)), a = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider.loadTile = function(e, t) { var u = e, c = t, h = l; if (c.state === Cesium.QuadtreeTileLoadState.START) { if (c.data = { lines: [], geometryPrimitive: void 0 }, !(c.level >= i.level_min && c.level < i.level_max && h.item.show)) return void(c .state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = !0); e = d.replace(window.encodeURIComponent("{x}"), c.x).replace(window.encodeURIComponent( "{y}"), c.y).replace(window.encodeURIComponent("{z}"), c.level); h._cache && (e += "&" + h._core.getuid()), h._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return c.state = Cesium.QuadtreeTileLoadState.DONE, void(c.renderable = !0); new h._cesium.PrimitiveCollection, h.Legend = []; var t = []; function i(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? i(e[ t]) : n.push(e[t]) } function o() { var e; h._option.extrudedHeight && (m.extrudedHeight = h._option .extrudedHeight), /^\[/.test(h._option .extrudedHeight) && /\]$/.test(h._option.extrudedHeight) && (e = h._option.extrudedHeight.replace(/\[/, "").replace( /\]/, ""), m.extrudedHeight = parseFloat(a .properties[e])), m.material = h._option.material, /^\[/ .test(h._option.material) && /\]$/.test(h._option .material) ? (e = h._option.material.replace(/\[/, "") .replace(/\]/, ""), m.material = a.properties[e], h ._core.isHtmlColor(m.material) ? m.material = h._color .colorFromHtmlColor(m.material) : (/^rgb/.test(m .material) && (m.material = h._color .rgbaStringToRgbaObj(m.material)), 1 < m .material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material .green = m.material.green / 255), 1 < m.material .blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material .alpha / 255), m.material = h._color .createColor(m.material.red, m.material.green, m .material.blue, m.material.alpha))) : (h._option .material && (m.material = h._option.material), m .material && (h._core.isHtmlColor(m.material) ? m .material = h._color.colorFromHtmlColor(m .material) : (/^rgb/.test(m.material) && (m .material = h._color.rgbaStringToRgbaObj(m .material)), 1 < m.material.red && (m .material.red = m.material.red / 255), 1 < m .material.green && (m.material.green = m .material.green / 255), 1 < m.material .blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material .a = m.material.alpha / 255), m.material = h ._color.createColor(m.material.red, m.material .green, m.material.blue, m.material.alpha))) ), 2 <= n.length && (e = h._cesium.Cartesian3 .fromDegreesArray(n), m.polygonHierarchy = new h._cesium .PolygonHierarchy(e), e = new h._cesium.PolygonGeometry( m), e = new h._cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new h._cesium .ColorGeometryInstanceAttribute .fromColor(m.material) } }), t.push(e)) } for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry .coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++) n = [], a.geometry.coordinates[s].pop(), i(a .geometry.coordinates[s]), o(); else i(a.geometry.coordinates), o() } var l = new h._cesium.ClassificationPrimitive1({ geometryInstances: t, appearance: new h._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders( "vertexShaderSource"), fragmentShaderSource: h._core.Shaders( "fragmentShaderSource") }), classificationType: h._option.classificationType }); c.data.geometryPrimitive = l, c.state = Cesium.QuadtreeTileLoadState .LOADING, c.state === Cesium.QuadtreeTileLoadState.LOADING && (c .data.geometryPrimitive.update(u, []), c.state = Cesium .QuadtreeTileLoadState.DONE, c.renderable = !0) }, error: function() { null == c.count && (c.count = 0), c.count += 1, 2 <= c.count ? (c .state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = ! 0) : c.state = Cesium.QuadtreeTileLoadState.START } }), c.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new l._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), s = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), r || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: m.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i, treeData: { name: e, geoOptions: t, styleOption: i, GroupID: o, checked: r, disFnc: n } }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, b.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization = function(e, t, n, i, o, r) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = (this._core.isnull(n) || this._core.isnull(n.material) || "[" == n.material.toString().charAt( 0) && "]" == n.material.toString().charAt(n.material.length - 1) || (this._core.isHtmlColor(n .material) ? n.material = this._color.colorFromHtmlColor(n.material) : (/^rgb/.test(n .material) && (n.material = this._color.rgbaStringToRgbaObj(n.material)), 1 < n .material.r && (n.material.r = n.material.r / 255), 1 < n.material.g && (n.material.g = n.material.g / 255), 1 < n.material.b && (n.material.b = n.material.b / 255), 1 < n .material.a && (n.material.a = n.material.a / 255), n.material = this._color .createColor(n.material.r, n.material.g, n.material.b, n.material.a))), this._option = this ._core.extend(a, n, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), m = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, d = this, a = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), this._Provider = new T(this ._viewer, this._cesium), this._Provider._normalTile = n.level_max - 1, this._Provider .loadTile = function(e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && d.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= n.level_min && t.level < n.level_max && d.item.show) { var o = y.filter(l, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) return t.data .geometryPrimitive = new d._cesium.Primitive({ geometryInstances: o[0].data, appearance: new d._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: d._cesium.ShadowMode.ENABLED }), t.state = d._cesium.QuadtreeTileLoadState.LOADING, void(t.state === d ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && ( t.state = d._cesium.QuadtreeTileLoadState.DONE), t .renderable = !0)); if (0 < d.PrimitiveData.length) for (var r = 0; r < d.PrimitiveData.length; r++) if (d.PrimitiveData[r].key == i) return void(d.Primitivekey.includes(i) || d .Primitivekey.push(i)); d.Primitivekey.includes(i) || (d.Primitivekey.push(i), l.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), c = t, o = d._urlTemplate.replace(window.encodeURIComponent("{x}"), c.x) .replace(window.encodeURIComponent("{y}"), c.y).replace(window .encodeURIComponent("{z}"), c.level), d.tilesLength++, h = "z" + c .level + "x" + c.x + "y" + c.y, d._cache && (o += "&" + d._core.getuid()), d ._core.xhr({ url: o, type: "get", dataType: "json", success: function(e) { var i = new d._cesium.PrimitiveCollection; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[t]) : n.push(e[t]) } function t() { var e, t; d._option.extrudedHeight && (m.extrudedHeight = d ._option.extrudedHeight), /^\[/.test(d._option .extrudedHeight) && /\]$/.test(d._option .extrudedHeight) && (e = d._option .extrudedHeight.replace(/\[/, "").replace(/\]/, ""), m.extrudedHeight = parseFloat(a .properties[e])), m.material = d._option .material, /^\[/.test(d._option.material) && /\]$/ .test(d._option.material) ? (e = d._option.material .replace(/\[/, "").replace(/\]/, ""), m .material = a.properties[e], d._core .isHtmlColor(m.material) ? m.material = d._color .colorFromHtmlColor(m.material) : (/^rgb/.test(m .material) && (m.material = d._color .rgbaStringToRgbaObj(m.material)), 1 < m .material.red && (m.material.red = m .material.red / 255), 1 < m.material .green && (m.material.green = m.material .green / 255), 1 < m.material.blue && (m .material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m .material.alpha / 255), m.material = d ._color.createColor(m.material.red, m .material.green, m.material.blue, m .material.alpha))) : (d._option .material && (m.material = d._option.material), m.material && (d._core.isHtmlColor(m.material) ? m.material = d._color.colorFromHtmlColor(m .material) : (/^rgb/.test(m.material) && (m.material = d._color .rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m .material.green && (m.material.green = m .material.green / 255), 1 < m .material.blue && (m.material.blue = m .material.blue / 255), 1 < m .material.alpha && (m.material.a = m .material.alpha / 255), m.material = d._color.createColor(m.material.red, m .material.green, m.material.blue, m .material.alpha)))), 2 <= n .length && (e = d._cesium.Cartesian3 .fromDegreesArray(n), m.polygonHierarchy = new d ._cesium.PolygonHierarchy(e), e = new d._cesium .PolygonGeometry(m), e = new d._cesium .GeometryInstance({ id: a, geometry: e, attributes: { color: new d._cesium .ColorGeometryInstanceAttribute .fromColor(m.material) } }), e = new d._cesium.ClassificationPrimitive({ geometryInstances: e, appearance: new d._cesium .PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: d._core .Shaders( "vertexShaderSource" ), fragmentShaderSource: d ._core.Shaders( "fragmentShaderSource" ) }), classificationType: d._option .classificationType }), t = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m .material.blue, d.Legend.push(t), i.add(e)) } d.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a .geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates .length; s++) n = [], a.geometry .coordinates[s].pop(), o(a.geometry .coordinates[s]), t(); else o(a.geometry.coordinates), t() } var l = i, u = (d.probj.push(l), { level: c.level, key: h, data: l }); d.loadFinishKey.push(h), d.PrimitiveData.push(u), d._viewer .scene.primitives.add(l), d.returnCount++, d .removeObsoletePrimitives(c) }, error: function() { var e = d.Primitivekey.indexOf(h); - 1 < e && d.Primitivekey .splice(e, 1), l = y.remove(l, function(e) { return e.x == c.x && e.y == c.y && e.level == c .level }) }, complete: function(e, t) { c.state = d._cesium.QuadtreeTileLoadState.LOADING, c .state === d._cesium.QuadtreeTileLoadState.LOADING && (c .data.geometryPrimitive && (c.state = d._cesium .QuadtreeTileLoadState.DONE), c.renderable = !0) } })) } else t.state = d._cesium.QuadtreeTileLoadState.LOADING, t.state === d._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = d._cesium .QuadtreeTileLoadState.DONE), t.renderable = !0) } var c, h }, this._primitive = new d._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), s = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: m.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: n, treeData: { name: e, geoOptions: t, styleOption: n, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization1 = function(e, t, l, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, u = (this._core.isnull(l) || this._core.isnull(l.material) || "[" == l.material.toString().charAt( 0) && "]" == l.material.toString().charAt(l.material.length - 1) || (this._core.isHtmlColor(l .material) ? l.material = this._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l .material) && (l.material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l .material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l .material.a && (l.material.a = l.material.a / 255), l.material = this._color .createColor(l.material.r, l.material.g, l.material.b, l.material.a))), this._option = this ._core.extend(n, l, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), m = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, d = this, n = (this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this ._viewer, this._cesium), this._Provider._normalTile = l.level_max - 1, this._Provider .loadTile = function(e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && d.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= l.level_min && t.level < l.level_max && d.item.show) { var o = y.filter(u, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) return t.data .geometryPrimitive = new d._cesium.Primitive({ geometryInstances: o[0].data, appearance: new d._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: d._cesium.ShadowMode.ENABLED }), t.state = d._cesium.QuadtreeTileLoadState.LOADING, void(t.state === d ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && ( t.state = d._cesium.QuadtreeTileLoadState.DONE), t .renderable = !0)); if (0 < d.PrimitiveData.length) for (var r = 0; r < d.PrimitiveData.length; r++) if (d.PrimitiveData[r].key == i) return void(d.Primitivekey.includes(i) || d .Primitivekey.push(i)); if (!d.Primitivekey.includes(i)) { d.Primitivekey.push(i), u.push({ level: t.level, x: t.x, y: t.y, data: void 0 }); for (var o = d._option.level_min + Math.floor((d._option.level_max - d._option .level_min) / 2), n = ct(t, o), r = 0; r < n.length; r++) { var a = n[r], s = "z" + a.level + "x" + a.x + "y" + a.y; d.loadAllKey.includes(s) || (d.loadAllKey.push(s), function(c) { var e = d._urlTemplate.replace(window.encodeURIComponent("{x}"), c.x).replace(window.encodeURIComponent("{y}"), c.y) .replace(window.encodeURIComponent("{z}"), c.level), h = (d.tilesLength++, "z" + c.level + "x" + c.x + "y" + c .y); d._cache && (e += "&" + d._core.getuid()), d._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array .isArray(e[t]) ? o(e[t]) : s.push(e[ t]) } function t() { var e, t; d._option.extrudedHeight && (m .extrudedHeight = d._option .extrudedHeight), /^\[/.test(d ._option.extrudedHeight) && /\]$/.test(d._option .extrudedHeight) && (e = d._option .extrudedHeight.replace(/\[/, "").replace(/\]/, ""), m .extrudedHeight = parseFloat(l .properties[e])), m .material = d._option.material, /^\[/.test(d._option.material) && /\]$/.test(d._option.material) ? ( e = d._option.material.replace( /\[/, "").replace(/\]/, ""), m.material = l.properties[e], d ._core.isHtmlColor(m.material) ? m.material = d._color .colorFromHtmlColor(m .material) : (/^rgb/.test(m .material) && (m .material = d._color .rgbaStringToRgbaObj(m .material)), 1 < m .material.red && (m.material .red = m.material.red / 255), 1 < m.material .green && (m.material .green = m.material .green / 255), 1 < m .material.blue && (m .material.blue = m .material.blue / 255), 1 < m.material.alpha && (m .material.a = m.material .alpha / 255), m .material = d._color .createColor(m.material.red, m.material.green, m .material.blue, m .material.alpha))) : (d ._option.material && (m .material = d._option .material), m.material && (d ._core.isHtmlColor(m .material) ? m .material = d._color .colorFromHtmlColor(m .material) : (/^rgb/ .test(m.material) && (m .material = d._color .rgbaStringToRgbaObj( m.material)), 1 < m.material.red && (m .material.red = m .material.red / 255 ), 1 < m.material .green && (m.material .green = m.material .green / 255), 1 < m .material.blue && (m .material.blue = m .material.blue / 255 ), 1 < m.material .alpha && (m.material .a = m.material .alpha / 255), m .material = d._color .createColor(m.material .red, m.material .green, m.material .blue, m.material .alpha)))), 2 <= s .length && (e = d._cesium.Cartesian3 .fromDegreesArray(s), m .polygonHierarchy = new d ._cesium.PolygonHierarchy(e), e = new d._cesium .PolygonGeometry(m), e = new d ._cesium.GeometryInstance({ id: l, geometry: e, attributes: { color: new d._cesium .ColorGeometryInstanceAttribute .fromColor(m .material) } }), t = "material:" + 255 * m .material.red + "," + 255 * m .material.green + "," + 255 * m .material.blue, d.Legend.push( t), i.push(e)) } d.Legend = []; for (var r, n, a = 0; a < e.features .length; a++) { var s = [], l = e.features[a]; if (Array.isArray(l.geometry .coordinates) && 0 < l.geometry .coordinates.length) if (Array.isArray(l.geometry .coordinates[0][0])) for (var u = 0; u < l.geometry .coordinates.length; u++) s = [], l.geometry .coordinates[u].pop(), o(l .geometry.coordinates[u] ), t(); else o(l.geometry.coordinates), t() } 0 < i.length && (r = new d._cesium .GroundPrimitive({ geometryInstances: i, appearance: new d._cesium .PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: d ._core .Shaders( "vertexShaderSource" ), fragmentShaderSource: d ._core .Shaders( "fragmentShaderSource" ) }), classificationType: d ._option .classificationType, show: d.item.show }), d.probj.push(r), n = { level: c.level, key: h, data: r }, d.loadFinishKey.push(h), d .PrimitiveData.push(n), d._viewer .scene.primitives.add(r), d .returnCount++) }, error: function() {}, complete: function(e, t) {} }) }(a)) } } } else t.state = d._cesium.QuadtreeTileLoadState.LOADING, t.state === d._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = d._cesium .QuadtreeTileLoadState.DONE), t.renderable = !0) } }, this._primitive = new d._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), a = (n.primitives.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: m.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: l, treeData: { name: e, geoOptions: t, styleOption: l, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization2 = function(e, t, i, o, r, n) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, m = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.toString().charAt( 0) && "]" == i.material.toString().charAt(i.material.length - 1) || (this._core.isHtmlColor(i .material) ? i.material = this._color.colorFromHtmlColor(i.material) : (/^rgb/.test(i .material) && (i.material = this._color.rgbaStringToRgbaObj(i.material)), 1 < i .material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i .material.a && (i.material.a = i.material.a / 255), i.material = this._color .createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this ._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, d = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s .urlParams)), a = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider.loadTile = function(e, t) { var u = e, c = t, h = l; if (c.state === Cesium.QuadtreeTileLoadState.START) { if (c.data = { lines: [], geometryPrimitive: void 0 }, !(c.level >= i.level_min && c.level < i.level_max && h.item.show)) return void(c .state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = !0); e = d.replace(window.encodeURIComponent("{x}"), c.x).replace(window.encodeURIComponent( "{y}"), c.y).replace(window.encodeURIComponent("{z}"), c.level); h._cache && (e += "&" + h._core.getuid()), h._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return c.state = Cesium.QuadtreeTileLoadState.DONE, void(c.renderable = !0); var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[ t]) : n.push(e[t]) } function t() { var e, t; h._option.extrudedHeight && (m.extrudedHeight = h._option .extrudedHeight), /^\[/.test(h._option .extrudedHeight) && /\]$/.test(h._option.extrudedHeight) && (e = h._option.extrudedHeight.replace(/\[/, "").replace( /\]/, ""), m.extrudedHeight = parseFloat(a .properties[e])), m.material = h._option.material, /^\[/ .test(h._option.material) && /\]$/.test(h._option .material) ? (e = h._option.material.replace(/\[/, "") .replace(/\]/, ""), m.material = a.properties[e], h ._core.isHtmlColor(m.material) ? m.material = h._color .colorFromHtmlColor(m.material) : (/^rgb/.test(m .material) && (m.material = h._color .rgbaStringToRgbaObj(m.material)), 1 < m .material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material .green = m.material.green / 255), 1 < m.material .blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material .alpha / 255), m.material = h._color .createColor(m.material.red, m.material.green, m .material.blue, m.material.alpha))) : (h._option .material && (m.material = h._option.material), m .material && (h._core.isHtmlColor(m.material) ? m .material = h._color.colorFromHtmlColor(m .material) : (/^rgb/.test(m.material) && (m .material = h._color.rgbaStringToRgbaObj(m .material)), 1 < m.material.red && (m .material.red = m.material.red / 255), 1 < m .material.green && (m.material.green = m .material.green / 255), 1 < m.material .blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material .a = m.material.alpha / 255), m.material = h ._color.createColor(m.material.red, m.material .green, m.material.blue, m.material.alpha))) ), 2 <= n.length && (e = h._cesium.Cartesian3 .fromDegreesArray(n), m.polygonHierarchy = new h._cesium .PolygonHierarchy(e), e = new h._cesium.PolygonGeometry( m), e = new h._cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new h._cesium .ColorGeometryInstanceAttribute .fromColor(m.material) } }), t = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m.material.blue, h.Legend .push(t), i.push(e)) } h.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry .coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++) n = [], a.geometry.coordinates[s].pop(), o(a .geometry.coordinates[s]), t(); else o(a.geometry.coordinates), t() } 0 == i.length && (c.state = Cesium.QuadtreeTileLoadState.DONE, c .renderable = !0); var l = new h._cesium.GroundPrimitive1({ geometryInstances: i, appearance: new h._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders( "vertexShaderSource"), fragmentShaderSource: h._core.Shaders( "fragmentShaderSource") }), classificationType: h._option.classificationType }); c.data.geometryPrimitive = l, c.state = Cesium.QuadtreeTileLoadState .LOADING, c.state === Cesium.QuadtreeTileLoadState.LOADING && (c .data.geometryPrimitive.update1(u, []), c.state = Cesium .QuadtreeTileLoadState.DONE, c.renderable = !0) }, error: function() { c.state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = !0 } }), c.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new l._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), s = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), r || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: m.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i, treeData: { name: e, geoOptions: t, styleOption: i, GroupID: o, checked: r, disFnc: n } }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, b.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization3 = function(e, t, i, o, r, n) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, d = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.toString().charAt( 0) && "]" == i.material.toString().charAt(i.material.length - 1) || (this._core.isHtmlColor(i .material) ? i.material = this._color.colorFromHtmlColor(i.material) : (/^rgb/.test(i .material) && (i.material = this._color.rgbaStringToRgbaObj(i.material)), 1 < i .material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i .material.a && (i.material.a = i.material.a / 255), i.material = this._color .createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this ._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, u = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s .urlParams)), a = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider.loadTile = function(e, t) { var c = e, h = t, m = l; if (h.state === Cesium.QuadtreeTileLoadState.START) { if (h.data = { lines: [], geometryPrimitive: void 0 }, !(h.level >= i.level_min && h.level < i.level_max && m.item.show)) return void(h .state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0); e = u.replace(window.encodeURIComponent("{x}"), h.x).replace(window.encodeURIComponent( "{y}"), h.y).replace(window.encodeURIComponent("{z}"), h.level); m._cache && (e += "&" + m._core.getuid()), m._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { var i = ["#ffff00", "#ffcc00", "#ff3300", "#ccff00", "#cccc00", "#99ff66", "#999933", "#66cc99", "#6633ff", "#33ffff", "#3399cc", "#009933", "#ccccff", "#ff99ff", "#9966ff", "#336699" ]; if (null == e) return h.state = Cesium.QuadtreeTileLoadState.DONE, void(h.renderable = !0); var o = []; function r(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? r(e[ t]) : a.push(e[t]) } function t() { var e, t; m._option.extrudedHeight && (d.extrudedHeight = m._option .extrudedHeight), /^\[/.test(m._option .extrudedHeight) && /\]$/.test(m._option.extrudedHeight) && (e = m._option.extrudedHeight.replace(/\[/, "").replace( /\]/, ""), d.extrudedHeight = parseFloat(s .properties[e])), d.material = m._option.material, /^\[/ .test(m._option.material) && /\]$/.test(m._option .material) ? (e = m._option.material.replace(/\[/, "") .replace(/\]/, ""), d.material = s.properties[e], m ._core.isHtmlColor(d.material) ? d.material = m._color .colorFromHtmlColor(d.material) : (/^rgb/.test(d .material) && (d.material = m._color .rgbaStringToRgbaObj(d.material)), 1 < d .material.red && (d.material.red = d.material.red / 255), 1 < d.material.green && (d.material .green = d.material.green / 255), 1 < d.material .blue && (d.material.blue = d.material.blue / 255), 1 < d.material.alpha && (d.material.a = d.material .alpha / 255), d.material = m._color .createColor(d.material.red, d.material.green, d .material.blue, d.material.alpha))) : (m._option .material && (d.material = m._option.material), d .material && (m._core.isHtmlColor(d.material) ? d .material = m._color.colorFromHtmlColor(d .material) : (/^rgb/.test(d.material) && (d .material = m._color.rgbaStringToRgbaObj(d .material)), 1 < d.material.red && (d .material.red = d.material.red / 255), 1 < d .material.green && (d.material.green = d .material.green / 255), 1 < d.material .blue && (d.material.blue = d.material.blue / 255), 1 < d.material.alpha && (d.material .a = d.material.alpha / 255), d.material = m ._color.createColor(d.material.red, d.material .green, d.material.blue, d.material.alpha))) ), 2 <= a.length && (e = m._cesium.Cartesian3 .fromDegreesArray(a), d.polygonHierarchy = new m._cesium .PolygonHierarchy(e), 0 != d.extrudedHeight && "0" != d .extrudedHeight && null != d.extrudedHeight && null != d .extrudedHeight || (d.extrudedHeight = 1e4), e = new m ._cesium.PolygonGeometry(d), t = i[Math.floor(Math .random() * i.length)], e = new m._cesium .GeometryInstance({ id: s, geometry: e, attributes: { color: m._cesium .ColorGeometryInstanceAttribute .fromColor(m._cesium.Color .fromCssColorString(t).withAlpha(.5) ) } }), t = "material:" + 255 * d.material.red + "," + 255 * d.material.green + "," + 255 * d.material.blue, m.Legend .push(t), o.push(e)) } m.Legend = []; for (var n = 0; n < e.features.length; n++) { var a = [], s = e.features[n]; if (Array.isArray(s.geometry.coordinates) && 0 < s.geometry .coordinates.length) if (Array.isArray(s.geometry.coordinates[0][0])) for (var l = 0; l < s.geometry.coordinates.length; l++) a = [], s.geometry.coordinates[l].pop(), r(s .geometry.coordinates[l]), t(); else r(s.geometry.coordinates), t() } 0 == o.length && (h.state = Cesium.QuadtreeTileLoadState.DONE, h .renderable = !0); var u = new m._cesium.ClassificationPrimitive1({ geometryInstances: o, classificationType: m._cesium.ClassificationType.BOTH }); h.data.geometryPrimitive = u, h.state = Cesium.QuadtreeTileLoadState .LOADING, h.state === Cesium.QuadtreeTileLoadState.LOADING && (h .data.geometryPrimitive.update(c, []), h.state = Cesium .QuadtreeTileLoadState.DONE, h.renderable = !0) }, error: function() { h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0 } }), h.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new l._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), s = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), r || this.setVisibility(!1), this._core.isnull(d.id) && (d.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + d.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: d.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i, treeData: { name: e, geoOptions: t, styleOption: i, GroupID: o, checked: r, disFnc: n } }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, b.prototype.createPointGeoJsonFeatureLayerProvider = function(e, t, a, i, o, r) { var n = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, s = ((s = this)._core.isnull(a) || s._core.isnull(a.color) || /^\[/.test(a.color) && "[" == a.color .toString().charAt(0) && "]" == a.color.toString().charAt(a.color.length - 1) || (s._core .isHtmlColor(a.color) ? a.color = s._color.colorFromHtmlColor(a.color) : (/^rgb/.test(a .color) && (a.color = s._color.rgbaStringToRgbaObj(a.color)), 1 < a.color.r && (a .color.r = a.color.r / 255), 1 < a.color.g && (a.color.g = a.color.g / 255), 1 < a .color.b && (a.color.b = a.color.b / 255), 1 < a.color.a && (a.color.a = a.color.a / 255), a.color = s._color.createColor(a.color.r, a.color.g, a.color.b, a.color.a))), s._core.isnull(a) || s._core.isnull(a.outlineColor) || /^\[/.test(a.outlineColor) && "[" == a .outlineColor.toString().charAt(0) && "]" == a.outlineColor.toString().charAt(a.outlineColor .length - 1) || (s._core.isHtmlColor(a.outlineColor) ? a.outlineColor = s._color .colorFromHtmlColor(a.outlineColor) : (/^rgb/.test(a.outlineColor) && (a.outlineColor = s ._color.rgbaStringToRgbaObj(a.outlineColor)), 1 < a.outlineColor.r && (a .outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor .g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a .outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor .a / 255), a.outlineColor = s._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), this), l = (this._urlTemplate = t.url + "?" + this._serialize(n.urlParams), t.url + "?" + this._serialize(n .urlParams)), n = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = a.level_max - 1, { Name: "", text: "", font: " 30px sans-serif", pixelSize: 10, style: s._cesium.LabelStyle.OUTLINE, fillColor: s._cesium.Color.WHITE, outlineColor: s._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new s._cesium.Color(.165, .165, .165, .8), backgroundPadding: new s._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: s._cesium.HorizontalOrigin.CENTER, verticalOrigin: s._cesium.VerticalOrigin.CENTER, eyeOffset: s._cesium.Cartesian3.ZERO, pixelOffset: s._cesium.Cartesian2.ZERO, heightReference: s._cesium.HeightReference.NONE, scaleByDistance: new s._cesium.NearFarScalar(0, 0, 1, 1) }), u = (s._core.isnull(a) || s._core.isnull(a.backgroundColor) || /^\[/.test(a.backgroundColor) && "[" == a.backgroundColor.toString().charAt(0) && "]" == a.backgroundColor.toString().charAt(a .backgroundColor.length - 1) || (s._core.isHtmlColor(a.backgroundColor) ? a .backgroundColor = s._color.colorFromHtmlColor(a.backgroundColor) : (/^rgb/.test(a .backgroundColor) && (a.backgroundColor = s._color.rgbaStringToRgbaObj(a .backgroundColor)), 1 < a.backgroundColor.r && (a.backgroundColor.r = a .backgroundColor.r / 255), 1 < a.backgroundColor.g && (a.backgroundColor.g = a .backgroundColor.g / 255), 1 < a.backgroundColor.b && (a.backgroundColor.b = a .backgroundColor.b / 255), 1 < a.backgroundColor.a && (a.backgroundColor.a = a .backgroundColor.a / 255), a.backgroundColor = s._color.createColor(a .backgroundColor.r, a.backgroundColor.g, a.backgroundColor.b, a.backgroundColor.a))), s ._core.extend(n, a, !0)), n = (s._core.isnull(a.near) && (a.near = 0), s._core.isnull(a.far) && (a.far = 999999999), parseFloat(a.near)), c = parseFloat(a.far), n = new s._cesium.DistanceDisplayCondition(n, c), c = (u.distanceDisplayCondition = n, s._core.isnull(a.font_size) && (a.font_size = "30px"), s._core .isnull(a.font_family) && (a.font_family = " sans-serif"), u.font = parseFloat(a.font_size) + "px " + a.font_family, a.material, this._Provider.loadTile = function(e, t) { var i = e, o = t, n = s; if (o.state === Cesium.QuadtreeTileLoadState.START) { if (o.data = { lines: [], geometryPrimitive: void 0 }, !(o.level >= a.level_min && o.level < a.level_max && n.item.show)) return void(o .state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0); e = l.replace(window.encodeURIComponent("{x}"), o.x).replace(window.encodeURIComponent( "{y}"), o.y).replace(window.encodeURIComponent("{z}"), o.level); n._cache && (e += "&" + n._core.getuid()), n._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return o.state = Cesium.QuadtreeTileLoadState.DONE, void(o.renderable = !0); var r = new n._cesium.PointPrimitiveCollection; e.features.forEach(function(e) { u.id = e; var t, i = 0, o = (/^\[/.test(u.pointHeight) && /\]$/.test(u .pointHeight) ? (o = u.pointHeight.replace( /\[/, "").replace(/\]/, ""), i = parseFloat(e.properties[o])) : void 0 !== u .pointHeight && "" !== u.pointHeight ? i = parseFloat(u.pointHeight) : null != e.properties .height && (i = parseFloat(e.properties .height)), /^\[/.test(a.color) && /\]$/.test(a .color) && (t = a.color.replace(/\[/, "") .replace(/\]/, ""), u.color = e.properties[ t], n._core.isHtmlColor(u.color) ? u .color = n._color.colorFromHtmlColor(u .color) : (/^rgb/.test(u.color) && (u .color = n._color .rgbaStringToRgbaObj(u.color)), 1 < u.color.r && (u.color.r = u.color.r / 255), 1 < u.color.g && (u.color.g = u.color.g / 255), 1 < u.color.b && ( u.color.b = u.color.b / 255), 1 < u .color.a && (u.color.a = u.color.a / 255), u.color = n._color .createColor(u.color.r, u.color.g, u .color.b, u.color.a))), /^\[/.test(a .outlineColor) && /\]$/.test(a .outlineColor) && (t = a.outlineColor.replace( /\[/, "").replace(/\]/, ""), u .outlineColor = e.properties[t], n._core .isHtmlColor(u.outlineColor) ? u .outlineColor = n._color.colorFromHtmlColor( u.outlineColor) : (/^rgb/.test(u .outlineColor) && (u.outlineColor = n._color.rgbaStringToRgbaObj(u .outlineColor)), 1 < u .outlineColor.r && (u.outlineColor.r = u .outlineColor.r / 255), 1 < u .outlineColor.g && (u.outlineColor.g = u .outlineColor.g / 255), 1 < u .outlineColor.b && (u.outlineColor.b = u .outlineColor.b / 255), 1 < u .outlineColor.a && (u.outlineColor.a = u .outlineColor.a / 255), u .outlineColor = n._color.createColor(u .outlineColor.r, u.outlineColor.g, u .outlineColor.b, u.outlineColor.a)) ), u.position = new n._cesium.Cartesian3 .fromDegrees(e.geometry.coordinates[0], e .geometry.coordinates[1], i), u.text = e .properties.name, { show: u.show, position: u.position, pixelSize: u.pixelSize, color: u.color, outlineColor: u.outlineColor, outlineWidth: u.outlineWidth, id: e }); u.color && u.color.red && (t = "color:" + 255 * u.color .red + "," + 255 * u.color.green + "," + 255 * u .color.blue + ";outlineColor:" + 255 * u .outlineColor.red + "," + 255 * u.outlineColor .green + "," + 255 * u.outlineColor.blue, n .Legend.push(t)), o.id.treeID = a.id, o.id .VectorType = "point", o.id.VectorStyle = { show: o.show, pointHeight: i, position: o.position, pixelSize: o.pixelSize, color: o.color, outlineColor: o.outlineColor, outlineWidth: o.outlineWidth }, r.add(o) }), o.data.geometryPrimitive = r, o.state = Cesium .QuadtreeTileLoadState.LOADING, o.state === Cesium .QuadtreeTileLoadState.LOADING && (o.data.geometryPrimitive .update(i, []), o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0) }, error: function() { null == o.count && (o.count = 0), o.count += 1, 2 <= o.count ? (o .state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = ! 0) : o.state = Cesium.QuadtreeTileLoadState.START } }), o.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 5 }), this._viewer.scene), n = c.primitives, n = (a && a.time && (this._Provider._availability = new s._cesium.TimeIntervalCollection([new s ._cesium.TimeInterval({ start: a.time.start ? s._cesium.JulianDate.fromDate(new Date(a.time .start)) : s._cesium.Iso8601.MINIMUM_VALUE, stop: a.time.end ? s._cesium.JulianDate.fromDate(new Date(a.time.end)) : s ._cesium.Iso8601.MAXIMUM_VALUE }) ]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), n.add(this._primitive), c.primitivesQuadTrees && c.primitivesQuadTrees.push(this ._primitive), o ? (this.item.show = !0, this.setVisibility(!0)) : this.setVisibility(!1), this ._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: a.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t.url, style: a, treeData: { name: e, geoOptions: t, styleOption: a, GroupID: i, checked: o, disFnc: r } }); return this._Provider.treeID = a.id, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull( i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.VolumeVectorGeoJsonFeatureLayerOptimization = function(e, a, o, t, i, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: a.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: a.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(a.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(a.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: a.upperLevelLimit, lowerLevelLimit: a.lowerLevelLimit, Cesium: this._cesium }, d = (this._core.isnull(o) || this._core.isnull(o.material) || "[" == o.material.toString().charAt( 0) && "]" == o.material.toString().charAt(o.material.length - 1) || (this._core.isHtmlColor(o .material) ? o.material = this._color.colorFromHtmlColor(o.material) : (/^rgb/.test(o .material) && (o.material = this._color.rgbaStringToRgbaObj(o.material)), 1 < o .material.r && (o.material.r = o.material.r / 255), 1 < o.material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o .material.a && (o.material.a = o.material.a / 255), o.material = this._color .createColor(o.material.r, o.material.g, o.material.b, o.material.a))), this._option = this ._core.extend({ ...n }, o, !0), null == a && console.log("geoOptions is required"), null == e && console.log( "layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, u = (this._urlTemplate = a.url + "?" + this._serialize(s.urlParams), a.url + "?" + this._serialize(s .urlParams)); l._core.xhr({ url: a.url + "?service=WMTS&request=GetCapabilities", type: "get", isXml: !0, success: function(r) { r = l._core.xml2json(r); let e = r.Contents && r.Contents.Layer; var n, r = e.filter(e => e.Identifier === a.layer)[0]; if (r) { let e = r.TileMatrixSetLink, t = r.WGS84BoundingBox; t && (r = t.LowerCorner.split(" "), n = t.UpperCorner.split(" "), l.item .boundingSphere = Cesium.BoundingSphere.fromPoints([Cesium.Cartesian3 .fromDegrees(r[0], r[1]), Cesium.Cartesian3.fromDegrees(n[0], n[ 1]) ])); let i = a.srs || "EPSG:4326", o = e.filter(e => e.TileMatrixSet === i)[0]; o && (l.TileMatrixLimits = {}, o.TileMatrixSetLimits && o.TileMatrixSetLimits .TileMatrixLimits.forEach(e => { let t = e.TileMatrix; var i = (t = t.split(":"))[t.length - 1]; l.TileMatrixLimits[i] = { maxCol: e.MaxTileCol, minCol: e.MinTileCol, maxRow: e.MaxTileRow, minRow: e.MinTileRow } })) } l.initThisProvider() } }), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this.initThisProvider = () => { this.initThisProvider = void 0, this._Provider.loadTile = function(e, t) { var c = e, h = t, m = l; if (h.state === Cesium.QuadtreeTileLoadState.START) { if (h.data = { lines: [], geometryPrimitive: void 0 }, !(h.level >= o.level_min && h.level < o.level_max && m.item.show)) return void(h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0); if (m.TileMatrixLimits) { var i = m.TileMatrixLimits[h.level]; if (h.x > i.maxCol || h.x < i.minCol || h.y > i.maxRow || h.y < i.minRow) return void(h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0) } i = u.replace(window.encodeURIComponent("{x}"), h.x).replace(window .encodeURIComponent("{y}"), h.y).replace(window.encodeURIComponent("{z}"), h .level); m._cache && (i += "&" + m._core.getuid()), m._core.xhr({ url: i, type: "get", dataType: "json", success: function(e) { if (null == e) return h.state = Cesium.QuadtreeTileLoadState .DONE, void(h.renderable = !0); var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o( e[t]) : (a.push(e[t]), 2 !== t || s || (s = !0)) } function t() { var e, t; /^\[/.test(m._option.extrudedHeight) && /\]$/.test(m._option .extrudedHeight) ? (e = m._option.extrudedHeight .replace(/\[/, "").replace(/\]/, ""), d .extrudedHeight = parseFloat(l.properties[e])) : m ._option.extrudedHeight && (d.extrudedHeight = parseFloat(m._option.extrudedHeight)), d.material = m._option.material, /^\[/.test(m._option.material) && /\]$/.test(m._option.material) ? (e = m._option.material .replace(/\[/, "").replace(/\]/, ""), d.material = l .properties[e], m._core.isHtmlColor(d.material) ? d .material = m._color.colorFromHtmlColor(d .material) : (/^rgb/.test(d.material) && (d .material = m._color.rgbaStringToRgbaObj(d .material)), 1 < d.material.red && (d .material.red = d.material.red / 255), 1 < d .material.green && (d.material.green = d .material.green / 255), 1 < d.material .blue && (d.material.blue = d.material.blue / 255), 1 < d.material.alpha && (d.material .a = d.material.alpha / 255), d.material = m ._color.createColor(d.material.red, d.material .green, d.material.blue, d.material.alpha)) ) : (m._option.material && (d.material = m._option .material), d.material && (m._core.isHtmlColor(d .material) ? d.material = m._color .colorFromHtmlColor(d.material) : (/^rgb/.test(d .material) && (d.material = m._color .rgbaStringToRgbaObj(d.material)), 1 < d .material.red && (d.material.red = d .material.red / 255), 1 < d.material .green && (d.material.green = d.material .green / 255), 1 < d.material.blue && (d .material.blue = d.material.blue / 255), 1 < d.material.alpha && (d.material.a = d .material.alpha / 255), d.material = m ._color.createColor(d.material.red, d .material.green, d.material.blue, d .material.alpha)))), 2 <= a.length && (e = s ? m._cesium.Cartesian3.fromDegreesArrayHeights( a) : m._cesium.Cartesian3.fromDegreesArray(a), d .polygonHierarchy = new m._cesium.PolygonHierarchy( e), e = new m._cesium.PolygonGeometry(d), l .treeID = d.id, l.VectorType = "polygon", l .VectorStyle = { haveZ: s, extrudedHeight: d.extrudedHeight, positions: a, material: d.material }, e = new m._cesium.GeometryInstance({ id: l, geometry: e, attributes: { color: new m._cesium .ColorGeometryInstanceAttribute .fromColor(d.material), distanceDisplayCondition: new Cesium .DistanceDisplayConditionGeometryInstanceAttribute( m._option.near, m._option.far) } }), t = "material:" + 255 * d.material.red + "," + 255 * d.material.green + "," + 255 * d.material .blue, m.Legend.push(t), i.push(e)) } m.Legend = []; for (var r, n = 0; n < e.features.length; n++) { var a = [], s = !1, l = e.features[n]; if (Array.isArray(l.geometry.coordinates) && 0 < l.geometry .coordinates.length) if (Array.isArray(l.geometry.coordinates[0][0])) for (var u = 0; u < l.geometry.coordinates .length; u++) a = [], l.geometry.coordinates[u] .pop(), o(l.geometry.coordinates[u]), t(); else o(l.geometry.coordinates), t() } 0 == i.length && (h.state = Cesium.QuadtreeTileLoadState.DONE, h .renderable = !0), r = d.material.alpha < 1 ? new m ._cesium.PerInstanceColorAppearance({ translucent: !0 }) : new m._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: m._core.Shaders( "vertexShaderSource"), fragmentShaderSource: m._core.Shaders( "fragmentShaderSource") }), r = m._option.clampToGround ? new m._cesium .GroundPrimitive({ geometryInstances: i, appearance: r, classificationType: m._cesium.ClassificationType .BOTH }) : new m._cesium.Primitive({ geometryInstances: i, appearance: r, shadows: m._option.shadows }), h.data.geometryPrimitive = r, h.state = Cesium .QuadtreeTileLoadState.LOADING, h.state === Cesium .QuadtreeTileLoadState.LOADING && (h.data.geometryPrimitive .update(c, []), h.state = Cesium.QuadtreeTileLoadState .DONE, h.renderable = !0) }, error: function() { h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0 } }), h.state = Cesium.QuadtreeTileLoadState.LOADING } } }; let c, h; this.saveDefaultVectorData = () => { h = l._core.extend({}, o, !0) }, this.restoreVector = () => { h && (o = h, l._option = l._core.extend({ ...n }, o, !0), l._Provider._normalTile = o.level_max - 1, l._primitive && l._primitive ._tilesToRender && l._primitive._tilesToRender.length && (l._primitive._tilesToRender .forEach(e => { e.data.geomeitryPrimitive && e.data.geomeitryPrimitive.destroy(), e.state = Cesium.QuadtreeTileLoadState.START }), l._primitive._tileToUpdateHeights.forEach(e => { e.data.geomeitryPrimitive && e.data.geomeitryPrimitive.destroy(), e.state = Cesium.QuadtreeTileLoadState.START }), l._primitive._tileToUpdateHeights = [], l._primitive._tilesToRender = [])), h = void 0 }, this.updataVector = (e = {}) => { (e.material || e.outlineColor) && (e.material && (e.material = Cesium.Color.fromCssColorString(e .material)), e.outlineColor && (e.outlineColor = Cesium.Color.fromCssColorString(e .outlineColor))), void 0 === e.minimumLevel && void 0 === e.maximumLevel || (void 0 !== e .minimumLevel && (e.level_min = e.minimumLevel), void 0 !== e.maximumLevel && (e .level_max = e.maximumLevel)), o = l._core.extend(o, e, !0), l._option = l._core .extend(l._option, o, !0), l._Provider._normalTile = o.level_max - 1, l._primitive && l ._primitive._tilesToRender && l._primitive._tilesToRender.length && (clearTimeout(c), c = setTimeout(() => { l._primitive._tilesToRender.forEach(e => { e.data.geomeitryPrimitive && e.data.geomeitryPrimitive.destroy(), e .state = Cesium.QuadtreeTileLoadState.START }), l._primitive._tileToUpdateHeights.forEach(e => { e.data.geomeitryPrimitive && e.data.geomeitryPrimitive.destroy(), e .state = Cesium.QuadtreeTileLoadState.START }), l._primitive._tileToUpdateHeights = [], l._primitive._tilesToRender = [] }, 100)) }, this._primitive = new l._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 5 }); var s = this._viewer.scene, m = s.primitives, m = (o && o.time && (this._Provider._availability = new l._cesium.TimeIntervalCollection([new l ._cesium.TimeInterval({ start: o.time.start ? l._cesium.JulianDate.fromDate(new Date(o.time .start)) : l._cesium.Iso8601.MINIMUM_VALUE, stop: o.time.end ? l._cesium.JulianDate.fromDate(new Date(o.time.end)) : l ._cesium.Iso8601.MAXIMUM_VALUE }) ]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), m.add(this._primitive), s.primitivesQuadTrees && s.primitivesQuadTrees.push(this ._primitive), i || this.setVisibility(!1), this._core.isnull(o.id) && (o.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + o.id), this.west = a.minx, this.south = a .miny, this.east = a.maxx, this.north = a.maxy, { id: o.id, name: e, checked: !0, pId: this._core.isnull(t) ? 0 : t, type: "polygonLayer", item: this, url: a.url, style: o, treeData: { name: e, geoOptions: a, styleOption: o, GroupID: t, checked: i, disFnc: r } }); return this._Provider.treeID = m.id, this.setTreeobj(m), this._tree.insertGroupId(m, this._core.isnull( t) ? 0 : t), "function" == typeof r && r(this.item), this }, b.prototype.createModelGeoJsonFeatureLayerProvider0825 = function(e, t, o, i, r, n) { var a = this, s = { url: "", color: a._cesium.Color.DARKSALMON, scale: 2 }, l = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, u = (a._core.isnull(o) || a._core.isnull(o.color) || /^\[/.test(o.color) && "[" == o.color .toString().charAt(0) && "]" == o.color.toString().charAt(o.color.length - 1) || (a._core .isHtmlColor(o.color) ? o.color = a._color.colorFromHtmlColor(o.color) : (/^rgb/.test(o .color) && (o.color = a._color.rgbaStringToRgbaObj(o.color)), 1 < o.color.r && (o .color.r = o.color.r / 255), 1 < o.color.g && (o.color.g = o.color.g / 255), 1 < o .color.b && (o.color.b = o.color.b / 255), 1 < o.color.a && (o.color.a = o.color.a / 255), o.color = a._color.createColor(o.color.r, o.color.g, o.color.b, o.color.a))), a._core.extend(s, o, !0)), s = (a._core.isnull(o.near) && (o.near = 0), a._core.isnull(o.far) && (o.far = 999999999), parseFloat(o.near)), c = parseFloat(o.far), s = new a._cesium.DistanceDisplayCondition(s, c), h = (u.distanceDisplayCondition = s, o.material, this._urlTemplate = t.url + "?" + this._serialize(l .urlParams), t.url + "?" + this._serialize(l.urlParams)), c = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider._minimumHeight = parseFloat(u.height) || 0, this._Provider.loadTile = function(t, i) { if (i.state === Cesium.QuadtreeTileLoadState.START) { if (i.data = { lines: [], geometryPrimitive: void 0 }, !(i.level >= o.level_min && i.level < o.level_max && a.item.show)) return i .state = Cesium.QuadtreeTileLoadState.DONE, void(i.renderable = !0); var e = h.replace(window.encodeURIComponent("{x}"), i.x).replace(window .encodeURIComponent("{y}"), i.y).replace(window.encodeURIComponent("{z}"), i .level); a._cache && (e += "&" + a._core.getuid()), a._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return i.state = Cesium.QuadtreeTileLoadState.DONE, void(i.renderable = !0); var o = new a._cesium.PrimitiveCollection({ isModel: !0 }); e.features.forEach(function(e) { var t = (u.id = e).geometry.coordinates[2] || 0, i = (null != e.properties.height && (t = parseFloat( e.properties.height)), /^\[/.test(u .height) && /\]$/.test(u.height) ? (i = u.height .replace(/\[/, "").replace(/\]/, ""), t += parseFloat(e.properties[i])) : t += parseFloat(u.height) || 0, u.modelMatrix = a ._cesium.Transforms.eastNorthUpToFixedFrame(a ._cesium.Cartesian3.fromDegrees(e.geometry .coordinates[0], e.geometry.coordinates[ 1], t)), a._cesium.Model.fromGltf({ id: e, url: u.uri, color: u.color, modelMatrix: u.modelMatrix, scale: u.scale, heightReference: parseInt(u .heightReference), distanceDisplayCondition: u .distanceDisplayCondition })); o.add(i) }), 0 == e.features.length && (i.state = Cesium .QuadtreeTileLoadState.DONE, i.renderable = !0), i.data .geometryPrimitive = o, i.state = Cesium.QuadtreeTileLoadState .LOADING, i.state === Cesium.QuadtreeTileLoadState.LOADING && (i .data.geometryPrimitive.update(t, []), i.state = Cesium .QuadtreeTileLoadState.DONE, i.renderable = !0) }, error: function() { null == i.count && (i.count = 0), i.count += 1, 2 <= i.count ? (i .state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = ! 0) : i.state = Cesium.QuadtreeTileLoadState.START } }), i.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new a._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), s = (c.primitives.add(this._primitive), c.primitivesQuadTrees && c.primitivesQuadTrees.push(this ._primitive), r || this.setVisibility(!1), this._core.isnull(u.id) && (u.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: u.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: o, treeData: { name: e, geoOptions: t, styleOption: o, GroupID: i, checked: r, disFnc: n } }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item), this }, b.prototype.createModelGeoJsonFeatureLayerProvider = function(e, t, o, i, r, n) { var a = this, s = { url: "", color: a._cesium.Color.DARKSALMON, scale: 2 }, l = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, Cesium: this._cesium }, u = (a._core.isnull(o) || a._core.isnull(o.color) || /^\[/.test(o.color) && "[" == o.color .toString().charAt(0) && "]" == o.color.toString().charAt(o.color.length - 1) || (a._core .isHtmlColor(o.color) ? o.color = a._color.colorFromHtmlColor(o.color) : (/^rgb/.test(o .color) && (o.color = a._color.rgbaStringToRgbaObj(o.color)), 1 < o.color.r && (o .color.r = o.color.r / 255), 1 < o.color.g && (o.color.g = o.color.g / 255), 1 < o .color.b && (o.color.b = o.color.b / 255), 1 < o.color.a && (o.color.a = o.color.a / 255), o.color = a._color.createColor(o.color.r, o.color.g, o.color.b, o.color.a))), a._core.extend(s, o, !0)), s = (a._core.isnull(o.near) && (o.near = 0), a._core.isnull(o.far) && (o.far = 999999999), parseFloat(o.near)), c = parseFloat(o.far), s = new a._cesium.DistanceDisplayCondition(s, c), h = (u.distanceDisplayCondition = s, o.material, this._urlTemplate = t.url + "?" + this._serialize(l .urlParams), t.url + "?" + this._serialize(l.urlParams)), c = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider._minimumHeight = parseFloat(u.height) || 0, this._Provider.loadTile = function(i, r) { if (r.state === Cesium.QuadtreeTileLoadState.START) { if (r.data = { lines: [], geometryPrimitive: void 0 }, !(r.level >= o.level_min && r.level < o.level_max && a.item.show)) return r .state = Cesium.QuadtreeTileLoadState.DONE, void(r.renderable = !0); var e = h.replace(window.encodeURIComponent("{x}"), r.x).replace(window .encodeURIComponent("{y}"), r.y).replace(window.encodeURIComponent("{z}"), r .level); a._cache && (e += "&" + a._core.getuid()), a._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { if (null == e) return r.state = Cesium.QuadtreeTileLoadState.DONE, void(r.renderable = !0); var o = [], t = (e.features.forEach(function(e) { var t = (u.id = e).geometry.coordinates[2] || 0, i = (null != e.properties.height && (t = parseFloat(e.properties.height)), /^\[/ .test(u.height) && /\]$/.test(u.height) ? ( i = u.height.replace(/\[/, "").replace( /\]/, ""), t += parseFloat(e .properties[i])) : t += parseFloat(u .height) || 0, a._cesium.Transforms .eastNorthUpToFixedFrame(a._cesium .Cartesian3.fromDegrees(e.geometry .coordinates[0], e.geometry .coordinates[1], t))); Cesium.Matrix4.multiplyByUniformScale(i, u.scale, i), o.push({ modelMatrix: i, modelId: e }) }), new Cesium.ModelInstanceCollection({ url: u.uri, instances: o, color: u.color })); 0 == e.features.length && (r.state = Cesium.QuadtreeTileLoadState .DONE, r.renderable = !0), r.data.geometryPrimitive = t, r .state = Cesium.QuadtreeTileLoadState.LOADING, r.state === Cesium.QuadtreeTileLoadState.LOADING && (r.data .geometryPrimitive.update(i, []), r.state = Cesium .QuadtreeTileLoadState.DONE, r.renderable = !0) }, error: function() { null == r.count && (r.count = 0), r.count += 1, 2 <= r.count ? (r .state = Cesium.QuadtreeTileLoadState.DONE, r.renderable = ! 0) : r.state = Cesium.QuadtreeTileLoadState.START } }), r.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), s = c.primitives, l = (o && o.time && (this._Provider._availability = new a._cesium.TimeIntervalCollection([new a ._cesium.TimeInterval({ start: o.time.start ? a._cesium.JulianDate.fromDate(new Date(o.time .start)) : a._cesium.Iso8601.MINIMUM_VALUE, stop: o.time.end ? a._cesium.JulianDate.fromDate(new Date(o.time.end)) : a ._cesium.Iso8601.MAXIMUM_VALUE }) ]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), s.add(this._primitive), c.primitivesQuadTrees && c.primitivesQuadTrees.push(this ._primitive), r || this.setVisibility(!1), this._core.isnull(u.id) && (u.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: u.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: o, treeData: { name: e, geoOptions: t, styleOption: o, GroupID: i, checked: r, disFnc: n } }); return this.setTreeobj(l), this._tree.insertGroupId(l, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item), this }, b.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1 = function(e, t, u, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, c = (this._core.isnull(u) || this._core.isnull(u.material) || "[" == u.material.toString().charAt( 0) && "]" == u.material.toString().charAt(u.material.length - 1) || (this._core.isHtmlColor(u .material) ? u.material = this._color.colorFromHtmlColor(u.material) : (/^rgb/.test(u .material) && (u.material = this._color.rgbaStringToRgbaObj(u.material)), 1 < u .material.r && (u.material.r = u.material.r / 255), 1 < u.material.g && (u.material.g = u.material.g / 255), 1 < u.material.b && (u.material.b = u.material.b / 255), 1 < u .material.a && (u.material.a = u.material.a / 255), u.material = this._color .createColor(u.material.r, u.material.g, u.material.b, u.material.a))), this._option = this ._core.extend(n, u, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, h = this, a = (this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this ._viewer, this._cesium), this._Provider._normalTile = u.level_max - 1, h._defaultStyle = { outlineColor: Cesium.Color.fromCssColorString("rgba(209,204,226,0)"), lineWidth: 0, outline: !0, fill: !0, fillColor: Cesium.Color.fromCssColorString("rgba(220,20,60,1)"), fillShow: "nod", tileCacheSize: 200, showMaker: !1, showCenterLabel: !0, fontColor: Cesium.Color.fromCssColorString("rgba(255,0,0,1)"), labelOffsetX: -10, labelOffsetY: -5, fontSize: 13, fontFamily: "黑体", pointColor: Cesium.Color.fromCssColorString("rgba(255,0,0,0)"), centerLabelPropertyName: "NAME" }, -1 != h._option.fill.indexOf("[") ? h._defaultStyle.fillShow = h._option.fill : h ._defaultStyle.fillColor = Cesium.Color.fromCssColorString(h._option.fill), this._Provider .loadTile = function(e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && h.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level > u.level_max + 2 && 0 < h.probj.length) for (; 0 < h.probj.length; n++) { h._viewer.entities.remove(h.probj[0]); var o = h.probj.indexOf(h.probj[0]); h.probj.splice(o, 1) } if (t.level >= u.level_min && t.level < u.level_max && h.item.show) { var r = y.filter(c, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != r.length && r[0].data && 0 < r[0].data.length) return t.data .geometryPrimitive = new h._cesium.Primitive({ geometryInstances: r[0].data, appearance: new h._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: h._cesium.ShadowMode.ENABLED }), t.state = h._cesium.QuadtreeTileLoadState.LOADING, void(t.state === h ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && ( t.state = h._cesium.QuadtreeTileLoadState.DONE), t .renderable = !0)); if (0 < h.PrimitiveData.length) for (var n = 0; n < h.PrimitiveData.length; n++) if (h.PrimitiveData[n].key == i) return void(h.Primitivekey.includes(i) || h .Primitivekey.push(i)); h.Primitivekey.includes(i) || (h.Primitivekey.push(i), c.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), a = t, r = h._urlTemplate.replace(window.encodeURIComponent("{x}"), a.x) .replace(window.encodeURIComponent("{y}"), a.y).replace(window .encodeURIComponent("{z}"), a.level), h.tilesLength++, s = "z" + a .level + "x" + a.x + "y" + a.y, h._cache && (r += "&" + h._core.getuid()), l = { xMin: Cesium.Math.toDegrees(a._rectangle.west), yMin: Cesium.Math.toDegrees(a._rectangle.south), xMax: Cesium.Math.toDegrees(a._rectangle.east), yMax: Cesium.Math.toDegrees(a._rectangle.north) }, h._core.xhr({ url: r, type: "get", dataType: "json", success: function(e) { var t = e, e = (h._tileWidth = 256, h._tileHeight = 256, h.x = a ._x, h.y = a._y, h.level = a._level, h ._createCanvas(), h._drawGeojson(h._context, 0, 0, e, l, h._tileWidth, h._tileHeight, h._fill, h ._outline, h.x, h.y, h.level), h._viewer .entities.add({ ids: t, name: "Rotating rectangle with rotating texture coordinate", rectangle: { coordinates: a.rectangle, material: new h._cesium .ImageMaterialProperty({ image: h._canvas, transparent: !0 }), zIndex: a.level, classificationType: h._cesium .ClassificationType.BOTH } })), t = (h.probj.push(e), { level: a.level, key: s, data: e }); h.loadFinishKey.push(s), h.PrimitiveData.push(t), h .returnCount++, h.removeObsoleteEntitiesxp(a.rectangle) }, error: function() { a.state = Cesium.QuadtreeTileLoadState.DONE, a .renderable = !0 } })) } else t.state = h._cesium.QuadtreeTileLoadState.LOADING, t.state === h._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = h._cesium .QuadtreeTileLoadState.DONE), t.renderable = !0) } var a, s, l }, this._primitive = new h._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), a = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(n.id) && (n.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: u, treeData: { name: e, geoOptions: t, styleOption: u, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest = function(e, t, l, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, u = (this._core.isnull(l) || this._core.isnull(l.material) || "[" == l.material.toString().charAt( 0) && "]" == l.material.toString().charAt(l.material.length - 1) || (this._core.isHtmlColor(l .material) ? l.material = this._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l .material) && (l.material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l .material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l .material.a && (l.material.a = l.material.a / 255), l.material = this._color .createColor(l.material.r, l.material.g, l.material.b, l.material.a))), this._option = this ._core.extend(n, l, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, c = this, a = (this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this ._viewer, this._cesium), this._Provider._normalTile = l.level_max - 1, c._defaultStyle = { outlineColor: Cesium.Color.fromCssColorString("rgba(209,204,226,0)"), lineWidth: 0, outline: !0, fill: !0, fillColor: Cesium.Color.fromCssColorString("rgba(220,20,60,1)"), fillShow: "nod", tileCacheSize: 200, showMaker: !1, showCenterLabel: !0, fontColor: Cesium.Color.fromCssColorString("rgba(255,0,0,1)"), labelOffsetX: -10, labelOffsetY: -5, fontSize: 13, fontFamily: "黑体", pointColor: Cesium.Color.fromCssColorString("rgba(255,0,0,0)"), centerLabelPropertyName: "NAME" }, -1 != c._option.fill.indexOf("[") ? c._defaultStyle.fillShow = c._option.fill : c ._defaultStyle.fillColor = Cesium.Color.fromCssColorString(c._option.fill), this._Provider .loadTile = function(e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && c.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level > l.level_max + 2 && 0 < c.probj.length) for (; 0 < c.probj.length; n++) { c._viewer.entities.remove(c.probj[0]); var o = c.probj.indexOf(c.probj[0]); c.probj.splice(o, 1) } if (t.level >= l.level_min && t.level < l.level_max && c.item.show) { var r = y.filter(u, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != r.length && r[0].data && 0 < r[0].data.length) return t.data .geometryPrimitive = new c._cesium.Primitive({ geometryInstances: r[0].data, appearance: new c._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: c._cesium.ShadowMode.ENABLED }), t.state = c._cesium.QuadtreeTileLoadState.LOADING, void(t.state === c ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && ( t.state = c._cesium.QuadtreeTileLoadState.DONE), t .renderable = !0)); if (0 < c.PrimitiveData.length) for (var n = 0; n < c.PrimitiveData.length; n++) if (c.PrimitiveData[n].key == i) return void(c.Primitivekey.includes(i) || c .Primitivekey.push(i)); c.Primitivekey.includes(i) || (c.Primitivekey.push(i), u.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), a = t, r = c._urlTemplate.replace(window.encodeURIComponent("{x}"), a.x) .replace(window.encodeURIComponent("{y}"), a.y).replace(window .encodeURIComponent("{z}"), a.level), c.tilesLength++, s = "z" + a .level + "x" + a.x + "y" + a.y, c._cache && (r += "&" + c._core.getuid()), Cesium.Math.toDegrees(a._rectangle.west), Cesium.Math.toDegrees(a._rectangle .south), Cesium.Math.toDegrees(a._rectangle.east), Cesium.Math .toDegrees(a._rectangle.north), c._core.xhr({ url: r, type: "get", dataType: "json", success: function(e) { var t = e, t = (c._tileWidth = 256, c._tileHeight = 256, c.x = a ._x, c.y = a._y, c.level = a._level, c._viewer .entities.add({ ids: t, name: "Rotating rectangle with rotating texture coordinate", rectangle: { coordinates: a.rectangle, material: new c._cesium .ImageMaterialProperty({ image: e, transparent: !0 }), zIndex: a.level, classificationType: c._cesium .ClassificationType.BOTH } })), e = (c.probj.push(t), { level: a.level, key: s, data: t }); c.loadFinishKey.push(s), c.PrimitiveData.push(e), c .returnCount++, c.removeObsoleteEntitiesxp(a.rectangle) }, error: function() { a.state = Cesium.QuadtreeTileLoadState.DONE, a .renderable = !0 } })) } else t.state = c._cesium.QuadtreeTileLoadState.LOADING, t.state === c._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = c._cesium .QuadtreeTileLoadState.DONE), t.renderable = !0) } var a, s }, this._primitive = new c._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), a = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(n.id) && (n.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: l, treeData: { name: e, geoOptions: t, styleOption: l, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, b.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest = function(e, a, o, t, i, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: a.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: a.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(a.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(a.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: a.upperLevelLimit, lowerLevelLimit: a.lowerLevelLimit, Cesium: this._cesium }, d = (this._core.isnull(o) || this._core.isnull(o.material) || "[" == o.material.toString().charAt( 0) && "]" == o.material.toString().charAt(o.material.length - 1) || (this._core.isHtmlColor(o .material) ? o.material = this._color.colorFromHtmlColor(o.material) : (/^rgb/.test(o .material) && (o.material = this._color.rgbaStringToRgbaObj(o.material)), 1 < o .material.r && (o.material.r = o.material.r / 255), 1 < o.material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o .material.a && (o.material.a = o.material.a / 255), o.material = this._color .createColor(o.material.r, o.material.g, o.material.b, o.material.a))), this._option = this ._core.extend(n, o, !0), null == a && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, u = (this._urlTemplate = a.url + "?" + this._serialize(s.urlParams), a.url + "?" + this._serialize(s .urlParams)), n = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider._minimumHeight = parseFloat(o.height || 0), l._core.xhr({ url: a.url + "?service=WMTS&request=GetCapabilities", type: "get", isXml: !0, success: function(r) { r = l._core.xml2json(r); let e = r.Contents && r.Contents.Layer; var n, r = e.filter(e => e.Identifier === a.layer)[0]; if (r) { let e = r.TileMatrixSetLink, t = r.WGS84BoundingBox; t && (r = t.LowerCorner.split(" "), n = t.UpperCorner.split(" "), l.item .boundingSphere = Cesium.BoundingSphere.fromPoints([Cesium .Cartesian3.fromDegrees(r[0], r[1]), Cesium.Cartesian3 .fromDegrees(n[0], n[1]) ])); let i = a.srs || "EPSG:4490", o = e.filter(e => e.TileMatrixSet === i)[0]; o && (l.TileMatrixLimits = {}, o.TileMatrixSetLimits && o .TileMatrixSetLimits.TileMatrixLimits.forEach(e => { let t = e.TileMatrix; var i = (t = t.split(":"))[t.length - 1]; l.TileMatrixLimits[i] = { maxCol: e.MaxTileCol, minCol: e.MinTileCol, maxRow: e.MaxTileRow, minRow: e.MinTileRow } })) } l.initThisProvider() } }), this.initThisProvider = () => { this.initThisProvider = void 0, this._Provider.loadTile = function(e, t) { var c = e, h = t, m = l; if (h.state === Cesium.QuadtreeTileLoadState.START) { if (h.data = { lines: [], geometryPrimitive: void 0 }, !(h.level >= o.level_min && h.level < o.level_max && m.item.show)) return void(h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0); if (m.TileMatrixLimits) { var i = m.TileMatrixLimits[h.level]; if (i && (h.x > i.maxCol || h.x < i.minCol || h.y > i.maxRow || h.y < i .minRow)) return void(h.state = Cesium.QuadtreeTileLoadState.DONE, h .renderable = !0) } i = u.replace(window.encodeURIComponent("{x}"), h.x).replace(window .encodeURIComponent("{y}"), h.y).replace(window.encodeURIComponent( "{z}"), h.level); m._cache && (i += "&" + m._core.getuid()), m._core.xhr({ url: i, type: "get", dataType: "json", success: function(e) { var t = y.cloneDeep(e); if (t.features.length <= 0) return h.state = Cesium .QuadtreeTileLoadState.DONE, void(h.renderable = !0); if (null == t) return h.state = Cesium.QuadtreeTileLoadState .DONE, void(h.renderable = !0); var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[t]) : (a.push(e[t]), 2 !== t || s || (s = !0)) } function r() { var e, t; /^\[/.test(m._option.extrudedHeight) && /\]$/.test(m ._option.extrudedHeight) && (e = m._option .extrudedHeight.replace(/\[/, "").replace(/\]/, ""), d.extrudedHeight = parseFloat(l .properties[e])), d.material = m._option .material, /^\[/.test(m._option.material) && /\]$/ .test(m._option.material) ? (e = m._option.material .replace(/\[/, "").replace(/\]/, ""), d .material = l.properties[e], m._core .isHtmlColor(d.material) ? d.material = m._color .colorFromHtmlColor(d.material) : (/^rgb/.test(d .material) && (d.material = m._color .rgbaStringToRgbaObj(d.material)), 1 < d .material.red && (d.material.red = d .material.red / 255), 1 < d.material .green && (d.material.green = d.material .green / 255), 1 < d.material.blue && (d .material.blue = d.material.blue / 255), 1 < d.material.alpha && (d.material.a = d .material.alpha / 255), d.material = m ._color.createColor(d.material.red, d .material.green, d.material.blue, d .material.alpha))) : (m._option .material && (d.material = m._option.material), d.material && (m._core.isHtmlColor(d.material) ? d.material = m._color.colorFromHtmlColor(d .material) : (/^rgb/.test(d.material) && (d.material = m._color .rgbaStringToRgbaObj(d.material)), 1 < d.material.red && (d.material.red = d.material.red / 255), 1 < d .material.green && (d.material.green = d .material.green / 255), 1 < d .material.blue && (d.material.blue = d .material.blue / 255), 1 < d .material.alpha && (d.material.a = d .material.alpha / 255), d.material = m._color.createColor(d.material.red, d .material.green, d.material.blue, d .material.alpha)))), 2 <= a .length && (e = s ? m._cesium.Cartesian3 .fromDegreesArrayHeights(a) : m._cesium .Cartesian3.fromDegreesArray(a), d .polygonHierarchy = new m._cesium .PolygonHierarchy(e), e = new m._cesium .PolygonGeometry(d), l.treeID = d.id, l .VectorType = "polygon", l.VectorStyle = { haveZ: s, extrudedHeight: d.extrudedHeight, positions: a, material: d.material }, e = new m._cesium.GeometryInstance({ id: l, geometry: e, attributes: { color: new m._cesium .ColorGeometryInstanceAttribute .fromColor(d.material) } }), t = "material:" + 255 * d.material.red + "," + 255 * d.material.green + "," + 255 * d .material.blue, m.Legend.push(t), i.push(e)) } m.Legend = []; for (var n = 0; n < t.features.length; n++) { var a = [], s = !1, l = t.features[n]; if (Array.isArray(l.geometry.coordinates) && 0 < l .geometry.coordinates.length) if (Array.isArray(l.geometry.coordinates[0][0])) for (var u = 0; u < l.geometry.coordinates .length; u++) a = [], l.geometry .coordinates[u].pop(), o(l.geometry .coordinates[u]), r(); else o(l.geometry.coordinates), r() } 0 == i.length && (h.state = Cesium.QuadtreeTileLoadState .DONE, h.renderable = !0); e = new m._cesium.GroundPrimitive({ geometryInstances: i, appearance: new m._cesium .PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: m._core.Shaders( "vertexShaderSource"), fragmentShaderSource: m._core .Shaders("fragmentShaderSource") }), classificationType: m._cesium.ClassificationType .BOTH, shadows: m._option.shadows }); m.probj.push(e), h.data.geometryPrimitive = e, h.state = Cesium.QuadtreeTileLoadState.LOADING, h.state === Cesium .QuadtreeTileLoadState.LOADING && (h.data .geometryPrimitive.update(c, []), h.state = Cesium .QuadtreeTileLoadState.DONE, h.renderable = !0) }, error: function() { null == h.count && (h.count = 0), h.count += 1, 2 <= h .count ? (h.state = Cesium.QuadtreeTileLoadState.DONE, h .renderable = !0) : h.state = Cesium .QuadtreeTileLoadState.START } }), h.state = Cesium.QuadtreeTileLoadState.LOADING } } }, this._primitive = new l._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 5 }), this._viewer.scene), s = (n.primitives.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), i || this.setVisibility(!1), this._core.isnull(o.id) && (o.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + o.id), this.west = a.minx, this.south = a .miny, this.east = a.maxx, this.north = a.maxy, { id: o.id, name: e, checked: !0, pId: this._core.isnull(t) ? 0 : t, type: "polygonLayer", item: this, url: a.url, style: o, treeData: { name: e, geoOptions: a, styleOption: o, GroupID: t, checked: i, disFnc: r } }); return this._Provider.treeID = s.id, this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull( t) ? 0 : t), "function" == typeof r && r(this.item), this }, b.prototype.createGeojsonImage = function(e) { let o = eval; Cesium.loadText( "http://36.7.136.132:8090/geoserver/swagger/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=swagger%3A_20200410153959_JZ11&maxFeatures=50&outputFormat=application%2Fjson" ).then(function(e) { e = o("(" + e + ")"); for (var t = 0; t < e.features.length; t++) e.features[t].properties.nod = 0 == t ? "rgba(255,255,0,1)" : 1 == t ? "rgba(220,20,60,1)" : 2 == t ? "rgba(75,0,130,1)" : 3 == t ? "rgba(0,0,255,1)" : 4 == t ? "rgba(30,144,255,1)" : "rgba(50,205,50,1)"; try { var i = new VectorTileImageryProvider({ source: e, zIndex: 99, removeDuplicate: !1, defaultStyle: { outlineColor: "rgba(209,204,226,1)", lineWidth: 0, outline: !0, fill: !0, fillColor: "rgba(209,204,226,1)", fillShow: "[nod]", tileCacheSize: 200, showMaker: !1, showCenterLabel: !0, fontColor: "rgba(255,0,0,1)", labelOffsetX: -10, labelOffsetY: -5, fontSize: 13, fontFamily: "黑体", centerLabelPropertyName: "NAME" }, maximumLevel: 20, minimumLevel: 15, simplify: !1 }); i.readyPromise.then(function() { viewer.imageryLayers.addImageryProvider(i), Cesium.Camera .DEFAULT_VIEW_RECTANGLE = i.rectangle }) } catch (e) { console.log(e) } }) }, b.prototype._drawGeojson = function(o, r, n, e, a, t, i, s, l, u, c, h) { var m, d, p, g, _, f, y, v, C, w, b, T, S, P = this; function E(e) { if (P._styleFilter) { if (0 == (d = e.style).show) return; p = { labelStroke: d.labelStroke, labelStrokeWidth: d.labelStrokeWidth, labelStrokeColor: d.labelStrokeColor, pointSize: d.pointSize, fontSize: d.fontSize, fontFamily: d.fontFamily, color: d.fontColor.toCssColorString(), backgroundColor: d.pointColor.toCssColorString(), pointStyle: d.pointStyle, ringRadius: d.ringRadius, circleLineWidth: d.circleLineWidth, showMaker: d.showMaker, showLabel: d.showLabel, labelOffsetX: d.labelOffsetX, labelOffsetY: d.labelOffsetY, markerSymbol: d.makerImage instanceof Image ? d.makerImage : d.makerImageEl } } else d = P._defaultStyle; if (o.lineWidth = d.lineWidth, o.strokeStyle = d.outlineColor.toCssColorString(), o.fillStyle = d .fillColor.toCssColorString(), -1 != d.fillShow.indexOf("[") && (i = d.fillShow.replace("[", "") .replace("]", ""), o.fillStyle = e.properties[i]), d.lineDash && o.setLineDash(d.lineDash), o.lineCap = d.lineCap, d.shadowColor && d.shadowColor instanceof Cesium.Color ? o.shadowColor = d.shadowColor.toCssColorString() : o.shadowColor = d.shadowColor, o.shadowBlur = d.shadowBlur, o .shadowOffsetX = d.shadowOffsetX, o.shadowOffsetY = d.shadowOffsetY, o.miterLimit = d .miterLimit, o.lineJoin = d.lineJoin, "Point" == e.geometry.type) drawMarker(o, m, a, r, n, e, s, l, d.labelPropertyName, p); else if ("Polygon" == e.geometry.type && d.fill) { var t = turf.getCoords(e), i = mt(o, m, a, r, n, t, !0, !1); i && i.map(function(e) { e.style = d, g.push(e) }) } else if ("MultiPolygon" == e.geometry.type && d.fill) try { turf.getCoords(e).map(function(e) { e = mt(o, m, a, r, n, e, !0, !1); e && e.map(function(e) { e.style = d, g.push(e) }) }) } catch (e) {} else "MultiLineString" == e.geometry.type ? e.properties.isOutline && !d .outline || (t = turf.getCoords(e), mt(o, m, a, r, n, t, !1, !0)) : "LineString" != e .geometry.type || e.properties.isOutline && !d.outline || (i = turf.getCoords(e), mt(o, m, a, r, n, t = [i], !1, !0), i = null) } void 0 === l && (l = !0), ((s = void 0 === s ? !0 : s) || l) && (m = new lt(t = void 0 === t ? o.canvas .width - r : t, i = void 0 === i ? o.canvas.height - n : i), d = this._defaultStyle, p = { labelStroke: d.labelStroke, labelStrokeWidth: d.labelStrokeWidth, labelStrokeColor: d.labelStrokeColor, pointSize: d.pointSize, fontSize: d.fontSize, fontFamily: d.fontFamily, color: d.fontColor.toCssColorString(), backgroundColor: d.pointColor.toCssColorString(), pointStyle: d.pointStyle, ringRadius: d.ringRadius, circleLineWidth: d.circleLineWidth, showMaker: d.showMaker, showLabel: d.showLabel, labelOffsetX: d.labelOffsetX, labelOffsetY: d.labelOffsetY, markerSymbol: d.makerImage instanceof Image ? d.makerImage : d.makerImageEl }, g = [], P._styleFilter && (turf.featureEach(e, function(e, t) { P._styleFilter && (d = P._defaultStyle.clone(), P._styleFilter(e, d, u, c, h), e .style = d) }), e.features.sort(function(e, t) { return e.style && e.style.lineDash ? 1 : t.style && t.style.lineDash ? -1 : 0 })), turf.featureEach(e, function(e, t) { "Polygon" != e.geometry.type && "MultiPolygon" != e.geometry.type || E(e) }), g && g.length && (_ = m, f = a, y = r, v = n, t = g, w = (i = o).canvas, b = i.getImageData( 0, 0, w.width, w.height), (T = document.createElement("canvas")).width = w.width, T .height = w.height, S = T.getContext("2d"), t.map(function(e) { S.clearRect(0, 0, T.width, T.height), S.beginPath(); var t = 0; e.map(function(e) { e = _.project(e, f); 0 == t ? S.moveTo(y + e.x, v + e.y) : S.lineTo(y + e.x, v + e.y), t++ }), S.closePath(), S.fillStyle = "rgba(255,255,255,1)", S.fill(), C = S .getImageData(0, 0, T.width, T.height).data; for (var i = 3; i < C.length; i += 4) 0 < C[i] && (b.data[i] = 0) }), i.putImageData(b, 0, 0)), turf.featureEach(e, function(e, t) { "LineString" != e.geometry.type && "MultiLineString" != e.geometry.type || E(e) }), turf.featureEach(e, function(e, t) { "Point" != e.geometry.type && "MultiPoint" != e.geometry.type || E(e) })) }, b.prototype._createCanvas = function() { this._canvas = document.createElement("canvas"), this._canvas.width = this._tileWidth, this._canvas .height = this._tileHeight, this._context = this._canvas.getContext("2d"), this._context.lineWidth = this._defaultStyle.lineWidth, this._context.strokeStyle = this._defaultStyle.outlineColor .toCssColorString(), this._context.fillStyle = this._defaultStyle.fillColor.toCssColorString() }, b.prototype.getLegend = function() { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, b.prototype.removeObsoletePrimitives1 = function(e) {}, b.prototype.removeObsoletePrimitives = function( e) { for (var t = this._viewer.scene.globe._surface._tilesToRender.map(function(e) { return e.level }), i = Math.min.apply(Math, ut(t)), o = Math.max.apply(Math, ut(t)), r = this.PrimitiveData .length - 1; 0 <= r; r--) { var n = this.PrimitiveData[r]; (n.level < i || n.level > o) && this._viewer.scene.primitives.remove(n.data) && (-1 < (c = this .Primitivekey.indexOf(this.loadFinishKey[r])) && this.Primitivekey.splice(c, 1), this .PrimitiveData.splice(r, 1), this.loadFinishKey.splice(r, 1)) } var a = [], t = e.parent, s = (t && t.parent && (t = t.parent, a.push(t)), e.children); a = a.concat(s); for (r = 0; r < s.length; r++) var l = s[r].children, a = a.concat(l); for (var u, c, r = 0; r < a.length; r++) a[r] && (u = "z" + a[r].level + "x" + a[r].x + "y" + a[r].y, - 1 < (c = this.loadFinishKey.indexOf(u)) && this._viewer.scene.primitives.remove(this .PrimitiveData[c].data) && (-1 < (c = this.Primitivekey.indexOf(u)) && this.Primitivekey .splice(c, 1), this.PrimitiveData.splice(c, 1), this.loadFinishKey.splice(c, 1))) }, b.prototype.removeObsoleteEntities = function(e) { for (var t = this._viewer.scene.globe._surface._tilesToRender.map(function(e) { return e.level }), i = Math.min.apply(Math, ut(t)) - 1, o = Math.max.apply(Math, ut(t)) + 1, r = this .PrimitiveData.length - 1; 0 <= r; r--) { var n = this.PrimitiveData[r]; (n.level < i || n.level > o) && this._viewer.entities.remove(n.data) && (-1 < (c = this.Primitivekey .indexOf(this.loadFinishKey[r])) && this.Primitivekey.splice(c, 1), this.PrimitiveData .splice(r, 1), this.loadFinishKey.splice(r, 1)) } var a = [], t = e.parent, s = (t && t.parent && (t = t.parent, a.push(t)), e.children); a = a.concat(s); for (r = 0; r < s.length; r++) var l = s[r].children, a = a.concat(l); for (var u, c, r = 0; r < a.length; r++) a[r] && (u = "z" + a[r].level + "x" + a[r].x + "y" + a[r].y, - 1 < (c = this.loadFinishKey.indexOf(u)) && this._viewer.entities.remove(this.PrimitiveData[c] .data) && (-1 < (c = this.Primitivekey.indexOf(u)) && this.Primitivekey.splice(c, 1), this .PrimitiveData.splice(c, 1), this.loadFinishKey.splice(c, 1))) }, b.prototype.removeObsoleteEntitiesxp = function(e) { for (var t = this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(e.west), this._cesium.Math .toDegrees(e.south)), i = this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(e .east), this._cesium.Math.toDegrees(e.north)), o = 0; o < this.probj.length; o++) this._cesium .Rectangle.contains(this.probj[o].rectangle.coordinates.getValue(), this._cesium.Cartographic .fromCartesian(t)), this._cesium.Rectangle.contains(this.probj[o].rectangle.coordinates .getValue(), this._cesium.Cartographic.fromCartesian(i)); for (var r = this._viewer.camera.computeViewRectangle(), n = 0; n < this.probj.length; n++) { var a = this.probj[n].rectangle.coordinates.getValue(), s = this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(a.west), this._cesium.Math .toDegrees(a.south)), a = this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(a.east), this._cesium.Math .toDegrees(a.north)), s = this._cesium.Rectangle.contains(r, this._cesium.Cartographic.fromCartesian(s)), a = this._cesium.Rectangle.contains(r, this._cesium.Cartographic.fromCartesian(a)); this.probj[n].show = !(!s && !a) } }, b.prototype.computeCircle = function(e) { this._core.isnull(e) && (e = 4); for (var t = [], i = 0; i < 360; i++) { var o = this._cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, b.prototype.setTreeobj = function(e) { this.treeobj = e }, b.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t, pId: this.treeobj.pId }, treeData: this.treeobj.treeData } }, b.prototype.deleteObject = function() { if (this._viewer.scene.primitives.remove(this.item), this.probj && 0 < this.probj.length && (this ._viewer.scene.primitives.remove(this.probj[0]), this.probj.pop()), null != this.img && this ._viewer.imageryLayers.remove(this.img), this.primitve && 0 < this.primitve.length) { for (var e = 0; e < this.primitve.length; e++) this._viewer.scene.primitives.remove(this.primitve[ e]); this.primitve = [] } this.loadAllKey && 0 < this.loadAllKey.length && (this.loadAllKey = []); try { this._Provider.remove() } catch (e) {} }, b.prototype.setRefresh = function(e) { try { this._Provider && this._Provider.setStatus(e) } catch (e) {} }, b.prototype.getLevel = function() { var e, t = this._viewer.camera; return t && t.positionCartographic && t.positionCartographic.height ? (e = this._viewer.scene.globe .getHeight(t.positionCartographic) || 0, t = t.positionCartographic.height - e, Math.round( 80955.31 / (1 + Math.pow(t / 91610.74, 7096758e-11)) - 40467.74)) : 0 }, b.prototype.setVisibility = function(e) { try { if (this.loadAllKey = [], null != this.item && null != this.item.show && (this.item.show = e), null != this.img && (this.img.show = e), this.primitve && 0 < this.primitve.length) for (var t = 0; t < this.primitve.length; t++) this.primitve[t].show = e; if (this._Provider && this._Provider.setStatus && this._Provider.setStatus(e), this.probj && 0 < this.probj.length) for (t = 0; t < this.probj.length; t++) this.probj[t].show = e } catch (e) {} }, b.prototype.edit = function(e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider .edit(e, t) }, b.prototype.isCache = function(e) { this._cache = e }, b.prototype.forceRefresh = function() { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) this._Provider.quadtree ._levelZeroTiles[e].freeResources() } catch (e) {} }, dt.prototype.flyTo = function(e, t = {}) { return this._viewer.flyTo(e, { duration: t.time || 3, maximumHeight: t.maxHeight, offset: new Cesium.HeadingPitchRange(Cesium.Math.toRadians(t.heading || 0), Cesium.Math .toRadians(t.pitch || -45), t.range) }) }, dt.prototype.flyToPointsInterest = function(e, t) { return this._viewer.camera.flyTo({ destination: e.destination, orientation: e.orientation, duration: e.duration, complete: t }) }, dt.prototype.flyToPosition = function(e, t, i) { Math.abs(e) <= 180 && Math.abs(t) <= 90 ? this._viewer.camera.flyTo({ destination: this._cesium.Cartesian3.fromDegrees(e, t, i) }) : this._viewer.camera.flyTo({ destination: { x: e, y: t, z: i } }) }, pt.prototype.createPolylineGeoJsonFeatureLayer = function(e, t, p, i, g, _) { var o = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE, height: 30 }, f = (this._core.isnull(p) || this._core.isnull(p.material) || "[" == p.material.toString().charAt( 0) && "]" == p.material.toString().charAt(p.material.length - 1) || (this._core.isHtmlColor(p .material) ? p.material = this._color.colorFromHtmlColor(p.material) : (/^rgb/.test(p .material) && (p.material = this._color.rgbaStringToRgbaObj(p.material)), 1 < p .material.r && (p.material.r = p.material.r / 255), 1 < p.material.g && (p.material.g = p.material.g / 255), 1 < p.material.b && (p.material.b = p.material.b / 255), 1 < p .material.a && (p.material.a = p.material.a / 255), p.material = this._color .createColor(p.material.r, p.material.g, p.material.b, p.material.a))), this._core.extend(o, p, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), y = this, o = (o.then(function(e) { for (var t, i = e.entities.values, o = new y._cesium.PrimitiveCollection, r = 0; r < i .length; r++) { var n = i[r], a = null; if (f.clampToGround) { f.positions = n.polyline.positions._value; var s = { positions: n.polyline.positions._value, width: f.width }, s = new y._cesium.GroundPolylineGeometry(s), a = new y._cesium.GeometryInstance({ id: n, geometry: s, attributes: { color: new y._cesium.ColorGeometryInstanceAttribute.fromColor(f .material) } }) } else { for (var l = [], r = 0; r < n.polyline.positions._value.length; r++) { y._viewer.scene.globe.ellipsoid; var u = y._cesium.Cartographic.fromCartesian(n.polyline.positions._value[ r]), c = y._cesium.Math.toDegrees(u.longitude), h = y._cesium.Math.toDegrees(u.latitude), u = u.height + f.height, c = new y._cesium.Cartesian3.fromDegrees(c, h, u); l.push(c) } f.positions = l; var s = new y._cesium.PolylineGeometry(f), m = y._cesium.PolylineGeometry.createGeometry(s); a = new y._cesium.GeometryInstance({ id: n, geometry: m, attributes: { color: new y._cesium.ColorGeometryInstanceAttribute.fromColor(f .material) } }) } n.positions = f.positions; var m = "material:" + 255 * f.material.red + "," + 255 * f.material.green + "," + 255 * f.material.blue, d = (y.Legend.push(m), null), d = f.clampToGround ? new y._cesium.GroundPolylinePrimitive({ geometryInstances: a, appearance: new y._cesium.MaterialAppearance({ material: new y._cesium.Material({ fabric: { type: "Color", uniforms: { color: f.material } } }), faceForward: !0, flat: !1 }) }) : new y._cesium.Primitive({ geometryInstances: a, appearance: new y._cesium.PolylineMaterialAppearance({ material: new y._cesium.Material({ fabric: { type: "Color", uniforms: { color: f.material } } }) }), shadows: y._cesium.ShadowMode.ENABLED }); o.add(d) } p && p.time && (t = new y._cesium.TimeIntervalCollection([new y._cesium.TimeInterval({ start: p.time.start ? y._cesium.JulianDate.fromDate(new Date(p .time.start)) : y._cesium.Iso8601.MINIMUM_VALUE, stop: p.time.end ? y._cesium.JulianDate.fromDate(new Date(p.time .end)) : y._cesium.Iso8601.MAXIMUM_VALUE })])), y._viewer.scene.primitives.add(o, t).show = f.show, y.item = o, g || y .setVisibility(!1), "function" == typeof _ && _(y.item) }), this._core.isnull(f.id) && (f.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + f.id), { id: f.id, name: e, checked: g, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t, style: f }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, pt.prototype.createGroundPolylineGeoJsonFeatureLayer = function(e, t, p, i, g, _) { var o = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE, height: 30 }, f = (this._core.isnull(p) || this._core.isnull(p.material) || "[" == p.material.toString().charAt( 0) && "]" == p.material.toString().charAt(p.material.length - 1) || (this._core.isHtmlColor(p .material) ? p.material = this._color.colorFromHtmlColor(p.material) : (/^rgb/.test(p .material) && (p.material = this._color.rgbaStringToRgbaObj(p.material)), 1 < p .material.r && (p.material.r = p.material.r / 255), 1 < p.material.g && (p.material.g = p.material.g / 255), 1 < p.material.b && (p.material.b = p.material.b / 255), 1 < p .material.a && (p.material.a = p.material.a / 255), p.material = this._color .createColor(p.material.r, p.material.g, p.material.b, p.material.a))), this._core.extend(o, p, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), y = this, o = (o.then(function(e) { for (var t, i = e.entities.values, o = new y._cesium.PrimitiveCollection, r = 0; r < i .length; r++) { var n = i[r], a = null; if (f.clampToGround) { f.positions = n.polyline.positions._value; var s = { positions: n.polyline.positions._value, width: f.width }, s = new y._cesium.GroundPolylineGeometry(s), a = new y._cesium.GeometryInstance({ id: n, geometry: s, attributes: { color: new y._cesium.ColorGeometryInstanceAttribute.fromColor(f .material) } }) } else { for (var l = [], r = 0; r < n.polyline.positions._value.length; r++) { y._viewer.scene.globe.ellipsoid; var u = y._cesium.Cartographic.fromCartesian(n.polyline.positions._value[ r]), c = y._cesium.Math.toDegrees(u.longitude), h = y._cesium.Math.toDegrees(u.latitude), u = u.height + f.height, c = new y._cesium.Cartesian3.fromDegrees(c, h, u); l.push(c) } f.positions = l; var s = new y._cesium.PolylineGeometry(f), m = y._cesium.PolylineGeometry.createGeometry(s); a = new y._cesium.GeometryInstance({ id: n, geometry: m, attributes: { color: new y._cesium.ColorGeometryInstanceAttribute.fromColor(f .material) } }) } n.positions = f.positions; var m = "material:" + 255 * f.material.red + "," + 255 * f.material.green + "," + 255 * f.material.blue, d = (y.Legend.push(m), null), d = f.clampToGround ? new y._cesium.GroundPolylinePrimitive({ geometryInstances: a, appearance: new y._cesium.MaterialAppearance({ material: new y._cesium.Material({ fabric: { type: "Color", uniforms: { color: f.material } } }), faceForward: !0, flat: !1 }) }) : new y._cesium.Primitive({ geometryInstances: a, appearance: new y._cesium.PolylineMaterialAppearance({ material: new y._cesium.Material({ fabric: { type: "Color", uniforms: { color: f.material } } }) }), shadows: y._cesium.ShadowMode.ENABLED }); o.add(d) } p && p.time && (t = new y._cesium.TimeIntervalCollection([new y._cesium.TimeInterval({ start: p.time.start ? y._cesium.JulianDate.fromDate(new Date(p .time.start)) : y._cesium.Iso8601.MINIMUM_VALUE, stop: p.time.end ? y._cesium.JulianDate.fromDate(new Date(p.time .end)) : y._cesium.Iso8601.MAXIMUM_VALUE })])), y._viewer.scene.primitives.add(o, t).show = f.show, y.item = o, g || y .setVisibility(!1), "function" == typeof _ && _(y.item) }), this._core.isnull(f.id) && (f.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + f.id), { id: f.id, name: e, checked: g, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t, style: f }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, pt.prototype.createPolylineVectorGeoJsonFeatureLayerProvider1 = function(e, t, u, i, o, r) { var n = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE, height: 30 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, c = (this._core.isnull(u) || this._core.isnull(u.material) || "[" == u.material.toString().charAt( 0) && "]" == u.material.toString().charAt(u.material.length - 1) || (this._core.isHtmlColor(u .material) ? u.material = this._color.colorFromHtmlColor(u.material) : (/^rgb/.test(u .material) && (u.material = this._color.rgbaStringToRgbaObj(u.material)), 1 < u .material.r && (u.material.r = u.material.r / 255), 1 < u.material.g && (u.material.g = u.material.g / 255), 1 < u.material.b && (u.material.b = u.material.b / 255), 1 < u .material.a && (u.material.a = u.material.a / 255), u.material = this._color .createColor(u.material.r, u.material.g, u.material.b, u.material.a))), this._core.extend(n, u, !0)), h = this, n = new v(this._viewer, this._cesium, a), a = ((this._Provider = n)._loadTile = function(e) { h.Legend = []; var l = new h._cesium.PrimitiveCollection; return e.features.forEach(function(a) { var e, i = [], s = !1; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[t]) : (i.push( e[t]), 2 !== t || s || (s = !0)) } if (/^\[/.test(u.material) && /\]$/.test(u.material) && (e = u.material.replace( /\[/, "").replace(/\]/, ""), c.material = a.properties[e], h._core .isHtmlColor(c.material) ? c.material = h._color.colorFromHtmlColor(c .material) : (/^rgb/.test(c.material) && (c.material = h._color .rgbaStringToRgbaObj(c.material)), 1 < c.material.r && (c .material.r = c.material.r / 255), 1 < c.material.g && (c .material.g = c.material.g / 255), 1 < c.material.b && (c .material.b = c.material.b / 255), 1 < c.material.a && (c .material.a = c.material.a / 255), c.material = h._color .createColor(c.material.r, c.material.g, c.material.b, c.material.a) )), Array.isArray(a.geometry.coordinates) && 0 < a.geometry .coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var t = 0; t < a.geometry.coordinates.length; t++) i = [], o(a .geometry.coordinates[t]), r(i); else o(a.geometry.coordinates), r(i); function r(e) { var t = s ? h._cesium.Cartesian3.fromDegreesArrayHeights(e) : h._cesium .Cartesian3.fromDegreesArray(e), i = (c.positions = t, { positions: c.positions, width: c.width }), t = (a.positions = t, a.treeID = c.id, a.VectorType = "polyline", a .VectorStyle = { haveZ: s, width: c.width, positions: e, material: c.material, clampToGround: c.clampToGround }, null); if (c.clampToGround) i = new h._cesium.GroundPolylineGeometry(i), t = new h ._cesium.GeometryInstance({ id: a, geometry: i, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute .fromColor(c.material) } }); else { var o = e, r = e.length / 2 + 1 + e.length; /^\[/.test(u.height) && /\]$/.test(u.height) && (i = u.height.replace( /\[/, "").replace(/\]/, ""), c.height = a.properties[i]); for (var n = 2; n < r; n += 3) o.splice(n, 0, parseFloat(c.height)); e = h._cesium.Cartesian3.fromDegreesArrayHeights(o), i = (c.positions = e, a.positions = e, new h._cesium.PolylineGeometry(c)); t = new h._cesium.GeometryInstance({ id: a, geometry: i, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute .fromColor(c.material) } }) } e = "material:" + 255 * c.material.red + "," + 255 * c.material.green + "," + 255 * c.material.blue, h.Legend.push(e), i = null, i = c .clampToGround ? new h._cesium.GroundPolylinePrimitive({ geometryInstances: t, appearance: new h._cesium.MaterialAppearance({ material: new h._cesium.Material({ fabric: { type: "Color", uniforms: { color: c.material } } }), faceForward: !0, flat: !1 }) }) : new h._cesium.Primitive({ geometryInstances: t, appearance: new h._cesium.PolylineMaterialAppearance({ material: new h._cesium.Material({ fabric: { type: "Color", uniforms: { color: c.material } } }) }), shadows: h._cesium.ShadowMode.ENABLED }); l.add(i) } }), l }, u && u.time && (n.availability = new h._cesium.TimeIntervalCollection([new h._cesium .TimeInterval({ start: u.time.start ? h._cesium.JulianDate.fromDate(new Date(u.time .start)) : h._cesium.Iso8601.MINIMUM_VALUE, stop: u.time.end ? h._cesium.JulianDate.fromDate(new Date(u.time.end)) : h ._cesium.Iso8601.MAXIMUM_VALUE }) ])), this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + c .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: c.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t.url, style: u }); return this._Provider.treeID = c.id, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull( i) ? 0 : i), "function" == typeof r && r(this.item), this }, pt.prototype.createPolylineVectorGeoJsonFeatureLayerProvider = function(e, a, d, t, i, o) { var r = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, outlineWidth: 1, show: !0, material: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.WHITE, gapColor: this._cesium.Color.TRANSPARENT, height: 30 }, n = { url: a.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: a.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(a.srs, "EPSG:4326") + ":{z}", TILEMATRIXSET: this._core.defaultValue(a.srs, "EPSG:4326"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: d.level_min, lowerLevelLimit: d.level_max, Cesium: this._cesium }, p = (this._core.isnull(d) || this._core.isnull(d.material) || "[" == d.material.toString().charAt( 0) && "]" == d.material.toString().charAt(d.material.length - 1) || (d.material = Cesium.Color .fromCssColorString(d.material)), this._core.isnull(d) || this._core.isnull(d .outlineColor) || (d.outlineColor = Cesium.Color.fromCssColorString(d.outlineColor)), this._core .isnull(d) || this._core.isnull(d.gapColor) || (d.gapColor = Cesium.Color.fromCssColorString(d .gapColor)), this._core.extend({ ...r }, d, !0)), s = this, l = (this._urlTemplate = a.url + "?" + this._core._serialize(n.urlParams), a.url + "?" + this._core ._serialize(n.urlParams)); s._core.xhr({ url: a.url + "?service=WMTS&request=GetCapabilities", type: "get", isXml: !0, success: function(r) { r = s._core.xml2json(r); let e = r.Contents && r.Contents.Layer; var n, r = e.filter(e => e.Identifier === a.layer)[0]; if (r) { let e = r.TileMatrixSetLink, t = r.WGS84BoundingBox; t && (r = t.LowerCorner.split(" "), n = t.UpperCorner.split(" "), s.item .boundingSphere = Cesium.BoundingSphere.fromPoints([Cesium.Cartesian3 .fromDegrees(r[0], r[1]), Cesium.Cartesian3.fromDegrees(n[0], n[ 1]) ])); let i = a.srs || "EPSG:4326", o = e.filter(e => e.TileMatrixSet === i)[0]; o && (s.TileMatrixLimits = {}, o.TileMatrixSetLimits && o.TileMatrixSetLimits .TileMatrixLimits.forEach(e => { let t = e.TileMatrix; var i = (t = t.split(":"))[t.length - 1]; s.TileMatrixLimits[i] = { maxCol: e.MaxTileCol, minCol: e.MinTileCol, maxRow: e.MaxTileRow, minRow: e.MinTileRow } })) } s.initThisProvider() } }), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = d.level_max - 1, this.initThisProvider = () => { this.initThisProvider = void 0, this._Provider.loadTile = function(e, t) { var c = e, h = t, m = s; if (h.state === Cesium.QuadtreeTileLoadState.START) { if (h.data = { lines: [], geometryPrimitive: void 0 }, !(h.level >= d.level_min && h.level < d.level_max && m.item.show)) return void(h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0); if (m.TileMatrixLimits) { var i = m.TileMatrixLimits[h.level]; if (h.x > i.maxCol || h.x < i.minCol || h.y > i.maxRow || h.y < i.minRow) return void(h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0) } i = l.replace(window.encodeURIComponent("{x}"), h.x).replace(window .encodeURIComponent("{y}"), h.y).replace(window.encodeURIComponent("{z}"), h .level); m._cache && (i += "&" + m._core.getuid()), m._core.xhr({ url: i, type: "get", dataType: "json", success: function(e) { var o, r = [], i = [], n = !1; for (o of e.features) { var t, i = []; function a(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? a(e[t]) : (2 === t && (e[t] = p.height || e[t], n = !0), i.push(e[t]), 1 === t && 2 === e .length && i.push(p.height || 0)) } if (/^\[/.test(d.material) && /\]$/.test(d.material) && (t = d.material.replace(/\[/, "").replace(/\]/, ""), p .material = o.properties[t], p.material = Cesium .Color.fromCssColorString(p.material)), /^\[/.test(d .height) && /\]$/.test(d.height) && (t = d.height .replace(/\[/, "").replace(/\]/, ""), p.height = o .properties[t]), Array.isArray(o.geometry .coordinates) && 0 < o.geometry.coordinates.length) if (Array.isArray(o.geometry.coordinates[0][0])) for (var s = 0; s < o.geometry.coordinates .length; s++) i = [], a(o.geometry.coordinates[ s]), l(i); else a(o.geometry.coordinates), l(i); function l(e) { var t = m._cesium.Cartesian3.fromDegreesArrayHeights(e), i = (p.positions = t, { positions: p.positions, width: p.width }), t = (o.positions = t, o.treeID = p.id, o .VectorType = "polyline", o.VectorStyle = { haveZ: n, width: p.width, positions: e, material: p.material, clampToGround: p.clampToGround }, null), i = (t = p.clampToGround ? (i = new m._cesium .GroundPolylineGeometry(i), new m._cesium .GeometryInstance({ id: o, geometry: i, attributes: { color: new m._cesium .ColorGeometryInstanceAttribute .fromColor(p.material), distanceDisplayCondition: new Cesium .DistanceDisplayConditionGeometryInstanceAttribute( p.near, p.far) } })) : (e = new m._cesium.PolylineGeometry( p), new m._cesium.GeometryInstance({ id: o, geometry: e, attributes: { color: new m._cesium .ColorGeometryInstanceAttribute .fromColor(p.material), distanceDisplayCondition: new Cesium .DistanceDisplayConditionGeometryInstanceAttribute( p.near, p.far) } })), "material:" + 255 * p.material.red + "," + 255 * p.material.green + "," + 255 * p .material.blue); m.Legend.push(i), r.push(t) } } e = null; let u; u = p.dash ? new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material .PolylineDashType, { color: p.material, gapColor: p.gapColor || Cesium.Color .TRANSPARENT, dashLength: p.dashLength || 20 }) }) : new Cesium.MaterialAppearance({ material: new Cesium.Material({ fabric: { type: "PolylineOutline", uniforms: { color: p.material, outlineColor: p.outlineColor, outlineWidth: p.outlineWidth } } }), faceForward: !0, flat: !1 }), e = p.clampToGround ? new m._cesium .GroundPolylinePrimitive({ geometryInstances: r, appearance: u }) : new m._cesium.Primitive({ geometryInstances: r, appearance: u, shadows: m._cesium.ShadowMode.ENABLED }), h.data.geometryPrimitive = e, h.state = Cesium .QuadtreeTileLoadState.LOADING, h.state === Cesium .QuadtreeTileLoadState.LOADING && (h.data.geometryPrimitive .update(c, []), h.state = Cesium.QuadtreeTileLoadState .DONE, h.renderable = !0) }, error: function() { null == h.count && (h.count = 0), h.count += 1, 2 <= h.count ? ( h.state = Cesium.QuadtreeTileLoadState.DONE, h .renderable = !0) : h.state = Cesium .QuadtreeTileLoadState.START } }), h.state = Cesium.QuadtreeTileLoadState.LOADING } } }; let u, c; this.saveDefaultVectorData = () => { c = s._core.extend({}, d, !0) }, this.restoreVector = () => { c && (d = c, p = s._core.extend({ ...r }, d, !0), s._Provider._normalTile = d.level_max - 1, s._primitive && s._primitive ._tilesToRender && s._primitive._tilesToRender.length && (s._primitive._tilesToRender .forEach(e => { e.data.geomeitryPrimitive && e.data.geomeitryPrimitive.destroy(), e.state = Cesium.QuadtreeTileLoadState.START }), s._primitive._tileToUpdateHeights.forEach(e => { e.data.geomeitryPrimitive && e.data.geomeitryPrimitive.destroy(), e.state = Cesium.QuadtreeTileLoadState.START }), s._primitive._tileToUpdateHeights = [], s._primitive._tilesToRender = [])), c = void 0 }, this.updataVector = (e = {}) => { (e.material || e.outlineColor || e.gapColor) && (e.material && (e.material = Cesium.Color .fromCssColorString(e.material)), e.outlineColor && (e.outlineColor = Cesium.Color .fromCssColorString(e.outlineColor)), e.gapColor && (e.gapColor = Cesium.Color .fromCssColorString(e.gapColor))), void 0 === e.minimumLevel && void 0 === e.maximumLevel || (void 0 !== e.minimumLevel && (e.level_min = e.minimumLevel), void 0 !== e.maximumLevel && ( e.level_max = e.maximumLevel)), d = s._core.extend(d, e, !0), p = s._core.extend(p, d, ! 0), s._Provider._normalTile = d.level_max - 1, s._primitive && s._primitive ._tilesToRender && s._primitive._tilesToRender.length && (clearTimeout(u), u = setTimeout( () => { s._primitive._tilesToRender.forEach(e => { e.data.geomeitryPrimitive && e.data.geomeitryPrimitive.destroy(), e .state = Cesium.QuadtreeTileLoadState.START }), s._primitive._tileToUpdateHeights.forEach(e => { e.data.geomeitryPrimitive && e.data.geomeitryPrimitive.destroy(), e .state = Cesium.QuadtreeTileLoadState.START }), s._primitive._tileToUpdateHeights = [], s._primitive._tilesToRender = [] }, 100)) }, this._forceRefreshProvider = this._Provider, this._primitive = new s._cesium .QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 5 }); n = this._viewer.scene, n.primitives.add(this._primitive), n.primitivesQuadTrees && n .primitivesQuadTrees.push(this._primitive), d && d.time && (geoJSONVectorTileProvider.availability = new s._cesium.TimeIntervalCollection([new s._cesium.TimeInterval({ start: d.time.start ? s._cesium.JulianDate.fromDate(new Date(d.time.start)) : s ._cesium.Iso8601.MINIMUM_VALUE, stop: d.time.end ? s._cesium.JulianDate.fromDate(new Date(d.time.end)) : s ._cesium.Iso8601.MAXIMUM_VALUE })])), i || this.setVisibility(!1), this._core.isnull(p.id) && (p.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + p.id), this.west = a.minx, this.south = a.miny, this.east = a .maxx, this.north = a.maxy, n = { id: p.id, name: e, checked: !0, pId: this._core.isnull(t) ? 0 : t, type: "polylineLayer", item: this, url: a.url, style: d }; return this._Provider.treeID = p.id, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull( t) ? 0 : t), "function" == typeof o && o(this.item), this }, pt.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel_obsolete = function(e, t, u, i, o, r) { var n = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE, height: 30 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, c = (this._core.isnull(u) || this._core.isnull(u.material) || "[" == u.material.toString().charAt( 0) && "]" == u.material.toString().charAt(u.material.length - 1) || (this._core.isHtmlColor(u .material) ? u.material = this._color.colorFromHtmlColor(u.material) : (/^rgb/.test(u .material) && (u.material = this._color.rgbaStringToRgbaObj(u.material)), 1 < u .material.r && (u.material.r = u.material.r / 255), 1 < u.material.g && (u.material.g = u.material.g / 255), 1 < u.material.b && (u.material.b = u.material.b / 255), 1 < u .material.a && (u.material.a = u.material.a / 255), u.material = this._color .createColor(u.material.r, u.material.g, u.material.b, u.material.a))), this._core.extend(n, u, !0)), h = this, n = new v(this._viewer, this._cesium, a), a = ((this._Provider = n)._loadTile = function(e, t) { var s = new h._cesium.PrimitiveCollection, l = []; return e.features.forEach(function(a) { var e, i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[t]) : i.push(e[ t]) } if (/^\[/.test(u.material) && /\]$/.test(u.material) && (e = u.material.replace( /\[/, "").replace(/\]/, ""), c.material = a.properties[e], h._core .isHtmlColor(c.material) ? c.material = h._color.colorFromHtmlColor(c .material) : (/^rgb/.test(c.material) && (c.material = h._color .rgbaStringToRgbaObj(c.material)), 1 < c.material.r && (c .material.r = c.material.r / 255), 1 < c.material.g && (c .material.g = c.material.g / 255), 1 < c.material.b && (c .material.b = c.material.b / 255), 1 < c.material.a && (c .material.a = c.material.a / 255), c.material = h._color .createColor(c.material.r, c.material.g, c.material.b, c.material.a) )), Array.isArray(a.geometry.coordinates) && 0 < a.geometry .coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var t = 0; t < a.geometry.coordinates.length; t++) i = [], o(a .geometry.coordinates[t]), r(i), n(i); else o(a.geometry.coordinates), r(i), n(i); function r(e) { var t = h._cesium.Cartesian3.fromDegreesArray(e), t = (c.positions = t, a.positions = t, { positions: c.positions, width: c.width }), i = null; if (c.clampToGround) t = new h._cesium.GroundPolylineGeometry(t), i = new h ._cesium.GeometryInstance({ id: a, geometry: t, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute .fromColor(c.material) } }); else { for (var o = e, r = e.length / 2 + 1 + e.length, n = 2; n < r; n += 3) o .splice(n, 0, parseFloat(c.height)); t = h._cesium.Cartesian3.fromDegreesArrayHeights(o), e = (c.positions = t, new h._cesium.PolylineGeometry(c)), t = h._cesium .PolylineGeometry.createGeometry(e); i = new h._cesium.GeometryInstance({ id: a, geometry: t, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute .fromColor(c.material) } }) } e = null, e = c.clampToGround ? new h._cesium.GroundPolylinePrimitive({ geometryInstances: i, appearance: new h._cesium.MaterialAppearance({ material: new h._cesium.Material({ fabric: { type: "Color", uniforms: { color: c.material } } }), faceForward: !0, flat: !1 }) }) : new h._cesium.Primitive({ geometryInstances: i, appearance: new h._cesium.PolylineMaterialAppearance({ material: new h._cesium.Material({ fabric: { type: "Color", uniforms: { color: c.material } } }) }), shadows: h._cesium.ShadowMode.ENABLED }); s.add(e) } function n(e) { for (var t = c.clampToGround ? h._cesium.Cartesian3.fromDegreesArray(e) : h ._cesium.Cartesian3.fromDegreesArrayHeights(e), i = 1; i < t .length; i++) { var o = [], r = (o.push(t[i - 1]), o.push(t[i]), h._cesium.SceneTransforms .wgs84ToWindowCoordinates(h._viewer.scene, t[i - 1]).x), n = h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer .scene, t[i - 1]).y, a = h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer .scene, t[i]).x, s = h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer .scene, t[i]).y; h.setPolylinemodels(o, r, n, a, s, c, function(e) { l.push(e) }) } } }), l.length && (e = new h._cesium.ModelInstanceCollection({ url: c.url, instances: l, color: c.color, lightColor: c.lightColor, scale: parseInt(c.scale), heightReference: parseInt(c.heightReference), distanceDisplayCondition: c.distanceDisplayCondition }), s.add(e)), s }, u && u.time && (n.availability = new h._cesium.TimeIntervalCollection([new h._cesium .TimeInterval({ start: u.time.start ? h._cesium.JulianDate.fromDate(new Date(u.time .start)) : h._cesium.Iso8601.MINIMUM_VALUE, stop: u.time.end ? h._cesium.JulianDate.fromDate(new Date(u.time.end)) : h ._cesium.Iso8601.MAXIMUM_VALUE }) ])), this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + c .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: c.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t.url, style: u }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, pt.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel = function(e, t, d, i, o, r) { var n = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE, height: 30 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, p = (this.item.show = o, this._core.isnull(d) || this._core.isnull(d.material) || "[" == d.material .toString().charAt(0) && "]" == d.material.toString().charAt(d.material.length - 1) || (this ._core.isHtmlColor(d.material) ? d.material = this._color.colorFromHtmlColor(d.material) : ( /^rgb/.test(d.material) && (d.material = this._color.rgbaStringToRgbaObj(d.material)), 1 < d.material.r && (d.material.r = d.material.r / 255), 1 < d.material.g && (d.material .g = d.material.g / 255), 1 < d.material.b && (d.material.b = d.material.b / 255), 1 < d.material.a && (d.material.a = d.material.a / 255), d.material = this._color .createColor(d.material.r, d.material.g, d.material.b, d.material.a))), this._core .extend(n, d, !0)), s = this, l = (this._urlTemplate = t.url + "?" + this._core._serialize(a.urlParams), t.url + "?" + this._core ._serialize(a.urlParams)), n = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = d.level_max - 1, this._Provider.loadTile = function(e, t) { var h = t, m = s; if (h.state === Cesium.QuadtreeTileLoadState.START) { if (h.data = { lines: [], geometryPrimitive: void 0 }, !(h.level >= d.level_min && h.level < d.level_max && m.item.show)) return void(h .state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0); t = l.replace(window.encodeURIComponent("{x}"), h.x).replace(window.encodeURIComponent( "{y}"), h.y).replace(window.encodeURIComponent("{z}"), h.level); m._cache && (t += "&" + m._core.getuid()), m._core.xhr({ url: t, type: "get", dataType: "json", success: function(e) { var l = [], a = new m._cesium.PrimitiveCollection, t = e.features, i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[ t]) : i.push(e[t]) } function r(e) { var t = m._cesium.Cartesian3.fromDegreesArray(e), t = (p.positions = t, u.positions = t, { positions: p.positions, width: p.width }), i = null; if (p.clampToGround) t = new m._cesium.GroundPolylineGeometry( t), i = new m._cesium.GeometryInstance({ id: u, geometry: t, attributes: { color: new m._cesium .ColorGeometryInstanceAttribute.fromColor(p .material) } }); else { for (var o = e, r = e.length / 2 + 1 + e.length, n = 2; n < r; n += 3) o.splice(n, 0, parseFloat(p.height)); t = m._cesium.Cartesian3.fromDegreesArrayHeights(o), e = (p .positions = t, new m._cesium.PolylineGeometry(p)), t = m._cesium.PolylineGeometry.createGeometry(e); i = new m._cesium.GeometryInstance({ id: u, geometry: t, attributes: { color: new m._cesium .ColorGeometryInstanceAttribute .fromColor(p.material) } }) } e = null, e = p.clampToGround ? new m._cesium .GroundPolylinePrimitive({ geometryInstances: i, appearance: new m._cesium.MaterialAppearance({ material: new m._cesium.Material({ fabric: { type: "Color", uniforms: { color: p.material } } }), faceForward: !0, flat: !1 }) }) : new m._cesium.Primitive({ geometryInstances: i, appearance: new m._cesium .PolylineMaterialAppearance({ material: new m._cesium.Material({ fabric: { type: "Color", uniforms: { color: p.material } } }) }), shadows: m._cesium.ShadowMode.ENABLED }); a.add(e) } function n(e) { for (var t = p.clampToGround ? m._cesium.Cartesian3 .fromDegreesArray(e) : m._cesium.Cartesian3 .fromDegreesArrayHeights(e), i = 1; i < t.length; i++) try { var o = [], r = (o.push(t[i - 1]), o.push(t[i]), m._cesium .SceneTransforms.wgs84ToWindowCoordinates(m ._viewer.scene, t[i - 1]).x), n = m._cesium.SceneTransforms .wgs84ToWindowCoordinates(m._viewer.scene, t[i - 1]) .y, a = m._cesium.SceneTransforms .wgs84ToWindowCoordinates(m._viewer.scene, t[i]).x, s = m._cesium.SceneTransforms .wgs84ToWindowCoordinates(m._viewer.scene, t[i]).y; m.setPolylinemodels(o, r, n, a, s, p, function(e) { l.push(e) }) } catch (e) {} } /^\[/.test(d.material) && /\]$/.test(d.material) && (e = d.material .replace(/\[/, "").replace(/\]/, ""), p.material = u .properties[e], m._core.isHtmlColor(p.material) ? p .material = m._color.colorFromHtmlColor(p.material) : ( /^rgb/.test(p.material) && (p.material = m._color .rgbaStringToRgbaObj(p.material)), 1 < p.material .r && (p.material.r = p.material.r / 255), 1 < p .material.g && (p.material.g = p.material.g / 255), 1 < p.material.b && (p.material.b = p.material.b / 255), 1 < p.material.a && (p.material.a = p.material.a / 255), p .material = m._color.createColor(p.material.r, p .material.g, p.material.b, p.material.a))); for (var s = 0; s < t.length; s++) { var u = t[s]; if (Array.isArray(u.geometry.coordinates) && 0 < u.geometry .coordinates.length) if (Array.isArray(u.geometry.coordinates[0][0])) for (var c = 0; c < u.geometry.coordinates.length; c++) i = [], o(u.geometry.coordinates[c]), r(i), n(i); else o(u.geometry.coordinates), r(i), n(i) } l.length && (e = new m._cesium.ModelInstanceCollection({ url: p.url, instances: l, color: p.color, lightColor: p.lightColor, scale: parseInt(p.scale), heightReference: parseInt(p.heightReference), distanceDisplayCondition: p.distanceDisplayCondition }), a.add(e)), h.data.geometryPrimitive = a }, error: function() { null == h.count && (h.count = 0), h.count += 1, 2 <= h.count ? (h .state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = ! 0) : h.state = Cesium.QuadtreeTileLoadState.START } }), h.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new s._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 5 }), this._viewer.scene), a = (n.primitives.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(p.id) && (p.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + p.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: p.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t.url, style: d }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, pt.prototype.setPolylinemodels = function(e, t, i, o, r, n, a) { for (var s = this._cesium, l = this._core.getSpaceDistancem(e, s), u = 10, c = parseFloat(n.distance), l = (0 != c && (u = parseInt(l / c)), e[0]), c = e[e.length - 1], e = s.Cartographic .fromCartesian(l), h = s.Math.toDegrees(e.longitude), m = s.Math.toDegrees(e.latitude), l = s .Cartographic.fromCartesian(c), e = s.Math.toDegrees(l.longitude), c = s.Math.toDegrees(l .latitude), d = u, p = s.Math.lerp(h, e, 1 / d) - h, g = s.Math.lerp(m, c, 1 / d) - m, _ = 0; _ < d; _++) { var f = s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(h + (_ + 1) * p, m + (_ + 1) * g, parseInt(n.height))); Cesium.Matrix4.multiplyByUniformScale(f, parseInt(n.scale), f), a && a({ modelMatrix: f, modelId: n }) } }, pt.prototype.getType = function() { return { label: "线", value: "polylineLayer" } }, pt.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, pt.prototype.deleteObject = function() { if (this._viewer.scene.primitives.remove(this.item), null != this.model && null != this.model && 0 < this.model.length) for (var e = 0; e < this.model.length; e++) this._viewer.scene.primitives.remove(this.model[e]); try { this._Provider.remove() } catch (e) {} }, pt.prototype.setTreeobj = function(e) { this.treeobj = e }, pt.prototype.getLegend = function() { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, pt.prototype.setRefresh = function(e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) {} }, pt.prototype.setVisibility = function(e) { if (null != this.item && (this.item.show = e), this._Provider && this._Provider.setStatus(e), null != this.model && null != this.model && 0 < this.model.length) for (var t = 0; t < this.model.length; t++) this.model[t].show = e }, pt.prototype.edit = function(e, t) { return this.editoption = t, this.isEditting = e, this._Provider && this._Provider.edit && this._Provider .edit(e, t) }, pt.prototype.forceRefresh = function() { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) this._Provider.quadtree ._levelZeroTiles[e].freeResources() } catch (e) {} }, S.prototype.exectPointModel = function(e, t, _, i, f, y) { var o = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE, height: 30 }, v = (this._core.isnull(_) || this._core.isnull(_.material) || "[" == _.material.toString().charAt( 0) && "]" == _.material.toString().charAt(_.material.length - 1) || (this._core.isHtmlColor(_ .material) ? _.material = this._color.colorFromHtmlColor(_.material) : (/^rgb/.test(_ .material) && (_.material = this._color.rgbaStringToRgbaObj(_.material)), 1 < _ .material.r && (_.material.r = _.material.r / 255), 1 < _.material.g && (_.material.g = _.material.g / 255), 1 < _.material.b && (_.material.b = _.material.b / 255), 1 < _ .material.a && (_.material.a = _.material.a / 255), _.material = this._color .createColor(_.material.r, _.material.g, _.material.b, _.material.a))), this._core.isnull( _) || this._core.isnull(_.color) || "[" == _.color.toString().charAt(0) && "]" == _.color .toString().charAt(_.color.length - 1) || (this._core.isHtmlColor(_.color) ? _.color = this ._color.colorFromHtmlColor(_.color) : (/^rgb/.test(_.color) && (_.color = this._color .rgbaStringToRgbaObj(_.color)), 1 < _.color.r && (_.color.r = _.color.r / 255), 1 < _.color.g && (_.color.g = _.color.g / 255), 1 < _.color.b && (_.color.b = _.color.b / 255), 1 < _.color.a && (_.color.a = _.color.a / 255), _.color = this._color .createColor(_.color.r, _.color.g, _.color.b, _.color.a))), this._core.isnull(_) || this ._core.isnull(_.lightColor) || "[" == _.lightColor.toString().charAt(0) && "]" == _.lightColor .toString().charAt(_.lightColor.length - 1) || (this._core.isHtmlColor(_.lightColor) ? _ .lightColor = this._color.colorFromHtmlColor(_.lightColor) : (/^rgb/.test(_.lightColor) && ( _.lightColor = this._color.rgbaStringToRgbaObj(_.lightColor)), 1 < _.lightColor.r && (_.lightColor.r = _.lightColor.r / 255), 1 < _.lightColor.g && (_.lightColor.g = _ .lightColor.g / 255), 1 < _.lightColor.b && (_.lightColor.b = _.lightColor.b / 255), 1 < _.lightColor.a && (_.lightColor.a = _.lightColor.a / 255), _.lightColor = this ._color.createColor(_.lightColor.r, _.lightColor.g, _.lightColor.b, _.lightColor.a))), this._core.isnull(_) || this._core.isnull(_.linecolor) || "[" == _.linecolor.toString().charAt( 0) && "]" == _.linecolor.toString().charAt(_.linecolor.length - 1) || (this._core .isHtmlColor(_.linecolor) ? _.linecolor = this._color.colorFromHtmlColor(_.linecolor) : ( /^rgb/.test(_.linecolor) && (_.linecolor = this._color.rgbaStringToRgbaObj(_ .linecolor)), 1 < _.linecolor.r && (_.linecolor.r = _.linecolor.r / 255), 1 < _ .linecolor.g && (_.linecolor.g = _.linecolor.g / 255), 1 < _.linecolor.b && (_.linecolor .b = _.linecolor.b / 255), 1 < _.linecolor.a && (_.linecolor.a = _.linecolor.a / 255), _.linecolor = this._color.createColor(_.linecolor.r, _.linecolor.g, _ .linecolor.b, _.linecolor.a))), this._core.extend(o, _, !0)), o = (this._core.isnull(_.near) && (_.near = 0), this._core.isnull(_.far) && (_.far = 999999999), parseFloat(_.near)), r = parseFloat(_.far), o = new this._cesium.DistanceDisplayCondition(o, r), r = (v.distanceDisplayCondition = o, null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t), C = this, o = (r.then(function(e) { e.entities.values; for (var t, i = [], o = e.entities.values, i = [], r = 0; r < o.length; r++) { var n = o[r], a = new C._cesium.GeometryInstance({ id: n, geometry: new C._cesium.CorridorGeometry({ positions: n.polyline.positions._value, width: v.width, height: v.height, arcType: v.arcType, vertexFormat: C._cesium.VertexFormat.POSITION_ONLY }), attributes: { color: new C._cesium.ColorGeometryInstanceAttribute.fromColor(v .linecolor) } }); i.push(a) } _ && _.time && (t = new C._cesium.TimeIntervalCollection([new C._cesium.TimeInterval({ start: _.time.start ? C._cesium.JulianDate.fromDate(new Date(_ .time.start)) : C._cesium.Iso8601.MINIMUM_VALUE, stop: _.time.end ? C._cesium.JulianDate.fromDate(new Date(_.time .end)) : C._cesium.Iso8601.MAXIMUM_VALUE })])); for (var e = C._viewer.scene.primitives.add(new C._cesium.GroundPrimitive({ geometryInstances: i, classificationType: C._cesium.ClassificationType.BOTH }), t), s = (e.show = v.show, C.item = e, []), r = 0; r < o.length; r++) for (var l = (n = o[r]).polyline.positions.getValue(), u = 1; u < l.length; u++) try { var c = [], h = (c.push(l[u - 1]), c.push(l[u]), C._cesium.SceneTransforms .wgs84ToWindowCoordinates(C._viewer.scene, l[u - 1]).x), m = C._cesium.SceneTransforms.wgs84ToWindowCoordinates(C._viewer.scene, l[u - 1]).y, d = C._cesium.SceneTransforms.wgs84ToWindowCoordinates(C._viewer.scene, l[u]).x, p = C._cesium.SceneTransforms.wgs84ToWindowCoordinates(C._viewer.scene, l[u]).y, s = C.setPolylinemodels(c, h, m, d, p, s, v, C._cesium, C._viewer, t) } catch (e) {} var g = new C._cesium.ModelInstanceCollection({ url: v.url, instances: s, color: v.color, lightColor: v.lightColor, scale: parseInt(v.scale), heightReference: parseInt(v.heightReference), distanceDisplayCondition: v.distanceDisplayCondition }); C._viewer.scene.primitives.add(g), C.model.push(g), f || C.setVisibility(!1), "function" == typeof y && y(e) }), this._core.isnull(v.id) && (v.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + v.id), { id: v.id, name: e, checked: f, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, S.prototype.createPointModel = function(e, c) { var h = this, m = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), d = [], t = null, i = 0, o = null, p = [], g = e.parameterd, _ = (e.objid, e.cyjj), r = e.url, f = (this.modelurl = r, []), n = { point: h._cesium.Color.RED, polyline: h._cesium.Color.YELLOW }, y = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (n.point = e.point), "" != e .polyline && null != e.polyline && (n.polyline = e.polyline)), this._core.CreateTooltip()), v = { spot: [], distance: [], label: [], polyline: [], model: [] }, a = (m.setInputAction(function(e) { 0 === d.length ? y.showAt(e.endPosition, "左键开始,右键结束!") : y.showAt(e.endPosition, "右键结束!"); e = h._viewer.camera.getPickRay(e.endPosition); o = h._viewer.scene.globe.pick(e, h._viewer.scene), 2 <= d.length && (h._cesium.defined( t) ? (d.pop(), d.push(o)) : t = new a(d), i = h._core.getHorizontalDistance( d, h._cesium)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), m.setInputAction(function(e) { var t = h._viewer.camera.getPickRay(e.position), t = (o = h._viewer.scene.globe.pick(t, h._viewer.scene), 0 == d.length && d.push(o .clone()), { px: e.position.x, py: e.position.y }), e = (d.push(o), { positionsxp: o, lxy: t }); f.push(e), v.spot.push(o), v.distance.push(i) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), m.setInputAction(function(e) { m.destroy(), d.pop(); for (var t = 0; t < p.length; t++) h._viewer.entities.remove(p[t]); for (var i = [], o = 1; o < f.length; o++) { var r = [], n = f[o - 1].lxy.px, a = f[o - 1].lxy.py, s = f[o].lxy.px, l = f[o].lxy.py, u = g; r.push(f[o - 1].positionsxp), r.push(f[o].positionsxp), i = h.setPolylinemodel(r, n, a, s, l, u, _, h.modelurl, i, h._cesium, h._viewer) } v.model = i, "" != c && null != c && "function" == typeof c && c(v), y.show(!1) }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), s.prototype._init = function() { var e = this, t = (this.options.polyline.positions = new h._cesium.CallbackProperty(function() { return e.positions }, !1), h._viewer.entities.add(this.options)); h.item = t, p.push(t), v.polyline.push(t) }, s); function s(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: n.polyline, width: 3, clampToGround: !0 } }, this.positions = e, this._init() } return this }, S.prototype.setPolylinemodel = function(e, t, i, o, r, n, a, s, l, u, c) { for (var h = this._core.getSpaceDistancem(e, u), h = (0 != a && (n = parseInt(h / a)), e[0]), a = e[e .length - 1], e = u.Cartographic.fromCartesian(h), m = u.Math.toDegrees(e.longitude), d = u .Math.toDegrees(e.latitude), h = (e.height, u.Cartographic.fromCartesian(a)), e = u.Math .toDegrees(h.longitude), a = u.Math.toDegrees(h.latitude), p = (h.height, n), g = u.Math.lerp(m, e, 1 / p) - m, _ = u.Math.lerp(d, a, 1 / p) - d, f = u.Math.lerp(t, o, 1 / p) - t, y = u .Math.lerp(i, r, 1 / p) - i, v = 0; v < p; v++) { var C = m + (v + 1) * g, w = d + (v + 1) * _; (0 == v || 1 == v) && new u.Cartesian3(C, w, 0); C = t + (v + 1) * f, w = i + (v + 1) * y; var b = c.camera.pickEllipsoid({ x: C, y: w }, c.scene.globe.ellipsoid), b = u.Cartographic.fromCartesian(b), C = u.Math.toDegrees(b.longitude), w = u.Math.toDegrees(b.latitude), b = u.Transforms.eastNorthUpToFixedFrame(u.Cartesian3.fromDegrees(C, w, 6)), C = u.Model.fromGltf({ url: s, modelMatrix: b, scale: 100 }); c.scene.primitives.add(C), l.push(C) } return l }, S.prototype.setPolylinemodels_obsolete = function(e, t, i, o, r, n, a, s, l, u) { var c = this._core.getSpaceDistancem(e, s), h = 10, m = parseFloat(a.distance), c = (0 != m && (h = parseInt(c / m)), e[0]), m = e[e.length - 1], e = s.Cartographic.fromCartesian(c), d = s.Math.toDegrees(e.longitude), p = s.Math.toDegrees(e.latitude), c = (e.height, s.Cartographic.fromCartesian(m)), m = s.Math.toDegrees(c.longitude), g = s.Math.toDegrees(c.latitude), _ = (c.height, s.Math.toDegrees(e.height), h), f = s.Math.lerp(d, m, 1 / _) - d, y = s.Math.lerp(p, g, 1 / _) - p; s.Math.lerp(t, o, 1 / _), s.Math.lerp(i, r, 1 / _); for (var v = 0; v < _; v++) { var C = s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(d + (v + 1) * f, p + (v + 1) * y, a.height)), C = (parseInt(a.heightReference), s.Model.fromGltf({ url: a.url, modelMatrix: C, color: a.color, lightColor: a.lightColor, scale: parseInt(a.scale), heightReference: parseInt(a.heightReference), distanceDisplayCondition: a.distanceDisplayCondition })); l.scene.primitives.add(C, u), n.push(C) } return n }, S.prototype.setPolylinemodels = function(e, t, i, o, r, n, a, s, l, u) { var c = this._core.getSpaceDistancem(e, s), h = 10, m = parseFloat(a.distance), c = (0 != m && (h = parseInt(c / m)), e[0]), m = e[e.length - 1], e = s.Cartographic.fromCartesian(c), d = s.Math.toDegrees(e.longitude), p = s.Math.toDegrees(e.latitude), c = (e.height, s.Cartographic.fromCartesian(m)), m = s.Math.toDegrees(c.longitude), g = s.Math.toDegrees(c.latitude), _ = (c.height, s.Math.toDegrees(e.height), h), f = s.Math.lerp(d, m, 1 / _) - d, y = s.Math.lerp(p, g, 1 / _) - p; s.Math.lerp(t, o, 1 / _), s.Math.lerp(i, r, 1 / _); for (var v = 0; v < _; v++) { var C = s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(d + (v + 1) * f, p + (v + 1) * y, parseInt(a.height || 0))); parseInt(a.heightReference), Cesium.Matrix4.multiplyByUniformScale(C, parseInt(a.scale), C), n .push({ modelMatrix: C, modelId: a }) } return n }, S.prototype.createPolygonModel = function(e, t, m, i, o, d) { var p, r = { height: 0, extrudedHeight: 0, heightReference: this._cesium.HeightReference.RELATIVE_TO_GROUND, show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, stRotation: 0, granularity: this._cesium.Math.RADIANS_PER_DEGREE, perPositionHeight: !1, closeTop: !0, closeBottom: !0, shadows: this._cesium.ShadowMode.ENABLED, clampToGround: !0, scale: 1, classificationType: this._cesium.ClassificationType.BOTH }, g = m.modelurl, _ = (this._core.isnull(m) || this._core.isnull(m.fill) || (this._core.isHtmlColor(m.fill) ? m .material = this._color.colorFromHtmlColor(m.fill) : (/^rgb/.test(m.fill) && (m.material = this._color.rgbaStringToRgbaObj(m.fill)), 1 < m.material.r && (m.material.r = m .material.r / 255), 1 < m.material.g && (m.material.g = m.material.g / 255), 1 < m .material.b && (m.material.b = m.material.b / 255), 1 < m.material.a && (m.material.a = m.material.a / 255), m.material = this._color.createColor(m.material.r, m.material .g, m.material.b, m.material.a))), this._core.isnull(m) || this._core.isnull(m .outlineColor) || (this._core.isHtmlColor(m.outlineColor) ? m.outlineColor = this._color .colorFromHtmlColor(m.outlineColor) : (/^rgb/.test(m.outlineColor) && (m.outlineColor = this ._color.rgbaStringToRgbaObj(m.outlineColor)), 1 < m.outlineColor.r && (m .outlineColor.r = m.outlineColor.r / 255), 1 < m.outlineColor.g && (m.outlineColor .g = m.outlineColor.g / 255), 1 < m.outlineColor.b && (m.outlineColor.b = m .outlineColor.b / 255), 1 < m.outlineColor.a && (m.outlineColor.a = m.outlineColor .a / 255), m.outlineColor = this._color.createColor(m.outlineColor.r, m.outlineColor .g, m.outlineColor.b, m.outlineColor.a))), this._core.isnull(m) || this._core.isnull(m .color) || (this._core.isHtmlColor(m.color) ? m.color = this._color.colorFromHtmlColor(m .color) : (/^rgb/.test(m.color) && (m.color = this._color.rgbaStringToRgbaObj(m.color)), 1 < m.color.r && (m.color.r = m.color.r / 255), 1 < m.color.g && (m.color.g = m.color .g / 255), 1 < m.color.b && (m.color.b = m.color.b / 255), 1 < m.color.a && (m.color .a = m.color.a / 255), m.color = this._color.createColor(m.color.r, m.color.g, m .color.b, m.color.a))), this._core.isnull(m) || this._core.isnull(m.lightColor) || (this ._core.isHtmlColor(m.lightColor) ? m.lightColor = this._color.colorFromHtmlColor(m .lightColor) : (/^rgb/.test(m.lightColor) && (m.lightColor = this._color .rgbaStringToRgbaObj(m.lightColor)), 1 < m.lightColor.r && (m.lightColor.r = m .lightColor.r / 255), 1 < m.lightColor.g && (m.lightColor.g = m.lightColor.g / 255), 1 < m.lightColor.b && (m.lightColor.b = m.lightColor.b / 255), 1 < m.lightColor.a && (m .lightColor.a = m.lightColor.a / 255), m.lightColor = this._color.createColor(m .lightColor.r, m.lightColor.g, m.lightColor.b, m.lightColor.a))), this._core.extend( r, m, !0)), r = (m.checked = o, _.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND, null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t, { clampToGround: !0 }), f = (this._viewer.dataSources.add(r), this), r = (m && m.time && (p = new f._cesium.TimeIntervalCollection([new f._cesium.TimeInterval({ start: m.time.start ? f._cesium.JulianDate.fromDate(new Date(m.time .start)) : f._cesium.Iso8601.MINIMUM_VALUE, stop: m.time.end ? f._cesium.JulianDate.fromDate(new Date(m.time.end)) : f ._cesium.Iso8601.MAXIMUM_VALUE })])), r.then(function(e) { f.item = e, f.model = []; var t = e.entities.values, i = (f._core.isnull(m.near) && (m.near = 0), f._core.isnull(m.far) && (m.far = 999999999), parseFloat(m.near)), o = parseFloat(m.far), r = new f._cesium.DistanceDisplayCondition(i, o); _.distanceDisplayCondition = r; for (var n = 0; n < t.length; n++) { for (var a = t[n], s = (_.height = parseFloat(f._core.extendgl(a, m.height, _ .height)), _.extrudedHeight = parseFloat(f._core.extendgl(a, m .extrudedHeight, _.extrudedHeight)), _.heightReference = f._core .extendgl(a, m.heightReference, _.heightReference), _.show = f._core .extendgl(a, m.show, _.show), _.material = f._core.extendgl(a, m .material, _.material), _.outline = f._core.extendgl(a, m.outline, _ .outline), _.outlineColor = f._core.extendgl(a, m.outlineColor, _ .outlineColor), _.outlineWidth = parseFloat(f._core.extendgl(a, m .outlineWidth, _.outlineWidth)), _.stRotation = f._core.extendgl(a, m.stRotation, _.stRotation), _.granularity = f._core.extendgl(a, m .granularity, _.granularity), _.distanceDisplayCondition = f._core .extendgl(a, m.distanceDisplayCondition, _.distanceDisplayCondition), _ .perPositionHeight = f._core.extendgl(a, m.perPositionHeight, _ .perPositionHeight), _.closeTop = f._core.extendgl(a, m.closeTop, _ .closeTop), _.closeBottom = f._core.extendgl(a, m.closeBottom, _ .closeBottom), _.shadows = f._core.extendgl(a, m.shadows, _ .shadows), _.classificationType = f._core.extendgl(a, m .classificationType, _.classificationType), a.polygon._hierarchy ._value.positions, a.polygon.heightReference = 1, a.polygon.show = _ .show, a.polygon.material = _.material, a.polygon.outline = _.outline, a .polygon.outlineColor = _.outlineColor, a.polygon.outlineWidth = _ .outlineWidth, a.polygon.stRotation = _.stRotation, a.polygon .granularity = _.granularity, a.polygon.distanceDisplayCondition = r, a .polygon.closeTop = _.closeTop, a.polygon.closeBottom = _.closeBottom, a .polygon.shadows = _.shadows, a.polygon.classificationType = _ .classificationType, p && (a.availability = p), []), l = a.polygon .hierarchy.getValue().positions, u = 0; u < l.length; u++) { var c = f._cesium.Math.toDegrees(f._cesium.Cartographic.fromCartesian(l[u]) .longitude), h = f._cesium.Math.toDegrees(f._cesium.Cartographic.fromCartesian(l[u]) .latitude); s.push(c), s.push(h) } a = f.getTheBottomPoint(s); f.scanningPolygon(a, _.offset_x, _.offset_y, s).forEach(function(e) { e = f._cesium.Transforms.eastNorthUpToFixedFrame(f._cesium.Cartesian3 .fromDegrees(e.lon, e.lat, _.height)), e = f._cesium.Model .fromGltf({ url: g, color: _.color, silhouetteColor: _.lightColor, silhouetteSize: _.lightWidth, modelMatrix: e, scale: _.scale, heightReference: parseInt(_.heightReference), distanceDisplayCondition: r }); f._viewer.scene.primitives.add(e, p), e.time = p, f.model.push(e) }) } m.checked || f.setVisibility(!1), "function" == typeof d && d(e) }), this._core.isnull(_.id) && (_.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + _.id), { id: _.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t, style: _ }); return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i), this }, S.prototype.setItem = function(e) { this.item = e }, S.prototype.modelMove = function() { this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this.yd = !1; var r = this; this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this._tree .handler.setInputAction(function(e) { r._viewer.scene.pickPosition(e.position); var t, i, o, e = r._viewer.scene.pick(e.position); null != r.yd && r.yd && r._tree.handler.destroy(), r.yd = !0, null != e.tileset && (t = e .tileset, i = r._cesium.Cartographic.fromCartesian(t.boundingSphere.center), o = r ._cesium.Cartesian3.fromRadians(i.longitude, i.latitude, i.height), r._tree.handler .setInputAction(function(e) { e = r._viewer.scene.pickPosition(e.endPosition), e = r._cesium.Cartographic .fromCartesian(e), e = r._cesium.Cartesian3.fromRadians(e.longitude, e .latitude, i.height), e = r._cesium.Cartesian3.subtract(e, o, new r ._cesium.Cartesian3); t.modelMatrix = r._cesium.Matrix4.fromTranslation(e) }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE)) }, r._cesium.ScreenSpaceEventType.LEFT_CLICK) }, S.prototype.getTheBottomPoint = function(e) { for (var t = 90, i = 0, o = 1; o < e.length; o += 2) t = t < e[o] ? t : (i = o) && e[o]; return { lon: e[i - 1], lat: e[i] } }, S.prototype.scanningPolygon = function(e, t, i, o) { for (var r, n, a, s = [], l = 180, u = -180, c = -90, h = 0; h < o.length; h += 2) c = c > o[h + 1] ? c : o[h + 1], l = l < o[h] ? l : o[h], u = u > o[h] ? u : o[h]; var i = this.GetPositionFromA_D(e.lat, e.lon, i, 0), m = this.GetPositionFromA_D(e.lat, e.lon, t, 90)[0] - e.lon, d = i[1] - e.lat; for (s.push({ lon: e.lon, lat: e.lat }), (a = { lon: e.lon, lat: e.lat }).lat += d; a.lat <= c; a.lat += d) { for (r = { lon: a.lon - m, lat: a.lat }, n = { lon: a.lon + m, lat: a.lat }, this.IsInPolygon(a.lon, a.lat, o) && s.push({ lon: a.lon, lat: a.lat }); r.lon >= l; r.lon -= m) this.IsInPolygon(r.lon, r.lat, o) && s.push({ lon: r.lon, lat: r.lat }); for (; n.lon <= u; n.lon += m) this.IsInPolygon(n.lon, n.lat, o) && s.push({ lon: n.lon, lat: n.lat }) } return s }, S.prototype.GetPositionFromA_D = function(e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = 6356725 + 21412 * (90 - e) / 90; return [180 * (r / (o * Math.cos(e * Math.PI / 180)) + t * Math.PI / 180) / Math.PI, 180 * (i / o + e * Math.PI / 180) / Math.PI] }, S.prototype.IsInPolygon = function(e, t, i) { var o, r, n, a, s = 0; if (i.length < 6) return !1; i.push(i[0], i[1]); for (var l = 0; l < i.length - 2; l += 2) o = i[l], n = i[l + 1], r = i[l + 2], a = i[l + 3], (n <= t && t < a || a <= t && t < n) && 0 < Math.abs(n - a) && o - (o - r) * (n - t) / (n - a) <= e && s++; return s % 2 != 0 }, S.prototype.createModel = function(e, t, i, o, r, n) { var t = { id: this._core.getuid(), uri: t, show: !0, heading: 0, pitch: 0, roll: 0, scale: 1 }, i = this._core.extend(t, i, !0), e = (this._position = e, { id: i.id, position: this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this ._position[2]), model: i }), a = ((i.heading || i.pitch || i.roll) && (this.heading = i.heading, this.pitch = i.pitch, this .roll = i.roll, e.orientation = this._cesium.Transforms.headingPitchRollQuaternion(this ._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this._position[ 2]), new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium .defaultValue(i.heading, 0)), this._cesium.Math.toRadians(this._cesium .defaultValue(i.pitch, 0)), this._cesium.Math.toRadians(this._cesium .defaultValue(i.roll, 0))))), this); i.rotate && (e.orientation = new this._cesium.CallbackProperty(function() { return a.heading = a.heading + a.rotate, a._cesium.Transforms .headingPitchRollQuaternion(a._cesium.Cartesian3.fromDegrees(a._position[0], a ._position[1], a._position[2]), new a._cesium.HeadingPitchRoll(a._cesium .Math.toRadians(a._cesium.defaultValue(a.heading, 0)), a._cesium.Math .toRadians(a._cesium.defaultValue(a.pitch, 0)), a._cesium.Math.toRadians(a ._cesium.defaultValue(a.roll, 0)))) }, !1), a.rotate = i.rotate, delete i.rotate), delete i.heading, delete i.pitch, delete i.roll, e .model = i, this.item = this._viewer.entities.add(e), "function" == typeof n && n(this.item); i = { id: this.item.id, name: r || "新建模型" + t.id, pId: this._core.isnull(o) ? 0 : o, type: "Point", item: this.item }; return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), this }, S.prototype.createModelEditable = function(e, t, i, o, r, n) { var t = { id: this._core.getuid(), uri: t, show: !0, heading: 0, pitch: 0, roll: 0, scale: 1 }, i = this._core.extend(t, i, !0), e = (this._position = e, { position: this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this ._position[2]), model: i }), a = this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this._position[2]), s = this.createCylinder(a, new this._cesium.CallbackProperty(function() { var e = l._cesium.Cartesian3.fromDegrees(l._position[0], l._position[1], l._position[ 2]), t = l._cesium.Math.toRadians(l.heading), t = new l._cesium.HeadingPitchRoll(t, l._cesium.Math.toRadians(l.pitch), l._cesium .Math.toRadians(l.roll)); return l._cesium.Transforms.headingPitchRollQuaternion(e, t) }, !1), new this._cesium.CallbackProperty(u, !1), new this._cesium.CallbackProperty(c, !1), this ._cesium.Color.LIMEGREEN, !1), s = (s.oid = 1, this.modelPointArr.push(s), this.createCylinder(a, new this._cesium .CallbackProperty(function() { var e = l._cesium.Cartesian3.fromDegrees(l._position[0], l._position[1], l ._position[2]), t = l._cesium.Math.toRadians(l.heading), t = new l._cesium.HeadingPitchRoll(t, l._cesium.Math.toRadians(90 + l.pitch), l ._cesium.Math.toRadians(l.roll)); return l._cesium.Transforms.headingPitchRollQuaternion(e, t) }, !1), new this._cesium.CallbackProperty(u, !1), new this._cesium.CallbackProperty(c, !1), this._cesium.Color.MEDIUMBLUE, !1)), s = (s.oid = 2, this.modelPointArr.push(s), this.createCylinder(a, new this._cesium .CallbackProperty(function() { var e = l._cesium.Cartesian3.fromDegrees(l._position[0], l._position[1], l ._position[2]), t = l._cesium.Math.toRadians(l.heading), t = new l._cesium.HeadingPitchRoll(t, l._cesium.Math.toRadians(l.pitch), l ._cesium.Math.toRadians(90 + l.roll)); return l._cesium.Transforms.headingPitchRollQuaternion(e, t) }, !1), new this._cesium.CallbackProperty(u, !1), new this._cesium.CallbackProperty(c, !1), this._cesium.Color.RED, !1)), s = (s.oid = 3, this.modelPointArr.push(s), this.creatBillboard(a, new this._cesium .CallbackProperty(function() { return new l._cesium.Cartesian2(0, -(l.Radius * l.scale)) }, !1), "../../img/j.png", !1)), s = (s.oid = 4, this.modelPointArr.push(s), this.creatBillboard(a, new this._cesium .CallbackProperty(function() { return new l._cesium.Cartesian2(-(l.Radius * l.scale), 0) }, !1), "../../img/s.png", !1)), l = (s.oid = 5, this.modelPointArr.push(s), (i.heading || i.pitch || i.roll) && (this.heading = i .heading, this.pitch = i.pitch, this.roll = i.roll, e.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0], this ._position[1], this._position[2]), new this._cesium.HeadingPitchRoll(this._cesium .Math.toRadians(this._cesium.defaultValue(i.heading, 0)), this._cesium.Math .toRadians(this._cesium.defaultValue(i.pitch, 0)), this._cesium.Math.toRadians(this ._cesium.defaultValue(i.roll, 0))))), this); function u() { return l.Radius * l.scale } function c() { return 100 * l.Radius } i.rotate && (e.orientation = new this._cesium.CallbackProperty(function() { return l.heading = l.heading + l.rotate, l._cesium.Transforms .headingPitchRollQuaternion(l._cesium.Cartesian3.fromDegrees(l._position[0], l ._position[1], l._position[2]), new l._cesium.HeadingPitchRoll(l._cesium .Math.toRadians(l._cesium.defaultValue(l.heading, 0)), l._cesium.Math .toRadians(l._cesium.defaultValue(l.pitch, 0)), l._cesium.Math.toRadians(l ._cesium.defaultValue(l.roll, 0)))) }, !1), l.rotate = i.rotate, delete i.rotate), e.orientation = new this._cesium.CallbackProperty( function() { return l._cesium.Transforms.headingPitchRollQuaternion(l._cesium.Cartesian3.fromDegrees(l ._position[0], l._position[1], l._position[2]), new l._cesium.HeadingPitchRoll(l ._cesium.Math.toRadians(l._cesium.defaultValue(l.heading, 0)), l._cesium.Math .toRadians(l._cesium.defaultValue(l.pitch, 0)), l._cesium.Math.toRadians(l ._cesium.defaultValue(l.roll, 0)))) }, !1), l.scale = i.scale, e.model.scale = new this._cesium.CallbackProperty(function() { return l.scale }, !1), delete i.heading, delete i.pitch, delete i.roll, e.model = i, this.item = this._viewer .entities.add(e), this.item.objId = this.objId, this._core.Entityadd(this), this.state = 1, "function" == typeof n && n(this.item); a = { id: this.item.id, name: r || "新建模型" + t.id, pId: this._core.isnull(o) ? 0 : o, type: "Point", item: this.item }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), this }, S.prototype.createOrientation = function(e, t, i) { var o = this._cesium.Math.toRadians(0), o = new this._cesium.HeadingPitchRoll(o, this._cesium.Math.toRadians(t), this._cesium.Math .toRadians(i)); return this._cesium.Transforms.headingPitchRollQuaternion(e, o) }, S.prototype.createCylinder = function(e, t, i, o, r, n) { if (e) return this._viewer.entities.add({ position: e, orientation: t, cylinder: { length: 10, topRadius: i, bottomRadius: i, fill: !1, material: r.withAlpha(.5), outline: !0, outlineWidth: 10, outlineColor: r, numberOfVerticalLines: o, slices: o }, show: n }) }, S.prototype.startModify = function() { if (2 == this.state || 1 == this.state) { var r = this; this.modifyHandler || (this.modifyHandler = new this._cesium.ScreenSpaceEventHandler(this._viewer .scene.canvas)); for (var n, a, s, l, u, c, e = 0; e < r.modelPointArr.length; e++) { var t = r.modelPointArr[e]; t && (t.show = !0) } this.modifyHandler.setInputAction(function(e) { var t = r._viewer.scene.pick(e.position), t = (r._cesium.defined(t) && t.id && (t.id.objId ? r.modifyModel = t.id : !r .modifyPoint || 4 != r.modifyPoint.oid && 5 != r.modifyPoint.oid ? r .modifyPoint = t.id : (t.id.oid != r.modifyPoint.oid && (r.modifyPoint = t .id), 4 == r.modifyPoint.oid ? r.scale = r.scale + 1 : r.scale = r .scale - 1), r.forbidDrawWorld(!0)), r._cesium.Cartesian3.fromDegrees(r ._position[0], r._position[1], r._position[2])); n = r._cesium.SceneTransforms.wgs84ToWindowCoordinates(r._viewer.scene, t), a = e .position, l = r.heading + 0, c = r.roll + 0, u = r.pitch + 0, r.state = 2 }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.modifyHandler.setInputAction(function(e) { e = r._viewer.scene.pick(e.position); if (!r._cesium.defined(e) || !e.id) { for (var t = 0; t < r.modelPointArr.length; t++) { var i = r.modelPointArr[t]; i && (i.show = !1) } r.modifyHandler && (r.modifyHandler.destroy(), r.modifyHandler = null) } }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.modifyHandler.setInputAction(function( e) { if (r._viewer.scene.pick(e.endPosition), r.modifyModel || r.modifyPoint) { var t = r._viewer.scene.pickPosition(e.endPosition); if (t) if (r.modifyModel) { r.item.position.setValue(t); for (var i = 0; i < r.modelPointArr.length; i++) { var o = r.modelPointArr[i]; o && o.position.setValue(t) } } else r.modifyPoint && (s = e.endPosition, e = r.arge(n, a, s), 1 == r .modifyPoint.oid ? r.heading = l + e : 2 == r.modifyPoint.oid ? r.roll = c + e : 3 == r.modifyPoint.oid && (r.pitch = u + e)) } }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.modifyHandler.setInputAction(function( e) { !r.modifyPoint && !r.modifyModel || r.modifyPoint && (4 == r.modifyPoint.oid || 5 == r .modifyPoint.oid) || (r.modifyPoint = null, r.modifyModel = null, r .forbidDrawWorld(!1)) }, this._cesium.ScreenSpaceEventType.LEFT_UP) } }, S.prototype.creatBillboard = function(e, t, i, o) { e = this._viewer.entities.add({ position: e, show: o, billboard: { image: i, pixelOffset: t, verticalOrigin: this._cesium.VerticalOrigin.BOTTOM } }); return e.attr = "editPoint", e }, S.prototype.arge = function(e, t, i) { var o = Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)), e = Math.sqrt(Math.pow(e.x - i.x, 2) + Math.pow(e.y - i.y, 2)), t = Math.sqrt(Math.pow(t.x - i.x, 2) + Math.pow(t.y - i.y, 2)), i = (Math.pow(o, 2) + Math.pow(e, 2) - Math.pow(t, 2)) / (2 * o * e); return Math.round(180 * Math.acos(i) / Math.PI) }, S.prototype.forbidDrawWorld = function(e) { this._viewer.scene.screenSpaceCameraController.enableRotate = !e, this._viewer.scene .screenSpaceCameraController.enableTilt = !e, this._viewer.scene.screenSpaceCameraController .enableTranslate = !e, this._viewer.scene.screenSpaceCameraController.enableInputs = !e }, S.prototype.getCatesian3FromPX = function(e, t, i) { var o, r = t.scene.pick(e), n = t.scene.drillPick(e), a = null; if (i) { for (var s = 0; s < n.length; s++) if (n[s].id._id != i[0].id && n[s].id._id != i[1].id) { a = n[s].id; break } } else a = r; if (t.scene.pickPositionSupported && Cesium.defined(a)) o = t.scene.pickPosition(e); else { r = t.camera.getPickRay(e); if (!r) return; o = t.scene.globe.pick(r, t.scene) } return o }, S.prototype.setTreeobj = function(e) { this.treeobj = e }, S.prototype.setVisibility = function(e) { if (this.item.item ? this.item.item.show = e : this.item.show = e, 0 < this.model.length) for (var t = 0; t < this.model.length; t++) this.model[t].show = e, this.model[t]._availability && ! e ? this.model[t]._availability = void 0 : this.model[t].time && e && (this.model[t] ._availability = this.model[t].time) }, S.prototype.setOrientation = function(e) { (e.heading || e.pitch || e.roll) && (this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[ 1], this._position[2]), new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this ._cesium.defaultValue(e.heading, 0)), this._cesium.Math.toRadians(this._cesium .defaultValue(e.pitch, 0)), this._cesium.Math.toRadians(this._cesium.defaultValue(e .roll, 0))))) }, S.prototype.setScale = function(e) { this.item && this.item.model && (this.item.model.scale = e) }, S.prototype.setPosition = function(e) { this.item && this.item.model && (this._position = e, this.item.position = this._cesium.Cartesian3 .fromDegrees(this._position[0], this._position[1], this._position[2])) }, S.prototype.getVisibility = function() { return this.item.show }, S.prototype.deleteObject = function() { if (this.model && this.model.length) for (var e = 0; e < this.model.length; e++) this._viewer.scene.primitives.remove(this.model[e]); try { this._viewer.scene.primitives.remove(this.item) } catch (e) {} try { this._viewer.entities.remove(this.item) } catch (e) {} try { this._viewer.dataSources.remove(this.item) } catch (e) {} try { this._Provider.remove() } catch (e) {} }, gt.prototype.createPolygonGeoJsonFeatureLayer = function(e, t, i, o, n) { var r = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, show: !0 }, a = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.toString().charAt( 0) && "]" == i.material.toString().charAt(i.material.length - 1) || (this._core.isHtmlColor(i .material) ? i.material = this._color.colorFromHtmlColor(i.material) : (/^rgb/.test(i .material) && (i.material = this._color.rgbaStringToRgbaObj(i.material)), 1 < i .material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i .material.a && (i.material.a = i.material.a / 255), i.material = this._color .createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._core.extend(r, i, !0)), r = (null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t), s = this, l = [], i = (r.then(function(e) { for (var t = e.entities.values, i = 0; i < t.length; i++) { var o = t[i], o = (a.polygonHierarchy = new s._cesium.PolygonHierarchy(o.polygon.hierarchy ._value.positions), new s._cesium.PolygonGeometry(a)), o = s._cesium.PolygonGeometry.createGeometry(o), o = new s._cesium.GeometryInstance({ geometry: o }); l.push(o) } var e = s._viewer.scene.primitives.add(new s._cesium.Primitive({ geometryInstances: l, appearance: new s._cesium.MaterialAppearance({ material: new s._cesium.Material({ fabric: { type: "Color", uniforms: { color: a.material } } }), faceForward: !0, flat: !1 }) })), r = "material:" + 255 * a.material.red + "," + 255 * a.material.green + "," + 255 * a.material.blue; s.Legend.push(r), s.item = e, 0 == a.show && (e.show = !1), "function" == typeof n && n( e) }), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a.id), { id: a.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t, style: a }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), this }, gt.prototype.deleteObject = function() { if (null != this.items && null != this.items && 0 < this.items.length) for (var e = 0; e < this.items.length; e++) this._viewer.scene.primitives.remove(this.items[e]); else this._viewer.scene.primitives.remove(this.item); if (null != this.model && null != this.model && 0 < this.model.length) for (e = 0; e < this.model.length; e++) this._viewer.scene.primitives.remove(this.model[e]); try { this._Provider.remove() } catch (e) {} }, gt.prototype.setRefresh = function(e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) {} }, gt.prototype.setVisibility = function(e) { if (null != this.items && null != this.items && 0 < this.items.length) for (var t = 0; t < this.items.length; t++) this.items[t].show = e; else this.item.show = e; if (null != this.model && null != this.model && 0 < this.model.length) for (t = 0; t < this.model.length; t++) this.model[t].show = e; this._Provider && this._Provider.setStatus(!e) }, gt.prototype.createPolygonVectorGeoJsonFeatureLayerProvider = function(e, t, a, i, o, r) { var n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 999999, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, shadows: this._cesium.ShadowMode.ENABLED, show: !0 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = (this._core.isnull(a) || this._core.isnull(a.material) || "[" == a.material.toString().charAt( 0) && "]" == a.material.toString().charAt(a.material.length - 1) || (this._core.isHtmlColor(a .material) ? a.material = this._color.colorFromHtmlColor(a.material) : (/^rgb/.test(a .material) && (a.material = this._color.rgbaStringToRgbaObj(a.material)), 1 < a .material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a .material.a && (a.material.a = a.material.a / 255), a.material = this._color .createColor(a.material.r, a.material.g, a.material.b, a.material.a))), this._core.extend(n, a, !0)), u = (0 == l.extrudedHeight && (l.extrudedHeight = 999999), this.items = [], this), c = new v(this._viewer, this._cesium, s), n = ((this._Provider = c)._loadTile = function(e) { var n = []; if (scene.primitives, u.Legend = [], new u._cesium.PrimitiveCollection, e.features.forEach( function(i) { if (c._isCameraMoving) return null; var o = []; function r(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? r(e[t]) : o.push(e[ t]) } if (Array.isArray(i.geometry.coordinates) && 0 < i.geometry.coordinates.length) if (Array.isArray(i.geometry.coordinates[0][0])) for (var e = 0; e < i.geometry.coordinates.length; e++) o = [], r(i .geometry.coordinates[e]), t(o); else r(i.geometry.coordinates), t(o); function t(e) { var t; c._isCameraMoving || (e = u._cesium.Cartesian3.fromDegreesArray(e), /^\[/ .test(a.extrudedHeight) && /\]$/.test(a.extrudedHeight) && (t = a .extrudedHeight.replace(/\[/, "").replace(/\]/, ""), l .extrudedHeight = parseFloat(i.properties[t])), l .extrudedHeight = parseFloat(l.extrudedHeight), 1 == l .heightReference && delete l.height, 1 == l .extrudedHeightReference && delete l.extrudedHeight, /^\[/.test(a .material) && /\]$/.test(a.material) && (t = a.material.replace( /\[/, "").replace(/\]/, ""), l.material = i.properties[t], u ._core.isHtmlColor(l.material) ? l.material = u._color .colorFromHtmlColor(l.material) : (/^rgb/.test(l.material) && (l .material = u._color.rgbaStringToRgbaObj(l.material)), 1 < l.material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l .material.b && (l.material.b = l.material.b / 255), 1 < l .material.a && (l.material.a = l.material.a / 255), l .material = u._color.createColor(l.material.r, l.material.g, l.material.b, l.material.a))), l.polygonHierarchy = new u._cesium.PolygonHierarchy(e), i.positions = e, t = new u ._cesium.PolygonGeometry(l), e = null, e = new u._cesium .GeometryInstance({ id: i, geometry: t, attributes: { color: new u._cesium.ColorGeometryInstanceAttribute .fromColor(l.material) } }), t = "material:" + 255 * l.material.red + "," + 255 * l.material .green + "," + 255 * l.material.blue, u.Legend.push(t), n.push(e)) } }), 0 < n.length) return new u._cesium.GroundPrimitive({ geometryInstances: n, appearance: new u._cesium.PerInstanceColorAppearance({ closed: !0, flat: !1 }), classificationType: l.classificationType }) }, this.item = c._primitiveCollection, c.addTo(this._viewer), o || this.setVisibility(!1), this ._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: a }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, gt.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel = function(e, t, l, i, o, r) { var n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 999999, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, shadows: this._cesium.ShadowMode.ENABLED, show: !0 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, u = l.material, c = l.height, h = (this._core.isnull(l) || this._core.isnull(l.color) || (this._core.isHtmlColor(l.color) ? l .color = this._color.colorFromHtmlColor(l.color) : (/^rgb/.test(l.color) && (l.color = this ._color.rgbaStringToRgbaObj(l.color)), 1 < l.color.r && (l.color.r = l.color.r / 255), 1 < l.color.g && (l.color.g = l.color.g / 255), 1 < l.color.b && (l.color.b = l.color.b / 255), 1 < l.color.a && (l.color.a = l.color.a / 255), l.color = this ._color.createColor(l.color.r, l.color.g, l.color.b, l.color.a))), this._core.isnull( l) || this._core.isnull(l.lightColor) || (this._core.isHtmlColor(l.lightColor) ? l.lightColor = this._color.colorFromHtmlColor(l.lightColor) : (/^rgb/.test(l.lightColor) && (l.lightColor = this._color.rgbaStringToRgbaObj(l.lightColor)), 1 < l.lightColor.r && (l.lightColor .r = l.lightColor.r / 255), 1 < l.lightColor.g && (l.lightColor.g = l.lightColor.g / 255), 1 < l.lightColor.b && (l.lightColor.b = l.lightColor.b / 255), 1 < l .lightColor.a && (l.lightColor.a = l.lightColor.a / 255), l.lightColor = this._color .createColor(l.lightColor.r, l.lightColor.g, l.lightColor.b, l.lightColor.a))), this ._core.isnull(l) || this._core.isnull(l.material) || "[" == l.material.toString().charAt(0) && "]" == l.material.toString().charAt(l.material.length - 1) || (this._core.isHtmlColor(l .material) ? l.material = this._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l .material) && (l.material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l .material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l .material.a && (l.material.a = l.material.a / 255), l.material = this._color .createColor(l.material.r, l.material.g, l.material.b, l.material.a))), this._core.extend(n, l, !0)), m = (0 == h.extrudedHeight && (h.extrudedHeight = 999999), this.items = [], this), d = new v(this._viewer, this._cesium, a), n = ((this._Provider = d)._loadTile = function(e) { var a = null, s = (scene.primitives, new m._cesium.PrimitiveCollection); return m.Legend = [], e.features.forEach(function(o) { if (d._isCameraMoving) return null; var i = []; function r(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? r(e[t]) : i.push(e[ t]) } if (Array.isArray(o.geometry.coordinates) && 0 < o.geometry.coordinates.length) if (Array.isArray(o.geometry.coordinates[0][0])) for (var e = 0; e < o.geometry.coordinates.length; e++) i = [], r(o .geometry.coordinates[e]), t(i), n(i); else r(o.geometry.coordinates), t(i), n(i); function t(e) { var t, i; d._isCameraMoving || (e = m._cesium.Cartesian3.fromDegreesArray(e), /^\[/ .test(l.extrudedHeight) && /\]$/.test(l.extrudedHeight) && (t = l .extrudedHeight.replace(/\[/, "").replace(/\]/, ""), h .extrudedHeight = parseFloat(o.properties[t])), h .extrudedHeight = parseFloat(h.extrudedHeight), 1 == h .heightReference && delete h.height, 1 == h .extrudedHeightReference && delete h.extrudedHeight, /^\[/.test(l .material) && /\]$/.test(l.material) && (t = l.material.replace( /\[/, "").replace(/\]/, ""), h.material = o.properties[t], m ._core.isHtmlColor(h.material) ? h.material = m._color .colorFromHtmlColor(h.material) : (/^rgb/.test(h.material) && (h .material = m._color.rgbaStringToRgbaObj(h.material)), 1 < h.material.r && (h.material.r = h.material.r / 255), 1 < h.material.g && (h.material.g = h.material.g / 255), 1 < h .material.b && (h.material.b = h.material.b / 255), 1 < h .material.a && (h.material.a = h.material.a / 255), h .material = m._color.createColor(h.material.r, h.material.g, h.material.b, h.material.a))), h.polygonHierarchy = new m._cesium.PolygonHierarchy(e), t = new m._cesium .PolygonGeometry(h), i = null, o.positions = e, i = new m._cesium .GeometryInstance({ id: o, geometry: t, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute .fromColor(h.material) } }), e = "material:" + 255 * h.material.red + "," + 255 * h.material .green + "," + 255 * h.material.blue, m.Legend.push(e), a = new m ._cesium.ClassificationPrimitive({ geometryInstances: i, appearance: new m._cesium.PerInstanceColorAppearance({ closed: !0, flat: !1 }), classificationType: h.classificationType, shadows: m._cesium.ShadowMode.ENABLED }), s.add(a)) } function n(e) { for (var e = m._cesium.Cartesian3.fromDegreesArray(e), t = [], i = new m ._cesium.PolygonHierarchy(e).positions, o = 0; o < i.length; o++) { var r = m._cesium.Math.toDegrees(m._cesium.Cartographic.fromCartesian(i[ o]).longitude), n = m._cesium.Math.toDegrees(m._cesium.Cartographic.fromCartesian(i[ o]).latitude); t.push(r), t.push(n) } e = m.getTheBottomPoint(t); m.scanningPolygon(e, h.offset_x, h.offset_y, t).forEach(function(e) { e = m._cesium.Transforms.eastNorthUpToFixedFrame(m._cesium .Cartesian3.fromDegrees(e.lon, e.lat, c)), e = m._cesium .Model.fromGltf({ url: u, color: h.color, lightColor: h.lightColor, modelMatrix: e, scale: h.scale }); s.add(e) }) } }), s }, l && l.time && (d.availability = new m._cesium.TimeIntervalCollection([new m._cesium .TimeInterval({ start: l.time.start ? m._cesium.JulianDate.fromDate(new Date(l.time .start)) : m._cesium.Iso8601.MINIMUM_VALUE, stop: l.time.end ? m._cesium.JulianDate.fromDate(new Date(l.time.end)) : m ._cesium.Iso8601.MAXIMUM_VALUE }) ])), this.item = d._primitiveCollection, d.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: h.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: l }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, gt.prototype.GetPositionFromA_D = function(e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = 6356725 + 21412 * (90 - e) / 90; return [180 * (r / (o * Math.cos(e * Math.PI / 180)) + t * Math.PI / 180) / Math.PI, 180 * (i / o + e * Math.PI / 180) / Math.PI] }, gt.prototype.getTheBottomPoint = function(e) { for (var t = 90, i = 0, o = 1; o < e.length; o += 2) t = t < e[o] ? t : (i = o) && e[o]; return { lon: e[i - 1], lat: e[i] } }, gt.prototype.scanningPolygon = function(e, t, i, o) { for (var r, n, a, s = [], l = 180, u = -180, c = -90, h = 0; h < o.length; h += 2) c = c > o[h + 1] ? c : o[h + 1], l = l < o[h] ? l : o[h], u = u > o[h] ? u : o[h]; var i = this.GetPositionFromA_D(e.lat, e.lon, i, 0), m = this.GetPositionFromA_D(e.lat, e.lon, t, 90)[0] - e.lon, d = i[1] - e.lat; for (s.push({ lon: e.lon, lat: e.lat }), (a = { lon: e.lon, lat: e.lat }).lat += d; a.lat <= c; a.lat += d) { for (r = { lon: a.lon - m, lat: a.lat }, n = { lon: a.lon + m, lat: a.lat }, this.IsInPolygon(a.lon, a.lat, o) && s.push({ lon: a.lon, lat: a.lat }); r.lon >= l; r.lon -= m) this.IsInPolygon(r.lon, r.lat, o) && s.push({ lon: r.lon, lat: r.lat }); for (; n.lon <= u; n.lon += m) this.IsInPolygon(n.lon, n.lat, o) && s.push({ lon: n.lon, lat: n.lat }) } return s }, gt.prototype.IsInPolygon = function(e, t, i) { var o, r, n, a, s = 0; if (i.length < 6) return !1; i.push(i[0], i[1]); for (var l = 0; l < i.length - 2; l += 2) o = i[l], n = i[l + 1], r = i[l + 2], a = i[l + 3], (n <= t && t < a || a <= t && t < n) && 0 < Math.abs(n - a) && o - (o - r) * (n - t) / (n - a) <= e && s++; return s % 2 != 0 }, gt.prototype.setPolylinemodels = function(e, t, i, o, r, n, a, s, l) { var u = this._core.getSpaceDistancem(e, s), c = 10, h = parseFloat(a.distance), u = (0 != h && (c = parseInt(u / h)), e[0]), h = e[e.length - 1], e = s.Cartographic.fromCartesian(u), m = s.Math.toDegrees(e.longitude), d = s.Math.toDegrees(e.latitude), u = (e.height, s.Cartographic.fromCartesian(h)), h = s.Math.toDegrees(u.longitude), p = s.Math.toDegrees(u.latitude), g = (u.height, s.Math.toDegrees(e.height), c), _ = s.Math.lerp(m, h, 1 / g) - m, f = s.Math.lerp(d, p, 1 / g) - d; s.Math.lerp(t, o, 1 / g), s.Math.lerp(i, r, 1 / g); for (var y = 0; y < g; y++) { var v = s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(m + (y + 1) * _, d + (y + 1) * f, a.height)), v = (parseInt(a.heightReference), s.Model.fromGltf({ url: a.url, modelMatrix: v, color: a.color, lightColor: a.lightColor, scale: a.scale, heightReference: parseInt(a.heightReference) })); l.scene.primitives.add(v), n.push(v) } return n }, gt.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsjl = function(e, t, i, o, r, n) { var a = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, shadows: this._cesium.ShadowMode.ENABLED, show: !0 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.toString().charAt( 0) && "]" == i.material.toString().charAt(i.material.length - 1) || (this._core.isHtmlColor(i .material) ? i.material = this._color.colorFromHtmlColor(i.material) : (/^rgb/.test(i .material) && (i.material = this._color.rgbaStringToRgbaObj(i.material)), 1 < i .material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i .material.a && (i.material.a = i.material.a / 255), i.material = this._color .createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._core.extend(a, i, !0)), u = this, c = new v(this._viewer, this._cesium, s), a = ((this._Provider = c)._loadTile = function(e, t) { var a, e = u._taskProcessor.scheduleTask({ json: e, styleOption: i, options: l, tileKey: t }); u._cesium.defined(e) && (a = u)._cesium.when(e, function(e) { if (!c._primitiveByTile[e.tileKey]) { for (var t = new a._cesium.PrimitiveCollection, i = 0; i < e.geomInstances .length; i++) { var o = null, r = e.geomInstances[i], n = r.id.id; c._primitiveByTile[n] || (n = new a._cesium.Material({ fabric: { type: "Color", uniforms: { color: e.materials[i] } } }), new a._cesium.MaterialAppearance({ material: n, faceForward: !0, flat: !1 }), o = new a._cesium.Primitive({ allowPicking: !0, appearance: new a._cesium.PerInstanceColorAppearance, geometryInstances: r, shadows: u._cesium.ShadowMode.ENABLED }), t.add(o)) } c._primitiveCollection.add(t), c._primitiveByTile[e.tileKey] = t } }) }, this.item = c._primitiveCollection, c.addTo(this._viewer), r || this.setVisibility(!1), this ._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, gt.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls = function(e, t, a, i, o, r) { var n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, shadows: this._cesium.ShadowMode.ENABLED, show: !0 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = (this._core.isnull(a) || this._core.isnull(a.material) || "[" == a.material.toString().charAt( 0) && "]" == a.material.toString().charAt(a.material.length - 1) || (this._core.isHtmlColor(a .material) ? a.material = this._color.colorFromHtmlColor(a.material) : /^http/.test(a .material) || (/^rgb/.test(a.material) && (a.material = this._color.rgbaStringToRgbaObj( a.material)), 1 < a.material.r && (a.material.r = a.material.r / 255), 1 < a .material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a.material.a && (a.material.a = a.material.a / 255), a .material = this._color.createColor(a.material.r, a.material.g, a.material.b, a.material .a))), this._core.isnull(a) || this._core.isnull(a.fill) || "[" == a.fill.toString() .charAt(0) && "]" == a.fill.toString().charAt(a.fill.length - 1) || (this._core.isHtmlColor(a .fill) ? a.fill = this._color.colorFromHtmlColor(a.fill) : /^http/.test(a.fill) || ( /^rgb/.test(a.fill) && (a.fill = this._color.rgbaStringToRgbaObj(a.fill)), 1 < a.fill .r && (a.fill.r = a.fill.r / 255), 1 < a.fill.g && (a.fill.g = a.fill.g / 255), 1 < a .fill.b && (a.fill.b = a.fill.b / 255), 1 < a.fill.a && (a.fill.a = a.fill.a / 255), a .fill = this._color.createColor(a.fill.r, a.fill.g, a.fill.b, a.fill.a))), this._core .extend(n, a, !0)), u = this, n = new v(this._viewer, this._cesium, s), s = ((this._Provider = n)._loadTile = function(e) { u.Legend = []; var n = new u._cesium.PrimitiveCollection; return e.features.forEach(function(r) { var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[t]) : i.push(e[ t]) } if (Array.isArray(r.geometry.coordinates) && 0 < r.geometry.coordinates.length) if (Array.isArray(r.geometry.coordinates[0][0])) for (var e = 0; e < r.geometry.coordinates.length; e++) i = [], o(r .geometry.coordinates[e]), t(i); else o(r.geometry.coordinates), t(i); function t(e) { var e = u._cesium.Cartesian3.fromDegreesArray(e), t = (/^\[/.test(a.extrudedHeight) && /\]$/.test(a.extrudedHeight) && ( t = a.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), l .extrudedHeight = parseFloat(r.properties[t])), l .extrudedHeight = parseFloat(l.extrudedHeight), 1 == l .heightReference && delete l.height, 1 == l .extrudedHeightReference && delete l.extrudedHeight, /^\[/.test(a .material) && /\]$/.test(a.material) && (t = a.material.replace( /\[/, "").replace(/\]/, ""), l.material = r.properties[t], u ._core.isHtmlColor(l.material) ? l.material = u._color .colorFromHtmlColor(l.material) : (/^rgb/.test(l.material) && (l .material = u._color.rgbaStringToRgbaObj(l.material)), 1 < l.material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l .material.b && (l.material.b = l.material.b / 255), 1 < l .material.a && (l.material.a = l.material.a / 255), l .material = u._color.createColor(l.material.r, l.material.g, l.material.b, l.material.a))), l.polygonHierarchy = new u._cesium.PolygonHierarchy(e), r.positions = e, new u._cesium .PolygonGeometry(l)), e = new u._cesium.ColorGeometryInstanceAttribute.fromColor(l.fill), i = {}, i = /^http/.test(l.material) ? new u._cesium.Material({ fabric: { type: "Image", uniforms: { image: l.material } } }) : (o = "material:" + 255 * l.material.red + "," + 255 * l.material .green + "," + 255 * l.material.blue, u.Legend.push(o), new u ._cesium.Material({ fabric: { type: "Color", uniforms: { color: l.material } } })), o = new u._cesium.GeometryInstance({ id: r, geometry: t, attributes: { color: e } }), t = new u._cesium.Primitive({ allowPicking: !0, appearance: new u._cesium.MaterialAppearance({ material: i }), geometryInstances: o, shadows: u._cesium.ShadowMode.ENABLED }); n.add(t) } }), n }, a && a.time && (n.availability = new u._cesium.TimeIntervalCollection([new u._cesium .TimeInterval({ start: a.time.start ? u._cesium.JulianDate.fromDate(new Date(a.time .start)) : u._cesium.Iso8601.MINIMUM_VALUE, stop: a.time.end ? u._cesium.JulianDate.fromDate(new Date(a.time.end)) : u ._cesium.Iso8601.MAXIMUM_VALUE }) ])), this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: a }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, gt.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd = function(e, t, i, o, r, n) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.toString().charAt( 0) && "]" == i.material.toString().charAt(i.material.length - 1) || (this._core.isHtmlColor(i .material) ? i.material = this._color.colorFromHtmlColor(i.material) : (/^rgb/.test(i .material) && (i.material = this._color.rgbaStringToRgbaObj(i.material)), 1 < i .material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i .material.a && (i.material.a = i.material.a / 255), i.material = this._color .createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._core.isnull( i) || this._core.isnull(i.outlineColor) || "[" == i.outlineColor.toString().charAt(0) && "]" == i.outlineColor.toString().charAt(i.outlineColor.length - 1) || (this._core.isHtmlColor(i .outlineColor) ? i.outlineColor = this._color.colorFromHtmlColor(i.outlineColor) : ( /^rgb/.test(i.outlineColor) && (i.outlineColor = this._color.rgbaStringToRgbaObj(i .outlineColor)), 1 < i.outlineColor.r && (i.outlineColor.r = i.outlineColor.r / 255), 1 < i.outlineColor.g && (i.outlineColor.g = i.outlineColor.g / 255), 1 < i .outlineColor.b && (i.outlineColor.b = i.outlineColor.b / 255), 1 < i.outlineColor.a && (i.outlineColor.a = i.outlineColor.a / 255), i.outlineColor = this._color.createColor(i .outlineColor.r, i.outlineColor.g, i.outlineColor.b, i.outlineColor.a))), this._option = this._core.extend(a, i, !0), this), a = t.urlinit, u = { polygonHierarchy: void 0, height: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, a = ($.ajax({ url: a, type: "get", async: !1, dataType: "json", success: function(e) { l.datas = e.features } }), new v(this._viewer, this._cesium, s)), s = ((this._Provider = a)._loadTile = function(e) { l.Legend = [], new l._cesium.PrimitiveCollection; var a = [], s = [], t = new Cesium.PrimitiveCollection; return e.features.forEach(function(e) { var o = []; var t = e.id, t = parseInt(t.split(".")[1]) - 1; if (e = l.datas[t], Array.isArray(e.geometry.coordinates) && 0 < e.geometry .coordinates.length && Array.isArray(e.geometry.coordinates[0][0][0])) for (var i = 0; i < e.geometry.coordinates[0].length; i++) { o = [], ! function e(t) { for (var i = 0; i < t.length; i++) Array.isArray(t[i]) ? (3 == t[i].length && t[i].splice(2, 1), t[i].push(l._option .height), e(t[i])) : o.push(t[i]) }(e.geometry.coordinates[0][i]), n = r = n = r = r = r = n = n = n = r = void 0; var r = o, n = (/^\[/.test(l._option.extrudedHeight) && /\]$/.test(l._option .extrudedHeight) && (n = l._option.extrudedHeight.replace( /\[/, "").replace(/\]/, ""), u.extrudedHeight = parseFloat(e.properties[n])), u.material = l._option .material, /^\[/.test(l._option.material) && /\]$/.test(l ._option.material) ? (n = l._option.material.replace(/\[/, "").replace(/\]/, ""), u.material = e.properties[n], l ._core.isHtmlColor(u.material) ? u.material = l._color .colorFromHtmlColor(u.material) : (/^rgb/.test(u .material) && (u.material = l._color .rgbaStringToRgbaObj(u.material)), 1 < u.material .red && (u.material.red = u.material.red / 255), 1 < u .material.green && (u.material.green = u.material .green / 255), 1 < u.material.blue && (u.material .blue = u.material.blue / 255), 1 < u.material .alpha && (u.material.a = u.material.alpha / 255), u .material = l._color.createColor(u.material.red, u .material.green, u.material.blue, u.material.alpha)) ) : (l._option.material && (u.material = l._option .material), u.material && (l._core.isHtmlColor(u.material) ? u.material = l._color.colorFromHtmlColor(u.material) : ( /^rgb/.test(u.material) && (u.material = l._color .rgbaStringToRgbaObj(u.material)), 1 < u .material.red && (u.material.red = u.material.red / 255), 1 < u.material.green && (u.material .green = u.material.green / 255), 1 < u.material .blue && (u.material.blue = u.material.blue / 255), 1 < u.material.alpha && (u.material.a = u.material .alpha / 255), u.material = l._color .createColor(u.material.red, u.material.green, u .material.blue, u.material.alpha)))), l._cesium .Cartesian3.fromDegreesArrayHeights(r)), r = (u.polygonHierarchy = new l._cesium.PolygonHierarchy(n), new l ._cesium.PolygonGeometry(u)), r = new Cesium.GeometryInstance({ id: e, geometry: r, attributes: { color: new l._cesium.ColorGeometryInstanceAttribute .fromColor(l._option.randomColor ? Cesium.Color .fromRandom().withAlpha(u.material.alpha) : u .material) } }), r = (a.push(r), { positions: n, width: l._option.width }), n = new l._cesium.GroundPolylineGeometry(r), r = new l._cesium.GeometryInstance({ geometry: n }), n = (s.push(r), "material:" + 255 * u.material.red + "," + 255 * u .material.green + "," + 255 * u.material.blue); l.Legend.push(n) } }), 0 < a.length && (u.extrudedHeight ? t.add(new l._cesium.Primitive({ geometryInstances: a, appearance: new l._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: l._core.Shaders("vertexShaderSource"), fragmentShaderSource: l._core.Shaders( "fragmentShaderSource") }) })) : t.add(new l._cesium.GroundPrimitive({ geometryInstances: a, appearance: new l._cesium.PerInstanceColorAppearance({ translucent: !0, vertexShaderSource: l._core.Shaders("vertexShaderSource") }) }))), 0 < s.length && t.add(new l._cesium.GroundPolylinePrimitive({ geometryInstances: s, appearance: new l._cesium.PolylineMaterialAppearance({ material: new l._cesium.Material({ fabric: { type: "Color", uniforms: { color: l._option.outlineColor } } }) }), shadows: l._cesium.ShadowMode.ENABLED })), t }, this.item = a._primitiveCollection, a.addTo(this._viewer), r || this.setVisibility(!1), this ._core.isnull(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: u.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, gt.prototype.setTreeobj = function(e) { this.treeobj = e }, gt.prototype.createPolygonVectorFeatureLayerProvider = function(e, t, n, i, o) { var r = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, show: !0 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, s = (this._core.isnull(n) || this._core.isnull(n.material) || "[" == n.material.toString().charAt( 0) && "]" == n.material.toString().charAt(n.material.length - 1) || (this._core.isHtmlColor(n .material) ? n.material = this._color.colorFromHtmlColor(n.material) : (/^rgb/.test(n .material) && (n.material = this._color.rgbaStringToRgbaObj(n.material)), 1 < n .material.r && (n.material.r = n.material.r / 255), 1 < n.material.g && (n.material.g = n.material.g / 255), 1 < n.material.b && (n.material.b = n.material.b / 255), 1 < n .material.a && (n.material.a = n.material.a / 255), n.material = this._color .createColor(n.material.r, n.material.g, n.material.b, n.material.a))), this._core.extend(r, n, !0)), l = this, r = new v(this._viewer, this._cesium, a), a = ((this._Provider = r)._loadTile = function(e) { var r = []; return l.Legend = [], e.features.forEach(function(e) { var o = []; ! function e(t) { for (var i = 0; i < t.length; i++) Array.isArray(t[i]) ? e(t[i]) : o.push(t[ i]) }(e.geometry.coordinates[0]); var t = l._cesium.Cartesian3.fromDegreesArray(o), e = (/^\[/.test(n.extrudedHeight) && /\]$/.test(n.extrudedHeight) && (i = n .extrudedHeight.replace(/\[/, "").replace(/\]/, ""), s .extrudedHeight = parseFloat(e.properties[i])), s.polygonHierarchy = new l._cesium.PolygonHierarchy(t), new l._cesium.PolygonGeometry(s)), i = l._cesium.PolygonGeometry.createGeometry(e), t = "material:" + 255 * s.material.red + "," + 255 * s.material.green + "," + 255 * s.material.blue, e = (l.Legend.push(t), new l._cesium.GeometryInstance({ geometry: i, attributes: { color: new l._cesium.ColorGeometryInstanceAttribute .fromColor(s.material) }, shadows: l._cesium.ShadowMode.ENABLED })); r.push(e) }), new this._cesium.Primitive({ allowPicking: !1, appearance: new this._cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0, faceForward: !0, closed: !0 }), geometryInstances: r }) }, this.item = r._primitiveCollection, r.addTo(this._viewer), this._core.isnull(s.id) && (s.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + s.id), { id: s.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: n }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof o && o(this.item) }, gt.prototype.createPolygonVectorMonomerFeatureLayerProvider = function(e, t, n, i, o) { var r = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, show: !0 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, s = (this._core.isnull(n) || this._core.isnull(n.material) || "[" == n.material.toString().charAt( 0) && "]" == n.material.toString().charAt(n.material.length - 1) || (this._core.isHtmlColor(n .material) ? n.material = this._color.colorFromHtmlColor(n.material) : (/^rgb/.test(n .material) && (n.material = this._color.rgbaStringToRgbaObj(n.material)), 1 < n .material.r && (n.material.r = n.material.r / 255), 1 < n.material.g && (n.material.g = n.material.g / 255), 1 < n.material.b && (n.material.b = n.material.b / 255), 1 < n .material.a && (n.material.a = n.material.a / 255), n.material = this._color .createColor(n.material.r, n.material.g, n.material.b, n.material.a))), this._core.extend(r, n, !0)), r = new v(this._viewer, this._cesium, a), l = (this._Provider = r, this), a = (r._loadTile = function(e) { var r = []; return e.features.forEach(function(e) { var o = []; ! function e(t) { for (var i = 0; i < t.length; i++) Array.isArray(t[i]) ? e(t[i]) : o.push(t[ i]) }(e.geometry.coordinates[0]); var t = l._cesium.Cartesian3.fromDegreesArray(o), e = (/^\[/.test(n.extrudedHeight) && /\]$/.test(n.extrudedHeight) && (i = n .extrudedHeight.replace(/\[/, "").replace(/\]/, ""), s .extrudedHeight = parseFloat(e.properties[i])), s.polygonHierarchy = new l._cesium.PolygonHierarchy(t), new l._cesium.PolygonGeometry(s)), i = new l._cesium.GeometryInstance({ geometry: e, attributes: { color: l._cesium.ColorGeometryInstanceAttribute.fromColor(l ._cesium.Color.fromCssColorString("#004FFF").withAlpha( .5)), show: new l._cesium.ShowGeometryInstanceAttribute(!0) } }); r.push(i) }), new l._cesium.GroundPrimitive({ classificationType: l._cesium.ClassificationType.BOTH, geometryInstances: r }) }, this.item = r._primitiveCollection, r.addTo(this._viewer), this._core.isnull(s.id) && (s.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + s.id), { id: s.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: n }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof o && o(this.item) }, gt.prototype.getLegend = function() { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, gt.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }; var _t = {}; function ft(e) { this.buf = ArrayBuffer.isView && ArrayBuffer.isView(e) ? e : new Uint8Array(e || 0), this.pos = 0, this .type = 0, this.length = this.buf.length } _t.read = function(e, t, i, o, r) { var n, a, s = 8 * r - o - 1, l = (1 << s) - 1, u = l >> 1, c = -7, h = i ? r - 1 : 0, m = i ? -1 : 1, r = e[t + h]; for (h += m, n = r & (1 << -c) - 1, r >>= -c, c += s; 0 < c; n = 256 * n + e[t + h], h += m, c -= 8); for (a = n & (1 << -c) - 1, n >>= -c, c += o; 0 < c; a = 256 * a + e[t + h], h += m, c -= 8); if (0 === n) n = 1 - u; else { if (n === l) return a ? NaN : 1 / 0 * (r ? -1 : 1); a += Math.pow(2, o), n -= u } return (r ? -1 : 1) * a * Math.pow(2, n - o) }, _t.write = function(e, t, i, o, r, n) { var a, s, l = 8 * n - r - 1, u = (1 << l) - 1, c = u >> 1, h = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = o ? 0 : n - 1, d = o ? 1 : -1, n = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0; for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0, a = u) : (a = Math.floor(Math .log(t) / Math.LN2), t * (o = Math.pow(2, -a)) < 1 && (a--, o *= 2), 2 <= (t += 1 <= a + c ? h / o : h * Math.pow(2, 1 - c)) * o && (a++, o /= 2), u <= a + c ? (s = 0, a = u) : 1 <= a + c ? (s = (t * o - 1) * Math.pow(2, r), a += c) : (s = t * Math.pow(2, c - 1) * Math.pow(2, r), a = 0)); 8 <= r; e[i + m] = 255 & s, m += d, s /= 256, r -= 8); for (a = a << r | s, l += r; 0 < l; e[i + m] = 255 & a, m += d, a /= 256, l -= 8); e[i + m - d] |= 128 * n }, ft.Varint = 0, ft.Fixed64 = 1, ft.Bytes = 2, ft.Fixed32 = 5; var yt = 4294967296, vt = 1 / yt; function Ct(e) { return e.type === ft.Bytes ? e.readVarint() + e.pos : e.pos + 1 } function wt(e, t, i) { return i ? 4294967296 * t + (e >>> 0) : 4294967296 * (t >>> 0) + (e >>> 0) } function bt(e, t, i) { var o = t <= 16383 ? 1 : t <= 2097151 ? 2 : t <= 268435455 ? 3 : Math.ceil(Math.log(t) / (7 * Math.LN2)); i.realloc(o); for (var r = i.pos - 1; e <= r; r--) i.buf[r + o] = i.buf[r] } function Tt(e, t) { for (var i = 0; i < e.length; i++) t.writeVarint(e[i]) } function St(e, t) { for (var i = 0; i < e.length; i++) t.writeSVarint(e[i]) } function Pt(e, t) { for (var i = 0; i < e.length; i++) t.writeFloat(e[i]) } function Et(e, t) { for (var i = 0; i < e.length; i++) t.writeDouble(e[i]) } function xt(e, t) { for (var i = 0; i < e.length; i++) t.writeBoolean(e[i]) } function It(e, t) { for (var i = 0; i < e.length; i++) t.writeFixed32(e[i]) } function Dt(e, t) { for (var i = 0; i < e.length; i++) t.writeSFixed32(e[i]) } function Lt(e, t) { for (var i = 0; i < e.length; i++) t.writeFixed64(e[i]) } function Mt(e, t) { for (var i = 0; i < e.length; i++) t.writeSFixed64(e[i]) } function At(e, t) { return (e[t] | e[t + 1] << 8 | e[t + 2] << 16) + 16777216 * e[t + 3] } function Rt(e, t, i) { e[i] = t, e[i + 1] = t >>> 8, e[i + 2] = t >>> 16, e[i + 3] = t >>> 24 } function Ot(e, t) { return (e[t] | e[t + 1] << 8 | e[t + 2] << 16) + (e[t + 3] << 24) } function Ht(e, t) { this.x = e, this.y = t } function Vt(e, t, i, o, r) { this.properties = {}, this.extent = i, this.type = 0, this._pbf = e, this._geometry = -1, this._keys = o, this._values = r, e.readFields(kt, this, t) } function kt(e, t, i) { if (1 == e) t.id = i.readVarint(); else if (2 == e) for (var o = i, r = t, n = o.readVarint() + o.pos; o.pos < n;) { var a = r._keys[o.readVarint()], s = r._values[o.readVarint()]; r.properties[a] = s } else 3 == e ? t.type = i.readVarint() : 4 == e && (t._geometry = i.pos) } function Ft(e, t) { this.version = 1, this.name = null, this.extent = 4096, this.length = 0, this._pbf = e, this._keys = [], this._values = [], this._features = [], e.readFields(Gt, this, t), this.length = this._features.length } function Gt(e, t, i) { 15 === e ? t.version = i.readVarint() : 1 === e ? t.name = i.readString() : 5 === e ? t.extent = i .readVarint() : 2 === e ? t._features.push(i.pos) : 3 === e ? t._keys.push(i.readString()) : 4 === e && t._values.push(function(e) { var t = null, i = e.readVarint() + e.pos; for (; e.pos < i;) { var o = e.readVarint() >> 3; t = 1 == o ? e.readString() : 2 == o ? e.readFloat() : 3 == o ? e.readDouble() : 4 == o ? e .readVarint64() : 5 == o ? e.readVarint() : 6 == o ? e.readSVarint() : 7 == o ? e .readBoolean() : null } return t }(i)) } function Nt(e, t) { this.layers = e.readFields(Bt, {}, t) } function Bt(e, t, i) { 3 === e && (e = new Ft(i, i.readVarint() + i.pos)).length && (t[e.name] = e) } function jt(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this.item = { show: !0 }, this._option = void 0, this._primitive = void 0, this._Provider = void 0, this.labelCollections = new this._cesium.PointPrimitiveCollection, this.geometries_line = [], this.geometries_polygon = [] } ft.prototype = { destroy: function() { this.buf = null }, readFields: function(e, t, i) { for (i = i || this.length; this.pos < i;) { var o = this.readVarint(), r = o >> 3, n = this.pos; this.type = 7 & o, e(r, t, this), this.pos === n && this.skip(o) } return t }, readMessage: function(e, t) { return this.readFields(e, t, this.readVarint() + this.pos) }, readFixed32: function() { var e = At(this.buf, this.pos); return this.pos += 4, e }, readSFixed32: function() { var e = Ot(this.buf, this.pos); return this.pos += 4, e }, readFixed64: function() { var e = At(this.buf, this.pos) + At(this.buf, this.pos + 4) * yt; return this.pos += 8, e }, readSFixed64: function() { var e = At(this.buf, this.pos) + Ot(this.buf, this.pos + 4) * yt; return this.pos += 8, e }, readFloat: function() { var e = _t.read(this.buf, this.pos, !0, 23, 4); return this.pos += 4, e }, readDouble: function() { var e = _t.read(this.buf, this.pos, !0, 52, 8); return this.pos += 8, e }, readVarint: function(e) { var t = this.buf, i = t[this.pos++], o = 127 & i; if (i < 128) return o; if (o |= (127 & (i = t[this.pos++])) << 7, i < 128) return o; if (o |= (127 & (i = t[this.pos++])) << 14, i < 128) return o; if (o |= (127 & (i = t[this.pos++])) << 21, i < 128) return o; var r, n, i = o |= (15 & t[this.pos]) << 28, t = e, o = this, e = o.buf; if (n = e[o.pos++], r = (112 & n) >> 4, n < 128) return wt(i, r, t); if (n = e[o.pos++], r |= (127 & n) << 3, n < 128) return wt(i, r, t); if (n = e[o.pos++], r |= (127 & n) << 10, n < 128) return wt(i, r, t); if (n = e[o.pos++], r |= (127 & n) << 17, n < 128) return wt(i, r, t); if (n = e[o.pos++], r |= (127 & n) << 24, n < 128) return wt(i, r, t); if (n = e[o.pos++], r |= (1 & n) << 31, n < 128) return wt(i, r, t); throw new Error("Expected varint not more than 10 bytes") }, readVarint64: function() { return this.readVarint(!0) }, readSVarint: function() { var e = this.readVarint(); return e % 2 == 1 ? (e + 1) / -2 : e / 2 }, readBoolean: function() { return Boolean(this.readVarint()) }, readString: function() { var e = this.readVarint() + this.pos, t = function(e, t, i) { var o, r, n, a = "", s = t; for (; s < i;) { var l = e[s], u = null, c = 239 < l ? 4 : 223 < l ? 3 : 191 < l ? 2 : 1; if (i < s + c) break; 1 === c ? l < 128 && (u = l) : 2 === c ? 128 == (192 & (o = e[s + 1])) && (u = (31 & l) << 6 | 63 & o) <= 127 && (u = null) : 3 === c ? (o = e[s + 1], r = e[s + 2], 128 == (192 & o) && 128 == (192 & r) && ((u = (15 & l) << 12 | (63 & o) << 6 | 63 & r) <= 2047 || 55296 <= u && u <= 57343) && (u = null)) : 4 === c && (o = e[s + 1], r = e[s + 2], n = e[s + 3], 128 == (192 & o) && 128 == (192 & r) && 128 == (192 & n) && ((u = (15 & l) << 18 | (63 & o) << 12 | ( 63 & r) << 6 | 63 & n) <= 65535 || 1114112 <= u) && (u = null)), null === u ? (u = 65533, c = 1) : 65535 < u && (u -= 65536, a += String .fromCharCode(u >>> 10 & 1023 | 55296), u = 56320 | 1023 & u), a += String .fromCharCode(u), s += c } return a }(this.buf, this.pos, e); return this.pos = e, t }, readBytes: function() { var e = this.readVarint() + this.pos, t = this.buf.subarray(this.pos, e); return this.pos = e, t }, readPackedVarint: function(e, t) { var i = Ct(this); for (e = e || []; this.pos < i;) e.push(this.readVarint(t)); return e }, readPackedSVarint: function(e) { var t = Ct(this); for (e = e || []; this.pos < t;) e.push(this.readSVarint()); return e }, readPackedBoolean: function(e) { var t = Ct(this); for (e = e || []; this.pos < t;) e.push(this.readBoolean()); return e }, readPackedFloat: function(e) { var t = Ct(this); for (e = e || []; this.pos < t;) e.push(this.readFloat()); return e }, readPackedDouble: function(e) { var t = Ct(this); for (e = e || []; this.pos < t;) e.push(this.readDouble()); return e }, readPackedFixed32: function(e) { var t = Ct(this); for (e = e || []; this.pos < t;) e.push(this.readFixed32()); return e }, readPackedSFixed32: function(e) { var t = Ct(this); for (e = e || []; this.pos < t;) e.push(this.readSFixed32()); return e }, readPackedFixed64: function(e) { var t = Ct(this); for (e = e || []; this.pos < t;) e.push(this.readFixed64()); return e }, readPackedSFixed64: function(e) { var t = Ct(this); for (e = e || []; this.pos < t;) e.push(this.readSFixed64()); return e }, skip: function(e) { e &= 7; if (e === ft.Varint) for (; 127 < this.buf[this.pos++];); else if (e === ft.Bytes) this.pos = this.readVarint() + this.pos; else if (e === ft.Fixed32) this.pos += 4; else { if (e !== ft.Fixed64) throw new Error("Unimplemented type: " + e); this.pos += 8 } }, writeTag: function(e, t) { this.writeVarint(e << 3 | t) }, realloc: function(e) { for (var t, i = this.length || 16; i < this.pos + e;) i *= 2; i !== this.length && ((t = new Uint8Array(i)).set(this.buf), this.buf = t, this.length = i) }, finish: function() { return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length) }, writeFixed32: function(e) { this.realloc(4), Rt(this.buf, e, this.pos), this.pos += 4 }, writeSFixed32: function(e) { this.realloc(4), Rt(this.buf, e, this.pos), this.pos += 4 }, writeFixed64: function(e) { this.realloc(8), Rt(this.buf, -1 & e, this.pos), Rt(this.buf, Math.floor(e * vt), this.pos + 4), this.pos += 8 }, writeSFixed64: function(e) { this.realloc(8), Rt(this.buf, -1 & e, this.pos), Rt(this.buf, Math.floor(e * vt), this.pos + 4), this.pos += 8 }, writeVarint: function(e) { if (268435455 < (e = +e || 0) || e < 0) { var t = e, i = this; if (0 <= t ? (o = t % 4294967296 | 0, r = t / 4294967296 | 0) : (r = ~(-t / 4294967296), 4294967295 ^ (o = ~(-t % 4294967296)) ? o = o + 1 | 0 : r = r + 1 | (o = 0)), 0x10000000000000000 <= t || t < -0x10000000000000000) throw new Error( "Given varint doesn't fit into 10 bytes"); i.realloc(10); var t = o, o = i, t = (o.buf[o.pos++] = 127 & t | 128, t >>>= 7, o.buf[o.pos++] = 127 & t | 128, t >>>= 7, o.buf[o.pos++] = 127 & t | 128, t >>>= 7, o.buf[o.pos++] = 127 & t | 128, t >>>= 7, o.buf[o.pos] = 127 & t, r), r = i, i = (7 & t) << 4; return r.buf[r.pos++] |= i | ((t >>>= 3) ? 128 : 0), void(t && (r.buf[r.pos++] = 127 & t | ( (t >>>= 7) ? 128 : 0), t && (r.buf[r.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), t && (r.buf[r.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), t && (r .buf[r.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), t && (r.buf[r .pos++] = 127 & t)))))) } this.realloc(4), this.buf[this.pos++] = 127 & e | (127 < e ? 128 : 0), e <= 127 || (this.buf[ this.pos++] = 127 & (e >>>= 7) | (127 < e ? 128 : 0), e <= 127 || (this.buf[this .pos++] = 127 & (e >>>= 7) | (127 < e ? 128 : 0), e <= 127 || (this.buf[this .pos++] = e >>> 7 & 127))) }, writeSVarint: function(e) { this.writeVarint(e < 0 ? 2 * -e - 1 : 2 * e) }, writeBoolean: function(e) { this.writeVarint(Boolean(e)) }, writeString: function(e) { e = String(e), this.realloc(4 * e.length), this.pos++; var t = this.pos, e = (this.pos = function(e, t, i) { for (var o, r, n = 0; n < t.length; n++) { if (55295 < (o = t.charCodeAt(n)) && o < 57344) { if (!r) { 56319 < o || n + 1 === t.length ? (e[i++] = 239, e[i++] = 191, e[i++] = 189) : r = o; continue } if (o < 56320) { e[i++] = 239, e[i++] = 191, e[i++] = 189, r = o; continue } o = r - 55296 << 10 | o - 56320 | 65536, r = null } else r && (e[i++] = 239, e[i++] = 191, e[i++] = 189, r = null); o < 128 ? e[i++] = o : (o < 2048 ? e[i++] = o >> 6 | 192 : (o < 65536 ? e[i++] = o >> 12 | 224 : (e[i++] = o >> 18 | 240, e[i++] = o >> 12 & 63 | 128), e[i++] = o >> 6 & 63 | 128), e[i++] = 63 & o | 128) } return i }(this.buf, e, this.pos), this.pos - t); 128 <= e && bt(t, e, this), this.pos = t - 1, this.writeVarint(e), this.pos += e }, writeFloat: function(e) { this.realloc(4), _t.write(this.buf, e, this.pos, !0, 23, 4), this.pos += 4 }, writeDouble: function(e) { this.realloc(8), _t.write(this.buf, e, this.pos, !0, 52, 8), this.pos += 8 }, writeBytes: function(e) { var t = e.length; this.writeVarint(t), this.realloc(t); for (var i = 0; i < t; i++) this.buf[this.pos++] = e[i] }, writeRawMessage: function(e, t) { this.pos++; var i = this.pos, e = (e(t, this), this.pos - i); 128 <= e && bt(i, e, this), this.pos = i - 1, this.writeVarint(e), this.pos += e }, writeMessage: function(e, t, i) { this.writeTag(e, ft.Bytes), this.writeRawMessage(t, i) }, writePackedVarint: function(e, t) { this.writeMessage(e, Tt, t) }, writePackedSVarint: function(e, t) { this.writeMessage(e, St, t) }, writePackedBoolean: function(e, t) { this.writeMessage(e, xt, t) }, writePackedFloat: function(e, t) { this.writeMessage(e, Pt, t) }, writePackedDouble: function(e, t) { this.writeMessage(e, Et, t) }, writePackedFixed32: function(e, t) { this.writeMessage(e, It, t) }, writePackedSFixed32: function(e, t) { this.writeMessage(e, Dt, t) }, writePackedFixed64: function(e, t) { this.writeMessage(e, Lt, t) }, writePackedSFixed64: function(e, t) { this.writeMessage(e, Mt, t) }, writeBytesField: function(e, t) { this.writeTag(e, ft.Bytes), this.writeBytes(t) }, writeFixed32Field: function(e, t) { this.writeTag(e, ft.Fixed32), this.writeFixed32(t) }, writeSFixed32Field: function(e, t) { this.writeTag(e, ft.Fixed32), this.writeSFixed32(t) }, writeFixed64Field: function(e, t) { this.writeTag(e, ft.Fixed64), this.writeFixed64(t) }, writeSFixed64Field: function(e, t) { this.writeTag(e, ft.Fixed64), this.writeSFixed64(t) }, writeVarintField: function(e, t) { this.writeTag(e, ft.Varint), this.writeVarint(t) }, writeSVarintField: function(e, t) { this.writeTag(e, ft.Varint), this.writeSVarint(t) }, writeStringField: function(e, t) { this.writeTag(e, ft.Bytes), this.writeString(t) }, writeFloatField: function(e, t) { this.writeTag(e, ft.Fixed32), this.writeFloat(t) }, writeDoubleField: function(e, t) { this.writeTag(e, ft.Fixed64), this.writeDouble(t) }, writeBooleanField: function(e, t) { this.writeVarintField(e, Boolean(t)) } }, Ht.prototype = { clone: function() { return new Ht(this.x, this.y) }, add: function(e) { return this.clone()._add(e) }, sub: function(e) { return this.clone()._sub(e) }, multByPoint: function(e) { return this.clone()._multByPoint(e) }, divByPoint: function(e) { return this.clone()._divByPoint(e) }, mult: function(e) { return this.clone()._mult(e) }, div: function(e) { return this.clone()._div(e) }, rotate: function(e) { return this.clone()._rotate(e) }, rotateAround: function(e, t) { return this.clone()._rotateAround(e, t) }, matMult: function(e) { return this.clone()._matMult(e) }, unit: function() { return this.clone()._unit() }, perp: function() { return this.clone()._perp() }, round: function() { return this.clone()._round() }, mag: function() { return Math.sqrt(this.x * this.x + this.y * this.y) }, equals: function(e) { return this.x === e.x && this.y === e.y }, dist: function(e) { return Math.sqrt(this.distSqr(e)) }, distSqr: function(e) { var t = e.x - this.x, e = e.y - this.y; return t * t + e * e }, angle: function() { return Math.atan2(this.y, this.x) }, angleTo: function(e) { return Math.atan2(this.y - e.y, this.x - e.x) }, angleWith: function(e) { return this.angleWithSep(e.x, e.y) }, angleWithSep: function(e, t) { return Math.atan2(this.x * t - this.y * e, this.x * e + this.y * t) }, _matMult: function(e) { var t = e[0] * this.x + e[1] * this.y, e = e[2] * this.x + e[3] * this.y; return this.x = t, this.y = e, this }, _add: function(e) { return this.x += e.x, this.y += e.y, this }, _sub: function(e) { return this.x -= e.x, this.y -= e.y, this }, _mult: function(e) { return this.x *= e, this.y *= e, this }, _div: function(e) { return this.x /= e, this.y /= e, this }, _multByPoint: function(e) { return this.x *= e.x, this.y *= e.y, this }, _divByPoint: function(e) { return this.x /= e.x, this.y /= e.y, this }, _unit: function() { return this._div(this.mag()), this }, _perp: function() { var e = this.y; return this.y = this.x, this.x = -e, this }, _rotate: function(e) { var t = Math.cos(e), e = Math.sin(e), i = t * this.x - e * this.y, e = e * this.x + t * this.y; return this.x = i, this.y = e, this }, _rotateAround: function(e, t) { var i = Math.cos(e), e = Math.sin(e), o = t.x + i * (this.x - t.x) - e * (this.y - t.y), e = t.y + e * (this.x - t.x) + i * (this.y - t.y); return this.x = o, this.y = e, this }, _round: function() { return this.x = Math.round(this.x), this.y = Math.round(this.y), this } }, Ht.convert = function(e) { return !(e instanceof Ht) && Array.isArray(e) ? new Ht(e[0], e[1]) : e }, Vt.types = ["Unknown", "Point", "LineString", "Polygon"], Vt.prototype.loadGeometry = function() { for (var e, t, i = this._pbf, o = (i.pos = this._geometry, i.readVarint() + i.pos), r = 1, n = 0, a = 0, s = 0, l = []; i.pos < o;) if (n <= 0 && (r = 7 & (t = i.readVarint()), n = t >> 3), n--, 1 === r || 2 === r) a += i .readSVarint(), s += i.readSVarint(), 1 === r && (e && l.push(e), e = []), e.push(new Ht(a, s)); else { if (7 !== r) throw new Error("unknown command " + r); e && e.push(e[0].clone()) } return e && l.push(e), l }, Vt.prototype.bbox = function() { for (var e, t = this._pbf, i = (t.pos = this._geometry, t.readVarint() + t.pos), o = 1, r = 0, n = 0, a = 0, s = 1 / 0, l = -1 / 0, u = 1 / 0, c = -1 / 0; t.pos < i;) if (r <= 0 && (o = 7 & (e = t.readVarint()), r = e >> 3), r--, 1 === o || 2 === o)(n += t .readSVarint()) < s && (s = n), l < n && (l = n), (a += t.readSVarint()) < u && (u = a), c < a && (c = a); else if (7 !== o) throw new Error("unknown command " + o); return [s, u, l, c] }, Vt.prototype.toGeoJSON = function(e, t, i, o) { var r, n = this.extent * Math.pow(2, i), a = this.extent * e, s = this.extent * t / 2, l = this.loadGeometry(), i = Vt.types[this.type]; function u(e) { for (var t = 0; t < e.length; t++) { var i = e[t], o = 90 - 180 * (i.y + s) / (n / 2); e[t] = [360 * (i.x + a) / n - 180, o] } } switch (this.type) { case 1: for (var c = [], h = 0; h < l.length; h++) c[h] = l[h][0]; u(l = c); break; case 2: for (h = 0; h < l.length; h++) u(l[h]); break; case 3: for (l = function(e) { var t = e.length; if (t <= 1) return [e]; for (var i, o, r = [], n = 0; n < t; n++) { var a = function(e) { for (var t, i, o = 0, r = 0, n = e.length, a = n - 1; r < n; a = r++) t = e[ r], i = e[a], o += (i.x - t.x) * (t.y + i.y); return o }(e[n]); 0 !== a && ((o = void 0 === o ? a < 0 : o) === a < 0 ? (i && r.push(i), i = [e[ n]]) : i.push(e[n])) } i && r.push(i); return r }(l), h = 0; h < l.length; h++) for (r = 0; r < l[h].length; r++) u(l[h][r]) } 1 === l.length ? l = l[0] : i = "Multi" + i; e = { type: "Feature", geometry: { type: i, coordinates: l }, properties: this.properties }; return "id" in this && (e.id = this.id), e }, Ft.prototype.feature = function(e) { if (e < 0 || e >= this._features.length) throw new Error("feature index out of bounds"); this._pbf.pos = this._features[e]; e = this._pbf.readVarint() + this._pbf.pos; return new Vt(this._pbf, e, this.extent, this._keys, this._values) }; var zt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; function Ut(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._VectorTileProvider = new T(this._viewer, this._cesium), this._primitive = void 0, this._Provider = void 0, this.Legend = [] } function P(e) { this._viewer = e, this._cesium = Cesium, this._core = new f, this._tree = V, this._getPosition = new et(this ._viewer, this._cesium), this._ModelEdit = new $e(this._viewer), this._popupmessage = new tt(this ._viewer, this._cesium), this._createGroup = new it(this._viewer, this._cesium), this ._billboardGeoJsonFeatureLayer = new at(this._viewer, this._cesium), this._GeoJsonFeatureLayer = new C( this._viewer, this._cesium), this._LabelGeoJsonFeatureLayercopy = new w(this._viewer, this._cesium), this._VectorGeoJsonFeatureLayer = new b(this._viewer, this._cesium), this._PolylineGeoJsonFeatureLayer = new pt(this._viewer, this._cesium), this._PointModel = new S(this._viewer, this._cesium), this ._PolygonGeoJsonFeatureLayer = new gt(this._viewer, this._cesium), this._PolygonVectorTileLayerArcgis = new jt(this._viewer, this._cesium), this._WallGeoFeatureLayer = new Ut(this._viewer, this._cesium), this .tooltip = this._core.CreateTooltip(), this.objectsToExclude = [], this.SimpleGraphicObj = [], V .editPointID || (V.editPointID = { edit: [], size: [], move: void 0, height: [], add: [] }), this.editProp = !1, this.PrimitiveCollection = new Cesium.PrimitiveCollection, e.scene.primitives .add(this.PrimitiveCollection), this.SizeData = [], this.featuresPlotting = [], this.openEdit = !0 } jt.prototype._serialize = function(e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : zt(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))): i .push(o(t) + "=" + o(e[t])) } return i.join("&") }, jt.prototype.createVolumeVectorGeoJsonFeatureLayer = function(e, t, P, i, o) { var r = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, E = (t.url, t.layer, t.upperLevelLimit, t.lowerLevelLimit, this._cesium.Rectangle.fromDegrees(t .minx, t.miny, t.maxx, t.maxy), this._cesium, this.extent = { XMin: t.minx || 0, YMin: t.miny || 0, XMax: t.maxx || 0, YMax: t.maxy || 0 }, this._core.isnull(P) || this._core.isnull(P.fill) || "[" == P.fill.toString().charAt(0) && "]" == P.fill.toString().charAt(P.fill.length - 1) || (this._core.isHtmlColor(P.fill) ? P.fill = this._color.colorFromHtmlColor(P.fill) : (/^rgb/.test(P.fill) && (P.fill = this._color .rgbaStringToRgbaObj(P.fill)), 1 < P.fill.r && (P.fill.r = P.fill.r / 255), 1 < P .fill.g && (P.fill.g = P.fill.g / 255), 1 < P.fill.b && (P.fill.b = P.fill.b / 255), 1 < P.fill.a && (P.fill.a = P.fill.a / 255), P.fill = this._color.createColor(P.fill.r, P .fill.g, P.fill.b, P.fill.a))), this._core.isnull(P) || this._core.isnull(P .polylinefill) || "[" == P.polylinefill.toString().charAt(0) && "]" == P.polylinefill .toString().charAt(P.polylinefill.length - 1) || (this._core.isHtmlColor(P.polylinefill) ? P .polylinefill = this._color.colorFromHtmlColor(P.polylinefill) : (/^rgb/.test(P .polylinefill) && (P.polylinefill = this._color.rgbaStringToRgbaObj(P .polylinefill)), 1 < P.polylinefill.r && (P.polylinefill.r = P.polylinefill.r / 255), 1 < P.polylinefill.g && (P.polylinefill.g = P.polylinefill.g / 255), 1 < P.polylinefill .b && (P.polylinefill.b = P.polylinefill.b / 255), 1 < P.polylinefill.a && (P .polylinefill.a = P.polylinefill.a / 255), P.polylinefill = this._color.createColor( P.polylinefill.r, P.polylinefill.g, P.polylinefill.b, P.polylinefill.a))), this ._core.isnull(P) || this._core.isnull(P.outlineColor) || "[" == P.outlineColor.toString() .charAt(0) && "]" == P.outlineColor.toString().charAt(P.outlineColor.length - 1) || (this._core .isHtmlColor(P.outlineColor) ? P.outlineColor = this._color.colorFromHtmlColor(P .outlineColor) : (/^rgb/.test(P.outlineColor) && (P.outlineColor = this._color .rgbaStringToRgbaObj(P.outlineColor)), 1 < P.outlineColor.r && (P.outlineColor.r = P .outlineColor.r / 255), 1 < P.outlineColor.g && (P.outlineColor.g = P.outlineColor .g / 255), 1 < P.outlineColor.b && (P.outlineColor.b = P.outlineColor.b / 255), 1 < P.outlineColor.a && (P.outlineColor.a = P.outlineColor.a / 255), P.outlineColor = this ._color.createColor(P.outlineColor.r, P.outlineColor.g, P.outlineColor.b, P.outlineColor .a))), this._option = this._core.extend(r, P, !0), null == t && console.log( "url is required"), null == e && console.log("layername is required"), this); Cesium.VertexFormat.DEFAULT, Cesium.Ellipsoid.WGS84, Cesium.ArcType.GEODESIC, Cesium.Color.WHITE; E._core.xhr({ url: "http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/resources/styles/root.json", type: "get", dataType: "json", success: function(e) { var T = [], S = e.layers; Cesium.Resource.createIfNeeded( "http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf" ).fetchArrayBuffer().then(function(e) { function i(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? i(e[t]) : T .push(e[t]) } function t(e) { e = { positions: Cesium.Cartesian3.fromDegreesArray(e), width: 10, color: Cesium.ColorGeometryInstanceAttribute.fromColor(E ._option.polylinefill) }, e = new Cesium.PolylineGeometry(e), e = new Cesium .GeometryInstance({ geometry: e }); a.push(e) } function o(e) { e = new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium.PolygonHierarchy(Cesium .Cartesian3.fromDegreesArray(e)) }), e = Cesium.PolygonGeometry.createGeometry(e), e = new Cesium .GeometryInstance({ geometry: e, attributes: { color: b } }); s.push(e) } var r, n = new Nt(new ft(e)), a = [], s = []; for (r in E.labelCollections = new E._cesium.LabelCollection, n.layers) for (var l = n.layers[r], u = 0; u < l.length; u++) for (var c = l.feature(u), h = c.loadGeometry(), m = 0; m < h .length; m++) for (var d = h[m], p = 0; p < d.length; p++) { d[p]; var g = null; if (null != c.properties._symbol) for (var _ = c.properties._symbol, f = 0; f < S .length; f++) null != S[f].filter && "==" == S[ f].filter[0] && "_symbol" == S[f].filter[ 1] && S[f].filter[2] == _ && (g = S[f]); else if (null != l.name) for (var y = l.name, f = 0; f < S.length; f++) null != S[f]["source-layer"] && S[f][ "source-layer" ] == y && (g = S[f]); if (1 == c.type) try { var v, C = c.toGeoJSON(0, 0, 0, E.extent), w = (null != P.text && /^\[/.test(P.text) && /\]$/.test(P.text) && (v = P.text .replace(/\[/, "").replace(/\]/, ""), E._option.text = c.properties[ v]), null != g.paint && g.paint[ "icon-color"] && (E._option.fill = E ._color.createColorTransformation(g .paint["icon-color"])), E ._option.position = new E._cesium .Cartesian3.fromDegrees(C.geometry .coordinates[0], C.geometry .coordinates[1], E._option.height ), {}), w = "point" == C.geometry.type ? { id: C, color: E._option.fill, position: E._option.position } : E._option; E.labelCollections.add(w) } catch (e) {} if (2 == c.type) { d[0]; C = c.toGeoJSON(0, 0, 0, E.extent); if (!E._core.isnull(P.polylinefill) && null != g .paint && g.paint["icon-color"] && (E._option .polylinefill = E._color .createColorTransformation(g.paint[ "icon-color"])), Array.isArray(C .geometry.coordinates) && 0 < C.geometry .coordinates.length) if (Array.isArray(C.geometry.coordinates[0][0])) for (m = 0; m < C.geometry.coordinates .length; m++) T = [], i(C.geometry .coordinates[m]), t(T); else i(C.geometry.coordinates), t(T) } if (3 == c.type) try { d[0]; var C = c.toGeoJSON(0, 0, 0, E.extent), b = Cesium.ColorGeometryInstanceAttribute .fromColor(Cesium.Color.AQUA); if (null != g.paint["fill-color"] && (b = Cesium .ColorGeometryInstanceAttribute .fromColor(E._color .createColorTransformation(g.paint[ "fill-color"]))), Array.isArray( C.geometry.coordinates) && 0 < C .geometry.coordinates.length) if (Array.isArray(C.geometry.coordinates[0][ 0 ])) for (m = 0; m < C.geometry.coordinates .length; m++) T = [], i(C.geometry .coordinates[m]), o(T); else i(C.geometry.coordinates), o(T) } catch (e) {} } 0 < E.labelCollections.length && E._viewer.scene.primitives.add(E .labelCollections), 0 < a.length && E._viewer.scene.primitives .add(new Cesium.Primitive({ geometryInstances: a, appearance: new Cesium.PolylineColorAppearance })), 0 < s.length && E._viewer.scene.primitives.add(new Cesium .Primitive({ geometryInstances: s, appearance: new E._cesium.MaterialAppearance({ material: new Cesium.Material({ fabric: { type: "Color", uniforms: { color: Cesium.Color .fromRandom({ alpha: 1 }) } } }), faceForward: !0, flat: !1 }), shadows: Cesium.ShadowMode.ENABLED })) }) } }) }, jt.prototype.createVolumeVectorGeoJsonFeatureLayers = function(e, t, o, i, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, s = (this.extent = { XMin: t.minx || 0, YMin: t.miny || 0, XMax: t.maxx || 0, YMax: t.maxy || 0 }, this._core.isnull(o) || this._core.isnull(o.material) || "[" == o.material.toString().charAt( 0) && "]" == o.material.toString().charAt(o.material.length - 1) || (this._core.isHtmlColor( o.material) ? o.material = this._color.colorFromHtmlColor(o.material) : (/^rgb/.test(o .material) && (o.material = this._color.rgbaStringToRgbaObj(o.material)), 1 < o .material.r && (o.material.r = o.material.r / 255), 1 < o.material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o .material.a && (o.material.a = o.material.a / 255), o.material = this._color .createColor(o.material.r, o.material.g, o.material.b, o.material.a))), this._option = this ._core.extend(n, o, !0), null == t && console.log("url is required"), null == e && console.log( "layername is required"), []), w = { polygonHierarchy: void 0, height: 0, extrudedHeight: 100, vertexFormat: Cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: Cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: Cesium.ArcType.GEODESIC, material: Cesium.Color.WHITE }, b = this; this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = styleOption.level_max - 1, this._Provider.loadTile = function(e, t) { if ((this.tile = t).state === Cesium.QuadtreeTileLoadState.START && b.item.show) if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= o.level_min && t.level < o.level_max) { var i = y.filter(s, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != i.length && i[0].data && 0 < i[0].data.length) return t.data .geometryPrimitive = new Cesium.Primitive({ geometryInstances: i[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, void(t.state === Cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data .geometryPrimitive.update(e, []), t.state = Cesium.QuadtreeTileLoadState .DONE, t.renderable = !0)); C = t, Cesium.Resource.createIfNeeded( "http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf" ).fetchArrayBuffer().then(function(e) { var t, i = new Nt(new ft(e)), o = (b.labelCollections = new b._cesium.PointPrimitiveCollection, []), r = []; for (t in i.layers) for (var n = i.layers[t], a = 0; a < n.length; a++) for (var s = n.feature(a), l = s.loadGeometry(), u = 0; u < l .length; u++) for (var c = l[u], h = 0; h < c.length; h++) { if (c[h], 1 == s.type) try { var m, d = s.toGeoJSON(0, 0, 0, b.extent), p = (null != b._option.text && /^\[/.test(b ._option.text) && /\]$/.test(b._option .text) && (m = b._option.text.replace( /\[/, "").replace(/\]/, ""), w .text = s.properties[m]), w.position = new b._cesium.Cartesian3.fromDegrees(d .geometry.coordinates[0], d.geometry .coordinates[1], w.height), {}), p = "point" == d.geometry.type ? { id: d, color: w.material, position: w.position } : w; b.labelCollections.add(p) } catch (e) {} if (2 == s.type) { c[0]; for (d = s.toGeoJSON(C.x, C.y, C.level, b.extent), h = 0; h < d.geometry.coordinates.length; h++) try { var g = [], _ = (d.geometry.coordinates[h].forEach( function(e) { g.push(e[0], e[1]) }), new Cesium.PolylineGeometry({ positions: Cesium.Cartesian3 .fromDegreesArray(g), width: 10 })), f = Cesium.PolylineGeometry.createGeometry( _), y = new Cesium.GeometryInstance({ geometry: f }); o.push(y) } catch (e) {} } if (3 == s.type) { c[0]; for (d = s.toGeoJSON(C.x, C.y, C.level, b.extent), h = 0; h < d.geometry.coordinates.length; h++) try { var g = [], v = (d.geometry.coordinates[h].forEach( function(e) { g.push(e[0], e[1]) }), new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium .PolygonHierarchy(Cesium .Cartesian3 .fromDegreesArray(g)) })), f = Cesium.PolygonGeometry.createGeometry( v), y = new Cesium.GeometryInstance({ geometry: f }); r.push(y) } catch (e) {} } } 0 < b.labelCollections.length && b._viewer.scene.primitives.add(b .labelCollections), 0 < o.length && b._viewer.scene.primitives.add( new Cesium.Primitive({ geometryInstances: o, appearance: new b._cesium.MaterialAppearance({ material: new Cesium.Material({ fabric: { type: "Color", uniforms: { color: Cesium.Color .fromRandom({ alpha: 1 }) } } }), faceForward: !0, flat: !1 }), shadows: Cesium.ShadowMode.ENABLED })), 0 < r.length && b._viewer.scene.primitives.add(new Cesium .Primitive({ geometryInstances: r, appearance: new b._cesium.MaterialAppearance({ material: new Cesium.Material({ fabric: { type: "Color", uniforms: { color: Cesium.Color .fromRandom({ alpha: 1 }) } } }), faceForward: !0, flat: !1 }), shadows: Cesium.ShadowMode.ENABLED })) }) } else t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.data.geometryPrimitive .update(e, []), t._parent && t._parent.data && t._parent.data .geometryPrimitive && (t._parent.data.geometryPrimitive.destroy(), t._parent .data.geometryPrimitive = null, t._parent.state = Cesium .QuadtreeTileLoadState.START), t._southwestChild && t._southwestChild .data && t._southwestChild.data.geometryPrimitive && (t._southwestChild.data .geometryPrimitive.destroy(), t._southwestChild.data.geometryPrimitive = null, t._southwestChild.state = Cesium.QuadtreeTileLoadState.START), t ._southeastChild && t._southeastChild.data && t._southeastChild.data .geometryPrimitive && (t._southeastChild.data.geometryPrimitive.destroy(), t ._southeastChild.data.geometryPrimitive = null, t._southeastChild.state = Cesium.QuadtreeTileLoadState.START), t._northwestChild && t._northwestChild .data && t._northwestChild.data.geometryPrimitive && (t._northwestChild.data .geometryPrimitive.destroy(), t._northwestChild.data.geometryPrimitive = null, t._northwestChild.state = Cesium.QuadtreeTileLoadState.START), t ._northeastChild && t._northeastChild.data && t._northeastChild.data .geometryPrimitive && (t._northeastChild.data.geometryPrimitive.destroy(), t ._northeastChild.data.geometryPrimitive = null, t._northeastChild.state = Cesium.QuadtreeTileLoadState.START)), t.state = Cesium.QuadtreeTileLoadState .DONE, t.renderable = !0); var C }, this._primitive = new b._cesium.QuadtreePrimitive({ tileProvider: this._Provider }), this._viewer.scene.primitives.add(this._primitive) }, jt.prototype.createVolumeGeoJsonFeatureLayer = function(e, t, n, i, a) { var s = { polylinePositions: void 0, shapePositions: void 0, ellipsoid: this._cesium.Ellipsoid.WGS84, granularity: this._cesium.Math.RADIANS_PER_DEGREE, vertexFormat: this._cesium.VertexFormat.DEFAULT, cornerType: this._cesium.CornerType.ROUNDED }, o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), l = this, u = [], t = (s.shapePositions = this.computeCircle(n.radius), o.then(function(e) { for (var t = l._cesium.Color.WHITE, i = (l._core.isnull(n) || l._core.isnull(n .material) || (t = "[" == n.material.toString().charAt(0) && "]" == n .material.toString().charAt(n.material.length - 1) ? n.material.replace( /\[/, "").replace("/]/", "") : y.clone(n.material), t = l._core .isHtmlColor(t) ? l._color.colorFromHtmlColor(n.material) : (1 < (t = /^rgb/.test(t) ? l._color.rgbaStringToRgbaObj(t) : t).r && (t .r = t.r / 255), 1 < t.g && (t.g = t.g / 255), 1 < t.b && (t.b = t.b / 255), 1 < t.a && (t.a = t.a / 255), l._color.createColor(t .r, t.g, t.b, t.a))), e.entities.values), o = 0; o < i.length; o++) { var r = i[o], r = (s.polylinePositions = r.polyline.positions._value, new l._cesium .PolylineVolumeGeometry(s)), r = l._cesium.PolylineVolumeGeometry.createGeometry(r), r = new l._cesium.GeometryInstance({ geometry: r }); u.push(r) } e = l._viewer.scene.primitives.add(new l._cesium.Primitive({ geometryInstances: u, appearance: new l._cesium.MaterialAppearance({ material: new l._cesium.Material({ fabric: { type: "Color", uniforms: { color: t } } }), faceForward: !0, flat: !1 }) })); l.item = e, 0 == n.show && (e.show = !1), "function" == typeof a && a(e) }), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建管状图层" + n.id), { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: geoOptions.url, style: n }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), this }, jt.prototype.computeCircle = function(e) { this._core.isnull(e) && (e = 4); for (var t = [], i = 0; i < 360; i++) { var o = this._cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, jt.prototype.createVolumeGeoJsonFeatureLayerProvider = function(e, t, c, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.RECEIVE_ONLY }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, Cesium: this._cesium }, h = (this._core.isnull(c) || this._core.isnull(c.material) || "[" == c.material.toString().charAt( 0) && "]" == c.material.toString().charAt(c.material.length - 1) || (this._core.isHtmlColor(c .material) ? c.material = this._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c .material) && (c.material = this._color.rgbaStringToRgbaObj(c.material)), 1 < c .material.r && (c.material.r = c.material.r / 255), 1 < c.material.g && (c.material.g = c.material.g / 255), 1 < c.material.b && (c.material.b = c.material.b / 255), 1 < c .material.a && (c.material.a = c.material.a / 255), c.material = this._color .createColor(c.material.r, c.material.g, c.material.b, c.material.a))), this._core.extend(n, c, !0)), n = new v(this._viewer, this._cesium, a), m = (this._Provider = n, this), a = (n._loadTile = function(e) { var u = new m._cesium.PrimitiveCollection; return e.features.forEach(function(e) { var t = []; /^\[/.test(c.material) && /\]$/.test(c.material) && (s = c.material.replace( /\[/, "").replace(/\]/, ""), h.material = e.properties[s], that ._core.isHtmlColor(h.material) ? h.material = that._color .colorFromHtmlColor(h.material) : (/^rgb/.test(h.material) && (h .material = that._color.rgbaStringToRgbaObj(h.material)), 1 < h .material.r && (h.material.r = h.material.r / 255), 1 < h.material .g && (h.material.g = h.material.g / 255), 1 < h.material.b && (h .material.b = h.material.b / 255), 1 < h.material.a && (h .material.a = h.material.a / 255), h.material = that._color .createColor(h.material.r, h.material.g, h.material.b, h.material.a) )); for (var i = 0; i < e.geometry.coordinates.length; i++) { var o = e.geometry.coordinates[i]; if (0 < o.length) if (Array.isArray(o[0])) for (var r = 0; r < o.length; r++) { var n = o[r], n = m._cesium.Cartesian3.fromDegrees(n[0], n[1], h.height); t.push(n) } else { var a = m._cesium.Cartesian3.fromDegrees(o[0], o[1], h.height); t.push(a) } } h.position = t, "0" == h.slttype || 0 == h.slttype ? h.shape = m._core .computeCircle(h.radius) : "1" == h.slttype || 1 == h.slttype ? h.shape = m ._core.starPositions(h.number, h.exradius, h.inradius) : "2" != h.slttype && 2 != h.slttype || (s = h.orth_width / 2, l = h.orth_height / 2, h.shape = [ new m._cesium.Cartesian2(-s, -l), new m._cesium.Cartesian2(s, -l), new m._cesium.Cartesian2(s, l), new m._cesium.Cartesian2(-s, l) ]), e.positions = t; var s = { polylinePositions: h.position, shapePositions: h.shape, cornerType: h.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }, l = new m._cesium.PolylineVolumeGeometry(s), s = m._cesium.PolylineVolumeGeometry.createGeometry(l), l = new m._cesium.GeometryInstance({ id: e, geometry: s, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute.fromColor(h .material) } }), s = new m._cesium.Primitive({ allowPicking: !0, appearance: new m._cesium.MaterialAppearance({ material: new m._cesium.Material({ fabric: { type: "Color", uniforms: { color: h.material } } }), faceForward: !0, flat: !1 }), shadows: h.shadows, geometryInstances: l }); u.add(s) }), u }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this ._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: h.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: t.url, style: c }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, jt.prototype.setTreeobj = function(e) { this.treeobj = e }, jt.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, jt.prototype.deleteObject = function() { this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) {} }, jt.prototype.setRefresh = function(e) { try { this._Provider && this._Provider.setStatus(e) } catch (e) {} }, jt.prototype.setVisibility = function(e) { this.item.show = e, this._Provider && this._Provider.setStatus(e) }, Ut.prototype.createWallGeoFeatureLayer = function(o, r, e, a, s, t, i) { var n = { positions: [], minimumHeights: [], maximumHeights: [], granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED }, l = (this._core.isnull(e) || this._core.isnull(e.material) || "[" == e.material.toString().charAt( 0) && "]" == e.material.toString().charAt(e.material.length - 1) || (this._core.isHtmlColor(e .material) ? e.material = this._color.colorFromHtmlColor(e.material) : (/^rgb/.test(e .material) && (e.material = this._color.rgbaStringToRgbaObj(e.material)), 1 < e .material.r && (e.material.r = e.material.r / 255), 1 < e.material.g && (e.material.g = e.material.g / 255), 1 < e.material.b && (e.material.b = e.material.b / 255), 1 < e .material.a && (e.material.a = e.material.a / 255), e.material = this._color .createColor(e.material.r, e.material.g, e.material.b, e.material.a))), this._core.extend(n, e, !0)), u = (this._core.isnull(a) && (a = 16), this._core.isnull(s) && (s = 14), null == r && console.log( "url is required"), null == o && console.log("layername is required"), this), c = []; this._VectorTileProvider.loadTile = function(e, t) { if ((this.tile = t).state === u._cesium.QuadtreeTileLoadState.START) if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= s && t.level < a) { var i = y.filter(c, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != i.length && i[0].data && 0 < i[0].data.length) return t.data .geometryPrimitive = new u._cesium.Primitive({ geometryInstances: i[0].data, appearance: new u._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: u._cesium.ShadowMode.ENABLED }), t.state = u._cesium.QuadtreeTileLoadState.LOADING, void(t.state === u ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t .data.geometryPrimitive.update(e, []), t.state = u._cesium .QuadtreeTileLoadState.DONE, t.renderable = !0)); c.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), n = t, u._core.xhr({ url: r + "?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=" + o + "&STYLE=&TILEMATRIX=EPSG:4490:" + n.level + "&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL=" + n.x + "&TILEROW=" + n.y, type: "get", dataType: "json", success: function(e) { var t = []; for (var i = 0; i < e.features.length; i++) { var o = [], r = (! function e(t) { for (var i = 0; i < t.length; i++) Array.isArray(t[ i]) ? e(t[i]) : o.push(t[i]) }(e.features[i].geometry.coordinates[0]), u._cesium .Cartesian3.fromDegreesArray(o)), r = (l.positions = r, new u._cesium.GeometryInstance({ geometry: new u._cesium.WallGeometry({ positions: l.positions }), attributes: { color: new u._cesium .ColorGeometryInstanceAttribute .fromColor(Cesium.Color.WHITE) } })); t.push(r) } y.filter(c, function(e) { return e.x == n.x && e.y == n.y })[0].data = t, n.data.geometryPrimitive = new u._cesium .Primitive({ geometryInstances: t, appearance: new u._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: u._cesium.ShadowMode.ENABLED }) }, error: function() { c = y.remove(c, function(e) { return e.x == n.x && e.y == n.y && e.level == n.level }) }, complete: function() { n.state = u._cesium.QuadtreeTileLoadState.LOADING, n.state === u ._cesium.QuadtreeTileLoadState.LOADING && (n.data .geometryPrimitive && n.data.geometryPrimitive.update(e, []), n.state = u._cesium.QuadtreeTileLoadState.DONE, n .renderable = !0) } }) } else t.state = u._cesium.QuadtreeTileLoadState.LOADING, t.state === u._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive .update(e, []), t.state = u._cesium.QuadtreeTileLoadState.DONE, t.renderable = !0); var n }, this._primitive = new u._cesium.QuadtreePrimitive({ tileProvider: this._VectorTileProvider }), this._viewer.scene.primitives.add(this._primitive) }, Ut.prototype.createWallPrimitiveGeoFeatureLayer = function(e, t, u, i, c, h) { var m = { positions: void 0, granularity: this._cesium.Math.RADIANS_PER_DEGREE, maximumHeights: 0, minimumHeights: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT }, o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), d = this, p = [], o = (o.then(function(e) { for (var t, i = e.entities.values, o = 0; o < i.length; o++) { var r = i[o], n = (m.positions = r.polyline.positions._value, new Array(m.positions.length)), a = new Array(m.positions.length), s = void 0, l = void 0, s = /^\[/.test(u.minimumHeights) ? (s = u.minimumHeights.replace(/\[/, "") .replace("/]/", ""), r.properties[s]._value) : u.minimumHeights, l = /^\[/.test(u.maximumHeights) ? (l = u.maximumHeights.replace(/\[/, "") .replace("/]/", ""), r.properties[l]._value) : u.maximumHeights, s = (n.fill(s), a.fill(l), m.minimumHeights = n, m.maximumHeights = a, d._cesium .Color.WHITE), l = (d._core.isnull(u) || d._core.isnull(u.material) || (s = "[" == u.material .toString().charAt(0) && "]" == u.material.toString().charAt(u.material .length - 1) ? u.material.replace(/\[/, "").replace("/]/", "") : y .clone(u.material), s = d._core.isHtmlColor(s) ? d._color .colorFromHtmlColor(u.material) : (1 < (s = /^rgb/.test(s) ? d._color .rgbaStringToRgbaObj(s) : s).r && (s.r = s.r / 255), 1 < s.g && (s.g = s.g / 255), 1 < s.b && (s.b = s.b / 255), 1 < s.a && (s.a = s .a / 255), d._color.createColor(s.r, s.g, s.b, s.a))), "material:" + 255 * s.red + "," + 255 * s.green + "," + 255 * s.blue), n = (d.Legend.push(l), new d._cesium.GeometryInstance({ id: r, geometry: new d._cesium.WallGeometry(m), attributes: { color: new d._cesium.ColorGeometryInstanceAttribute.fromColor(s) } })); p.push(n) } u && u.time && (t = new d._cesium.TimeIntervalCollection([new d._cesium.TimeInterval({ start: u.time.start ? d._cesium.JulianDate.fromDate(new Date(u .time.start)) : d._cesium.Iso8601.MINIMUM_VALUE, stop: u.time.end ? d._cesium.JulianDate.fromDate(new Date(u.time .end)) : d._cesium.Iso8601.MAXIMUM_VALUE })])); e = d._viewer.scene.primitives.add(new d._cesium.Primitive({ geometryInstances: p, appearance: new d._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }) }), t); d.item = e, c || _this.setVisibility(!1), "function" == typeof h && h(e) }), this._core.isnull(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建墙图层" + options.id), { id: u.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "polylineWallLayer", item: this, url: t, style: options }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Ut.prototype.createWallGeoJsonFeatureLayerProvider = function(e, t, l, i, o, r) { var u = { positions: void 0, granularity: this._cesium.Math.RADIANS_PER_DEGREE, maximumHeights: 0, minimumHeights: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT }, n = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, n = (this._core.isnull(l) || this._core.isnull(l.material) || "[" == l.material.toString().charAt( 0) && "]" == l.material.toString().charAt(l.material.length - 1) || (this._core.isHtmlColor(l .material) ? l.material = this._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l .material) && (l.material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l .material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l .material.a && (l.material.a = l.material.a / 255), l.material = this._color .createColor(l.material.r, l.material.g, l.material.b, l.material.a))), new v(this._viewer, this._cesium, n)), c = (this._Provider = n, this), n = (n._loadTile = function(e) { c.Legend = []; var s = new c._cesium.PrimitiveCollection; return e.features.forEach(function(n) { var i = [], a = !1; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[t]) : (i.push( e[t]), 2 !== t || a || (a = !0)) } if (Array.isArray(n.geometry.coordinates) && 0 < n.geometry.coordinates.length) if (Array.isArray(n.geometry.coordinates[0][0])) for (var e = 0; e < n.geometry.coordinates.length; e++) i = [], o(n .geometry.coordinates[e]), t(i); else o(n.geometry.coordinates), t(i); function t(e) { /^\[/.test(l.material) && /\]$/.test(l.material) && (t = l.material.replace( /\[/, "").replace(/\]/, ""), options.material = n.properties[t], c._core.isHtmlColor(options.material) ? options.material = c._color .colorFromHtmlColor(options.material) : (/^rgb/.test(options .material) && (options.material = c._color .rgbaStringToRgbaObj(options.material)), 1 < options .material.r && (options.material.r = options.material.r / 255), 1 < options.material.g && (options.material.g = options.material .g / 255), 1 < options.material.b && (options.material.b = options.material.b / 255), 1 < options.material.a && ( options.material.a = options.material.a / 255), options .material = c._color.createColor(options.material.r, options .material.g, options.material.b, options.material.a))); var t = a ? c._cesium.Cartesian3.fromDegreesArrayHeights(e) : c._cesium .Cartesian3.fromDegreesArray(e), t = (u.positions = t, n.positions = t, new Array(u.positions.length)), i = new Array(u.positions.length), o = void 0, r = void 0, o = /^\[/.test(l.minimumHeights) ? (o = l.minimumHeights.replace(/\[/, "").replace("/]/", ""), entity.properties[o]._value) : l .minimumHeights, r = /^\[/.test(l.maximumHeights) ? (r = l.maximumHeights.replace(/\[/, "").replace("/]/", ""), entity.properties[r]._value) : l .maximumHeights, o = (t.fill(o), i.fill(r), u.minimumHeights = t, u.maximumHeights = i, n .treeID = l.id, n.VectorType = "wall", n.VectorStyle = { haveZ: a, minimumHeights: t, maximumHeights: i, positions: e, material: l.material }, new c._cesium.GeometryInstance({ id: n, geometry: new c._cesium.WallGeometry(u), attributes: { color: new c._cesium.ColorGeometryInstanceAttribute .fromColor(l.material) } })), r = "material:" + 255 * l.material.red + "," + 255 * l.material.green + "," + 255 * l.material.blue, t = (c.Legend.push(r), new c._cesium.Primitive({ geometryInstances: o, appearance: new c._cesium.MaterialAppearance({ material: new c._cesium.Material({ fabric: { type: "Color", uniforms: { color: l.material } } }), faceForward: !0, flat: !1 }), vertexCacheOptimize: !0, interleave: !0, shadows: c._cesium.ShadowMode.ENABLED })); s.add(t) } }), s }, l && l.time && (n.availability = new c._cesium.TimeIntervalCollection([new c._cesium .TimeInterval({ start: l.time.start ? c._cesium.JulianDate.fromDate(new Date(l.time .start)) : c._cesium.Iso8601.MINIMUM_VALUE, stop: l.time.end ? c._cesium.JulianDate.fromDate(new Date(l.time.end)) : c ._cesium.Iso8601.MAXIMUM_VALUE }) ])), this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建墙图层" + l.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineWallLayer", item: this, url: t.url, style: l }); return this._Provider.treeID = l.id, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull( i) ? 0 : i), "function" == typeof r && r(this.item), this }, Ut.prototype.setTreeobj = function(e) { this.treeobj = e }, Ut.prototype.deleteObject = function() { this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) {} }, Ut.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, Ut.prototype.getLegend = function() { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, Ut.prototype.setRefresh = function(e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) {} }, Ut.prototype.setVisibility = function(e) { this.item.show = e, this._Provider && this._Provider.setStatus(!e) }, Ut.prototype.edit = function(e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider .edit(e, t) }, Ut.prototype.forceRefresh = function() { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) this._Provider.quadtree ._levelZeroTiles[e].freeResources() } catch (e) {} }, P.prototype.createSimpleGraphic = function(e, t = {}, i) { let o = null; var r = e => { this.defaultEdit(), e && t.removeEdit && this.SimpleGraphicObj.pop(), i && i(e) }; switch (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), e) { case "point": o = this.createPoint(t, r); break; case "billboard": o = this.createBillboard(t, r); break; case "label": o = this.createLabel(t, r); break; case "model": o = this.createModel(t, r); break; case "polyline": o = this.createPolyline(t, r); break; case "polygon": o = this.createPolygon(t, r); break; case "triangle": o = this.createTriangle(t, r); break; case "polygon-rectangle": o = this.createPolygonRectangle(t, r); break; case "rectangle": o = this.createRectangle(t, r); break; case "circle": o = this.createCircle(t, r); break; case "ellipse": o = this.createEllipse(t, r); break; case "box": o = this.createBox(t, r); break; case "cylinder": o = this.createCylinder(t, r); break; case "cone": o = this.createCone(t, r); break; case "sphere": o = this.createSphere(t, r); break; case "polyhedron": o = this.createPolyhedron(t, r) } return o }, P.prototype.addSimpleGraphic = function(t, i = {}, e) { let o = null; switch (t) { case "point": o = this.addPoint(i); break; case "billboard": o = this.addBillboard(i); break; case "label": o = this.addLabel(i); break; case "model": o = this.addModel(i); break; case "polyline": o = this.addPolyline(i); break; case "polylinePrimitive": o = this.addPolylinePrimitive(i); break; case "polygon": o = this.addPolygon(i); break; case "polygonPrimitive": o = this.addPolygonPrimitive(i); break; case "rectangle": o = this.addRectangle(i); break; case "circle": o = this.addCircle(i); break; case "ellipse": o = this.addEllipse(i); break; case "box": o = this.addBox(i); break; case "cylinder": o = this.addCylinder(i); break; case "cone": o = this.addCone(i); break; case "sphere": case "ellipsoid": o = this.addSphere(i); break; case "polyhedron": o = this.addPolyhedron(i) } if (this.defaultEdit(), o && i.removeEdit && this.SimpleGraphicObj.pop(), o.deleteObject = () => { this.remove(o.id), this._viewer.entities.removeById(o.id) }, e && (i.GroupID = e.pId, i.id = e.id, i.name = e.name), void 0 !== i.GroupID) { let e = { id: o.id, name: o.name, pId: i.GroupID, type: t, item: { item: o, setVisibility: e => { o.show = e } } }; - 1 < t.indexOf("Primitive") && (e.id = i.id, e.name = i.name), V.insertGroupId(e, i.GroupID) } return o }, P.prototype.addSimpleGraphicGroup = function(t, i = {}, e) { let o = null; switch (t) { case "point": o = this.addPoint(i); break; case "billboard": o = this.addBillboard(i); break; case "label": o = this.addLabel(i); break; case "model": o = this.addModel(i); break; case "polyline": o = this.addPolyline(i); break; case "polylinePrimitive": o = this.addPolylinePrimitive(i); break; case "polygon": o = this.addPolygon(i); break; case "polygonPrimitive": o = this.addPolygonPrimitive(i); break; case "rectangle": o = this.addRectangle(i); break; case "circle": o = this.addCircle(i); break; case "ellipse": o = this.addEllipse(i); break; case "box": o = this.addBox(i); break; case "cylinder": o = this.addCylinder(i); break; case "cone": o = this.addCone(i); break; case "sphere": case "ellipsoid": o = this.addSphere(i); break; case "polyhedron": o = this.addPolyhedron(i) } if (this.defaultEdit(), o && i.removeEdit && this.SimpleGraphicObj.pop(), o.deleteObject = () => { this.remove(o.id), this._viewer.entities.removeById(o.id) }, e && (i.GroupID = e.pId, i.id = e.id, i.name = e.name), void 0 !== i.GroupID) { let e = { id: o.id, name: o.name, pId: i.GroupID, type: t, item: { item: o, setVisibility: e => { o.show = e } } }; - 1 < t.indexOf("Primitive") && (e.id = i.id, e.name = i.name), V.insertGroupId(e, i.GroupID) } return o }, P.prototype.createPoint = function(t = {}, i) { let o = this, r = this._viewer; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, this.drawHandler .setInputAction(e => { var e = o._getPosition.getMousePosition(e); e && (e = r.entities.add({ id: o._core.getuid(), name: "Point", position: e, point: { pixelSize: 16, color: o._cesium.Color.fromCssColorString(o._core.defaultValue(t.color, "#0000ff")), outlineWidth: o._core.defaultValue(t.outlineWidth, 2), outlineColor: o._cesium.Color.fromCssColorString(o._core.defaultValue(t .outlineColor, "rgba(255,255,255,0.6)")), disableDepthTestDistance: o._core.defaultValue(t .disableDepthTestDistance, Number.POSITIVE_INFINITY), distanceDisplayCondition: o._core.defaultValue(t .distanceDisplayCondition, new o._cesium .DistanceDisplayCondition(0, 1e8)) } }), o.SimpleGraphicObj.push(e.id), o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), i && "function" == typeof i && i(e)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { o.tooltip.showAt(e.endPosition, "点击绘制点") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = () => { this.end = void 0, o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0") }, this }, P.prototype.addPoint = function(e = {}) { var t = this; let i = this._viewer; e = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "Point"), position: e.position, point: { pixelSize: t._core.defaultValue(e.pixelSize, 16), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "#0000ff")), outlineWidth: t._core.defaultValue(e.outlineWidth, 2), outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor, "rgba(255,255,255,0.6)")), heightReference: t._core.defaultValue(e.heightReference, 1), scaleByDistance: t._core.defaultValue(e.scaleByDistance, void 0), disableDepthTestDistance: t._core.defaultValue(e.disableDepthTestDistance, Number .POSITIVE_INFINITY), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return t.SimpleGraphicObj.push(e.id), e }, P.prototype.createBillboard = function(t = {}, i) { let o = this, r = this._viewer; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, this.drawHandler .setInputAction(e => { var e = o._getPosition.getMousePosition(e); e && (e = r.entities.add({ id: o._core.getuid(), name: "Billboard", position: e, billboard: { horizontalOrigin: o._cesium.HorizontalOrigin.CENTER, verticalOrigin: o._cesium.VerticalOrigin.BOTTOM, scale: o._core.defaultValue(t.scale, 1), width: o._core.defaultValue(t.width, t.image ? void 0 : 32), height: o._core.defaultValue(t.height, t.image ? void 0 : 44), image: o._core.defaultValue(t.image, window.SmartEarthRootUrl + D.mark), color: o._cesium.Color.fromCssColorString(o._core.defaultValue(t.color, "#ffffff")), disableDepthTestDistance: o._core.defaultValue(t .disableDepthTestDistance, Number.POSITIVE_INFINITY), distanceDisplayCondition: o._core.defaultValue(t .distanceDisplayCondition, new o._cesium .DistanceDisplayCondition(0, 1e8)) } }), o.SimpleGraphicObj.push(e.id), o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), i && "function" == typeof i && i(e)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { o.tooltip.showAt(e.endPosition, "点击绘制图标") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = () => { this.end = void 0, o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0") }, this }, P.prototype.addBillboard = function(e = {}) { var t = this; let i = this._viewer; e = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "Billboard"), position: e.position, billboard: { horizontalOrigin: t._core.defaultValue(e.horizontalOrigin, t._cesium.HorizontalOrigin .CENTER), verticalOrigin: t._core.defaultValue(e.verticalOrigin, t._cesium.VerticalOrigin.BOTTOM), scale: t._core.defaultValue(e.scale, 1), rotation: t._core.defaultValue(e.rotation, 0), width: t._core.defaultValue(e.width, void 0), height: t._core.defaultValue(e.height, void 0), image: t._core.defaultValue(e.image, window.SmartEarthRootUrl + D.mark), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "#ffffff")), heightReference: t._core.defaultValue(e.heightReference, 1), scaleByDistance: t._core.defaultValue(e.scaleByDistance, void 0), disableDepthTestDistance: t._core.defaultValue(e.disableDepthTestDistance, Number .POSITIVE_INFINITY), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return t.SimpleGraphicObj.push(e.id), e }, P.prototype.createLabel = function(t = {}, i) { let o = this, r = this._viewer; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, this.drawHandler .setInputAction(e => { var e = o._getPosition.getMousePosition(e); e && (e = r.entities.add({ id: o._core.getuid(), name: "Label", position: e, label: { text: "新建文本", font: "24px 宋体", fillColor: o._cesium.Color.fromCssColorString(o._core.defaultValue(t .fillColor, "#ffffff")), scale: 1, style: 2, outlineColor: o._cesium.Color.BLACK, outlineWidth: 0, showBackground: !1, backgroundColor: new o._cesium.Color(.165, .165, .165, .8), horizontalOrigin: o._cesium.HorizontalOrigin.CENTER, verticalOrigin: o._cesium.VerticalOrigin.CENTER, distanceDisplayCondition: o._core.defaultValue(t .distanceDisplayCondition, new o._cesium .DistanceDisplayCondition(0, 1e8)), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), o.SimpleGraphicObj.push(e.id), o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), i && "function" == typeof i && i(e)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { o.tooltip.showAt(e.endPosition, "点击绘制文本") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = () => { this.end = void 0, o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0") }, this }, P.prototype.addLabel = function(e = {}) { var t = this; let i = this._viewer; e = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "Label"), position: e.position, label: { text: t._core.defaultValue(e.text, "新建文本"), font: t._core.defaultValue(e.font, "24px 宋体"), scale: t._core.defaultValue(e.scale, 1), style: t._core.defaultValue(e.style, 2), fillColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.fillColor, "#ffffff")), outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor, "#000000")), outlineWidth: t._core.defaultValue(e.outlineWidth, 0), showBackground: t._core.defaultValue(e.showBackground, !1), backgroundColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e .backgroundColor, "rgba(42,42,42,0.8)")), heightReference: t._core.defaultValue(e.heightReference, 1), horizontalOrigin: t._core.defaultValue(e.horizontalOrigin, t._cesium.HorizontalOrigin .CENTER), verticalOrigin: t._core.defaultValue(e.verticalOrigin, t._cesium.VerticalOrigin.CENTER), scaleByDistance: t._core.defaultValue(e.scaleByDistance, void 0), pixelOffset: t._core.defaultValue(e.pixelOffset, void 0), disableDepthTestDistance: t._core.defaultValue(e.disableDepthTestDistance, Number .POSITIVE_INFINITY), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return t.SimpleGraphicObj.push(e.id), e }, P.prototype.createModel = function(o = {}, t) { let r = this, n = this._viewer; this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this ._cesium.ScreenSpaceEventHandler(n.scene.canvas), V.states = 1; let a; var e = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(r._core.defaultValue(o.heading, 0))), i = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(r._core.defaultValue(o.pitch, 0))), s = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(r._core.defaultValue(o.roll, 0))); let l = Cesium.Matrix4.fromRotationTranslation(e), u = Cesium.Matrix4.fromRotationTranslation(i), c = Cesium.Matrix4.fromRotationTranslation(s), h = (this.drawHandler.setInputAction(e => { e = r._getPosition.getMousePosition(e, a); e && (a && n.scene.primitives.remove(a), (a = n.entities.add({ id: r._core.getuid(), name: r._core.defaultValue(o.name, "Model"), position: e, orientation: Cesium.Transforms.headingPitchRollQuaternion(e, new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(r._core .defaultValue(o.heading, 0)), Cesium.Math.toRadians( r._core.defaultValue(o.pitch, 0)), Cesium.Math .toRadians(r._core.defaultValue(o.roll, 0)))), model: { uri: r._core.defaultValue(o.url, window.SmartEarthRootUrl + D .testModel), scale: r._core.defaultValue(o.scale, 1), minimumPixelSize: 0, runAnimations: !0, colorBlendMode: r._core.defaultValue(o.colorBlendMode, void 0), color: r._cesium.Color.fromCssColorString(r._core.defaultValue(o .color, "#ffffff")), distanceDisplayCondition: r._core.defaultValue(o .distanceDisplayCondition, new r._cesium .DistanceDisplayCondition(0, 1e8)) } })).heading = r._core.defaultValue(o.heading, 0), a.pitch = r._core .defaultValue(o.pitch, 0), a.roll = r._core.defaultValue(o.roll, 0), r .SimpleGraphicObj.push(a.id), r.drawHandler.destroy(), r.drawHandler = void 0, r .tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), r._core.mouse(r._viewer.container, 0, "0"), t && "function" == typeof t && t(a)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), !1); return this.drawHandler.setInputAction(e => { var t, i = r._getPosition.getMousePosition(e, a); a ? (t = Cesium.Transforms.eastNorthUpToFixedFrame(i), Cesium.Matrix4.multiply(t, l, t), Cesium.Matrix4.multiply(t, u, t), Cesium.Matrix4.multiply(t, c, t), a.modelMatrix = t) : i && (t = Cesium.Transforms.eastNorthUpToFixedFrame(i), Cesium.Matrix4 .multiply(t, l, t), Cesium.Matrix4.multiply(t, u, t), Cesium.Matrix4.multiply(t, c, t), (a = n.scene.primitives.add(Cesium.Model.fromGltf({ modelMatrix: t, url: r._core.defaultValue(o.url, window.SmartEarthRootUrl + D .testModel), scale: r._core.defaultValue(o.scale, 1), minimumPixelSize: 0, colorBlendMode: r._core.defaultValue(o.colorBlendMode, void 0), color: r._cesium.Color.fromCssColorString(r._core.defaultValue(o .color, "#ffffff")).withAlpha(.5), distanceDisplayCondition: r._core.defaultValue(o .distanceDisplayCondition, new r._cesium .DistanceDisplayCondition(0, 1e8)), allowPicking: !1 }))).readyPromise.then(() => { h = !0 })), h ? r.tooltip.showAt(e.endPosition, "点击绘制模型") : r.tooltip.showAt(e.endPosition, "加载模型中...") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = () => { this.end = void 0, r.drawHandler.destroy(), r.drawHandler = void 0, r.tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), r._core.mouse(r._viewer.container, 0, "0") }, this }, P.prototype.addModel = function(e = {}) { var t = this; let i = this._viewer, o = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "Model"), position: e.position, orientation: Cesium.Transforms.headingPitchRollQuaternion(e.position, new Cesium .HeadingPitchRoll(Cesium.Math.toRadians(t._core.defaultValue(e.heading, 0)), Cesium .Math.toRadians(t._core.defaultValue(e.pitch, 0)), Cesium.Math.toRadians(t._core .defaultValue(e.roll, 0)))), model: { scale: t._core.defaultValue(e.scale, 1), uri: t._core.defaultValue(e.url, window.SmartEarthRootUrl + D.testModel), minimumPixelSize: t._core.defaultValue(e.minimumPixelSize, 0), runAnimations: t._core.defaultValue(e.runAnimations, !0), colorBlendMode: t._core.defaultValue(e.colorBlendMode, void 0), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "#ffffff")), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return o.heading = t._core.defaultValue(e.heading, 0), o.pitch = t._core.defaultValue(e.pitch, 0), o .roll = t._core.defaultValue(e.roll, 0), t.SimpleGraphicObj.push(o.id), o }, P.prototype.createPolyline = function(i = {}, t) { let o = this, r = this._viewer, n = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, []), a; return this.drawHandler.setInputAction(e => { let t = o._getPosition.getMousePosition(e, a); t && (0 === n.length && n.push(t.clone()), n.push(t), i.toPoint && 3 === n.length && (n .pop(), o.end()), a || (a = r.entities.add({ id: o._core.getuid(), name: o._core.defaultValue(i.name, "新建线"), polyline: { positions: new o._cesium.CallbackProperty(function() { return n }, !1), clampToGround: o._core.defaultValue(i.clampToGround, !0), material: new Cesium.PolylineOutlineMaterialProperty({ color: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.color, "rgba(0,255,0,0.6)")), outlineWidth: 0, outlineColor: o._cesium.Color.WHITE.withAlpha(.6) }), depthFailMaterial: i.depthFailColor && new Cesium .PolylineOutlineMaterialProperty({ color: o._cesium.Color.fromCssColorString(i .depthFailColor), outlineWidth: 0, outlineColor: o._cesium.Color.WHITE.withAlpha(.6) }), width: o._core.defaultValue(i.width, 3), distanceDisplayCondition: new o._cesium.DistanceDisplayCondition(0, 1e8) } }), o.SimpleGraphicObj.push(a.id)), i.showSize && o.showSizeData("polyline", [n[n .length - 2], n[n.length - 1]])) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { 0 === n.length ? o.tooltip.showAt(e.endPosition, "点击开始绘制") : (o.tooltip.showAt(e .endPosition, "点击添加点,右键结束绘制"), (e = o._getPosition.getMousePosition(e, a)) && (n .pop(), n.push(e), i.showSize && (o.clearLastSizeData(), o.showSizeData( "polyline", [n[n.length - 2], n[n.length - 1]])))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.end = function(e) { o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), o.clearAllSizeData(), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0), o.end = void 0, "cancel" === e ? a && (r .entities.remove(a), o.SimpleGraphicObj.pop()) : t && "function" == typeof t && t(a, n) }, this.drawHandler.setInputAction(e => { o.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, P.prototype.addPolyline = function(e = {}) { var t = this; let i = this._viewer; var o = e.positions, o = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "新建线"), polyline: { positions: o, clampToGround: t._core.defaultValue(e.clampToGround, !0), material: new Cesium.PolylineOutlineMaterialProperty({ color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")), outlineWidth: t._core.defaultValue(e.outlineWidth, 0), outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e .outlineColor, "rgba(255,255,255,0.6)")) }), depthFailMaterial: e.depthFailColor && new Cesium.PolylineOutlineMaterialProperty({ color: t._cesium.Color.fromCssColorString(e.depthFailColor), outlineWidth: 0, outlineColor: t._cesium.Color.WHITE.withAlpha(.6) }), width: t._core.defaultValue(e.width, 3), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return t.SimpleGraphicObj.push(o.id), o }, P.prototype.addPolylinePrimitive = function(e = {}) { var t = this, i = (this._viewer, e.positions); let o; o = e.clampToGround ? new t._cesium.GroundPolylineGeometry({ positions: i, width: t._core.defaultValue(e.width, 3) }) : (i = new Cesium.PolylineGeometry({ positions: i, width: t._core.defaultValue(e.width, 3) }), Cesium.PolylineGeometry.createGeometry(i)); i = t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")), i = new Cesium.GeometryInstance({ id: t._core.defaultValue(e.id, t._core.getuid()), geometry: o, attributes: { color: new t._cesium.ColorGeometryInstanceAttribute.fromColor(i) } }); let r; var n = new t._cesium.PolylineColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }); return r = new(e.clampToGround ? t._cesium.GroundPolylinePrimitive : t._cesium.Primitive)({ geometryInstances: i, appearance: n }), this.PrimitiveCollection.add(r), r }, P.prototype.createPolygon = function(i = {}, t) { let o = this, r = this._viewer, n = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, []), a, s; return this.drawHandler.setInputAction(e => { let t = o._getPosition.getMousePosition(e, [s, a]); t && (0 === n.length && n.push(t.clone()), n.push(t), 2 !== n.length || s || (i .clampToGround = o._core.defaultValue(i.clampToGround, !0), s = r.entities.add({ name: "临时线", polyline: { positions: new o._cesium.CallbackProperty(function() { return n }, !1), clampToGround: o._core.defaultValue(i.clampToGround, !0), material: new Cesium.PolylineOutlineMaterialProperty({ color: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.color, "rgba(0,255,0,0.6)")), outlineWidth: 0, outlineColor: o._cesium.Color.WHITE.withAlpha(.6) }), width: 3 } })), 3 !== n.length || a || (s && r.entities.remove(s), a = r.entities.add({ id: o._core.getuid(), name: o._core.defaultValue(i.name, "新建面"), polygon: { hierarchy: new o._cesium.CallbackProperty(function() { return new o._cesium.PolygonHierarchy(n) }, !1), material: new o._cesium.ImageMaterialProperty({ image: null, repeat: new o._cesium.Cartesian2(1, 1), color: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.color, "rgba(0,255,0,0.6)")) }), perPositionHeight: !o._core.defaultValue(i.clampToGround, !1), heightReference: i.clampToGround ? 1 : 0, outline: o._core.defaultValue(i.outline, !1), outlineColor: o._cesium.Color.WHITE.withAlpha(.6), distanceDisplayCondition: new o._cesium.DistanceDisplayCondition(0, 1e8) } }), o.SimpleGraphicObj.push(a.id))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { var t; 0 === n.length ? o.tooltip.showAt(e.endPosition, "点击添加第一个点") : 1 === n.length ? (o.tooltip .showAt(e.endPosition, "点击添加第二个点"), (t = o._getPosition.getMousePosition(e, [s, a])) && (n.pop(), n.push(t))) : (o.tooltip.showAt(e.endPosition, "点击添加点,右键结束绘制"), ( t = o._getPosition.getMousePosition(e, [s, a])) && (n.pop(), n.push(t), i .showSize && (o.clearLastSizeData(), o.showSizeData("polygon", n)))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.end = function(e) { o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), s && r.entities.remove(s), o.clearAllSizeData(), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), o.end = void 0, "cancel" === e ? a && ( r.entities.remove(a), o.SimpleGraphicObj.pop()) : t && "function" == typeof t && t(a) }, this.drawHandler.setInputAction(e => { o.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, P.prototype.createTriangle = function(t = {}, i) { let h = this, o = this._viewer, r = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(o.scene.canvas), V.states = 1, []), n, a; function s(e, t) { let i = []; var o, r, n, a, e = h.toDegrees(e), t = h.toDegrees(t), s = (o = e.lat, c = e.lon, r = t.lat, n = t.lon, s = p(o), l = p(r), a = p(r) - p(o), u = p(n) - p(c), a = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(s) * Math.cos(l) * Math.pow(Math.sin(u / 2), 2))), a *= m, a = Math.round(1e4 * a) / 1e4, { angle: h._core.TwoPointAzimuth(c, o, n, r), distance: a }), l = s.angle, u = s.distance, c = (i.push(t.lon, t.lat), d(e.lat, e.lon, u, l + 120)); return i.push(c[0], c[1]), c = d(e.lat, e.lon, u, l - 120), i.push(c[0], c[1]), Cesium.Cartesian3 .fromDegreesArray(i) } this.drawHandler.setInputAction(e => { e = h._getPosition.getMousePosition(e, a); e && (n ? (r = s(n, e), this.end()) : (n = e, r = [e, e, e]), r.length && !a && (t .clampToGround = h._core.defaultValue(t.clampToGround, !0), a = o.entities.add({ id: h._core.getuid(), name: "新建三角形", polygon: { hierarchy: new h._cesium.CallbackProperty(function() { return new h._cesium.PolygonHierarchy(r) }, !1), material: new h._cesium.ImageMaterialProperty({ image: null, repeat: new h._cesium.Cartesian2(1, 1), color: h._cesium.Color.fromCssColorString(h._core .defaultValue(t.color, "rgba(0,255,0,0.6)")) }), perPositionHeight: !h._core.defaultValue(t.clampToGround, !1), heightReference: t.clampToGround ? 1 : 0, outline: h._core.defaultValue(t.outline, !1), outlineColor: h._cesium.Color.WHITE.withAlpha(.6), distanceDisplayCondition: new h._cesium.DistanceDisplayCondition(0, 1e8) } }), h.SimpleGraphicObj.push(a.id))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { var t; n ? (h.tooltip.showAt(e.endPosition, "再次点击结束绘制"), (t = h._getPosition.getMousePosition(e, a)) && (r = s(n, t))) : h.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.end = function(e) { h.drawHandler.destroy(), h.drawHandler = void 0, h.tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), h._core.mouse(h._viewer.container, 0), h.end = void 0, "cancel" === e ? a && (o .entities.remove(a), h.SimpleGraphicObj.pop()) : i && "function" == typeof i && i(a) }, this.drawHandler.setInputAction(e => { h.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK); let m = 6378137, l = 6356725; function d(e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = l + (m - l) * (90 - e) / 90; return [180 * (r / (o * Math.cos(e * Math.PI / 180)) + t * Math.PI / 180) / Math.PI, 180 * (i / o + e * Math.PI / 180) / Math.PI] } function p(e) { return e * Math.PI / 180 } return this }, P.prototype.createPolygonRectangle = function(i = {}, t) { let o = this, r = this._viewer, n = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, []), a, s, l; return this.drawHandler.setInputAction(e => { let t = o._getPosition.getMousePosition(e, a); t && (n.length ? o.end() : (s = e.position, n.push(t.clone(), t.clone(), t.clone(), t .clone())), a || (i.clampToGround = o._core.defaultValue(i.clampToGround, !0), a = r .entities.add({ id: o._core.getuid(), name: "新建面", polygon: { hierarchy: new o._cesium.CallbackProperty(function() { return new o._cesium.PolygonHierarchy(n) }, !1), material: new o._cesium.ImageMaterialProperty({ image: null, repeat: new o._cesium.Cartesian2(1, 1), color: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.color, "rgba(0,255,0,0.6)")) }), perPositionHeight: !o._core.defaultValue(i.clampToGround, !1), heightReference: i.clampToGround ? 1 : 0, outline: o._core.defaultValue(i.outline, !1), outlineColor: o._cesium.Color.WHITE.withAlpha(.6), distanceDisplayCondition: new o._cesium.DistanceDisplayCondition(0, 1e8) } }))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(t => { if (0 === n.length) o.tooltip.showAt(t.endPosition, "点击开始绘制"); else { o.tooltip.showAt(t.endPosition, "点击结束绘制"), s = Viewer.scene .cartesianToCanvasCoordinates(n[0]), l = t.endPosition; var t = { x: s.x, y: l.y }, i = { x: l.x, y: s.y }; let e = o._getPosition.getMousePosition(t, a); e && (n[1] = e), (e = o._getPosition.getMousePosition(l, a)) && (n[2] = e), (e = o ._getPosition.getMousePosition(i, a)) && (n[3] = e) } }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.end = function(e) { o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), o.end = void 0, "cancel" === e ? a && r .entities.remove(a) : t && "function" == typeof t && t(a, s, l) }, this }, P.prototype.addPolygon = function(e = {}) { var t = this; let i = this._viewer; var o = e.positions; let r; r = e.hierarchy || new t._cesium.PolygonHierarchy(o), e.clampToGround = t._core.defaultValue(e .clampToGround, !0); o = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "新建面"), polygon: { hierarchy: new t._cesium.CallbackProperty(function() { return r }, !1), material: new t._cesium.ImageMaterialProperty({ image: t._core.defaultValue(e.image, null), repeat: t._core.defaultValue(e.repeat, new t._cesium.Cartesian2(1, 1)), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")) }), outline: t._core.defaultValue(e.outline, !1), outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor, "rgba(255,255,255,0.6)")), perPositionHeight: !t._core.defaultValue(e.clampToGround, !1), heightReference: e.clampToGround ? 1 : 0, distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return t.SimpleGraphicObj.push(o.id), o }, P.prototype.addPolygonPrimitive = function(e = {}) { var t = this, i = (this._viewer, e.positions); let o; o = e.hierarchy || new t._cesium.PolygonHierarchy(i); let r; var i = new t._cesium.PolygonGeometry({ height: t._core.defaultValue(e.height, void 0), extrudedHeight: t._core.defaultValue(e.extrudedHeight, void 0), polygonHierarchy: o, vertexFormat: e.water ? Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT : void 0 }), i = t._cesium.PolygonGeometry.createGeometry(i), n = t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")), i = new Cesium.GeometryInstance({ id: t._core.defaultValue(e.id, t._core.getuid()), geometry: i, attributes: e.water ? void 0 : { color: new t._cesium.ColorGeometryInstanceAttribute.fromColor(n) } }); let a; return e.water ? a = new Cesium.Primitive({ geometryInstances: i, appearance: new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { type: "Water", uniforms: { baseWaterColor: e.watherColor || Cesium.Color.SKYBLUE .withAlpha(.6), blendColor: e.watherColor || Cesium.Color.SKYBLUE.withAlpha( .6), normalMap: e.url, frequency: e.frequency || 1e3, animationSpeed: e.watherSpeed || .01, amplitude: e.amplitude || 10 } } }) }), show: !0 }) : (a = new t._cesium.Primitive({ geometryInstances: i, appearance: new t._cesium.PerInstanceColorAppearance({ translucent: !0 }), shadows: e.shadows }), e.extrudedHeight && (r = new Cesium.PrimitiveCollection, n = new Cesium .PolygonOutlineGeometry({ height: t._core.defaultValue(e.height, void 0), polygonHierarchy: o, extrudedHeight: e.extrudedHeight }), i = Cesium.PolygonOutlineGeometry.createGeometry(n), n = t._cesium.Color .fromCssColorString(t._core.defaultValue(e.outlineColor, "rgba(255,255,255,0.6)")), e = new Cesium.GeometryInstance({ id: t._core.defaultValue(e.id, t._core.getuid()), geometry: i, attributes: { color: new t._cesium.ColorGeometryInstanceAttribute.fromColor(n) } }), i = new t._cesium.Primitive({ geometryInstances: e, appearance: new t._cesium.PolylineColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }) }), r.add(a), r.add(i))), r = r || a, this.PrimitiveCollection.add(r), r }, P.prototype.createRectangle = function(i = {}, t) { let o = this, r = this._viewer, n = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, []), a; return this.drawHandler.setInputAction(e => { var e = o._getPosition.getMousePosition(e, a); e && (0 === n.length ? n.push(e, e) : (n.pop(), n.push(e), o.end()), a || (e = o.toDegrees( n[0]), i.clampToGround = o._core.defaultValue(i.clampToGround, !0), (a = r .entities.add({ id: o._core.getuid(), name: "新建矩形", rectangle: { coordinates: new o._cesium.CallbackProperty(function() { return o._cesium.Rectangle.fromCartesianArray(n) }, !1), material: new o._cesium.ImageMaterialProperty({ image: null, repeat: new o._cesium.Cartesian2(1, 1), color: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.color, "rgba(0,255,0,0.6)")) }), height: i.clampToGround ? void 0 : e.height, heightReference: i.clampToGround ? 1 : 0, outline: !0, outlineColor: o._cesium.Color.WHITE.withAlpha(.6), outlineWidth: 1, distanceDisplayCondition: new o._cesium .DistanceDisplayCondition(0, 1e8) } })).thisHeight = e.height, o.SimpleGraphicObj.push(a.id))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { var t; 0 < n.length ? (o.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = o._getPosition .getMousePosition(e, a)) && (n.pop(), n.push(t), i.showSize && (o .clearLastSizeData(), o.showSizeData("rectangle", n)))) : o.tooltip.showAt(e .endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end("cancel") }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { this.end = void 0, o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), o .clearAllSizeData(), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), "cancel" === e ? a && (r.entities .remove(a), o.SimpleGraphicObj.pop()) : t && "function" == typeof t && t(a) }, this }, P.prototype.addRectangle = function(e = {}) { var t = this; let i = this._viewer; var o = e.positions; let r; r = e.coordinates || t._cesium.Rectangle.fromCartesianArray(o); o = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "新建矩形"), rectangle: { coordinates: new t._cesium.CallbackProperty(function() { return r }, !1), material: new t._cesium.ImageMaterialProperty({ image: t._core.defaultValue(e.image, null), repeat: t._core.defaultValue(e.repeat, new t._cesium.Cartesian2(1, 1)), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")) }), height: t._core.defaultValue(e.height, void 0), rotation: t._core.defaultValue(e.rotation, 0), heightReference: t._core.defaultValue(e.heightReference, 1), outline: t._core.defaultValue(e.outline, !1), outlineWidth: 1, outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor, "rgba(255,255,255,0.6)")), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return t.SimpleGraphicObj.push(o.id), o }, P.prototype.createCircle = function(i = {}, t) { let o = this, r = this._viewer, n = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, []), a, s = 0; return this.drawHandler.setInputAction(e => { var e = o._getPosition.getMousePosition(e, a); e && (0 === n.length ? n.push(e, e) : (n[0] = e, s = o._cesium.Cartesian3.distance(n[0], n[ 1]), o.end()), a || (e = o.toDegrees(n[1]), i.clampToGround = o._core .defaultValue(i.clampToGround, !0), (a = r.entities.add({ id: o._core.getuid(), name: "新建圆", position: n[1], ellipse: { semiMajorAxis: new o._cesium.CallbackProperty(function() { return s }, !1), semiMinorAxis: new o._cesium.CallbackProperty(function() { return s }, !1), material: new o._cesium.ImageMaterialProperty({ image: null, repeat: new o._cesium.Cartesian2(1, 1), color: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.color, "rgba(0,255,0,0.6)")) }), height: i.clampToGround ? void 0 : e.height, heightReference: i.clampToGround ? 1 : 0, outline: !0, outlineWidth: 1, outlineColor: o._cesium.Color.WHITE.withAlpha(.6), distanceDisplayCondition: new o._cesium .DistanceDisplayCondition(0, 1e8) } })).thisHeight = e.height, o.SimpleGraphicObj.push(a.id))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { var t; 0 < n.length ? (o.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = o._getPosition .getMousePosition(e, a)) && (n[0] = t, s = o._cesium.Cartesian3.distance(n[0], n[1]), i.showSize && (o.clearLastSizeData(), o.showSizeData("circle", n[1], s)))) : o.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end("cancel") }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { this.end = void 0, o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), o .clearAllSizeData(), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), "cancel" === e ? a && (r.entities .remove(a), o.SimpleGraphicObj.pop()) : t && "function" == typeof t && t(a, { distance: s, positions: n }) }, this }, P.prototype.addCircle = function(e = {}) { var t = this; let i = this._viewer, o = e.radius; e = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "新建圆"), position: e.position, ellipse: { semiMajorAxis: new t._cesium.CallbackProperty(function() { return o }, !1), semiMinorAxis: new t._cesium.CallbackProperty(function() { return o }, !1), material: new t._cesium.ImageMaterialProperty({ image: t._core.defaultValue(e.image, null), repeat: t._core.defaultValue(e.repeat, new t._cesium.Cartesian2(1, 1)), transparent: !0, color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, e .image ? "#ffffff" : "rgba(0,255,0,0.6)")) }), height: t._core.defaultValue(e.height, void 0), heightReference: t._core.defaultValue(e.heightReference, e.height ? 0 : 1), outline: t._core.defaultValue(e.outline, !1), outlineWidth: 1, rotation: e.rotation, stRotation: e.outline, outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor, "rgba(255,255,255,0.6)")), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return t.SimpleGraphicObj.push(e.id), e }, P.prototype.createEllipse = function(t = {}, i) { let o = this, r = this._viewer, n = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, []), a, s = 0; return this.drawHandler.setInputAction(e => { var e = o._getPosition.getMousePosition(e, a); e && (0 === n.length ? n.push(e, e) : (n[0] = e, s = o._cesium.Cartesian3.distance(n[0], n[ 1]), o.end()), a || (e = o.toDegrees(n[1]), t.clampToGround = o._core .defaultValue(t.clampToGround, !0), (a = r.entities.add({ id: o._core.getuid(), name: "新建椭圆", position: n[1], ellipse: { semiMajorAxis: new o._cesium.CallbackProperty(function() { return s }, !1), semiMinorAxis: new o._cesium.CallbackProperty(function() { return s / 2 }, !1), material: new o._cesium.ImageMaterialProperty({ image: null, repeat: new o._cesium.Cartesian2(1, 1), color: o._cesium.Color.fromCssColorString(o._core .defaultValue(t.color, "rgba(0,255,0,0.6)")) }), height: t.clampToGround ? void 0 : e.height, heightReference: t.clampToGround ? 1 : 0, outline: !0, outlineWidth: 1, outlineColor: o._cesium.Color.WHITE.withAlpha(.6), distanceDisplayCondition: new o._cesium .DistanceDisplayCondition(0, 1e8) } })).thisHeight = e.height, o.SimpleGraphicObj.push(a.id))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { var t; 0 < n.length ? (o.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = o._getPosition .getMousePosition(e, a)) && (n[0] = t, s = o._cesium.Cartesian3.distance(n[0], n[1]))) : o.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end("cancel") }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { this.end = void 0, o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), o .clearAllSizeData(), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), "cancel" === e ? a && (r.entities .remove(a), o.SimpleGraphicObj.pop()) : i && "function" == typeof i && i(a) }, this }, P.prototype.addEllipse = function(e = {}) { var t = this; let i = this._viewer, o = e.semiMajorAxis, r = e.semiMinorAxis; e = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "新建圆"), position: e.position, ellipse: { semiMajorAxis: new t._cesium.CallbackProperty(function() { return o }, !1), semiMinorAxis: new t._cesium.CallbackProperty(function() { return r }, !1), material: new t._cesium.ImageMaterialProperty({ image: t._core.defaultValue(e.image, null), repeat: t._core.defaultValue(e.repeat, new t._cesium.Cartesian2(1, 1)), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")) }), height: t._core.defaultValue(e.height, void 0), heightReference: t._core.defaultValue(e.heightReference, 1), outline: t._core.defaultValue(e.outline, !1), outlineWidth: 1, outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor, "rgba(255,255,255,0.6)")), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return t.SimpleGraphicObj.push(e.id), e }, P.prototype.createBox = function(n = {}, t) { let a = this, r = this._viewer, s = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, []), l, u = [0, 0, 200]; return this.drawHandler.setInputAction(e => { let t = a._getPosition.getMouseDegrees(e, l); var i, o; t && (0 === s.length ? s.push(t, t) : (t.height = s[0].height, s[1] = t, e = a.Cdcl(s[0] .lat, s[0].lon, s[0].lat, s[1].lon), i = a.Cdcl(s[0].lat, s[0].lon, s[1] .lat, s[0].lon), o = { lon: (s[0].lon + s[1].lon) / 2, lat: (s[0].lat + s[1].lat) / 2 }, u && (u[0] = e, u[1] = i), l.position = Cesium.Cartesian3.fromDegrees(o.lon, o.lat, s[0].height + u[2] / 2), a.end()), l || (l = r.entities.add({ id: a._core.getuid(), name: "新建立方体", position: a._cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height), box: { dimensions: new a._cesium.CallbackProperty(function() { return a._cesium.Cartesian3.fromArray(u) }, !1), material: new a._cesium.ImageMaterialProperty({ image: null, repeat: new a._cesium.Cartesian2(1, 1), color: a._cesium.Color.fromCssColorString(a._core .defaultValue(n.color, "rgba(0,255,0,0.6)")) }), fill: !0, outline: !0, outlineColor: a._cesium.Color.fromCssColorString(a._core .defaultValue(n.outlineColor, "rgba(255,255,255,0.6)")), shadows: a._cesium.ShadowMode.ENABLED, distanceDisplayCondition: new a._cesium.DistanceDisplayCondition(0, 1e8) } }), a.SimpleGraphicObj.push(l.id))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(t => { if (0 < s.length) { a.tooltip.showAt(t.endPosition, "再次点击结束绘制,右键取消"); let e = a._getPosition.getMouseDegrees(t, l); var i, o, r; e && (e.height = s[0].height, s[1] = e, i = a.Cdcl(s[0].lat, s[0].lon, s[0].lat, s[1] .lon), o = a.Cdcl(s[0].lat, s[0].lon, s[1].lat, s[0].lon), r = { lon: (s[0].lon + s[1].lon) / 2, lat: (s[0].lat + s[1].lat) / 2 }, u && (u[0] = i, u[1] = o), l.position = Cesium.Cartesian3.fromDegrees(r.lon, r.lat, s[0].height + u[2] / 2), n.showSize && (a.clearLastSizeData(), a .showSizeData("box", l.position, u))) } else a.tooltip.showAt(t.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end("cancel") }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { this.end = void 0, a.drawHandler.destroy(), a.drawHandler = void 0, a.tooltip.show(!1), a .clearAllSizeData(), setTimeout(function() { V.states = 0 }, 100), a._core.mouse(a._viewer.container, 0, "0"), "cancel" === e ? l && (r.entities .remove(l), a.SimpleGraphicObj.pop()) : t && "function" == typeof t && t(l) }, this }, P.prototype.addBox = function(e = {}) { var t = this; let i = this._viewer, o = e.dimensions; e = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "新建立方体"), position: e.position, box: { dimensions: new t._cesium.CallbackProperty(function() { return o }, !1), material: new t._cesium.ImageMaterialProperty({ image: t._core.defaultValue(e.image, null), repeat: t._core.defaultValue(e.repeat, new t._cesium.Cartesian2(1, 1)), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")) }), fill: !0, outline: t._core.defaultValue(e.outline, !0), shadows: t._cesium.ShadowMode.ENABLED, outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor, "rgba(255,255,255,0.6)")), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return t.SimpleGraphicObj.push(e.id), e }, P.prototype.createCylinder = function(i = {}, t) { let o = this, r = this._viewer, n = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, []), a, s = 0; return this.drawHandler.setInputAction(e => { var e = o._getPosition.getMousePosition(e, a); e && (0 === n.length ? n.push(e, e) : (n[0] = e, s = o._cesium.Cartesian3.distance(n[0], n[ 1]), o.end()), a || (e = o.toDegrees(e), (a = r.entities.add({ id: o._core.getuid(), name: "新建圆柱体", position: o._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height + 100), cylinder: { length: 200, topRadius: new o._cesium.CallbackProperty(function() { return s }, !1), bottomRadius: new o._cesium.CallbackProperty(function() { return s }, !1), material: new o._cesium.ImageMaterialProperty({ image: null, repeat: new o._cesium.Cartesian2(1, 1), color: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.color, "rgba(0,255,0,0.6)")) }), fill: !0, shadows: o._cesium.ShadowMode.ENABLED, distanceDisplayCondition: new o._cesium .DistanceDisplayCondition(0, 1e8), outline: !0, outlineColor: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.outlineColor, "rgba(255,255,255,0.6)")) } })).changeTop = !0, o.SimpleGraphicObj.push(a.id))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { var t; 0 < n.length ? (o.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = o._getPosition .getMousePosition(e, a)) && (n[0] = t, s = o._cesium.Cartesian3.distance(n[0], n[1]), i.showSize && (o.clearLastSizeData(), o.showSizeData("cylinder", n[ 1], s, 200)))) : o.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end("cancel") }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { this.end = void 0, o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), o .clearAllSizeData(), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), "cancel" === e ? a && (r.entities .remove(a), o.SimpleGraphicObj.pop()) : t && "function" == typeof t && t(a) }, this }, P.prototype.addCylinder = function(e = {}) { var t = this; let i = this._viewer, o = e.radius, r = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "新建圆柱体"), position: e.position, cylinder: { length: t._core.defaultValue(e.length, 200), topRadius: new t._cesium.CallbackProperty(function() { return o }, !1), bottomRadius: new t._cesium.CallbackProperty(function() { return o }, !1), material: new t._cesium.ImageMaterialProperty({ image: t._core.defaultValue(e.image, null), repeat: t._core.defaultValue(e.repeat, new t._cesium.Cartesian2(1, 1)), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")) }), fill: !0, outline: t._core.defaultValue(e.outline, !0), shadows: t._cesium.ShadowMode.ENABLED, outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor, "rgba(255,255,255,0.6)")), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return r.changeTop = !0, t.SimpleGraphicObj.push(r.id), r }, P.prototype.createCone = function(i = {}, t) { let o = this, r = this._viewer, n = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, []), a, s = 0; return this.drawHandler.setInputAction(e => { var e = o._getPosition.getMousePosition(e, a); e && (0 === n.length ? n.push(e, e) : (n[0] = e, s = o._cesium.Cartesian3.distance(n[0], n[ 1]), o.end()), a || (e = o.toDegrees(e), (a = r.entities.add({ id: o._core.getuid(), name: "新建圆锥体", position: o._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height + 100), cylinder: { length: 200, topRadius: 0, bottomRadius: new o._cesium.CallbackProperty(function() { return s }, !1), material: new o._cesium.ImageMaterialProperty({ image: null, repeat: new o._cesium.Cartesian2(1, 1), color: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.color, "rgba(0,255,0,0.6)")) }), fill: !0, shadows: o._cesium.ShadowMode.ENABLED, distanceDisplayCondition: new o._cesium .DistanceDisplayCondition(0, 1e8), outline: !0, outlineColor: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.outlineColor, "rgba(255,255,255,0.6)")) } })).changeTop = !1, o.SimpleGraphicObj.push(a.id))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { var t; 0 < n.length ? (o.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = o._getPosition .getMousePosition(e, a)) && (n[0] = t, s = o._cesium.Cartesian3.distance(n[0], n[1]), i.showSize && (o.clearLastSizeData(), o.showSizeData("cone", n[1], s, 200)))) : o.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end("cancel") }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { this.end = void 0, o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), o .clearAllSizeData(), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), "cancel" === e ? a && (r.entities .remove(a), o.SimpleGraphicObj.pop()) : t && "function" == typeof t && t(a) }, this }, P.prototype.addCone = function(e = {}) { var t = this; let i = this._viewer, o = e.bottomRadius, r = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "新建圆锥体"), position: e.position, cylinder: { length: t._core.defaultValue(e.length, 200), topRadius: t._core.defaultValue(e.topRadius, 0), bottomRadius: new t._cesium.CallbackProperty(function() { return o }, !1), material: new t._cesium.ImageMaterialProperty({ image: t._core.defaultValue(e.image, null), repeat: t._core.defaultValue(e.repeat, new t._cesium.Cartesian2(1, 1)), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")) }), fill: !0, outline: t._core.defaultValue(e.outline, !0), shadows: t._cesium.ShadowMode.ENABLED, outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor, "rgba(255,255,255,0.6)")), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return r.changeTop = !1, t.SimpleGraphicObj.push(r.id), r }, P.prototype.createSphere = function(i = {}, o) { let r = this, n = this._viewer, a = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(n.scene.canvas), V.states = 1, []), s, l = 0; return this.drawHandler.setInputAction(e => { let t = r._getPosition.getMousePosition(e, s); t && (0 === a.length ? a.push(t, t) : (a[0] = t, l = r._cesium.Cartesian3.distance(a[0], a[ 1]), r.end()), s || ((s = n.entities.add({ id: r._core.getuid(), name: "新建球体", position: t.clone(), ellipsoid: { radii: new r._cesium.CallbackProperty(function() { return new Cesium.Cartesian3(l, l, l) }, !1), material: new r._cesium.ImageMaterialProperty({ image: null, repeat: new r._cesium.Cartesian2(1, 1), color: r._cesium.Color.fromCssColorString(r._core .defaultValue(i.color, "rgba(0,255,0,0.6)")) }), fill: !0, shadows: r._cesium.ShadowMode.ENABLED, distanceDisplayCondition: new r._cesium .DistanceDisplayCondition(0, 1e8), outline: !0, outlineColor: r._cesium.Color.fromCssColorString(r._core .defaultValue(i.outlineColor, "rgba(255,255,255,0.6)")) } })).isSphere = !0, r.SimpleGraphicObj.push(s.id))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { var t; 0 < a.length ? (r.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = r._getPosition .getMousePosition(e, s)) && (a[0] = t, l = r._cesium.Cartesian3.distance(a[0], a[1]), i.showSize && (r.clearLastSizeData(), r.showSizeData("sphere", a[1], l)))) : r.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { this.end("cancel") }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = t => { if (this.end = void 0, r.drawHandler.destroy(), r.drawHandler = void 0, r.tooltip.show(!1), r .clearAllSizeData(), setTimeout(function() { V.states = 0 }, 100), r._core.mouse(r._viewer.container, 0, "0"), "cancel" === t) s && (n.entities .remove(s), r.SimpleGraphicObj.pop()); else { let e = r.toDegrees(a[0]); t = r.toDegrees(a[1]); e.height = t.height, a[0] = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), o && "function" == typeof o && o(s) } }, this }, P.prototype.addSphere = function(e = {}) { var t = this; let i = this._viewer; var o = e.radius; let r, n = (r = e.radii || new Cesium.Cartesian3(o, o, o), i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "新建球体"), position: e.position, ellipsoid: { radii: new t._cesium.CallbackProperty(function() { return r }, !1), material: new t._cesium.ImageMaterialProperty({ image: t._core.defaultValue(e.image, null), repeat: t._core.defaultValue(e.repeat, new t._cesium.Cartesian2(1, 1)), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")) }), fill: !0, outline: t._core.defaultValue(e.outline, !0), shadows: t._cesium.ShadowMode.ENABLED, outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e .outlineColor, "rgba(255,255,255,0.6)")), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t ._cesium.DistanceDisplayCondition(0, 1e8)) } })); return n.isSphere = !0, t.SimpleGraphicObj.push(n.id), n }, P.prototype.createPolyhedron = function(i = {}, t) { let o = this, r = this._viewer, n = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, []), a; return this.drawHandler.setInputAction(e => { let t = o._getPosition.getMousePosition(e, a); t && (1 === n.length && n.push(t.clone()), n.push(t), 3 !== n.length || a || (e = o .toDegrees(n[0]), a = r.entities.add({ id: o._core.getuid(), name: "新建多边体", polygon: { hierarchy: new o._cesium.CallbackProperty(function() { return new o._cesium.PolygonHierarchy(n) }, !1), extrudedHeight: e.height + 200, height: e.height, material: new o._cesium.ImageMaterialProperty({ image: null, repeat: new o._cesium.Cartesian2(1, 1), color: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.color, "rgba(0,255,0,0.6)")) }), fill: !0, shadows: o._cesium.ShadowMode.ENABLED, distanceDisplayCondition: new o._cesium.DistanceDisplayCondition(0, 1e8), outline: !0, outlineColor: o._cesium.Color.fromCssColorString(o._core .defaultValue(i.outlineColor, "rgba(255,255,255,0.6)")) } }), o.SimpleGraphicObj.push(a.id))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { 0 === n.length ? o.tooltip.showAt(e.endPosition, "点击添加第一个点") : 1 === n.length ? o.tooltip .showAt(e.endPosition, "点击添加第二个点") : (o.tooltip.showAt(e.endPosition, "点击添加点,右键结束绘制"), ( e = o._getPosition.getMousePosition(e, a)) && (n.pop(), n.push(e), i.showSize && (o.clearLastSizeData(), o.showSizeData("polyhedron", n, 0, 200)))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.end = function(e) { o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), o.clearAllSizeData(), setTimeout(function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), o.end = void 0, "cancel" === e ? a && ( r.entities.remove(a), o.SimpleGraphicObj.pop()) : t && "function" == typeof t && t(a) }, this.drawHandler.setInputAction(e => { o.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, P.prototype.addPolyhedron = function(e = {}) { var t = this; let i = this._viewer; var o = e.positions, r = t._core.defaultValue(e.height, 0); let n; n = e.hierarchy || new t._cesium.PolygonHierarchy(o); o = i.entities.add({ id: t._core.defaultValue(e.id, t._core.getuid()), name: t._core.defaultValue(e.name, "新建多边体"), polygon: { hierarchy: new t._cesium.CallbackProperty(function() { return n }, !1), extrudedHeight: t._core.defaultValue(e.extrudedHeight, r + 200), height: r, material: new t._cesium.ImageMaterialProperty({ image: t._core.defaultValue(e.image, null), repeat: t._core.defaultValue(e.repeat, new t._cesium.Cartesian2(1, 1)), color: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color, "rgba(0,255,0,0.6)")) }), shadows: t._cesium.ShadowMode.ENABLED, fill: !0, outline: t._core.defaultValue(e.outline, !0), outlineColor: t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor, "rgba(255,255,255,0.6)")), distanceDisplayCondition: t._core.defaultValue(e.distanceDisplayCondition, new t._cesium .DistanceDisplayCondition(0, 1e8)) } }); return t.SimpleGraphicObj.push(o.id), o }, P.prototype.toDegrees = function(e) { e = this._cesium.Cartographic.fromCartesian(e); return { lon: this._cesium.Math.toDegrees(e.longitude), lat: this._cesium.Math.toDegrees(e.latitude), height: e.height } }, P.prototype.showSizeData = function(o, r, n, a) { let s = "", l; switch (o) { case "polyline": let e = Cesium.Cartesian3.distance(r[0], r[1]); s = 1e3 <= e ? (e /= 1e3).toFixed(2) + "千米" : e.toFixed(2) + "米", l = Cesium.Cartesian3 .midpoint(r[0], r[1], new Cesium.Cartesian3); break; case "polygon": var u = []; l = new Cesium.Cartesian3, r.forEach(e => { l = Cesium.Cartesian3.add(e, l, new Cesium.Cartesian3); e = this.toDegrees(e); u.push([e.lon, e.lat]) }), l = Cesium.Cartesian3.divideByScalar(l, r.length, new Cesium.Cartesian3), s = this._core .getArea(u, r); break; case "rectangle": var c = this.toDegrees(r[0]), h = this.toDegrees(r[1]), h = Cesium.Cartesian3.distance(r[0], Cesium.Cartesian3.fromDegrees(c.lon, h.lat, c .height)) * Cesium.Cartesian3.distance(r[1], Cesium.Cartesian3.fromDegrees(c.lon, h.lat, c .height)); s = 1e6 <= h ? (h /= 1e6).toFixed(2) + "平方千米" : h.toFixed(2) + "平方米", l = Cesium.Cartesian3 .midpoint(r[0], r[1], new Cesium.Cartesian3); break; case "circle": l = r, s = 1e3 <= n ? "半径:" + (n /= 1e3).toFixed(2) + "千米" : "半径:" + n.toFixed(2) + "米"; break; case "box": let t = [], i = (n[0] < n[1] ? (t.push(n[1]), t.push(n[0])) : (t.push(n[0]), t.push(n[1])), t.push(n[ 2]), ["长:", "\n宽:", "\n高:"]); t.forEach((e, t) => { 1e3 <= e ? (e /= 1e3, s += i[t] + e.toFixed(2) + "千米") : s += i[t] + e.toFixed(2) + "米" }), l = r; break; case "cylinder": case "cone": l = r, s = 1e3 <= n ? "半径:" + (n /= 1e3).toFixed(2) + "千米\n" : "半径:" + n.toFixed(2) + "米\n", 1e3 <= a ? (a /= 1e3, s += "高度:" + a.toFixed(2) + "千米") : s += "高度:" + a.toFixed(2) + "米"; break; case "sphere": l = r, s = 1e3 <= n ? "半径:" + (n /= 1e3).toFixed(2) + "千米" : "半径:" + n.toFixed(2) + "米"; break; case "polyhedron": u = []; l = new Cesium.Cartesian3, r.forEach(e => { l = Cesium.Cartesian3.add(e, l, new Cesium.Cartesian3); e = this.toDegrees(e); u.push([e.lon, e.lat]) }), l = Cesium.Cartesian3.divideByScalar(l, r.length, new Cesium.Cartesian3), s = 1e3 <= a ? "高度:" + (a /= 1e3).toFixed(2) + "千米" : "高度:" + a.toFixed(2) + "米", s += "\n面积:" + this._core .getArea(u, r) } o = this._viewer.entities.add({ position: l, label: { text: s, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); this.SizeData.push(o.id) }, P.prototype.clearLastSizeData = function() { var e; this.SizeData.length && (e = this.SizeData.pop(), this._viewer.entities.removeById(e)) }, P.prototype.clearAllSizeData = function() { this.SizeData.forEach(e => { this._viewer.entities.removeById(e) }), this.SizeData = [] }, P.prototype.Cdcl = function(e, t, i, o) { let r = Math.PI; function n(e) { return e * r / 180 } var a = n((e + i) / 2), e = n((e - i) / 2), i = n((t - o) / 2), t = Math.sin(e), o = Math.sin(i), e = Math.sin(a), i = (t *= t) * (1 - (o *= o)) + (1 - (e *= e)) * o, a = (1 - t) * (1 - o) + e * o; return 2 * (o = Math.atan(Math.sqrt(i / a))) * 6378137 * (1 + 1 / 298.257 * ((3 * (o = Math.sqrt(i * a) / o) - 1) / 2 / a * e * (1 - t) - (3 * o + 1) / 2 / i * (1 - e) * t)) }, P.prototype.setEdit = function(e, t) { this.openEdit = e = void 0 === e ? !0 : e, t && (this.editOption = t), this.defaultEdit() }, P.prototype.openEditProp = function(e, i) { i = i || (this.editOption || { editPropData: {} }), void 0 === e.GeoType && (t = this.getEntityTypeAndObject(e), e.GeoType = t.type); var t = e.GeoType; SmartEarthPopupData.editGraphic && SmartEarthPopupData.editGraphic.entity || (this.getSimpleGraphicData( t, e), "point" === t || "billboard" === t || "label" === t || "model" === t ? (this .isEditting = !0, "model" === t && this._ModelEdit.start(e)) : (this.isEditting = !0, SmartEarthPopupData.editGraphic.updataEditPoint())), i.editPropData || (i.editPropData = {}), this._popupmessage.createPopupProp("属性编辑", { width: i.editPropData.width || 360, height: i.editPropData.height || "90%", url: "Workers/prop/jdtx_prop.html", shade: i.editPropData.shade, offset: i.editPropData.offset, type: t, fn: { success: (e, t) => { i.editPropData.success && i.editPropData.success(e, t), SmartEarthPopupData .layerIndex = t, SmartEarthPopupData.window = e.find("iframe")[0] .contentWindow }, end: () => { i.callBack && i.callBack.end && i.callBack.end(e), SmartEarthPopupData .layerIndex = void 0, SmartEarthPopupData.window = void 0, this .endThisEdit && this.endThisEdit() } } }) }, P.prototype.defaultEdit = function() { this.openEdit ? this.SimpleGraphicObj.length && !this.editHandler ? this.edit(this.openEdit, this .editOption) : !this.SimpleGraphicObj.length && this.editHandler && this.edit(!1) : this .editHandler && this.edit(!1) }, P.prototype.edit = function(e, r) { let c = this, h = this._viewer; var m, d, p, g; void 0 !== (r = r || (this.editOption || {})).editProp && (this.editProp = r.editProp), this .editHandler && (this.editHandler.destroy(), this.editHandler = void 0), void 0 === e && (e = !0), this.isEditting = !1; let a; this.endThisEdit = () => { c.defaultEvent(!0), V.editPointID.edit.forEach(e => { h.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { h.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { h.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { h.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && h.entities.remove(V.editPointID.move), V .editPointID.move = void 0, g = m = void 0, window.layuiLayer.close(SmartEarthPopupData .layerIndex), SmartEarthPopupData.editGraphic = {}, c.isEditting = !1, c.tooltip.show(! 1), c.delButton(!1), c._ModelEdit.end() }, this.endThisEdit(), e && (this.editHandler = new this._cesium.ScreenSpaceEventHandler(h.scene .canvas), this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView)) c.isEditting && (c.endThisEdit(), c .defaultEvent(!1)); else if (!V.editVector) { var i = t.position, o = h.scene.pick(i); if (c._cesium.defined(o) && o.id instanceof Cesium.Entity) { let e = o.id; c.isEditting || 0 != V.states ? e == m && ("point" === e.GeoType || "billboard" === e.GeoType || "label" === e.GeoType) || "height_point" == e.name || "edit_point" == e.name || "move_point" == e.name || "add_point" == e.name || "size_point" == e.name ? (h.container.style.cursor = "crosshair", c.defaultEvent(!1), "height_point" == e.name ? (p = { windowPosition: i, originHeight: c._cesium.Cartographic.fromCartesian(e.position .getValue()).height }, a = "height_point") : "move_point" == e.name ? a = "move_point" : "point" === e.GeoType || "billboard" === e.GeoType || "label" === e .GeoType ? (c.tooltip.showAt(t.position, "释放后完成修改"), a = "move_point") : "edit_point" == e.name ? a = "edit_point" : "add_point" == e.name ? a = "add_point" : "size_point" == e.name && (a = "size_point"), d = e) : m && e.id === m.id || c.endThisEdit() : -1 !== c.SimpleGraphicObj.indexOf(e .id) && (void 0 === (m = e).GeoType && (i = c.getEntityTypeAndObject(m), m.GeoType = i.type), g = m.GeoType, c.getSimpleGraphicData(g, m), "point" === g || "billboard" === g || "label" === g || "model" === g ? ( c.isEditting = !0, "model" === g ? c._ModelEdit.start(m) : c.tooltip .showAt(t.position, "拖拽修改位置")) : (c.isEditting = !0, SmartEarthPopupData.editGraphic.updataEditPoint()), this.editProp && c.openEditProp(m, r)) } else o && "modeEditAxis" === o.id || c.endThisEdit() } }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView)) c.isEditting && (c.endThisEdit(), c .defaultEvent(!1)); else if (!V.editVector) { var r = h.scene.pick(t.endPosition); if (c._cesium.defined(r)) if (c.isEditting && !d) { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth .enable || Cesium.ExpandBySmartEarth.isStreetView)) return void(c .isEditting && (c.endThisEdit(), c.defaultEvent(!1))); "point" !== g && "billboard" !== g && "label" !== g && "model" !== g || r .id != m ? r.id && "edit_point" === r.id.name && m.pottingPoint ? "polyline" === g && 2 < m.pottingPoint.length || "polygon" === g && 3 < m.pottingPoint.length ? c.tooltip.showAt(t.endPosition, "拖拽修改位置,右键删除点") : c.tooltip.showAt(t.endPosition, "拖拽修改位置") : !r.id || "move_point" !== r.id.name && "size_point" !== r.id.name ? r.id && "add_point" === r.id.name ? c.tooltip.showAt(t.endPosition, "拖拽增加节点") : r.id && "height_point" === r.id.name ? c.tooltip.showAt(t.endPosition, "拖拽修改高度") : r.id != m && "modeEditAxis" !== r.id || c.tooltip.show(! 1) : c.tooltip.showAt(t.endPosition, "拖拽修改位置") : c.tooltip.showAt(t .endPosition, "model" === g ? "右键删除" : "拖拽修改位置,右键删除") } else c.isEditting || 0 !== V.states || (r.id && -1 < c.SimpleGraphicObj .indexOf(r.id.id) ? c.tooltip.showAt(t.endPosition, "点击激活编辑,右键删除") : c .tooltip.show(!1)); else 0 != V.states || d || c.tooltip.show(!1); if (c.isEditting && d) { c.tooltip.showAt(t.endPosition, "释放后完成修改"); let i = c._getPosition.getMousePosition(t, [d, m]); if (i || "height_point" === a) if ("edit_point" === a) { d.position = i; r = V.editPointID.edit.indexOf(d.id); if (void 0 !== m[g].height ? (n = c.toDegrees(i), m.pottingPoint[r] = Cesium.Cartesian3.fromDegrees(n.lon, n.lat, m[g].height .getValue()), d.position = m.pottingPoint[r]) : m .pottingPoint[r] = i, 0 < V.editPointID.height.length) { let e = h.entities.getById(V.editPointID.height[r]); e && (n = c.toDegrees(i), u = c._cesium.Cartographic.fromCartesian(e .position.getValue()), e.position = c._cesium.Cartesian3 .fromDegrees(n.lon, n.lat, u.height)) } if (0 < V.editPointID.add.length) { if (0 < r) { let i = h.entities.getById(V.editPointID.add[r - 1]); if (i) { let e = h.entities.getById(V.editPointID.edit[r - 1]), t = h.entities.getById(V.editPointID.edit[r]); i.position = Cesium.Cartesian3.midpoint(e.position .getValue(), t.position.getValue(), new Cesium .Cartesian3) } } if (r < m.pottingPoint.length - 1) { let i = h.entities.getById(V.editPointID.add[r]); if (i) { let e = h.entities.getById(V.editPointID.edit[r]), t = h.entities.getById(V.editPointID.edit[r + 1]); i.position = Cesium.Cartesian3.midpoint(e.position .getValue(), t.position.getValue(), new Cesium .Cartesian3) } } if ("polygon" === g && (0 === r || r === m.pottingPoint.length - 1)) { let i = h.entities.getById(V.editPointID.add[V.editPointID.add .length - 1]); if (i) { let e = h.entities.getById(V.editPointID.edit[0]), t = h.entities.getById(V.editPointID.edit[m.pottingPoint .length - 1]); i.position = Cesium.Cartesian3.midpoint(e.position .getValue(), t.position.getValue(), new Cesium .Cartesian3) } } } let e = m.pottingPoint.concat([]), t = new c._cesium.Cartesian3; var n = e.length; e.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= n, t.y /= n, t.z /= n, V.editPointID.move && (V .editPointID.move.position = t), "polyline" !== g && "polygon" !== g && "rectangle" !== g || SmartEarthPopupData .editGraphic.setValue("positions", e) } else if ("height_point" === a) { var u = V.editPointID.height.indexOf(d.id); let e = h.entities.getById(V.editPointID.edit[u]), i = ("ellipse" !== g && "cylinder" !== g && "box" !== g || (e = V .editPointID.move), c.toDegrees(e.position.getValue())); r = p.originHeight - i.height, n = h.scene.cartesianToCanvasCoordinates(e .position.getValue()), u = (p.windowPosition.y - t.endPosition.y) * r / Math.abs(n.y - p.windowPosition.y); let o = Math.abs(r + u); V.editPointID.height.forEach(e => { let t = h.entities.getById(e); t && (e = t.position.getValue(), e = c.toDegrees(e), t .position = c._cesium.Cartesian3.fromDegrees(e.lon, e .lat, o + i.height)) }), m[g].extrudedHeight ? m[g].extrudedHeight = new c._cesium .CallbackProperty(function() { return o + i.height }, !1) : "box" === g ? SmartEarthPopupData.editGraphic.setValue( "height", o) : "cylinder" === g && SmartEarthPopupData.editGraphic .setValue("length", o), SmartEarthPopupData.window && ( SmartEarthPopupData.window.document.querySelector( '.ExtrudedPolygon input[name="extrudedHeight"]') && ( SmartEarthPopupData.window.document.querySelector( '.ExtrudedPolygon input[name="extrudedHeight"]').value = parseFloat(o).toFixed(2)), SmartEarthPopupData.window.document .querySelector('.box input[name="height"]') && (SmartEarthPopupData .window.document.querySelector('.box input[name="height"]') .value = parseFloat(o).toFixed(2)), SmartEarthPopupData.window .document.querySelector('.cylinder input[name="height"]') && ( SmartEarthPopupData.window.document.querySelector( '.cylinder input[name="height"]').value = parseFloat(o) .toFixed(2)), SmartEarthPopupData.window.document.querySelector( '.cone input[name="height"]') && (SmartEarthPopupData.window .document.querySelector('.cone input[name="height"]').value = parseFloat(o).toFixed(2))) } else if ("add_point" === a) { t = V.editPointID.add.indexOf(d.id), n = (h.entities.remove(d), h.entities .add({ name: "edit_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } })); if (V.editPointID.edit.splice(t + 1, 0, n.id), m.pottingPoint.splice(t + 1, 0, i.clone()), 0 < V.editPointID.height.length) { let e = c.toDegrees(i); e.height = m[g].extrudedHeight.getValue(); r = h.entities.add({ name: "height_point", position: c._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e .height), point: { color: c._cesium.Color.YELLOW, pixelSize: 12, outlineColor: c._cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.height.splice(t + 1, 0, r.id) } u = Cesium.Cartesian3.midpoint(m.pottingPoint[t], m.pottingPoint[t + 1], new Cesium.Cartesian3), r = h.entities.add({ name: "add_point", position: c.isClampToGround(m[g]) ? c.getClampToGroundPosition( u) : u, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), u = Cesium.Cartesian3.midpoint(m.pottingPoint[t + 1], m .pottingPoint[t + 2 === m.pottingPoint.length ? 0 : t + 2], new Cesium.Cartesian3), u = h.entities.add({ name: "add_point", position: c.isClampToGround(m[g]) ? c.getClampToGroundPosition( u) : u, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), t = (V.editPointID.add.splice(t, 1, r.id, u.id), d = n, a = "edit_point", m.pottingPoint.concat([])); "polyline" !== g && "polygon" !== g || SmartEarthPopupData.editGraphic .setValue("positions", t) } else if ("size_point" === a) { r = V.editPointID.move.position.getValue(), u = c._cesium.Cartesian3 .distance(r, i); "ellipse" === g || "cylinder" === g || "ellipsoid" === g && m.isSphere ? ( SmartEarthPopupData.editGraphic.setValue("radius", u), SmartEarthPopupData.window && SmartEarthPopupData.window.document .querySelector("." + g + ' input[name="radius"]') && ( SmartEarthPopupData.window.document.querySelector("." + g + ' input[name="radius"]').value = parseFloat(u).toFixed(2)) ) : "box" === g && (n = 90 === d.angle ? "long" : "width", SmartEarthPopupData.editGraphic.setValue(n, 2 * u), SmartEarthPopupData.window && SmartEarthPopupData.window.document .querySelector('.box input[name="' + n + '"]') && ( SmartEarthPopupData.window.document.querySelector( '.box input[name="' + n + '"]').value = parseFloat(2 * u) .toFixed(2))) } else if ("model" !== g) { if ("point" === g || "billboard" === g || "label" === g) return d.position = i, void(SmartEarthPopupData.window && SmartEarthPopupData.window .document.querySelector("." + g + ' input[name="height"]') && ( SmartEarthPopupData.window.document.querySelector("." + g + ' input[name="height"]').value = SmartEarthPopupData .editGraphic.getValue("pHeight").toFixed(2))); t = c.toDegrees(i), r = (p = d.position.getValue(), c.toDegrees(p)); let a = t.lon - r.lon, s = t.lat - r.lat, l = t.height - r.height; d.position = i, m[g].height && (n = c.toDegrees(i).height, m[g].height = n, m.thisHeight = n), m.pottingPoint.forEach((e, t) => { let i, o, r, n = h.entities.getById(V.editPointID.edit[t]); if (n = n || h.entities.getById(V.editPointID.size[t]), i = n ? c.toDegrees(n.position.getValue()) : c.toDegrees(e), r = c ._cesium.Cartesian3.fromDegrees(i.lon + a, i.lat + s, i .height + l), e.x = r.x, e.y = r.y, e.z = r.z, n && (n .position = r), 0 < V.editPointID.height.length) { let e = h.entities.getById(V.editPointID.height[t]); e && (i = e.position.getValue(), o = c._cesium.Cartographic .fromCartesian(i), i = { lon: c._cesium.Math.toDegrees(o.longitude), lat: c._cesium.Math.toDegrees(o.latitude), height: o.height }, e.position = c._cesium.Cartesian3.fromDegrees(i .lon + a, i.lat + s, i.height + l)) } if (0 < V.editPointID.add.length && V.editPointID.add[t]) { let e = h.entities.getById(V.editPointID.add[t]); e && (i = c.toDegrees(e.position.getValue()), e.position = c ._cesium.Cartesian3.fromDegrees(i.lon + a, i.lat + s, i.height + l)) } }); var u = m.pottingPoint.concat([]); "polyline" === g || "polygon" === g || "rectangle" === g ? ( SmartEarthPopupData.editGraphic.setValue("positions", u), 0 < V .editPointID.height.length && (SmartEarthPopupData.editGraphic .setValue("extrudedHeight", SmartEarthPopupData.editGraphic .getValue("extrudedHeight") + l), SmartEarthPopupData .window && m[g].height && SmartEarthPopupData.window.document .querySelector('.ExtrudedPolygon input[name="height"]') && ( SmartEarthPopupData.window.document.querySelector( '.ExtrudedPolygon input[name="height"]').value = parseFloat(m[g].height.getValue()).toFixed(2))), SmartEarthPopupData.window && m[g].height && SmartEarthPopupData .window.document.querySelector('.rectangle input[name="height"]') && (SmartEarthPopupData.window.document.querySelector( '.rectangle input[name="height"]').value = parseFloat(m[g] .height.getValue()).toFixed(2))) : "ellipse" === g ? (m .pottingPoint[1] = i, m.position = i.clone(), SmartEarthPopupData .window && m[g].height && SmartEarthPopupData.window.document .querySelector('.ellipse input[name="height"]') && ( SmartEarthPopupData.window.document.querySelector( '.ellipse input[name="height"]').value = parseFloat(m[g] .height.getValue()).toFixed(2))) : "box" === g ? (m .pottingPoint[2] = i, t = m.box.dimensions.getValue(), r = c .toDegrees(i), m.position = Cesium.Cartesian3.fromDegrees(r.lon, r .lat, r.height + t.z / 2)) : "cylinder" === g ? (m.pottingPoint[ 1] = i, n = m.cylinder.length.getValue(), u = c.toDegrees(m .pottingPoint[1]), m.position = Cesium.Cartesian3.fromDegrees(u .lon, u.lat, u.height + n / 2)) : "ellipsoid" === g && (m .pottingPoint[m.pottingPoint.length - 1] = i, m.position = i.clone() ) } } } }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.editHandler.setInputAction(e => { Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView) ? c.isEditting && (c.endThisEdit(), c .defaultEvent(!1)) : V.editVector || (d && r.callBack && r.callBack.update && r .callBack.update(d.name, m), h.container.style.cursor = "default", d = void 0, c .defaultEvent(!0)) }, this._cesium.ScreenSpaceEventType.LEFT_UP), this.editHandler.setInputAction(e => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium .ExpandBySmartEarth.isStreetView)) c.isEditting && (c.endThisEdit(), c .defaultEvent(!1)); else if (!V.editVector) { var o = h.scene.pick(e.position); if (c._cesium.defined(o) && 0 == V.states) { let i = o.id; if (-1 < c.SimpleGraphicObj.indexOf(i.id)) c.tooltip.show(!1), c.delButton(!0, e .position, function() { i.treeobj && V.delete(i.treeobj.id, h, c._cesium), h.entities .removeById(i.id); var e = c.SimpleGraphicObj.indexOf(i.id); c.SimpleGraphicObj.splice(e, 1), c.delButton(!1), c.tooltip.show(! 1), c.endThisEdit(), c.defaultEdit(), r.callBack && r.callBack .delete && r.callBack.delete(i) }); else if (-1 < V.editPointID.edit.indexOf(i.id) && ("polyline" === g && 2 < V .editPointID.edit.length || "polygon" === g && 3 < V.editPointID.edit .length)) { o = V.editPointID.edit.indexOf(i.id); if (h.entities.removeById(i.id), V.editPointID.edit.splice(o, 1), 0 < V .editPointID.height.length && (h.entities.removeById(V.editPointID .height[o]), V.editPointID.height.splice(o, 1)), m.pottingPoint .splice(o, 1), 0 < V.editPointID.add.length) if (V.editPointID.add[o]) { if (h.entities.removeById(V.editPointID.add[o]), V.editPointID.add .splice(o, 1), 0 <= o - 1) { let e = h.entities.getById(V.editPointID.add[o - 1]); e && (e.position = Cesium.Cartesian3.midpoint(m.pottingPoint[o - 1], m.pottingPoint[o === m.pottingPoint.length ? 0 : o], new Cesium.Cartesian3)) } else if (o - 1 == -1 && "polygon" === g) { let e = h.entities.getById(V.editPointID.add[V.editPointID.add .length - 1]); e && (e.position = Cesium.Cartesian3.midpoint(m.pottingPoint[0], m.pottingPoint[m.pottingPoint.length - 1], new Cesium.Cartesian3)) } } else h.entities.removeById(V.editPointID.add[o - 1]), V.editPointID .add.pop(); let t = new c._cesium.Cartesian3; e = m.pottingPoint.length, o = (m.pottingPoint.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= e, t.y /= e, t.z /= e, V.editPointID.move && (V .editPointID.move.position = t), m.pottingPoint.concat([])); "polyline" !== g && "polygon" !== g || SmartEarthPopupData.editGraphic .setValue("positions", o), c.tooltip.show(!1), r.callBack && r.callBack .update && r.callBack.update(d && d.name, m) } } } }, this._cesium.ScreenSpaceEventType.RIGHT_DOWN)) }, P.prototype.delButton = function(e, t, i) { if (e) { let e = document.getElementById("DeleteMilitaryStandardDelete"); e || ((e = document.createElement("button")).id = "DeleteMilitaryStandardDelete", e.innerText = "删除对象", e.style.cssText = `height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`, this._viewer.container.appendChild(e)), e.style.display = "block", e.style.top = t.y + "px", e.style.left = t.x + "px", e.onclick = i } else { let e = document.getElementById("DeleteMilitaryStandardDelete"); e && (e.style.display = "none", e.onclick = null) } }, P.prototype.defaultEvent = function(e) { let t = this._viewer.scene; t.screenSpaceCameraController.enableRotate = e, t.screenSpaceCameraController.enableTranslate = e, t .screenSpaceCameraController.enableZoom = e, t.screenSpaceCameraController.enableTilt = e, t .screenSpaceCameraController.enableLook = e }, P.prototype.GetDegreesFromA_D = function(e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = 6356725 + 21412 * (90 - t) / 90; return [180 * (r / (o * Math.cos(t * Math.PI / 180)) + e * Math.PI / 180) / Math.PI, 180 * (i / o + t * Math.PI / 180) / Math.PI] }, P.prototype.isClampToGround = function(e) { return e.heightReference && 1 === e.heightReference.getValue() }, P.prototype.getClampToGroundPosition = function(e, t) { let i = Cesium.Cartographic.fromCartesian(e); e = this._viewer.scene.sampleHeight(i, t); return i.height = e, Cesium.Cartographic.toCartesian(i) }, P.prototype.GetPositionFromA_D = function(e, t, i) { e = this.toDegrees(e), t = this.GetDegreesFromA_D(e.lon, e.lat, t, i); return this._cesium.Cartesian3.fromDegrees(t[0], t[1], e.height) }, P.prototype.getEntityTypeAndObject = function(e) { let t = { type: "", object: null }; return e && (e.billboard ? (t.type = "billboard", t.object = e.billboard) : e.box ? (t.type = "box", t .object = e.box) : e.corridor ? (t.type = "corridor", t.object = e.corridor) : e.cylinder ? (t.type = "cylinder", t.object = e.cylinder) : e.ellipse ? (t.type = "ellipse", t.object = e .ellipse) : e.ellipsoid ? (t.type = "ellipsoid", t.object = e.ellipsoid) : e.label ? (t .type = "label", t.object = e.label) : e.model ? (t.type = "model", t.object = e.model) : e .path ? (t.type = "path", t.object = e.path) : e.plane ? (t.type = "plane", t.object = e .plane) : e.point ? (t.type = "point", t.object = e.point) : e.polygon ? (t.type = "polygon", t .object = e.polygon) : e.polyline ? (t.type = "polyline", t.object = e.polyline) : e .polylineVolume ? (t.type = "polylineVolume", t.object = e.polylineVolume) : e.rectangle ? (t .type = "rectangle", t.object = e.rectangle) : e.wall && (t.type = "wall", t.object = e .wall)), t }, P.prototype.getSimpleGraphicData = function(r, n) { let a = this, s = this._viewer; var e, t; function i(e) { SmartEarthPopupData.editGraphic.fillColor = l("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")"), SmartEarthPopupData.editGraphic.alpha = 100 * e.alpha } function o(e) { SmartEarthPopupData.editGraphic.outlineColor = l("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")"), SmartEarthPopupData.editGraphic.outlineAlpha = 100 * e.alpha } function l(e) { let t = e; if (/^(rgb|RGB)/.test(t)) { let e = t.replace(/(rgb|RGB)*/g, ""); var o = (e = e.replace("(", "").replace(")", "")).split(","); let i = "#"; for (let t = 0; t < o.length; t++) { let e = Number(o[t]).toString(16); "0" === (e = 1 === e.length ? "0" + e : e) && (e += e), i += e } return i = 7 !== i.length ? t : i } if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) return t; var i = t.replace(/#/, "").split(""); if (6 === i.length) return t; if (3 === i.length) { let t = "#"; for (let e = 0; e < i.length; e += 1) t += i[e] + i[e]; return t } } SmartEarthPopupData.editGraphic = { entity: n, type: r, graphic: n[r], getValue: function(e) { return "position" === e || "name" === e || "id" === e || "orientation" === e || "heading" === e || "pitch" === e || "roll" === e ? this.entity[e] && (this.entity[e] .getValue ? this.entity[e].getValue() : this.entity[e]) : "radius" === e ? "ellipse" === this.type ? this.graphic.semiMajorAxis.getValue() : "ellipsoid" === this.type ? this.graphic.radii.getValue().x : "cylinder" === this.type ? this .graphic.bottomRadius.getValue() : void 0 : "pHeight" !== e ? "repeat" === e ? this .graphic.material[e] && (this.graphic.material[e].getValue ? this.graphic.material[ e].getValue() : this.graphic.material[e]) : this.graphic[e] && (this.graphic[e] .getValue ? this.graphic[e].getValue() : this.graphic[e]) : this.getValue( "position") ? (e = this.getValue("position"), Cesium.Cartographic.fromCartesian( e).height) : void 0 }, changeHeightPoint: function(i) { 0 < V.editPointID.height.length && V.editPointID.height.forEach(e => { let t = s.entities.getById(e); t && (e = t.position.getValue(), e = a.toDegrees(e), t.position = Cesium .Cartesian3.fromDegrees(e.lon, e.lat, i)) }) }, changeEditPoint: function(i) { 0 < V.editPointID.edit.length && V.editPointID.edit.forEach(e => { let t = s.entities.getById(e); t && ("clampToGround" === i ? t.point.heightReference = 1 : (t.point .heightReference = 0, e = t.position.getValue(), e = a .toDegrees(e), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, i))) }), 0 < V.editPointID.size.length && V.editPointID.size.forEach(e => { let t = s.entities.getById(e); t && ("clampToGround" === i ? t.point.heightReference = 1 : (t.point .heightReference = 0, e = t.position.getValue(), e = a .toDegrees(e), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, i))) }), 0 < V.editPointID.add.length && V.editPointID.add.forEach(e => { let t = s.entities.getById(e); t && ("clampToGround" === i ? t.point.heightReference = 1 : (t.point .heightReference = 0, e = t.position.getValue(), e = a .toDegrees(e), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, i))) }); let e = V.editPointID.move; var t; e && ("clampToGround" === i ? e.point.heightReference = 1 : (e.point.heightReference = 0, t = e.position.getValue(), t = a.toDegrees(t), e.position = Cesium .Cartesian3.fromDegrees(t.lon, t.lat, i))) }, clearAllEditPoint: function() { V.editPointID.edit.forEach(e => { s.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { s.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { s.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { s.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && s.entities.remove(V.editPointID .move), V.editPointID.move = void 0 } }, "billboard" === r || "point" === r || "label" === r || "model" === r ? ((t = SmartEarthPopupData .editGraphic.getValue("color") || SmartEarthPopupData.editGraphic.getValue("fillColor")) ? i(t) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData.editGraphic .alpha = 60), (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? o(t) : ( SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic .outlineAlpha = 60), "label" === r && ((t = SmartEarthPopupData.editGraphic.getValue( "backgroundColor")) ? (t = t, SmartEarthPopupData.editGraphic.backgroundColor = l( "rgb(" + 255 * t.red + "," + 255 * t.green + "," + 255 * t.blue + ")"), SmartEarthPopupData.editGraphic.backgroundAlpha = 100 * t.alpha) : (SmartEarthPopupData .editGraphic.backgroundColor = "#000000", SmartEarthPopupData.editGraphic .backgroundAlpha = 80)), SmartEarthPopupData.editGraphic.setValue = function(e, t) { var i; if ("position" === e && this.entity.offset ? (this.entity.oP = t, o = Cesium.Transforms .eastNorthUpToFixedFrame(this.entity.oP), i = new Cesium.Cartesian3(0, 0, 0), Cesium .Matrix4.multiplyByPoint(o, this.entity.offset, i), t = i) : "offset" === e && (this .entity.oP || (this.entity.oP = this.getValue("position")), this.entity.offset = t, o = Cesium.Transforms.eastNorthUpToFixedFrame(this.entity.oP), i = new Cesium .Cartesian3(0, 0, 0), Cesium.Matrix4.multiplyByPoint(o, this.entity.offset, i), t = i, e = "position"), "position" === e || "name" === e) this.entity[e] = t; else if ("autoRotate" === e && "model" === this.type) void 0 === this.entity.heading && ( this.entity.heading = 0, this.entity.pitch = 0, this.entity.roll = 0), "number" == typeof t ? (this.entity.orientation = new Cesium.CallbackProperty(() => (this.entity .heading += t, 360 < this.entity.heading && (this.entity.heading -= 360), SmartEarthPopupData.window && SmartEarthPopupData.window.document .querySelector('.model input[name="heading"]') && (SmartEarthPopupData .window.document.querySelector('.model input[name="heading"]').value = this.entity.heading), Cesium.Transforms.headingPitchRollQuaternion(this .getValue("position"), new Cesium.HeadingPitchRoll(Cesium.Math .toRadians(this.entity.heading), Cesium.Math.toRadians(this.entity .pitch), Cesium.Math.toRadians(this.entity.roll)))), !1), SmartEarthPopupData.window && (SmartEarthPopupData.window.document.querySelector( '.model input[name="heading"]') && (SmartEarthPopupData.window.document .querySelector('.model input[name="heading"]').disabled = !0), SmartEarthPopupData.window.document.querySelector( '.model input[name="pitch"]') && (SmartEarthPopupData.window.document .querySelector('.model input[name="pitch"]').disabled = !0), SmartEarthPopupData.window.document.querySelector( '.model input[name="roll"]') && (SmartEarthPopupData.window.document .querySelector('.model input[name="roll"]').disabled = !0))) : !1 === t && ( this.entity.orientation = Cesium.Transforms.headingPitchRollQuaternion(this .getValue("position"), new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this .entity.heading), Cesium.Math.toRadians(this.entity.pitch), Cesium.Math .toRadians(this.entity.roll))), SmartEarthPopupData.window && ( SmartEarthPopupData.window.document.querySelector( '.model input[name="heading"]') && (SmartEarthPopupData.window.document .querySelector('.model input[name="heading"]').disabled = !1), SmartEarthPopupData.window.document.querySelector( '.model input[name="pitch"]') && (SmartEarthPopupData.window.document .querySelector('.model input[name="pitch"]').disabled = !1), SmartEarthPopupData.window.document.querySelector( '.model input[name="roll"]') && (SmartEarthPopupData.window.document .querySelector('.model input[name="roll"]').disabled = !1))); else if ("heading" !== e && "pitch" !== e && "roll" !== e || "model" !== this.type) { if ("color" === e || "outlineColor" === e || "backgroundColor" === e || "fillColor" === e) t = Cesium.Color.fromCssColorString(t); else if ("fontSize" === e) { let e = this.getValue("font"); (e = e.split(" "))[0] = t, t = e.join(" ") } else { if ("alpha" === e) return void("label" === this.type ? this.graphic.fillColor._value .alpha = t : this.graphic.color._value.alpha = t); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = t); if ("backgroundAlpha" === e) return void(this.graphic.backgroundColor._value.alpha = t); if ("pHeight" === e && this.getValue("position")) { var o = this.getValue("position"); let e = Cesium.Cartographic.fromCartesian(o); return e.height = t, void(this.entity.position = Cesium.Cartographic .toCartesian(e)) } } this.graphic[e] = t } else this.entity[e] = t, this.entity.orientation = Cesium.Transforms .headingPitchRollQuaternion(this.getValue("position"), new Cesium.HeadingPitchRoll( Cesium.Math.toRadians(this.entity.heading), Cesium.Math.toRadians(this.entity .pitch), Cesium.Math.toRadians(this.entity.roll))) }) : "polyline" === r ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color ? i(t .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), t.outlineColor ? o(t.outlineColor) : (SmartEarthPopupData .editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(e, t) { if ("name" === e) this.entity[e] = t; else { if ("color" === e || "outlineColor" === e) return t = Cesium.Color.fromCssColorString( t), void(this.graphic.material[e] = t); "outlineWidth" === e ? this.graphic.material[e] = t : "alpha" === e ? this.graphic .material.color._value.alpha = t : "outlineAlpha" === e ? this.graphic.material .outlineColor._value.alpha = t : this.graphic[e] = "positions" === e ? new Cesium .CallbackProperty(function() { return t }, !1) : t } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e = this.getValue("positions"); return this.entity.pottingPoint = e }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); let t = this.getPottingPoint(); if (t) { let e = new Cesium.Cartesian3; t.forEach((t, i) => { let o = s.entities.add({ name: "edit_point", position: a.isClampToGround(this.graphic) ? a .getClampToGroundPosition(t) : t, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); if (V.editPointID.edit.push(o.id), void 0 !== this.getValue( "extrudedHeight")) { var r = Cesium.Cartographic.fromCartesian(t), r = { lon: Cesium.Math.toDegrees(r.longitude), lat: Cesium.Math.toDegrees(r.latitude), height: this.getValue("extrudedHeight") }; if (this.getValue("height")) { let e = Cesium.Cartesian3.fromDegrees(r.lon, r.lat, this.getValue( "height")); t.x = e.x, t.y = e.y, t.z = e.z, o.position = e, this.entity .pottingPoint[i] = e.clone() } i = s.entities.add({ name: "height_point", position: Cesium.Cartesian3.fromDegrees(r.lon, r.lat, r .height), point: { color: Cesium.Color.YELLOW, pixelSize: 12, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.height.push(i.id) } e.x += t.x, e.y += t.y, e.z += t.z }), e.x /= t.length, e.y /= t.length, e.z /= t.length, V.editPointID.move = s .entities.add({ name: "move_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition(e) : e, point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); for (let e = 0; e < t.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "add_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition( i) : i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.add.push(i.id) } } }) : "polygon" === r ? ((e = SmartEarthPopupData.editGraphic.getValue("material")).color ? i(e .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), (e = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? o(e) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData .editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(e, t) { if ("name" === e) this.entity[e] = t; else { if ("color" === e || "outlineColor" === e) { if (t = Cesium.Color.fromCssColorString(t), "color" === e) return void(this.graphic .material.color = t) } else { if ("image" === e || "repeat" === e) return void(this.graphic.material[e] = t); if ("alpha" === e) return void(this.graphic.material.color._value.alpha = t); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = t); if ("positions" === e) return void(this.graphic.hierarchy = new Cesium .CallbackProperty(function() { return new Cesium.PolygonHierarchy(t) }, !1)); if ("hierarchy" === e) return void(this.graphic.hierarchy = new Cesium .CallbackProperty(function() { return t }, !1)); function i(e, t, i) { i ? (e.perPositionHeight = !1, e.heightReference = Cesium.HeightReference .CLAMP_TO_GROUND) : (e.perPositionHeight = !0, e.heightReference = Cesium.HeightReference.NONE), 0 < V.editPointID.edit.length && !i && t .forEach((e, t) => { let i = s.entities.getById(V.editPointID.edit[t]); i && (t = i.position.getValue(), e.x = t.x, e.y = t.y, e.z = t.z) }), e.hierarchy = new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(t) }, !1) } if ("clampToGround" === e) return void(this.graphic.hierarchy instanceof Cesium .CallbackProperty ? (this.graphic.hierarchy = this.graphic.hierarchy .getValue(), setTimeout(() => { i(this.graphic, this.entity.pottingPoint, t) }, 100)) : i(this.graphic, this.entity.pottingPoint, t)); "extrudedHeight" === e ? this.changeHeightPoint(t) : "height" === e && this .changeEditPoint(t) } this.graphic[e] = t } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { let e = this.getValue("hierarchy"), t = e.positions.concat([]); if (void 0 !== this.getValue("height")) { let i = this.getValue("height"); t.forEach(e => { var t = a.toDegrees(e), t = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, i); e.x = t.x, e.y = t.y, e.z = t.z }) } return this.entity.pottingPoint = t }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); let t = this.getPottingPoint(); if (t) { let e = new Cesium.Cartesian3; t.forEach((t, i) => { let o = s.entities.add({ name: "edit_point", position: a.isClampToGround(this.graphic) ? a .getClampToGroundPosition(t) : t, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); if (V.editPointID.edit.push(o.id), void 0 !== this.getValue( "extrudedHeight")) { var r = Cesium.Cartographic.fromCartesian(t), r = { lon: Cesium.Math.toDegrees(r.longitude), lat: Cesium.Math.toDegrees(r.latitude), height: this.getValue("extrudedHeight") }; if (this.getValue("height")) { let e = Cesium.Cartesian3.fromDegrees(r.lon, r.lat, this.getValue( "height")); t.x = e.x, t.y = e.y, t.z = e.z, o.position = e, this.entity .pottingPoint[i] = e.clone() } i = s.entities.add({ name: "height_point", position: Cesium.Cartesian3.fromDegrees(r.lon, r.lat, r .height), point: { color: Cesium.Color.YELLOW, pixelSize: 12, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.height.push(i.id) } e.x += t.x, e.y += t.y, e.z += t.z }), e.x /= t.length, e.y /= t.length, e.z /= t.length, V.editPointID.move = s .entities.add({ name: "move_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition(e) : e, point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); for (let e = 0; e < t.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "add_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition( i) : i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.add.push(i.id) } var o = Cesium.Cartesian3.midpoint(t[0], t[t.length - 1], new Cesium.Cartesian3), o = s.entities.add({ name: "add_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition(o) : o, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.add.push(o.id) } }) : "ellipse" === r || "cylinder" === r || n.isSphere ? ((e = SmartEarthPopupData.editGraphic .getValue("material")).color ? i(e.color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData.editGraphic.alpha = 60), (e = SmartEarthPopupData.editGraphic .getValue("outlineColor")) ? o(e) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic.outlineAlpha = 60), SmartEarthPopupData .editGraphic.setValue = function(e, i) { if ("name" === e) this.entity[e] = i; else { if ("color" === e || "outlineColor" === e) { if (i = Cesium.Color.fromCssColorString(i), "color" === e) return void(this.graphic .material.color = i) } else { if ("image" === e || "repeat" === e) return void(this.graphic.material[e] = i); if ("alpha" === e) return void(this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = i); if ("semiMajorAxis" === e) return void(this.graphic.semiMajorAxis = new Cesium .CallbackProperty(function() { return i }, !1)); if ("semiMinorAxis" === e) return void(this.graphic.semiMinorAxis = new Cesium .CallbackProperty(function() { return i }, !1)); if ("radii" === e) return void(this.graphic.radii = new Cesium.CallbackProperty( function() { return i }, !1)); if ("topRadius" === e) return void(this.graphic.topRadius = new Cesium .CallbackProperty(function() { return i }, !1)); if ("bottomRadius" === e) return void(this.graphic.bottomRadius = new Cesium .CallbackProperty(function() { return i }, !1)); if ("radius" === e) { "ellipse" === this.type ? (this.graphic.semiMajorAxis = new Cesium .CallbackProperty(function() { return i }, !1), this.graphic.semiMinorAxis = new Cesium.CallbackProperty( function() { return i }, !1)) : "ellipsoid" === this.type ? null !== this.graphic.material .image.getValue() ? this.graphic.radii = new Cesium.Cartesian3(i, i, i) : this.graphic.radii = new Cesium.CallbackProperty(function() { return new Cesium.Cartesian3(i, i, i) }, !1) : "cylinder" === this.type && (this.graphic.bottomRadius = new Cesium .CallbackProperty(function() { return i }, !1), this.entity.changeTop && (this.graphic.topRadius = new Cesium .CallbackProperty(function() { return i }, !1))); var o = V.editPointID.move.position.getValue(), r = a.GetPositionFromA_D(o, i, 90); let e = s.entities.getById(V.editPointID.size[0]), t = (e.position = r, n.pottingPoint[0] = r, n.pottingPoint[n.pottingPoint .length - 1] = o, s.entities.getById(V.editPointID.height[0])); return void(t && (o = a.toDegrees(r), r = a._cesium.Cartographic.fromCartesian(t .position.getValue()), t.position = a._cesium.Cartesian3 .fromDegrees(o.lon, o.lat, r.height))) } if ("cylinder" === this.type && "length" === e) return this.graphic.length = i, o = a.toDegrees(this.entity.pottingPoint[1]), this.entity.position = Cesium .Cartesian3.fromDegrees(o.lon, o.lat, o.height + i / 2), void this .changeHeightPoint(o.height + i); function t(e, t, i) { i ? (void 0 === e.thisHeight && (e.thisHeight = t.height && t.height .getValue()), t.height = void 0, t.heightReference = Cesium.HeightReference .CLAMP_TO_GROUND) : (t.height = e.thisHeight, t.heightReference = Cesium .HeightReference.NONE); let o = t.semiMinorAxis.getValue(); t.semiMinorAxis = new Cesium.CallbackProperty(function() { return o }, !1), t.semiMajorAxis = new Cesium.CallbackProperty(function() { return o }, !1) } if ("ellipse" === this.type && "clampToGround" === e) return this.graphic .semiMinorAxis instanceof Cesium.CallbackProperty ? (this.graphic .semiMinorAxis = this.graphic.semiMinorAxis.getValue(), this.graphic .semiMajorAxis = this.graphic.semiMajorAxis.getValue(), setTimeout( () => { t(this.entity, this.graphic, i) }, 100)) : t(this.entity, this.graphic, i), void(i ? this .changeEditPoint("clampToGround") : this.changeEditPoint(this.entity .thisHeight)); "ellipse" === this.type && "extrudedHeight" === e ? this.changeHeightPoint(i) : "ellipse" === this.type && "height" === e && (this.changeEditPoint(i), this .entity.thisHeight = i) } this.graphic[e] = i } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e, t, i = this.getValue("radius"); let o = this.getValue("position"); return "ellipse" === this.type || this.entity.isSphere ? ("ellipse" === this.type && void 0 !== this.getValue("height") && (e = this.getValue("height"), t = a.toDegrees( o), o = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, e)), t = a .GetPositionFromA_D(o, i, 90), this.entity.pottingPoint = [t, o], [t, o]) : (e = a .toDegrees(o), o = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height - this .getValue("length") / 2), t = a.GetPositionFromA_D(o, i, 90), this.entity .pottingPoint = [t, o], [t, o]) }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); var t, i = this.getPottingPoint(); if (i) { let e = s.entities.add({ name: "size_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition(i[ 0]) : i[0], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); if (e.angle = 90, V.editPointID.size.push(e.id), void 0 !== this.getValue( "extrudedHeight")) { let e = a.toDegrees(i[1]); e.height = this.getValue("extrudedHeight"); var o = s.entities.add({ name: "height_point", position: Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), point: { color: Cesium.Color.YELLOW, pixelSize: 12, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.height.push(o.id) } else "cylinder" === r && (o = a.toDegrees(i[1]), t = this.getValue("length"), o = s .entities.add({ name: "height_point", position: Cesium.Cartesian3.fromDegrees(o.lon, o.lat, o.height + t), point: { color: Cesium.Color.YELLOW, pixelSize: 12, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), V.editPointID.height.push(void 0, o.id)); V.editPointID.move = s.entities.add({ name: "move_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition(i[ 1]) : i[1], point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }) } }) : "rectangle" === r ? ((e = SmartEarthPopupData.editGraphic.getValue("material")).color ? i(e .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), (e = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? o(e) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData .editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(e, t) { if ("name" === e) this.entity[e] = t; else { if ("color" === e || "outlineColor" === e) { if (t = Cesium.Color.fromCssColorString(t), "color" === e) return void(this.graphic .material.color = t) } else { if ("image" === e || "repeat" === e) return void(this.graphic.material[e] = t); if ("alpha" === e) return void(this.graphic.material.color._value.alpha = t); if ("outlineAlpha" === e) return void(this.graphic.outlineColor._value.alpha = t); if ("positions" === e) return void(this.graphic.coordinates = new Cesium .CallbackProperty(function() { return Cesium.Rectangle.fromCartesianArray(t) }, !1)); if ("coordinates" === e) return void(this.graphic.coordinates = new Cesium .CallbackProperty(function() { return t }, !1)); function i(e, t, i) { i ? (void 0 === e.thisHeight && (e.thisHeight = t.height && t.height .getValue()), t.height = void 0, t.heightReference = Cesium.HeightReference .CLAMP_TO_GROUND) : (t.height = e.thisHeight, t.heightReference = Cesium .HeightReference.NONE); let o = t.coordinates.getValue(); t.coordinates = new Cesium.CallbackProperty(function() { return o }, !1) } if ("clampToGround" === e) return this.graphic.coordinates instanceof Cesium .CallbackProperty ? (this.graphic.coordinates = this.graphic.coordinates .getValue(), setTimeout(() => { i(this.entity, this.graphic, t) }, 100)) : i(this.entity, this.graphic, t), void(t ? this .changeEditPoint("clampToGround") : this.changeEditPoint(this.entity .thisHeight)); "extrudedHeight" === e ? this.changeHeightPoint(t) : "height" === e && (this .changeEditPoint(t), this.entity.thisHeight = t) } this.graphic[e] = t } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e = this.getValue("coordinates"); let t, i, o = this.getValue("height"); return i = (void 0 !== o ? t = Cesium.Cartesian3.fromRadians(e.west, e.north, o) : (o = s .scene.sampleHeight(new Cesium.Cartographic(e.west, e.north, 0), [this.entity]), t = Cesium.Cartesian3.fromRadians(e.west, e.north, o), o = s.scene.sampleHeight( new Cesium.Cartographic(e.east, e.south, 0), [this.entity])), Cesium .Cartesian3.fromRadians(e.east, e.south, o)), this.entity.pottingPoint = [t, i], [t, i ] }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); let t = this.getPottingPoint(); if (t) { let e = new Cesium.Cartesian3; t.forEach((t, i) => { let o = s.entities.add({ name: "edit_point", position: a.isClampToGround(this.graphic) ? a .getClampToGroundPosition(t) : t, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); if (V.editPointID.edit.push(o.id), void 0 !== this.getValue( "extrudedHeight")) { var r = Cesium.Cartographic.fromCartesian(t), r = { lon: Cesium.Math.toDegrees(r.longitude), lat: Cesium.Math.toDegrees(r.latitude), height: this.getValue("extrudedHeight") }; if (this.getValue("height")) { let e = Cesium.Cartesian3.fromDegrees(r.lon, r.lat, this.getValue( "height")); t.x = e.x, t.y = e.y, t.z = e.z, o.position = e, this.entity .pottingPoint[i] = e.clone() } i = s.entities.add({ name: "height_point", position: Cesium.Cartesian3.fromDegrees(r.lon, r.lat, r .height), point: { color: Cesium.Color.YELLOW, pixelSize: 12, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.height.push(i.id) } e.x += t.x, e.y += t.y, e.z += t.z }), e.x /= t.length, e.y /= t.length, e.z /= t.length, V.editPointID.move = s .entities.add({ name: "move_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition(e) : e, point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }) } }) : "box" === r ? ((e = SmartEarthPopupData.editGraphic.getValue("material")).color ? i(e .color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData .editGraphic.alpha = 60), (e = SmartEarthPopupData.editGraphic.getValue("outlineColor")) ? o(e) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData .editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function(t, i) { if ("name" === t) this.entity[t] = i; else { if ("color" === t || "outlineColor" === t) { if (i = Cesium.Color.fromCssColorString(i), "color" === t) return void(this.graphic .material.color = i) } else { if ("image" === t || "repeat" === t) return void(this.graphic.material[t] = i); if ("alpha" === t) return void(this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === t) return void(this.graphic.outlineColor._value.alpha = i); if ("long" === t || "width" === t || "height" === t) { let e = this.getValue("dimensions"); if ("long" === t ? e.x = i : "width" === t ? e.y = i : e.z = i, this.graphic .dimensions = new Cesium.CallbackProperty(function() { return e }, !1), "long" === t || "width" === t) { var o = "long" === t ? 90 : 180, r = "long" === t ? 0 : 1, n = V.editPointID.move.position.getValue(), o = a.GetPositionFromA_D(n, i / 2, o); let e = s.entities.getById(V.editPointID.size[r]); e.position = o, this.entity.pottingPoint[r] = o, this.entity.pottingPoint[ this.entity.pottingPoint.length - 1] = n } else { r = a.toDegrees(V.editPointID.move.position.getValue()); this.entity.position = Cesium.Cartesian3.fromDegrees(r.lon, r.lat, r .height + i / 2), this.changeHeightPoint(r.height + i) } return } if ("dimensions" === t) return void(this.graphic.dimensions = new Cesium .CallbackProperty(function() { return i }, !1)) } this.graphic[t] = i } }, SmartEarthPopupData.editGraphic.getPottingPoint = function() { var e = this.getValue("dimensions"), t = this.getValue("position"), i = a.toDegrees(t), t = Cesium.Cartesian3.fromDegrees(i.lon, i.lat, i.height - e.z / 2), i = a.GetPositionFromA_D(t, e.x / 2, 90), e = a.GetPositionFromA_D(t, e.y / 2, 180); return this.entity.pottingPoint = [i, e, t], [i, e, t] }, SmartEarthPopupData.editGraphic.updataEditPoint = function() { this.clearAllEditPoint(); var i = this.getPottingPoint(); if (i) { let e = s.entities.add({ name: "size_point", position: i[0], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), t = (e.angle = 90, s.entities.add({ name: "size_point", position: i[1], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } })); t.angle = 180, V.editPointID.size.push(e.id), V.editPointID.size.push(t.id); var o = a.toDegrees(i[2]), r = this.getValue("dimensions"), o = s.entities.add({ name: "height_point", position: Cesium.Cartesian3.fromDegrees(o.lon, o.lat, o.height + r.z), point: { color: Cesium.Color.YELLOW, pixelSize: 12, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.height.push(void 0, void 0, o.id), V.editPointID.move = s.entities.add({ name: "move_point", position: i[2], point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }) } }) : "corridor" !== r && "ellipsoid" === r && n.isSphere }, P.prototype.getStyle = function(t) { let e, i; i = this.getEntityTypeAndObject(t).type; var o = r("distanceDisplayCondition"); function r(e) { return "position" === e || "name" === e || "id" === e ? t[e] && (t[e].getValue ? t[e].getValue() : t[e]) : "radius" === e ? "ellipse" === i ? t[i].semiMajorAxis.getValue() : "ellipsoid" === i ? t[i].radii.getValue().x : "cylinder" === i ? t[i].bottomRadius.getValue() : void 0 : "repeat" === e ? t[i].material[e] && (t[i].material[e].getValue ? t[i].material[e].getValue() : t[i].material[e]) : t[i][e] && (t[i][e].getValue ? t[i][e].getValue() : t[i][e]) } return "point" === i ? e = { id: r("id"), name: r("name"), position: r("position"), pixelSize: r("pixelSize"), scaleByDistance: r("scaleByDistance"), color: r("color") && r("color").toCssColorString(), outlineWidth: r("outlineWidth"), outlineColor: r("outlineColor") && r("outlineColor").toCssColorString(), heightReference: r("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "billboard" === i ? e = { id: r("id"), name: r("name"), position: r("position"), image: r("image"), scale: r("scale"), scaleByDistance: r("scaleByDistance"), rotation: r("rotation"), width: r("width"), height: r("height"), color: r("color") && r("color").toCssColorString(), horizontalOrigin: r("horizontalOrigin"), verticalOrigin: r("verticalOrigin"), heightReference: r("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "label" === i ? e = { id: r("id"), name: r("name"), position: r("position"), text: r("text"), font: r("font"), style: r("style"), scale: r("scale"), scaleByDistance: r("scaleByDistance"), fillColor: r("fillColor") && r("fillColor").toCssColorString(), outlineColor: r("outlineColor") && r("outlineColor").toCssColorString(), outlineWidth: r("outlineWidth"), showBackground: r("showBackground"), backgroundColor: r("backgroundColor") && r("backgroundColor").toCssColorString(), horizontalOrigin: r("horizontalOrigin"), verticalOrigin: r("verticalOrigin"), heightReference: r("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "model" === i ? e = { id: r("id"), name: r("name"), position: r("position"), url: r("uri"), minimumPixelSize: r("minimumPixelSize"), runAnimations: r("runAnimations"), scale: r("scale"), color: r("color") && r("color").toCssColorString(), heightReference: r("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "polyline" === i ? e = { id: r("id"), name: r("name"), positions: r("positions"), clampToGround: r("clampToGround"), color: r("material") && r("material").color.toCssColorString(), outlineWidth: r("material") && r("material").outlineWidth, outlineColor: r("material") && r("material").outlineColor.toCssColorString(), width: r("width"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "polylineVolume" !== i && "corridor" !== i && "wall" !== i && "path" !== i && "plane" !== i && ( "polygon" === i ? e = { id: r("id"), name: r("name"), positions: r("hierarchy").positions, color: r("material") && r("material").color.toCssColorString(), image: r("material") && r("material").image, repeat: r("material") && r("material").repeat, outlineColor: r("outlineColor") && r("outlineColor").toCssColorString(), outline: r("outline"), perPositionHeight: r("perPositionHeight"), height: r("height"), extrudedHeight: r("extrudedHeight"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "ellipse" === i ? (e = { id: r("id"), name: r("name"), position: r("position"), radius: r("radius"), semiMajorAxis: r("semiMajorAxis"), semiMinorAxis: r("semiMinorAxis"), color: r("material") && r("material").color.toCssColorString(), image: r("material") && r("material").image, repeat: r("material") && r("material").repeat, outlineColor: r("outlineColor") && r("outlineColor").toCssColorString(), outline: r("outline"), height: r("height"), heightReference: r("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } }, i = "circle") : "rectangle" === i ? e = { id: r("id"), name: r("name"), coordinates: r("coordinates"), color: r("material") && r("material").color.toCssColorString(), image: r("material") && r("material").image, repeat: r("material") && r("material").repeat, outlineColor: r("outlineColor") && r("outlineColor").toCssColorString(), outline: r("outline"), height: r("height"), rotation: r("rotation"), heightReference: r("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "box" === i ? e = { id: r("id"), name: r("name"), position: r("position"), dimensions: r("dimensions"), color: r("material") && r("material").color.toCssColorString(), image: r("material") && r("material").image, repeat: r("material") && r("material").repeat, outlineColor: r("outlineColor") && r("outlineColor").toCssColorString(), outline: r("outline"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "cylinder" === i ? e = { id: r("id"), name: r("name"), position: r("position"), radius: r("radius"), topRadius: r("topRadius"), bottomRadius: r("bottomRadius"), length: r("length"), color: r("material") && r("material").color.toCssColorString(), image: r("material") && r("material").image, repeat: r("material") && r("material").repeat, outlineColor: r("outlineColor") && r("outlineColor").toCssColorString(), outline: r("outline"), distanceDisplayCondition: o && { near: o.near, far: o.far }, changeTop: t.changeTop } : "ellipsoid" === i && (e = { id: r("id"), name: r("name"), position: r("position"), radius: r("radius"), radii: r("radii"), color: r("material") && r("material").color.toCssColorString(), image: r("material") && r("material").image, repeat: r("material") && r("material").repeat, outlineColor: r("outlineColor") && r("outlineColor").toCssColorString(), outline: r("outline"), distanceDisplayCondition: o && { near: o.near, far: o.far }, isSphere: t.isSphere })), e.type = i, e }, P.prototype.addPlotting = function(e) { var t; let i = new this._cesium.EntityCollection; ("polygon" === e.type && void 0 !== e.style.extrudedHeight || "cylinder" === e.type && !e.style .changeTop || "ellipsoid" === e.type && e.style.isSphere) && e.type, e.style && e.style.id && -1 < this.SimpleGraphicObj.indexOf(e.style.id) || (t = this.addSimpleGraphic(e.type, e.style, e.treeobj), e.removeEdit || this.SimpleGraphicObj.push(t.id), i.add(t)) }, P.prototype.addFeatures = function(e) { let t = new this._cesium.EntityCollection; return e.forEach(e => { e && (e = this.addFeature(e)) && t.add(e) }), t }, P.prototype.addFeature = function(e) { if (("polygon" === e.type && void 0 !== e.style.extrudedHeight || "cylinder" === e.type && !e.style .changeTop || "ellipsoid" === e.type && e.style.isSphere) && e.type, !(e.style && e.style.id && -1 < this.SimpleGraphicObj.indexOf(e.style.id))) return this.addSimpleGraphic(e.type, e.style) }, P.prototype.open = function(e, t) { let i = this, o = this._viewer, r = new FileReader; r.readAsText(e), r.onload = function() { var e = JSON.parse(this.result).features, e = i.addFeatures(e); o.flyTo(e), t && "function" == typeof t && t(e) } }, P.prototype.ImportPlotting = function(e, t) { let i = this, o = this._viewer, r = new FileReader; r.readAsText(e), r.onload = function() { var e = JSON.parse(this.result).features, e = i.addFeatures(e); o.flyTo(e), t && "function" == typeof t && t(e) } }, P.prototype.analysisJson = function(t, e) { this.featuresPlotting = []; for (let e = 0; e < t.length; e++) t[e] instanceof Array ? this.analysisJson(t[e]) : this .ScreenPlotting(t[e]); var i = that.addFeatures(featuresPlotting); viewer.flyTo(i), e && "function" == typeof e && e(i) }, P.prototype.ScreenPlotting = function(e) { -1 != e.treeobj.type.indexOf("Plotting") && this.featuresPlotting.push(e) }; var Wt = []; function Yt(e) { this._viewer = e, this._core = new f, this.points = [], this._SimpleGraphic = new P(this._viewer), this ._SimpleGraphic.setEdit(!1) } function Qt(e, t) { this._viewer = e, this._cesium = t } function qt(e, t) { this._viewer = e, this._cesium = t, this.leftIndex = void 0, this.rightIndex = void 0 } P.prototype.createsj = function(t) { let i = 0, e = ""; if (0 != t.style.pId) for (let e = 0; e < Wt.length; e++) Wt[e].id === t.style.pId && (i = Wt[e].real); "group" === t.type ? e = this._createGroup.createGroup(t.style.name, !1, i) : t.treeData ? (t.treeData .GroupID = i, this.CreateLayer(t)) : this.addPlotting(t); var o = { pid: i, real: e, id: t.style.id }; Wt.push(o) }, P.prototype.CreateLayer = function(e) { let t = e.treeData.geoOptions.styletype, i = e.treeData.geoOptions.servertype; void 0 === t && (t = "polygonbase"), void 0 === i && (i = "geojson"), e.treeobj.pId && (e.treeData .GroupID = e.treeobj.pId), "billboardlayer" == t ? "vector" == i ? this ._billboardGeoJsonFeatureLayer.createBillboardGeoJsonFeatureLayerProvider(e.treeData.name, e .treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData .disFnc) : this._GeoJsonFeatureLayer.createBillboardGeoJsonFeature(e.treeData.name, e.treeData .geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc ) : "labellayer" == t ? "vector" == i ? "rich" != e.treeData.styleOption.textType && (1 == e .treeData.styleOption.heightReference && (e.treeData.styleOption.heightReference = void 0), this ._LabelGeoJsonFeatureLayercopy.createPrimitiveLabelGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e .treeData.disFnc)) : e.treeData.styleOption.collect ? this._LabelGeoJsonFeatureLayercopy .createLabelPolymerizationGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData .styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "rich" == e.treeData .styleOption.textType ? this._LabelGeoJsonFeatureLayercopy .createLabelRichtextGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData .styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this ._LabelGeoJsonFeatureLayercopy.createLabelPointGeoJsonFeatureLayer(e.treeData.name, e.treeData .geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc ) : "SXTLabellayer" == t ? "vector" == i && "rich" != e.treeData.styleOption.textType && this ._LabelGeoJsonFeatureLayercopy.createSXTLabelGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData .geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc ) : "pointlayer" == t ? "vector" == i ? this._VectorGeoJsonFeatureLayer .createPointGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData .styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : e.treeData .styleOption.collect ? this._LabelGeoJsonFeatureLayercopy .createPointPolymerizationGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData .styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this ._GeoJsonFeatureLayer.createPointGeojsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e .treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "Streetscape" == t ? "vector" == i ? this._PolylineGeoJsonFeatureLayer .createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e .treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : (e.treeData .styleOption.opacity && e.treeData.styleOption.material && -1 < e.treeData.styleOption.material .indexOf("#") && 1 == !e.treeData.styleOption.opacity && (e.treeData.styleOption.material += 100 * e.treeData.styleOption.opacity), this._GeoJsonFeatureLayer .createStreetscapeGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData .styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc)) : "polylinelayer" == t ? "vector" == i ? this._PolylineGeoJsonFeatureLayer .createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e .treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this ._GeoJsonFeatureLayer.createStreetscapeGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e .treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "polylinemodellayer" == t ? "vector" == i ? this._PolylineGeoJsonFeatureLayer .createPolylineVectorGeoJsonFeatureLayerProviderModel(e.treeData.name, e.treeData.geoOptions, e .treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this ._PointModel.exectPointModel(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e .treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "polygonmodellayer" == t ? "vector" == i ? this._PolygonGeoJsonFeatureLayer .createPolygonVectorGeoJsonFeatureLayerProviderModel(e.treeData.name, e.treeData.geoOptions, e .treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this ._PointModel.createPolygonModel(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e .treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "polygonbase" == t ? "vector" == i ? "1" == e.treeData.styleOption.ground ? (e.treeData.styleOption.extrudedHeightReference = 1, this ._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderOptimization(e.treeData.name, e .treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e .treeData.disFnc)) : this._VectorGeoJsonFeatureLayer .VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest(e.treeData.name, e.treeData.geoOptions, e .treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : e.treeData .styleOption.material && -1 != e.treeData.styleOption.material.indexOf(".jpg") ? this ._GeoJsonFeatureLayer.createPolygonMapGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e .treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this ._GeoJsonFeatureLayer.createPolygonGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e .treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "polygonlayer" == t ? "vector" == i ? (e.treeData.styleOption.classificationType = 0) == e.treeData .styleOption.classificationType ? this._VectorGeoJsonFeatureLayer .createGeoJsonFeatureLayerProviderOptimization(e.treeData.name, e.treeData.geoOptions, e.treeData .styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : (e.treeData .styleOption.classificationType = 2, e.treeData.styleOption.ground = "1", this ._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderClassOptimization(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e .treeData.disFnc)) : e.treeData.styleOption.material && -1 != e.treeData.styleOption .material.indexOf(".jpg") ? this._PolygonVectorTileLayerArcgis.createPolygonMapGeoJsonFeatureLayer(e .treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData .checked, e.treeData.disFnc) : this._GeoJsonFeatureLayer.createPolygonGeoJsonFeatureLayer(e .treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData .checked, e.treeData.disFnc) : "modellayer" == t ? "vector" == i ? this ._VectorGeoJsonFeatureLayer.createModelGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData .geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc ) : this._GeoJsonFeatureLayer.createModelPointGeoJsonFeatureLayer(e.treeData.name, e.treeData .geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc ) : "polylinevolumelayer" == t ? "vector" == i ? this._VolumeGeoJsonFeatureLayer .createVolumeGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData .styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this ._GeoJsonFeatureLayer.createpolylineVolumeGeojsonFeatureLayer(e.treeData.name, e.treeData .geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc ) : "polylineWallLayer" == t ? "vector" == i ? this._WallGeoFeatureLayer .createWallGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData .styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this ._GeoJsonFeatureLayer.createWallGeoFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData .styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "primiviteModels" == t ? this._PolygonVectorGeoJsonFeatureLayer.createPolygonVectorGeoJsonFeatureLayer(e.treeData.name, e .treeData.geoOptions, e.treeData.styleOption, e.treeData.styleOption.level_max, e.treeData .styleOption.level_min, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "primiviteWall" == t ? "vector" != i && this._WallGeoFeatureLayer .createWallPrimitiveGeoFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "model" != t && "pointcloudmodel" != t && "rasterlayer" != t && this._GeoJsonFeatureLayer.createGeoJsonFeatureLayer( e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData .checked, e.treeData.disFnc) }, P.prototype.remove = function(e) { let t = this._viewer; var i = this.SimpleGraphicObj.indexOf(e); - 1 < i && (t.entities.removeById(e), this.SimpleGraphicObj .splice(i, 1), SmartEarthPopupData && SmartEarthPopupData.editGraphic && SmartEarthPopupData .editGraphic.getValue && SmartEarthPopupData.editGraphic.getValue("id") === e && (V.editPointID .edit.forEach(e => { t.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { t.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { t.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { t.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && t.entities.remove(V.editPointID.move), V .editPointID.move = void 0, window.layuiLayer.close(SmartEarthPopupData.layerIndex), SmartEarthPopupData.editGraphic = {})), this.defaultEdit() }, P.prototype.clear = function() { let t = this._viewer; this.SimpleGraphicObj.forEach(e => { t.entities.removeById(e) }), this.SimpleGraphicObj = [], this.PrimitiveCollection.removeAll(), V.editPointID.edit.forEach( e => { t.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { t.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { t.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { t.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && t.entities.remove(V.editPointID.move), V .editPointID.move = void 0, window.layuiLayer.close(SmartEarthPopupData.layerIndex), SmartEarthPopupData.editGraphic = {}, this.defaultEdit() }, P.prototype.save = function(e) { let i = this._viewer, o = { type: "FeatureCollection", features: [] }, r, n = this; this.SimpleGraphicObj.forEach(e => { var t, e = i.entities.getById(e); e && (t = n.getStyle(e), r = { id: e.id, name: e.name, type: t.type, style: t }), o.features.push(r) }); var t = JSON.stringify(o), t = new Blob([t], { type: "text/plain;charset=utf-8" }); this._core.saveAs(t, e ? e + ".json" : "标绘.json") }, P.prototype.setRichtext = function(e, t) { var i = e.position.getValue(); this._viewer.entities.removeById(e.id); let o = "0", r = (e.treeobj && (V.delete(e.treeobj.id, this._viewer, this._cesium), o = e.treeobj.pId), new Ze( this._viewer)); return r.createDivPoint(e.name, i, { id: e.id, description: t, GroupID: o }), r }, P.prototype.forceEndHanlder = function() { if (this.editHandler) try { this.editHandler.destroy(), this.editHandler = void 0 } catch (e) {} if (this.drawHandler) try { this.drawHandler.destroy(), this.drawHandler = void 0 } catch (e) {} }, Yt.prototype.createSightLine = function(n = {}) { return "circle" === n.type ? this._SimpleGraphic.createCircle({}, (e, t) => { let { distance: i, positions: o } = t; this._SimpleGraphic.remove(e.id); t = this._core.toDegrees(o[1]), o[1] = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, t .height + (n.height || 1.8)), this.createPoint(o[1], "观察点"), e = [t.lon, t.lat]; let r = Cesium_turf.circle(e, i, { steps: n.steps || 64, units: "meters" }); r.geometry.coordinates[0].forEach(e => { var t = this._viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(e[0], e[1])), e = Cesium.Cartesian3.fromDegrees(e[0], e[1], t), t = this._viewer.scene.clampToHeight(e); this.createLine([o[1], t || e]) }) }) : this._SimpleGraphic.createPolyline({ toPoint: !0, clampToGround: !1 }, (e, t) => { this._SimpleGraphic.remove(e.id); e = this._core.toDegrees(t[0]); t[0] = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height + (n.height || 1.8)), this .createLine(t), this.createPoint(t[0], "观察点"), this.createPoint(t[1], "目标点") }), this }, Yt.prototype.createLine = async function(e, t) { t = this._core.pickFromRay(this._viewer, e[0], e[1], t); t && t.position ? (this._SimpleGraphic.addPolyline({ positions: [e[0], t.position], color: "#00ff00", clampToGround: !1 }), this._SimpleGraphic.addPolyline({ positions: [t.position, e[1]], color: "#ff0000", depthFailColor: "#ff00c6", clampToGround: !1 })) : this._SimpleGraphic.addPolyline({ positions: e, color: "#00ff00", clampToGround: !1 }) }, Yt.prototype.createPoint = function(e, t) { this._SimpleGraphic.addPoint({ position: e, pixelSize: 8, heightReference: 0 }), t && this._SimpleGraphic.addLabel({ text: t, position: e, font: "bold 18px 宋体", outlineWidth: 2, verticalOrigin: 1, pixelOffset: new Cesium.Cartesian2(0, -18), heightReference: 0 }) }, Yt.prototype.setVisibility = function(e) {}, Yt.prototype.deleteObject = function() { this._SimpleGraphic.clear() }, Qt.prototype.createterrainExaggeration = function(e) { this._viewer.scene.globe.terrainExaggeration = e }, qt.prototype.curtainContrast = function(e, t) { document.getElementById("slider") && this.clear(); var i = this._viewer.imageryLayers, o = this._viewer.scene, r = (Jt._scene = o, this._viewer.container), n = document.createElement("div"), r = (n.id = "slider", n.style.position = "absolute", n.style.cursor = "e-resize", n.style.top = 0, n.style.backgroundColor = "#D3D3D3", n.style.width = "8px", n.style.height = "100%", n .style.zIndex = "1000", r.appendChild(n), i.get(e)), n = i.get(t), i = (this.leftIndex = e, this.rightIndex = t, r.splitDirection = this._cesium .ImagerySplitDirection.LEFT, n.splitDirection = this._cesium.ImagerySplitDirection.RIGHT, document.getElementById("slider")); o.imagerySplitPosition = i.offsetLeft / i.parentElement.offsetWidth, i.addEventListener("mousedown", Kt, !1), window.addEventListener("mouseup", Xt, !1), i.style.left = "50%", Jt._scene .imagerySplitPosition = .5 }; var Jt = { dragStartX: 0, _scene: void 0 }; function Xt() { window.removeEventListener("mousemove", $t, !1) } function Kt(e) { var t = document.getElementById("slider"); Jt.dragStartX = e.clientX - t.offsetLeft, window.addEventListener("mousemove", $t, !1) } function $t(e) { var t = document.getElementById("slider"), e = (e.clientX - Jt.dragStartX) / t.parentElement.offsetWidth; t.style.left = 100 * e + "%", Jt._scene.imagerySplitPosition = e } function Zt(e, t) { this._viewer = e, this._cesium = t, this._handler = null, this.setPointerLocker = !1 } qt.prototype.close = function() { var e, t = document.getElementById("slider"); t && (Jt._scene.imagerySplitPosition = "0%", t.removeEventListener("mousedown", Kt, !1), window .removeEventListener("mouseup", Xt, !1), window.removeEventListener("mousemove", $t, !1), t .remove(), e = (t = this._viewer.imageryLayers).get(this.leftIndex), t = t.get(this.rightIndex), e.splitDirection = this._cesium.ImagerySplitDirection.NONE, t.splitDirection = this._cesium .ImagerySplitDirection.NONE, Jt._scene = void 0) }; var ei, ti, ii, E = { _this: null, X_speedScale: 1, Y_speedScale: .8, moveRate: .1, moveRates: [.1, .5, 1], clickNum: 1, movementX: 0, movementY: 0, moveFactor: 0, enable_looking: !(Zt.prototype.createIndoormode = function(e) { var t, i = this; if (null == i._handler) return e && e.undergroundMode && (this.undergroundMode = e .undergroundMode), e = i._viewer.scene, t = i._viewer.canvas, t.setAttribute( "tabindex", "0"), t.focus(), t.onclick = function() { t.focus() }, this.ellipsoid = e.globe.ellipsoid, e.screenSpaceCameraController .enableRotate = !1, e.screenSpaceCameraController.enableTranslate = !1, e .screenSpaceCameraController.enableZoom = !1, e.screenSpaceCameraController .enableTilt = !1, e.screenSpaceCameraController.enableLook = !1, i._handler = new i ._cesium.ScreenSpaceEventHandler(t), E._this = this, E.Viewer = i._viewer, E .camera = i._viewer.camera, document.addEventListener("pointerlockchange", si, !1), document.addEventListener("mousemove", ni, !1), document.addEventListener("keydown", li, !1), document.addEventListener("keyup", ui, !1), document.addEventListener( "click", ri, !1), i._viewer.clock.onTick.addEventListener(ai, i), i._viewer .container.requestPointerLock(), this }), Viewer: null, camera: null }, oi = { looking: !1, moveForward: !1, moveBackward: !1, moveUp: !1, moveDown: !1, moveLeft: !1, moveRight: !1 }; function ri(e) { 1 === e.button && E.moveFactor < 100 && (E.moveRate = E.moveRates[E.clickNum++], 2 < E.clickNum && (E .clickNum = 0)) } function ni(e) { var t; E.enable_looking && (E.movementX = e.movementX, E.movementY = e.movementY, e = E.Viewer.canvas.clientWidth, t = E.Viewer.canvas.clientHeight, e = E.movementX / e, t = -E.movementY / t, (!E.camera.roll && E .camera.pitch < 0 && t < 0 || !E.camera.roll && 0 < E.camera.pitch && 0 < t) && (t = 0), E .camera.rotate(E.camera.position, e * E.X_speedScale), E.camera.lookUp(t * E.Y_speedScale)) } function ai(e) { var t = this._viewer.camera, i = this._viewer.scene.globe.getHeight(t.positionCartographic), o = this.ellipsoid.cartesianToCartographic(t.position).height, o = (E.moveFactor = o - i, 100 < E.moveFactor ? E.moveFactor / 100 : E.moveRate); oi.moveForward && t.moveForward(o), oi.moveBackward && t.moveBackward(o), oi.moveUp && t.moveUp(o), oi .moveDown && t.moveDown(o), oi.moveLeft && t.moveLeft(o), oi.moveRight && t.moveRight(o) } function si() { document.pointerLockElement ? E.enable_looking = !0 : E.enable_looking && E._this.Indoormodeclose() } function li(e) { e = ci(e.keyCode); void 0 !== e && (oi[e] = !0) } function ui(e) { e = ci(e.keyCode); void 0 !== e && (oi[e] = !1) } function ci(e) { switch (e) { case "W".charCodeAt(0): return "moveForward"; case "S".charCodeAt(0): return "moveBackward"; case "Q".charCodeAt(0): return "moveUp"; case "E".charCodeAt(0): return "moveDown"; case "D".charCodeAt(0): return "moveRight"; case "A".charCodeAt(0): return "moveLeft"; default: return } } function hi(e, t) { this._viewer = e, this._cesium = t } function mi(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this.Fireworks = [], this.Smog = [], this .Fountain = [], this.Flame = [], this.Blast = [] } function di(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._indoormode = new Zt(e, t), this._model = null, this._relativeHeight = -100, this._groundHeightAtCameraPosition = 0, this ._startMousePosition, this._mousePosition, this._cameraHeight, this._originalOption, this._alpha = .5, this._brightness = .3, this._depth = 300, this._canvas = null, this.isIndoor = !1, this .isUndergroundMode = !1, this._flags = { move: !1, vertical: !1, horizontally: !1, rotate: !1 }, this.moveSpeed = 1 } function pi(e) { var t = e._viewer.scene; e._viewer.canvas, e._tree && e._tree.handler && (e._tree.handler.destroy(), e._tree.handler = null), t .screenSpaceCameraController.enableRotate = !0, t.screenSpaceCameraController.enableTranslate = !0, t .screenSpaceCameraController.enableZoom = !0, t.screenSpaceCameraController.enableTilt = !0, t .screenSpaceCameraController.enableLook = !0 } function gi(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this.isStreetView = !1, this .StreetViewType = void 0, Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.isStreetView = !1), this.defaultSkyAtmosphere = !0, this.StreetViewSphere = [null, null], this.StreetViewSphere_Canvas = [ null, null ], this.StreetViewNavigation = [], this.StreetViewSphereIndex = 0, this.URL = { getInitImageByPosition: "", getInitImageInfoById: "", getInitImageById: "", getSecondImageById: "", getThirdImageById: "", getImageInfo: "" }, this.CallBack = { getInitImageByPositionCallBack: void 0, getImageInfoByIdCallBack: void 0, getInitImageByIdCallBack: void 0, getSecondImageByIdCallBack: void 0, getThirdImageByIdCallBack: void 0, selectJoinsCallBack: void 0, setImageDataCallback: void 0 }, this.StreetViewData = { name: "", radius: 5, defaultFov: 60, fov: 110, alpha: 1, speedScale: 1.5, lon: void 0, lat: void 0, height: 0, HeadingPitchRoll: null, getImageTileID: "", linkImagesData: [], isTwoTextures: !1, isThreeTextures: !1, _handler: null, navigation_handler: null }, this.FirstImage = void 0 } Zt.prototype.Indoormodeclose = function() { var e; this._handler.destroy(), this._handler = null, document.removeEventListener("keydown", li, !1), document .removeEventListener("keyup", ui, !1), document.removeEventListener("pointerlockchange", si, !1), document.removeEventListener("mousemove", ni, !1), document.removeEventListener("click", ri, !1), this._viewer.clock.onTick.removeEventListener(ai, this), document.exitPointerLock(), E .enable_looking = !1, document.body.style.cursor = "default", this.undergroundMode ? (this .undergroundMode.isIndoor = !1, this.undergroundMode.attachMouseEvent(), this.undergroundMode = void 0) : ((e = this._viewer.scene).screenSpaceCameraController.enableRotate = !0, e .screenSpaceCameraController.enableTranslate = !0, e.screenSpaceCameraController.enableZoom = ! 0, e.screenSpaceCameraController.enableTilt = !0, e.screenSpaceCameraController.enableLook = !0) }, hi.prototype.createWeather = function(e, t, i) { var o = this._viewer.scene.postProcessStages, r = null, n = null, a = null, s = null, l = { min: 10, max: 160 }, u = { min: .5, max: 3 }, c = { min: -1, max: 1 }, h = { min: 0, max: 1 }, m = { min: 10, max: 160 }, d = { min: 0, max: 1 }, p = { min: 0, max: .7 }, g = { min: .1, max: .9 }; switch (e) { case "rain": if (r = i, this._viewer.scene.postProcessStages._stages.length && this._viewer.scene .postProcessStages._stages.forEach(function(e) { e && "rain" === e.name && o.remove(e) }), t) { if (r ? n = { test1: i.test1, test2: i.test2, test3: i.test3, test4: i.test4 } : (n = { test1: 7, test2: .3, test3: -.4, test4: 1 }, r = { test1: 7, test2: .3, test3: -.4, test4: 1 }), n.test1 = 15 * (10 - parseFloat(n.test1)) + 10, n.test2 = 2.5 * parseFloat(n .test2) + .5, n.test1 > l.max || n.test1 < l.min) return; if (n.test2 > u.max || n.test2 < u.min) return; if (n.test3 > c.max || n.test3 < c.min) return; if (n.test4 > h.max || n.test4 < h.min) return; n.test1 = this.getValue(n.test1 + ""), n.test2 = this.getValue(n.test2 + ""), n.test3 = this .getValue(n.test3 + ""), n.test4 = this.getValue(n.test4 + ""); var _ = new this._cesium.PostProcessStage({ name: "rain", fragmentShader: "uniform sampler2D colorTexture; \nvarying vec2 v_textureCoordinates;\n\nfloat hash(float x){\nreturn fract(sin(x*133.3)*13.13);\n}\n\nvoid main(void){\nfloat time = czm_frameNumber / " + n.test1 + ";\nvec2 resolution = czm_viewport.zw; \nvec2 uv=(gl_FragCoord.xy*" + n .test2 + "-resolution.xy)/min(resolution.x,resolution.y); \nvec3 c=vec3(.6,.7,.8);\nfloat a=" + n.test3 + ";\nfloat si=sin(a),co=cos(a);\nuv*=mat2(co,-si,si,co);\nuv*=length(uv+vec2(0,4.9))*.3+" + n.test4 + ";\nfloat v=1.-sin(hash(floor(uv.x*100.))*2.);\nfloat b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\nc*=v*b; //屏幕上雨的颜色\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); \n }" }); o.add(_) } break; case "snow": if (a = i, this._viewer.scene.postProcessStages._stages.length && this._viewer.scene .postProcessStages._stages.forEach(function(e) { e && "snow" === e.name && o.remove(e) }), t) { if (a ? n = { test1: i.test1, test2: i.test2, test3: i.test3, test4: i.test4 } : (n = { test1: 7, test2: .1, test3: .5, test4: .5 }, a = { test1: 7, test2: .1, test3: .5, test4: .5 }), n.test1 = 15 * (10 - parseFloat(n.test1)) + 10, n.test2 = parseFloat(n.test2) / 10, n.test3 = .7 * parseFloat(n.test3), n.test4 = .8 * (1 - parseFloat(n.test4)) + .1, parseFloat(n.test1) > m.max || parseFloat(n.test1) < m.min) return; if (parseFloat(n.test2) > d.max || parseFloat(n.test2) < d.min) return; if (parseFloat(n.test3) > p.max || parseFloat(n.test3) < p.min) return; if (parseFloat(n.test4) > g.max || parseFloat(n.test4) < g.min) return; n.test1 = this.getValue(n.test1 + ""), n.test2 = this.getValue(n.test2 + ""), n.test3 = this .getValue(n.test3 + ""), n.test4 = this.getValue(n.test4 + ""); _ = new this._cesium.PostProcessStage({ name: "snow", fragmentShader: "uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat snow(vec2 uv,float scale){\nfloat time = czm_frameNumber / " + n.test1 + ";\nfloat w=smoothstep(1.0,0.,-uv.y*(scale/10.0));if(w<" + n .test2 + ")return 0.;\nuv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\nuv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\np=" + n.test3 + "+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\nk=smoothstep(0.,k,sin(f.x+f.y)*0.01);\nreturn k*w;\n}\nvoid main(void){\nvec2 resolution = czm_viewport.zw;\nvec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\nvec3 finalColor=vec3(0);\nfloat c = 0.0;\nc+=snow(uv,30.)*.0;\nc+=snow(uv,20.)*.0;\nc+=snow(uv,15.)*.0;\nc+=snow(uv,10.);\nc+=snow(uv,8.);\nc+=snow(uv,6.);\nc+=snow(uv,5.);\nfinalColor=(vec3(c)); //屏幕上雪的颜色\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), " + n.test4 + "); //将雪和三维场景融合\n}" }); o.add(_) } break; case "fog": if (s = i, this._viewer.scene.postProcessStages._stages.length && this._viewer.scene .postProcessStages._stages.forEach(function(e) { e && "fog" === e.name && o.remove(e) }), t) { if (s ? n = { distance: i.distance, color: i.color && Cesium.Color.fromCssColorString(i.color) } : (n = { distance: 200, color: "#ffffff" }, s = { distance: 200, color: "#ffffff" }), n.distance < 10) return; _ = new Cesium.PostProcessStage({ name: "fog", fragmentShader: "float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n float depth = czm_unpackDepth(texture2D(depthTexture, texCoords)); \n if (depth == 0.0) { \n return czm_infinity; \n } \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n float startDistance = nearFarScalar.x; \n float startValue = nearFarScalar.y; \n float endDistance = nearFarScalar.z; \n float endValue = nearFarScalar.w; \n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nvarying vec2 v_textureCoordinates; \nvoid main(void) \n{ \n float distance = getDistance(depthTexture, v_textureCoordinates); \n vec4 sceneColor = texture2D(colorTexture, v_textureCoordinates); \n float blendAmount = interpolateByDistance(fogByDistance, distance); \n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n gl_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n", uniforms: { fogByDistance: new Cesium.Cartesian4(10, 0, n.distance || 200, 1), fogColor: n.color || Cesium.Color.WHITE } }); o.add(_) } } }, hi.prototype.getValue = function(e) { return "" === e || "-" === e || "." === e || void 0 === e || 2 < (e = "-" === e[e.length - 1] ? e .substr(0, e.length - 1) : e).split(".").length ? "0.0" : e.split(".")[1] && e.split(".")[1] .length ? e : parseFloat(e).toFixed(1) }, mi.prototype.createParticleEffect = function(e, t, i, o) { switch (this._viewer.clockViewModel.shouldAnimate || (this._viewer.clockViewModel.shouldAnimate = !0), e) { case "fireworks": this.createFireworks(t, i, o); break; case "smog": this.createSmog(t, i, o); break; case "fountain": this.createFountain(t, i, o); break; case "flame": this.createFlame(t, i, o); break; case "blast": this.createBlast(t, i, o) } return this }, mi.prototype.deleteObject = function() { var t = this._viewer.scene; 0 < this.Fireworks.length && (this.Fireworks.forEach(function(e) { t.primitives.remove(e) }), this.Fireworks = []), 0 < this.Smog.length && (this.Smog.forEach(function(e) { t.primitives.remove(e) }), this.Smog = []), 0 < this.Fountain.length && (this.Fountain.forEach(function(e) { t.primitives.remove(e) }), this.Fountain = []), 0 < this.Flame.length && (this.Flame.forEach(function(e) { t.primitives.remove(e) }), this.Flame = []), 0 < this.Blast.length && (this.Blast.forEach(function(e) { t.primitives.remove(e) }), this.Blast = []) }, mi.prototype.removeParticleEffect = function(e) { var t = this._viewer.scene; switch (e) { case "fireworks": 0 < this.Fireworks.length && (this.Fireworks.forEach(function(e) { t.primitives.remove(e) }), this.Fireworks = []); break; case "smog": 0 < this.Smog.length && (this.Smog.forEach(function(e) { t.primitives.remove(e) }), this.Smog = []); break; case "fountain": 0 < this.Fountain.length && (this.Fountain.forEach(function(e) { t.primitives.remove(e) }), this.Fountain = []); break; case "flame": 0 < this.Flame.length && (this.Flame.forEach(function(e) { t.primitives.remove(e) }), this.Flame = []); break; case "blast": 0 < this.Blast.length && (this.Blast.forEach(function(e) { t.primitives.remove(e) }), this.Blast = []) } }, mi.prototype.createFireworks = function(e, t, i) { var l, u = this._viewer.scene, o = this._viewer, c = this._cesium, h = (t = t || {}, c.Math.setRandomNumberSeed(315), this.computeModelMatrix(e)), m = new c.Cartesian3(0, 0, 100); var d = c.defaultValue(t.minSize, 30), p = c.defaultValue(t.maxSize, 100), e = c.defaultValue(t.size, 7), g = new c.Cartesian2(e, e), _ = 10, r = c.defaultValue(t.num, 20), f = new c.Matrix4; function n(e, t, i) { var o, e = c.Cartesian3.add(m, e, new c.Cartesian3), e = c.Matrix4.fromTranslation(e, f), r = c.Matrix4.multiply(h, e, new c.Matrix4), n = c.Matrix4.inverseTransformation(r, r), a = c.Math.randomBetween(d, p), s = new c.Cartesian3, r = .7 * ((a - d) / (p - d)) + .3; return u.primitives.add(new c.ParticleSystem({ image: (c.defined(l) || ((l = document.createElement("canvas")).width = 20, l .height = 20, (o = l.getContext("2d")).beginPath(), o.arc(8, 8, 8, 0, c .Math.TWO_PI, !0), o.closePath(), o.fillStyle = "rgb(255, 255, 255)", o.fill()), l), startColor: t, endColor: t.withAlpha(0), particleLife: r, speed: 100, imageSize: g, emissionRate: 0, emitter: new c.SphereEmitter(.1), bursts: i, lifetime: _, updateCallback: function(e) { var t = c.Matrix4.multiplyByPoint(n, e.position, s); c.Cartesian3.magnitudeSquared(t) >= a * a && c.Cartesian3.clone(c.Cartesian3 .ZERO, e.velocity) }, modelMatrix: h, emitterModelMatrix: e })) } for (var a = [{ minimumRed: .75, green: 0, minimumBlue: .8, alpha: 1 }, { red: 0, minimumGreen: .75, minimumBlue: .8, alpha: 1 }, { red: 0, green: 0, minimumBlue: .8, alpha: 1 }, { minimumRed: .75, minimumGreen: .75, blue: 0, alpha: 1 }], s = 0; s < r; ++s) { for (var y = c.Math.randomBetween(-100, 100), v = c.Math.randomBetween(-80, 100), C = c.Math .randomBetween(-50, 50), y = new c.Cartesian3(y, v, C), v = c.Color.fromRandom(a[s % a .length]), w = [], b = 0; b < 3; ++b) w.push(new c.ParticleBurst({ time: c.Math.nextRandomNumber() * _, minimum: 400, maximum: 400 })); this.Fireworks.push(n(y, v, w)) } i && "function" == typeof i ? i(this.Fireworks) : (e = o.scene.camera, t = new c.Cartesian3(-300, 0, 0), e.lookAtTransform(h, t), e.lookAtTransform(c.Matrix4.IDENTITY), i = c.Cartesian3.subtract(m, t, new c.Cartesian3), c.Cartesian3.normalize(i, i), o = c.Math.PI_OVER_TWO - Math.acos(c .Cartesian3.dot(i, c.Cartesian3.UNIT_Z)), e.lookUp(o)) }, mi.prototype.createSmog = function(e, o, t) { this._viewer.scene; var r, n = this._viewer, a = this._cesium, s = this, l = (o && "" !== o || (o = {}), a.Math.setRandomNumberSeed(3), { image: window.SmartEarthRootUrl + D.smog, emissionRate: 50, gravity: 0, minimumParticleLife: 1, maximumParticleLife: 1.2, minimumSpeed: 1, maximumSpeed: 4, startScale: 1, endScale: 5, particleSize: 1, lifetime: 6 }), u = (this._core.extend(l, o, !0), new a.Cartesian3), e = function(i) { var e = n.scene; r = e.primitives.add(new a.ParticleSystem({ image: l.image, startColor: a.Color.LIGHTSEAGREEN.withAlpha(.7), endColor: a.Color.WHITE.withAlpha(0), startScale: l.startScale, endScale: l.endScale, sizeInMeters: !0, minimumParticleLife: l.minimumParticleLife, maximumParticleLife: l.maximumParticleLife, minimumSpeed: l.minimumSpeed, maximumSpeed: l.maximumSpeed, imageSize: new a.Cartesian2(l.particleSize, l.particleSize), emissionRate: l.emissionRate, lifetime: l.lifetime, emitter: new a.CircleEmitter(2), emitterModelMatrix: s.computeEmitterModelMatrix(o.translation, o.rotation), updateCallback: c })), l.type && function(e) { "圆形放射" === e ? r.emitter = new a.CircleEmitter(2) : "球体放射" === e ? r.emitter = new a .SphereEmitter(2.5) : "圆锥体放射" === e ? r.emitter = new a.ConeEmitter(a.Math .toRadians(45)) : "盒状放射" === e && (r.emitter = new a.BoxEmitter(new a .Cartesian3(10, 10, 10))) }(l.type); return n.scene.preUpdate.addEventListener(function(e, t) { r && (r.modelMatrix = s.computeModelMatrix(i, t), r.emitterModelMatrix = s .computeEmitterModelMatrix(o.translation, o.rotation)) }), r }(e); function c(e, t) { var i = e.position; a.Cartesian3.normalize(i, u), a.Cartesian3.multiplyByScalar(u, l.gravity * t, u), e.velocity = a .Cartesian3.add(e.velocity, u, e.velocity) } this.Smog.push(e), t && "function" == typeof t && t(this.Smog) }, mi.prototype.createFountain = function(i, o, e) { this._viewer.scene; var r, t = this._viewer, n = this._cesium, a = this, s = (o && "" !== o || (o = {}), { image: window.SmartEarthRootUrl + D.penquan, emissionRate: 50, minimumParticleLife: 3, maximumParticleLife: 4, minimumSpeed: 9, maximumSpeed: 9.5, startScale: 1, endScale: 15, particleSize: 1, lifetime: 6, gravity: -3.5 }), l = (this._core.extend(s, o, !0), new n.Cartesian3), t = (r = t.scene.primitives.add(new n.ParticleSystem({ image: s.image, startColor: new n.Color(1, 1, 1, .3), endColor: new n.Color(.8, .86, 1, .4), startScale: s.startScale, endScale: s.endScale, minimumParticleLife: s.minimumParticleLife, maximumParticleLife: s.maximumParticleLife, minimumSpeed: s.minimumSpeed, maximumSpeed: s.maximumSpeed, imageSize: new n.Cartesian2(s.particleSize, 2 * s.particleSize), emissionRate: s.emissionRate, lifetime: s.lifetime, loop: !0, emitter: new n.ConeEmitter(n.Math.toRadians(n.defaultValue(s.angle, 7))), updateCallback: u, sizeInMeters: !0 })), t.scene.preUpdate.addEventListener(function(e, t) { r && (r.modelMatrix = a.computeModelMatrix(i, t), r.emitterModelMatrix = a .computeEmitterModelMatrix(o.translation, o.rotation)) }), r); function u(e, t) { var i = e.position; n.Cartesian3.normalize(i, l), n.Cartesian3.multiplyByScalar(l, s.gravity * t, l), e.velocity = n .Cartesian3.add(e.velocity, l, e.velocity) } this.Fountain.push(t), e && "function" == typeof e && e(this.Fountain) }, mi.prototype.createFlame = function(e, t, i) { this._viewer.scene; var o = this._viewer, r = this._cesium, n = this, a = (t && "" !== t || (t = {}), { image: window.SmartEarthRootUrl + D.fire, emissionRate: 50, gravity: 0, minimumParticleLife: 1, maximumParticleLife: 3, minimumSpeed: 1, maximumSpeed: 4, startScale: 1, endScale: 6, particleSize: 1, lifetime: 16 }), e = (this._core.extend(a, t, !0), t = e, o.scene.primitives.add(new r.ParticleSystem({ image: a.image, startColor: r.Color.RED.withAlpha(.7), endColor: r.Color.YELLOW.withAlpha(.3), startScale: a.startScale, endScale: a.endScale, minimumParticleLife: a.minimumParticleLife, maximumParticleLife: a.maximumParticleLife, minimumSpeed: a.minimumSpeed, maximumSpeed: a.maximumSpeed, imageSize: new r.Cartesian2(a.particleSize, a.particleSize), emissionRate: a.emissionRate, sizeInMeters: !0, lifetime: a.lifetime, emitter: new r.ConeEmitter(r.Math.toRadians(30)), modelMatrix: n.computeModelMatrix(t), emitterModelMatrix: n.computeEmitterModelMatrix(a.translation, a.rotation) }))); this.Flame.push(e), i && "function" == typeof i && i(this.Flame) }, mi.prototype.createBlast = function(e, t, i) { this._viewer.scene; var o = this._viewer, r = this._cesium, n = this, a = (t && "" !== t || (t = {}), { image: window.SmartEarthRootUrl + D.fire2, emissionRate: 10, gravity: 0, minimumParticleLife: 1, maximumParticleLife: 3, minimumSpeed: 5, maximumSpeed: 20, startScale: 1, endScale: 10, particleSize: 5, lifetime: 3 }), t = (this._core.extend(a, t, !0), function(e) { let t = new r.ParticleSystem({ image: a.image, startColor: a.startColor, endColor: a.endColor, startScale: a.startScale, endScale: a.endScale, minimumParticleLife: a.minimumParticleLife, maximumParticleLife: a.maximumParticleLife, minimumSpeed: a.minimumSpeed, maximumSpeed: a.maximumSpeed, imageSize: new r.Cartesian2(a.particleSize, a.particleSize), emissionRate: a.emissionRate, sizeInMeters: !0, lifetime: a.lifetime, emitter: new r.ConeEmitter(r.Math.toRadians(30)), emitterModelMatrix: n.computeEmitterModelMatrix(a.translation, a.rotation), bursts: a.bursts, updateCallback: () => { t.modelMatrix = n.computeModelMatrix(e, n._viewer.clock.currentTime) } }); return o.scene.primitives.add(t) }(e)); this.Blast.push(t), i && "function" == typeof i && i(this.Blast) }, mi.prototype.computeModelMatrix = function(e, t) { var i = this._cesium; return e instanceof i.Entity ? e.computeModelMatrix(t, new i.Matrix4) : e.x && e.y ? (t = e.x <= 180 && -180 <= e.x && e.y <= 90 && -90 <= e.y ? i.Cartesian3.fromDegrees(e.x, e.y, e.z || 0) : e, i .Transforms.eastNorthUpToFixedFrame(t)) : void 0 }, mi.prototype.computeEmitterModelMatrix = function(e, t) { var i = this._cesium, o = new i.TranslationRotationScale, r = i.HeadingPitchRoll.fromDegrees(0, 0, 0); return o.translation = i.defaultValue(e, i.Cartesian3.fromElements(0, 0, 0)), o.rotation = i.Quaternion .fromHeadingPitchRoll(i.defaultValue(t, r)), i.Matrix4.fromTranslationRotationScale(o) }, di.prototype.refreshGridLines = function() { var e, t = this._relativeHeight < 0, i = this._viewer.camera, i = new this._cesium.Cartographic(i.positionCartographic.longitude, i.positionCartographic.latitude, -this._depth); this._model ? (e = this.UndergroundGridLines(i, t), this._viewer.scene.primitives.remove(this._model), this._model = e) : this._model = this.UndergroundGridLines(i, t) }, di.prototype.UndergroundModelOpen = function(e, t) { var i, o, r; if (!this._model) return this._getOriginalOption(), o = this._viewer.camera, r = new this._cesium .Cartographic(o.positionCartographic.longitude, o.positionCartographic.latitude, -this._depth), i = new this._cesium.Cartographic(o.positionCartographic.longitude, o.positionCartographic .latitude, o.positionCartographic.height), this.destination = i, this.orientation = { heading: o.heading, pitch: o.pitch, roll: 0 }, this._cesium.ExpandBySmartEarth && (this._cesium.ExpandBySmartEarth.underEarth.cullFace = !1, this._cesium.ExpandBySmartEarth.underEarth.enable = !0, this._cesium.ExpandBySmartEarth .underEarth.enableDepth = this._depth, this._cesium.ExpandBySmartEarth.underEarth .enableSkirt = !0), this._viewer.scene.globe.baseColor = this._cesium.Color.WHITE.withAlpha( 0), i = e ? (this._depth = this._cesium.defaultValue(e.depth, 300), this._alpha = this ._cesium.defaultValue(e.alpha, .5), this._brightness = this._cesium.defaultValue(e .brightness, .3), this.isEnterUnderground = this._cesium.defaultValue(e .isEnterUnderground, !0), this.isFlyToSky = this._cesium.defaultValue(e.isFlyToSky, !0), this._cesium.defaultValue(e.height, -100)) : (this._depth = 300, this._alpha = .5, this ._brightness = .3, this.isEnterUnderground = !0, this.isFlyToSky = !0, -100), this .setLayerAlpha(this._alpha, this._brightness), this._viewer.scene.globe .depthTestAgainstTerrain = !0, this._viewer.scene.highDynamicRange = !1, this._viewer.scene .skyAtmosphere.show = !1, this._viewer.scene.skyBox.show = !1, this._viewer.scene.fog .enabled = !1, this._viewer.scene.backgroundColor = new this._cesium.Color(0, 0, 0, 1), this ._viewer.container.style.backgroundImage = "unset", this.isUndergroundMode = !0, t ? (this .isIndoor = !0, this._indoormode.createIndoormode({ undergroundMode: this })) : this.isIndoor = !1, o = this._viewer.camera, r = new this._cesium.Cartographic(o .positionCartographic.longitude, o.positionCartographic.latitude, -this._depth), this ._model = this.UndergroundGridLines(r, !0), this._viewer.scene.preRender.addEventListener(this .getRelativeHeight, this), this.getRelativeHeight(), 0 < this._relativeHeight && this .isEnterUnderground && this.enterUnderground(i), this }, di.prototype.close = function() { this._model && (this._viewer.scene.preRender.removeEventListener(this.getRelativeHeight, this), this .setLayerAlpha(this._originalOption.alpha, this._originalOption.brightness), this._viewer.scene .primitives.remove(this._model), this._cesium.ExpandBySmartEarth && (this._cesium .ExpandBySmartEarth.underEarth.cullFace = void 0, this._cesium.ExpandBySmartEarth.underEarth .enable = !1, this._cesium.ExpandBySmartEarth.underEarth.enableDepth = 0, this._cesium .ExpandBySmartEarth.underEarth.enableSkirt = !1), this._viewer.scene.globe.baseColor = this ._cesium.Color.WHITE.withAlpha(1), this._viewer.scene.globe.depthTestAgainstTerrain = this ._originalOption.depthTest, this._viewer.scene.skyBox && (this._viewer.scene.skyBox.show = this ._originalOption.skyBoxShow), this._viewer.scene.highDynamicRange = this._originalOption .highDynamicRange, this._viewer.scene.skyAtmosphere.show = this._originalOption.skyShow, this ._viewer.scene.backgroundColor = this._originalOption.backgroundColor, this._viewer.container .style.backgroundImage = this._originalOption.backgroundImage, this._viewer.scene.fog.enabled = this._originalOption.fog, this.isUndergroundMode = !1, this._model = null, ei = void 0, this ._viewer.camera.positionCartographic, pi(this), !this.isFlyToSky || 500 < this ._relativeHeight || this.flyToSky()) }, di.prototype._getOriginalOption = function() { var e = { alpha: this._cesium.clone(this._viewer.imageryLayers._layers[0] && this._viewer.imageryLayers ._layers[0].alpha), brightness: this._cesium.clone(this._viewer.imageryLayers._layers[0] && this._viewer .imageryLayers._layers[0].brightness), highDynamicRange: this._cesium.clone(this._viewer.scene.highDynamicRange), skyShow: this._cesium.clone(this._viewer.scene.skyAtmosphere.show), skyBoxShow: this._cesium.clone(this._viewer.scene.skyBox && this._viewer.scene.skyBox.show), depthTest: this._cesium.clone(this._viewer.scene.globe.depthTestAgainstTerrain), backgroundColor: this._viewer.scene.backgroundColor.clone(), backgroundImage: this._viewer.container.style.backgroundImage, fog: this._viewer.scene.fog.enabled }; this._viewer.scene.globe._surface && this._viewer.scene.globe._surface._tileProvider && this._viewer .scene.globe._surface._tileProvider._renderState && (e.blending = this._cesium.clone(this._viewer .scene.globe._surface._tileProvider._renderState.blending)), this._originalOption = e }, di.prototype.enterUnderground = function(e) { var t = this._viewer.camera, i = new this._cesium.Cartographic(t.positionCartographic.longitude, t.positionCartographic.latitude, -this._depth); t.positionCartographic.height <= 10 || t.flyTo({ destination: new this._cesium.Cartesian3.fromRadians(i.longitude, i.latitude, e || -this ._depth / 3), orientation: { heading: this._cesium.Math.toRadians(0), pitch: this._cesium.Math.toRadians(0), roll: 0 }, complete: function() {} }) }, di.prototype.flyToSky = function() { var e = this._viewer.camera; this._viewer.camera.positionCartographic, 10 <= e.positionCartographic.height || this._viewer.camera .flyTo({ destination: new this._cesium.Cartesian3.fromRadians(this.destination.longitude, this .destination.latitude, this.destination.height), orientation: { heading: this.orientation.heading, pitch: this.orientation.pitch, roll: 0 } }) }, di.prototype.setLayerAlpha = function(e, t) { for (var i = this._viewer.imageryLayers.length, o = 0; o < i; o++) this._viewer.imageryLayers.get(o) .alpha = e, void 0 !== t && (this._viewer.imageryLayers.get(o).brightness = t); this._alpha = e, void 0 !== t && (this._brightness = t) }, di.prototype.UndergroundGridLines = function(e, t) { var i = e, e = (e instanceof this._cesium.Cartesian3 && (i = this._viewer.scene.globe.ellipsoid .cartesianToCartographic(e)), new this._cesium.GeometryInstance({ geometry: new this._cesium.EllipseGeometry({ center: this._cesium.Cartesian3.fromRadians(i.longitude, i.latitude), height: i.height, semiMinorAxis: 2e4, semiMajorAxis: 2e4, vertexFormat: this._cesium.VertexFormat.POSITION_AND_ST }), id: "undergroundSurface" })), i = this._cesium.Material.fromType("Grid"), e = (i.uniforms.color = this._cesium.Color.WHITE.withAlpha(.3), i.uniforms.cellAlpha = .01, i .uniforms.lineCount = new this._cesium.Cartesian2(200, 200), i.uniforms.lineThickness = new this ._cesium.Cartesian2(1, 1), this._viewer.scene.primitives.add(new this._cesium.Primitive({ geometryInstances: e, appearance: new this._cesium.EllipsoidSurfaceAppearance({ material: i }) }))); return e.appearance.renderState.depthTest.enabled = !0, e.show = t, e }, di.prototype.attachMouseEvent = function() { var o = this, e = this._viewer.scene; this._canvas = this._viewer.canvas, this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this ._canvas), this._canvas.setAttribute("tabindex", "0"), this._canvas.onclick = function() { o._canvas.focus() }, e.screenSpaceCameraController.enableRotate = !1, e.screenSpaceCameraController .enableTranslate = !1, e.screenSpaceCameraController.enableZoom = !1, e.screenSpaceCameraController .enableTilt = !1, e.screenSpaceCameraController.enableLook = !1, this._tree.handler.setInputAction( function(e) { o._flags.move = !0, o._viewer.camera.pitch > o._cesium.Math.toRadians(5) ? (o._flags .vertical = !0, o._startMousePosition = e.position) : o._flags.horizontally = !0, o ._viewer.camera.positionCartographic, o._cameraHeight = o._viewer.camera .positionCartographic.height }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this._tree.handler.setInputAction(function(e) { o._flags.move = !0, o._flags.rotate = !0 }, this._cesium.ScreenSpaceEventType.MIDDLE_DOWN), this._tree.handler.setInputAction(function(e) { o._flags.vertical || (o._startMousePosition = e.startPosition), o._mousePosition = e .endPosition, o.mouseMoveEvent() }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { o._flags.move = !1, o._flags.horizontally = !1, o._flags.vertical = !1 }, this._cesium.ScreenSpaceEventType.LEFT_UP), this._tree.handler.setInputAction(function(e) { o._flags.move = !1, o._flags.rotate = !1 }, this._cesium.ScreenSpaceEventType.MIDDLE_UP); this._tree.handler.setInputAction(function(e) { var t = o._viewer.camera, i = 500 < t.positionCartographic.height ? t.positionCartographic.height / 1e3 : .1; t.pitch < 0 && t.positionCartographic.height < -200 && 0 < e || 0 < t.pitch && t .positionCartographic.height < -200 && e < 0 || t.zoomIn(e * i) }, this._cesium.ScreenSpaceEventType.WHEEL) }, di.prototype.mouseMoveEvent = function() { var e, t, i, o = 200 * this.moveSpeed, r = this._viewer.camera; this._flags.move && (this._canvas.clientWidth, e = this._canvas.clientHeight, t = this._mousePosition .x - this._startMousePosition.x, i = -(this._mousePosition.y - this._startMousePosition.y), this ._flags.horizontally && (r.moveLeft(2 * t), r.moveBackward(2 * i), r.setView({ destination: this._cesium.Cartesian3.fromRadians(r.positionCartographic.longitude, r .positionCartographic.latitude, this._cameraHeight), orientation: { heading: r.heading, pitch: r.pitch, roll: r.roll } })), this._flags.vertical && r.setView({ destination: this._cesium.Cartesian3.fromRadians(r.positionCartographic.longitude, r .positionCartographic.latitude, this._cameraHeight - (i /= e) * o), orientation: { heading: r.heading, pitch: r.pitch, roll: r.roll } }), this._flags.rotate && ((!r.roll && r.pitch < 0 && i < 0 || !r.roll && 0 < r.pitch && 0 < i) && (i = 0), r.rotate(r.position, .001 * t), r.lookUp(.001 * i))) }, di.prototype.getRelativeHeight = function() { var e = this._viewer.camera, t = this._viewer.scene.globe.getHeight(e.positionCartographic); this._groundHeightAtCameraPosition = t || this._groundHeightAtCameraPosition, this._relativeHeight = e .positionCartographic.height - this._groundHeightAtCameraPosition, this._relativeHeight < 1 ? (this ._tree.handler || this.isIndoor || this.attachMouseEvent(), t = Math.abs(this._relativeHeight), this.moveSpeed = t < 50 ? .25 : t < 100 ? .5 : t < 150 ? .75 : 1) : this._tree.handler && !this .isIndoor && pi(this), ei = ei || e.position.clone(), 1e4 < this._core.getSpaceDistancem([ei, e .position ], this._cesium) && (ei = e.position.clone(), this.refreshGridLines()), this._relativeHeight < 0 ? this._model && (this._model.show = !0) : this._model && (this._model.show = !1) }, di.prototype.isHaveTerrain = function() { return !!(this._viewer.scene && this._viewer.scene.terrainProvider && this._viewer.scene.terrainProvider ._layers) }, di.prototype.setCesiumFov = function(e) { this._viewer.camera.frustum.fov = this._cesium.Math.toRadians(e) }, gi.prototype.StreetViewOpen = function(e, t, i) { var o, r = this, n = this._viewer; return this.isStreetView || (0 < this.StreetViewSphere.length && (this.StreetViewSphere.forEach( function(e) { e && n.entities.remove(e) }), this.StreetViewSphere = [null, null]), this.StreetViewType = t.type, this.StreetViewData .linkImagesData = [], this.URL = this.extend(this.URL, t, !1), this.CallBack = this.extend(this .CallBack, t, !1), this.defaultSkyAtmosphere = !!n.scene.skyAtmosphere.show, n.scene .skyAtmosphere.show || (n.scene.skyAtmosphere.show = !0), o = n.camera, this .getInitImageByPosition(e, function(e) { r.isStreetView = !0, Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth .isStreetView = !0), o.flyTo({ destination: new r._cesium.Cartesian3.fromDegrees(r.StreetViewData.lon, r .StreetViewData.lat, r.StreetViewData.height), orientation: { heading: o.heading, pitch: o.pitch > r._cesium.Math.toRadians(45) || o.pitch < r._cesium .Math.toRadians(-45) ? 0 : o.pitch, roll: 0 }, duration: 5, complete: function() { i && "function" == typeof i && i() } }), r.attachMouseEvent(), r.createNavigation(), r.StreetViewSphereIndex = 0, r .StreetViewSphere_Canvas[r.StreetViewSphereIndex] = e, r.StreetViewSphere[r .StreetViewSphereIndex] = r.createScene(r.StreetViewData.lon, r.StreetViewData .lat, r.StreetViewData.height), r.StreetViewSphere[r.StreetViewSphereIndex] .show = !0, r.StreetViewSphere[r.StreetViewSphereIndex].orientation = r._cesium .Transforms.headingPitchRollQuaternion(r._cesium.Cartesian3.fromDegrees(r .StreetViewData.lon, r.StreetViewData.lat, r.StreetViewData.height), new r ._cesium.HeadingPitchRoll(r._cesium.Math.toRadians(r.StreetViewData .HeadingPitchRoll.heading + ("lide" === r.StreetViewType ? 90 : 0)), r ._cesium.Math.toRadians(-r.StreetViewData.HeadingPitchRoll.roll), r._cesium .Math.toRadians(r.StreetViewData.HeadingPitchRoll.pitch))), "lide" === r .StreetViewType ? r._core.xhr({ url: r.URL.getImageInfo + r.StreetViewData.getImageTileID, type: "get", dataType: "json", success: function(e) { r.CallBack && r.CallBack.setImageDataCallback && "function" == typeof r.CallBack.setImageDataCallback && r.CallBack .setImageDataCallback(r.StreetViewData, e), r .getSecondTexturesFromAtlasFile(r.StreetViewData.getImageTileID, function(e) { e.index === r.StreetViewSphereIndex && !1 === r .StreetViewData.isTwoTextures && (r .StreetViewSphere_Canvas[r .StreetViewSphereIndex] = e.canvas), r .StreetViewData.isTwoTextures = !0, r.StreetViewData .isThreeTextures = !1 }) } }) : r.getSecondTexturesFromAtlasFile(r.StreetViewData.getImageTileID, function(e) { e.index === r.StreetViewSphereIndex && !1 === r.StreetViewData .isTwoTextures && (r.StreetViewSphere_Canvas[r.StreetViewSphereIndex] = e.canvas), r.StreetViewData.isTwoTextures = !0, r.StreetViewData .isThreeTextures = !1 }) })), this }, gi.prototype.exit = function() { var e, t, i; this.isStreetView && (t = (e = this)._viewer, 0 < this.StreetViewSphere.length && (this.StreetViewSphere .forEach(function(e) { e && t.entities.remove(e) }), this.StreetViewSphere = [null, null], this.StreetViewSphere_Canvas = [null, null]), 0 < this.StreetViewNavigation.length && (this.StreetViewNavigation.forEach(function(e) { t.entities.remove(e) }), this.StreetViewNavigation = []), this.setCesiumFov(this.StreetViewData.defaultFov), this .detachMouseEvent(), t.scene.skyAtmosphere.show = this.defaultSkyAtmosphere, this .isStreetView = !1, Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.isStreetView = !1), i = t.camera.positionCartographic, t.camera.flyTo({ destination: new this._cesium.Cartesian3.fromRadians(i.longitude, i.latitude, i.height + 3e3), orientation: { heading: t.camera.heading, pitch: this._cesium.Math.toRadians(-90), roll: 0 }, complete: function() { e.isStreetView = !1, Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth .isStreetView = !1) } })) }, gi.prototype.extend = function(e, t, i) { for (var o in t) t.hasOwnProperty(o) && (e.hasOwnProperty(o) || i) && (e[o] = t[o]); return e }, gi.prototype.getInitImageByPositionURL = function(e) { var t, i, o; return o = this.URL && this.URL.getInitImageByPosition ? 1 < (i = this.URL.getInitImageByPosition.split( "{lon}"))[0].split("{lat}").length ? (t = i[0].split("{lat}"))[0] + e.lat + t[1] + e.lon + i[ 1] : (t = i[1].split("{lat}"), i[0] + e.lon + t[0] + e.lat + t[1]) : o }, gi.prototype.getImageByIdURL = function(e, t) { var i, o; switch (e) { case "one": i = this.URL.getInitImageById; break; case "two": i = this.URL.getSecondImageById; break; case "three": i = this.URL.getThirdImageById; break; case "init": i = this.URL.getInitImageInfoById } return "lide" === this.StreetViewType && (t = t.replace("-0-", "-X-"), "one" === e && (i += "&row=0&col=0")), o = i ? (e = i.split("{id}"))[0] + t + e[1] : o }, gi.prototype.getInitImageByPosition = function(e, n) { var a = this, e = this.getInitImageByPositionURL(e); this.StreetViewData.linkImagesData = [], this._core.xhr({ url: e, type: "get", dataType: "json", success: e => { if (a.CallBack && a.CallBack.getInitImageByPositionCallBack) { "function" == typeof a.CallBack.getInitImageByPositionCallBack && a.CallBack .getInitImageByPositionCallBack(a.StreetViewData, e); var e = a.getImageByIdURL("one", a.StreetViewData.getImageTileID), r = new Image; r.onload = function() { var e = r.width, t = r.height, i = ("lide" === a.StreetViewType && (e = 512, t = 256), document .createElement("canvas")), o = i.getContext("2d"); i.height = t, i.width = e, o.translate(e, 0), o.scale(-1, 1), o .drawImage(r, 0, 0, e, t, 0, 0, e, t), "function" == typeof n && n( i) }, r.setAttribute("crossOrigin", "Anonymous"); try { r.src = e } catch (e) { r.src = "" } a.FirstImage = r } else console.log("the getInitImageByPositionCallBack is undefined!") }, error: function(e, t, i) {} }) }, gi.prototype.getInitImage = function(e, r) { var e = this.getImageByIdURL("one", e), n = new Image, a = this; n.onload = function() { var e = n.width, t = n.height, i = ("lide" === a.StreetViewType && (e = 512, t = 256), document.createElement("canvas")), o = i.getContext("2d"); i.height = t, i.width = e, o.translate(e, 0), o.scale(-1, 1), o.drawImage(n, 0, 0, e, t, 0, 0, e, t), "function" == typeof r && r(i) }, n.setAttribute("crossOrigin", "Anonymous"); try { n.src = e } catch (e) { n.src = "" } a.FirstImage = n }, gi.prototype.getSecondTexturesFromAtlasFile = function(e, o) { var r, n, a, s, l = this.StreetViewSphereIndex, t = this.getImageByIdURL("two", e), u = null, c = null, h = 0, m = []; let d = 4, p = 8, i = "{row}-{col}", g = 1 / 0, _ = 1 / 0; "lide" === this.StreetViewType && (i = "&row={row}&col={col}", d = this.StreetViewData.row, p = this .StreetViewData.col, g = this.StreetViewData.maxWidth, _ = this.StreetViewData.maxHeight); for (var f = () => { if (++h == d * p) { null == u && (u = document.createElement("canvas"), c = u.getContext("2d"), u.height = s > _ ? _ : s, u.width = a > g ? g : a, c.translate(u.width, 0), c.scale(-1, 1)); var e = r, t = n; "lide" === this.StreetViewType && (e = 512, t = 256), c.drawImage(this.FirstImage, 0, 0, e, t, 0, 0, u.width, u.height); for (var i = 0; i < m.length; i++) m[i].src && c.drawImage(m[i], 0, 0, r, n, r * (i % p), n * Math.floor(i / p), r, n); o({ index: l, canvas: u }) } }, y = 0; y < d; y++) for (var v = 0; v < p; v++) { var C = (C = t + i).replace("{row}", y).replace("{col}", v), w = new Image; w.onload = function() { r = this.width, n = this.height, a = r * p, s = n * d, f() }, w.onerror = function() { this.src = "", this.onerror = void 0, f() }, w.setAttribute("crossOrigin", "Anonymous"); try { w.src = C } catch (e) { w.src = "" } m.push(w) } }, gi.prototype.getThreeTexturesFromAtlasFile = function(e, r) { for (var n = this.StreetViewSphereIndex, t = this.getImageByIdURL("three", e), a = null, s = null, l = 0, u = [], i = 0; i < 8; i++) for (var o = 0; o < 16; o++) { var c = t + i + "-" + o, h = new Image; ! function(o) { o.onload = function() { var e = o.width, t = o.height; if (128 == ++l) { null == a && (a = document.createElement("canvas"), s = a.getContext("2d"), a .height = 4096, a.width = 8192, s.translate(8192, 0), s.scale(-1, 1)); for (var i = 0; i < u.length; i++) s.drawImage(u[i], 0, 0, e, t, e * (i % 16), t * Math.floor(i / 16), e, t); r({ index: n, canvas: a }) } } }(h), h.setAttribute("crossOrigin", "Anonymous"); try { h.src = c } catch (e) { h.src = "" } u.push(h) } }, gi.prototype.InitSceneByID = function(t) { var i = this, o = this._viewer; this.updateStreetSphereIndex(), this.StreetViewSphere[this.StreetViewSphereIndex] = this.createScene( this.StreetViewData.lon, this.StreetViewData.lat, this.StreetViewData.height), this .getInitImage(this.StreetViewData.getImageTileID, function(e) { i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e, setTimeout(function() { i.StreetViewSphere[i.StreetViewSphereIndex].show = !0 }, 300) }), this.StreetViewData.isTwoTextures = !1, "lide" !== this.StreetViewType ? this.getImageInfoById( this.StreetViewData.getImageTileID, function(e) { i.StreetViewData.linkImagesData = [], i.CallBack && i.CallBack.getImageInfoByIdCallBack ? ( "function" == typeof i.CallBack.getImageInfoByIdCallBack && i.CallBack .getImageInfoByIdCallBack(i.StreetViewData, e), i.StreetViewSphere[i .StreetViewSphereIndex].position = i._cesium.Cartesian3.fromDegrees(i .StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), o.camera .cancelFlight(), o.camera.flyTo({ destination: i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i .StreetViewData.lat, i.StreetViewData.height), orientation: { heading: o.camera.heading, pitch: o.camera.pitch, roll: 0 }, duration: 1.5 }), setTimeout(function() { o.entities.remove(t), t = null }, 1300), i.StreetViewSphere[i.StreetViewSphereIndex].orientation = i._cesium .Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i .StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), new i ._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData .HeadingPitchRoll.heading), i._cesium.Math.toRadians(-i.StreetViewData .HeadingPitchRoll.roll), i._cesium.Math.toRadians(i.StreetViewData .HeadingPitchRoll.pitch))), i.getInitImage(i.StreetViewData.getImageTileID, function(e) { i.StreetViewData.isTwoTextures || (i.StreetViewSphere_Canvas[i .StreetViewSphereIndex] = e) }), i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID, function( e) { e.index === i.StreetViewSphereIndex && !1 === i.StreetViewData .isTwoTextures && (i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e.canvas), i.StreetViewData.isTwoTextures = !0, i.StreetViewData .isThreeTextures = !1 }), i.createNavigation()) : console.log( "the getImageInfoByIdCallBack is undefined!") }) : this.getInitImageByPosition(i.StreetViewData, function(e) { i.StreetViewSphere[i.StreetViewSphereIndex].position = i._cesium.Cartesian3.fromDegrees(i .StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), i .StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e, o.camera.cancelFlight(), o.camera .flyTo({ destination: i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i .StreetViewData.lat, i.StreetViewData.height), orientation: { heading: o.camera.heading, pitch: o.camera.pitch, roll: 0 }, duration: 1.5 }), setTimeout(function() { o.entities.remove(t), t = null }, 1300), i.StreetViewSphere[i.StreetViewSphereIndex].orientation = i._cesium.Transforms .headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i .StreetViewData.lat, i.StreetViewData.height), new i._cesium.HeadingPitchRoll(i ._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading + 90), i ._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll), i._cesium.Math .toRadians(i.StreetViewData.HeadingPitchRoll.pitch))), i .getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID, function(e) { e.index === i.StreetViewSphereIndex && !1 === i.StreetViewData.isTwoTextures && (i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e.canvas), i .StreetViewData.isTwoTextures = !0, i.StreetViewData.isThreeTextures = !1 }) }) }, gi.prototype.getImageInfoById = function(e, t) { e = this.getImageByIdURL("init", e); this._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { "function" == typeof t && t(e) } }) }, gi.prototype.createScene = function(e, t, i) { var o = this, r = this._viewer, n = this.StreetViewSphereIndex, a = new this._cesium.ImageMaterialProperty({ image: new this._cesium.CallbackProperty(function() { return o.StreetViewSphere_Canvas[n] }, !1), transparent: !0, color: this._cesium.Color.WHITE.withAlpha(this.StreetViewData.alpha) }), e = { show: !1, position: this._cesium.Cartesian3.fromDegrees(e, t, i), ellipsoid: { radii: new this._cesium.Cartesian3(this.StreetViewData.radius, this.StreetViewData.radius, this.StreetViewData.radius), material: a } }, t = r.entities.add(e); return t.geometryName = "街景", t }; var _i, fi, yi, vi, Ci, wi, bi, Ti, Si, Pi = null, Ei = null, xi = { looking: !(gi.prototype.detachMouseEvent = function() { var e = this._viewer.scene; this._viewer.canvas, this.StreetViewData._handler && (this.StreetViewData._handler .destroy(), this.StreetViewData._handler = void 0), this.StreetViewData .navigation_handler && (this.StreetViewData.navigation_handler.destroy(), this .StreetViewData.navigation_handler = void 0), "lide" !== this.StreetViewType && this ._viewer.clock.onTick.removeEventListener(this.StreetView_onTick, this), e .screenSpaceCameraController.enableRotate = !0, e.screenSpaceCameraController .enableTranslate = !0, e.screenSpaceCameraController.enableZoom = !0, e .screenSpaceCameraController.enableTilt = !0, e.screenSpaceCameraController .enableLook = !0 }) }; function Ii(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function Di(e, t) { this._viewer = e, this._cesium = t } gi.prototype.attachMouseEvent = function() { var t = this; Pi = this._viewer.scene, Ei = this._viewer.canvas, this.StreetViewData._handler = new this._cesium .ScreenSpaceEventHandler(Ei), Ei.setAttribute("tabindex", "0"), Ei.focus(), Ei.onclick = function() { Ei.focus() }, setTimeout(function() { t.setCesiumFov(t.StreetViewData.fov) }, 4e3), Pi.screenSpaceCameraController.enableRotate = !1, Pi.screenSpaceCameraController .enableTranslate = !1, Pi.screenSpaceCameraController.enableZoom = !1, Pi .screenSpaceCameraController.enableTilt = !1, Pi.screenSpaceCameraController.enableLook = !1, this .StreetViewData._handler.setInputAction(function(e) { xi.looking = !0 }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.StreetViewData._handler.setInputAction( function(e) { xi.looking && (ti = e.startPosition, ii = e.endPosition, t.StreetView_mouseMove()) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.StreetViewData._handler.setInputAction( function(e) { xi.looking = !1 }, this._cesium.ScreenSpaceEventType.LEFT_UP), this.StreetViewData._handler.setInputAction( function(e) { e = t.StreetViewData.fov + e / -10; 30 < e && e < 120 && (t.StreetViewData.fov = e, t.setCesiumFov(t.StreetViewData.fov)) }, this._cesium.ScreenSpaceEventType.WHEEL), "lide" !== this.StreetViewType && this._viewer .clock.onTick.addEventListener(t.StreetView_onTick, this) }, gi.prototype.StreetView_onTick = function() { var t = this; !this.StreetViewData.isThreeTextures && this.StreetViewData.fov < 50 && (this.StreetViewData .isThreeTextures = !0, this.getThreeTexturesFromAtlasFile(this.StreetViewData.getImageTileID, function(e) { e.index === t.StreetViewSphereIndex && (t.StreetViewSphere_Canvas[t .StreetViewSphereIndex] = e.canvas) })) }, gi.prototype.StreetView_mouseMove = function() { var e, t, i = this._viewer.camera; xi.looking && (e = Ei.clientWidth, t = Ei.clientHeight, e = -(ii.x - ti.x) / e, t = (ii.y - ti.y) / t, ( !i.roll && i.pitch < 0 && t < 0 || !i.roll && 0 < i.pitch && 0 < t) && (t = 0), i.rotate(i .position, e * this.StreetViewData.speedScale), i.lookUp(t * this.StreetViewData .speedScale)) }, gi.prototype.setOpacity = function(t) { var i = this; this.StreetViewSphere.forEach(function(e) { e && (e.ellipsoid.material.color._value = i._cesium.Color.WHITE.withAlpha(t)) }), this.StreetViewData.alpha = t }, gi.prototype.setCesiumFov = function(e) { this._viewer.camera.frustum.fov = this._cesium.Math.toRadians(e) }, gi.prototype.MoveToLinkImage = function(e) { e ? "lide" !== this.StreetViewType || e.ImageID ? (this.StreetViewData.name = e.name, this .StreetViewData.lon = e.Position[0], this.StreetViewData.lat = e.Position[1], this .StreetViewData.height = e.Position[2], this.StreetViewData.getImageTileID = e.ImageID, this .InitSceneByID(this.StreetViewSphere[this.StreetViewSphereIndex])) : this.CallBack && this .CallBack.selectJoinsCallBack && "function" == typeof this.CallBack.selectJoinsCallBack && this .CallBack.selectJoinsCallBack() : alert("暂无街景数据") }, gi.prototype.updateStreetSphereIndex = function() { this.StreetViewSphereIndex = 0 === this.StreetViewSphereIndex ? 1 : 0 }, gi.prototype.createNavigation = function() { var t, i = this, a = this._viewer, s = (0 < this.StreetViewNavigation.length && (this.StreetViewNavigation.forEach(function(e) { a.entities.remove(e) }), this.StreetViewNavigation = []), this.StreetViewData.navigation_handler && (this .StreetViewData.navigation_handler.destroy(), this.StreetViewData.navigation_handler = null ), 6378137), n = 6356725, o = { lon: this.StreetViewData.lon, lat: this.StreetViewData.lat, height: this.StreetViewData.height - 1 }; function l(e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = n + (s - n) * (90 - t) / 90; return [180 * (r / (o * Math.cos(t * Math.PI / 180)) + e * Math.PI / 180) / Math.PI, 180 * (i / o + t * Math.PI / 180) / Math.PI] } function u(e) { return e * Math.PI / 180 } this.StreetViewData.linkImagesData.forEach(function(t) { var e = a.entities.add({ polygon: { hierarchy: new i._cesium.CallbackProperty(function() { var e = function(e, t) { var i = [], e = l(e.lon, e.lat, 3.5, 180 * a.camera.heading / Math.PI), o = { lon: e[0], lat: e[1] }; e = l(e[0], e[1], 1.1, 0), i.push(e[0], e[1]), e = l(e[ 0], e[1], .5758, 135), i.push(e[0], e[1]), e = l(e[0], e[1], .2, 270), i.push(e[0], e[1]), e = l(e[ 0], e[1], .5, 180), i.push(e[0], e[1]), e = l(e[ 0], e[1], .4, 270), i.push(e[0], e[1]), e = l(e[ 0], e[1], .5, 0), i.push(e[0], e[1]), e = l(e[ 0], e[1], .2, 270), i.push(e[0], e[1]); for (var r, n = 0; n < i.length - 1; n += 2) r = function(e, t, i) { t = function(e, t, i, o) { var r = u(t), n = u(o), o = u(o) - u(t), t = u(i) - u(e); i = (i = 2 * Math.asin(Math.sqrt(Math .pow(Math.sin(o / 2), 2) + Math.cos(r) * Math .cos(n) * Math.pow(Math .sin(t / 2), 2)))) * s, i = Math.round(1e4 * i) / 1e4, e = 0 == o && 0 < t ? 90 : 0 == o && t < 0 ? 270 : o < 0 && 0 == t ? 180 : 0 <= o && 0 == t ? 0 : o < 0 && 0 < t ? 180 - 180 * Math.atan(t / -o) / Math .PI : o < 0 && t < 0 ? 180 + 180 * Math.atan(t / o) / Math.PI : 0 < o && t < 0 ? 360 - 180 * Math.atan(- t / o) / Math.PI : 180 * Math .atan(t / o) / Math.PI; return { angle: e, distance: i } }(e.lon, e.lat, t.lon, t.lat); return l(e.lon, e.lat, t.distance, i - t.angle) }(o, { lon: i[n], lat: i[n + 1] }, t), i[n] = r[0], i[n + 1] = r[1]; return i }(o, t.NavigationAngle); return new i._cesium.PolygonHierarchy(i._cesium.Cartesian3 .fromDegreesArray(e)) }, !1), fill: !0, outline: !0, outlineColor: i._cesium.Color.BLACK.withAlpha(.2), height: o.height } }); e.geometryName = "街景", e.isNavigation = !0, e.linkImageData = t, i.StreetViewNavigation .push(e) }), i.StreetViewData.navigation_handler = new i._cesium.ScreenSpaceEventHandler(Ei), i .StreetViewData.navigation_handler.setInputAction(function(e) { e = a.scene.pick(e.position); i._cesium.defined(e) && (e && e.id && e.id.isNavigation ? (t && (t.polygon.outlineColor = i ._cesium.Color.BLACK.withAlpha(.5), t.polygon.material = i._cesium.Color .WHITE), (t = e.id).polygon.outlineColor = i._cesium.Color.BLUE, t.polygon .material = i._cesium.Color.WHITE.withAlpha(.9)) : t && (t.polygon .outlineColor = i._cesium.Color.BLACK.withAlpha(.5), t.polygon.material = i ._cesium.Color.WHITE, t = void 0)), t && i.MoveToLinkImage(t.linkImageData) }, i._cesium.ScreenSpaceEventType.LEFT_CLICK) }, Ii.prototype.createCircleScan = function(e, t = 1500, i = "#ff0000", o = 4e3, r = !0) { var n = new this._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), e = (this._position = e, this._cesium.Color.fromCssColorString(i)), i = (this.item = this.AddCircleScanPostStage(n, t, e, o, r), { id: this._core.getuid(), name: "新建扩散圆扫描", pId: 0, type: "scan", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this }, Ii.prototype.createMultiCircleScan = function(e, t = 1500, i = "#ff0000", o = 4e3, r = !0) { var n = new this._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), e = (this._position = e, this._cesium.Color.fromCssColorString(i)), i = (this.item = this.AddCircleScanMultiPostStage(n, t, e, o, r), { id: this._core.getuid(), name: "新建扩散圆扫描", pId: 0, type: "scan", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this }, Ii.prototype.createRadarScan = function(e, t = 1500, i = "#ff0000", o = 4e3, r = !0) { var n = new this._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), e = (this._position = e, this._cesium.Color.fromCssColorString(i)), i = (this.item = this.AddRadarScanPostStage(n, t, e, o, r), { id: this._core.getuid(), name: "新建雷达扫描", pId: 0, type: "scan", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this }, Ii.prototype.createSectorScan = function(e, t = 1500, i = "#ff0000", o = 90, r = 0, n = 4e3, a = !0) { var s = this._cesium, l = new s.Cartesian3.fromDegrees(e.lon, e.lat, e.height), e = (this._position = e, s.Color.fromCssColorString(i)), s = (this.item = this.AddSectorScanPostStage(l, t, e, o, r, n, a), { id: this._core.getuid(), name: "新建扇形扩散扫描", pId: 0, type: "scan", item: this }); return this.setTreeobj(s), this._tree.insertGroupId(s, 0), this }, Ii.prototype.AddSectorScanPostStage = function(e, t, i, o, r, n, a) { var s = this._viewer, l = this._cesium, u = this._core.defaultValue(this._position.height, 0); function c(e, t, i) { this._definitionChanged = new l.Event, this._color = void 0, this._colorSubscription = void 0, this .color = e, this.duration = i, this._angle = t, this._time = (new Date).getTime() } return l.EllipsoidFadeMaterialProperty || (Object.defineProperties(c.prototype, { isConstant: { get: function() { return !1 } }, definitionChanged: { get: function() { return this._definitionChanged } }, color: l.createPropertyDescriptor("color"), angle: l.createPropertyDescriptor("angle") }), c.prototype.getType = function(e) { return "EllipsoidFade" }, c.prototype.getValue = function(e, t) { return (t = l.defined(t) ? t : {}).color = l.Property.getValueOrClonedDefault(this._color, e, l.ColorWHITE, t.color), t.angle = this._angle, t }, c.prototype.equals = function(e) { return this === e || e instanceof c && Property.equals(this._color, e._color) }, l.EllipsoidFadeMaterialProperty = c, l.Material.EllipsoidFadeType = "EllipsoidFade", l .Material.EllipsoidFadeSource = "float getAngle(in vec2 dv)\n{\n if(dv.y == 0.0 && dv.x > 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n if(dv.y > 0.0)\n {\n rAngle = 360.0 + rAngle;\n }\n }\n return rAngle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n if(nowAngle < angle)\n {\n material.alpha = 1.0 - dis/0.5;\n float intensity =step(0.001,ripple(dis, 100.0, 15.0));\n if(intensity == 1.0)\n {\n material.alpha = material.alpha/2.0;\n }\n }\n else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n}", l.Material._materialCache.addMaterial(l.Material.EllipsoidFadeType, { fabric: { type: l.Material.EllipsoidFadeType, uniforms: { color: new l.Color(1, 0, 0, 1), angle: 90 }, source: l.Material.EllipsoidFadeSource }, translucent: function(e) { return !0 } })), e = { name: "EllipsoidFade", position: e, ellipse: { height: a ? void 0 : u, semiMinorAxis: t, semiMajorAxis: t, stRotation: r * Math.PI / 180, material: new l.EllipsoidFadeMaterialProperty(i, o, n) } }, s.entities.add(e) }, Ii.prototype.AddCircleScanPostStage = function(e, t, i, o, r) { var n = this._viewer, a = this._cesium, s = this._core.defaultValue(this._position.height, 0); function l(e, t) { this._definitionChanged = new a.Event, this._color = void 0, this._colorSubscription = void 0, this .color = e, this.duration = t, this._time = (new Date).getTime() } a.CircleScanMaterialProperty || (Object.defineProperties(l.prototype, { isConstant: { get: function() { return !1 } }, definitionChanged: { get: function() { return this._definitionChanged } }, color: a.createPropertyDescriptor("color") }), l.prototype.getType = function(e) { return "CircleScan" }, l.prototype.getValue = function(e, t) { return (t = a.defined(t) ? t : {}).color = a.Property.getValueOrClonedDefault(this._color, e, a.Color.WHITE, t.color), t.time = ((new Date).getTime() - this._time) % this .duration / this.duration, t }, l.prototype.equals = function(e) { return this === e || e instanceof l && a.Property.equals(this._color, e._color) }, a.CircleScanMaterialProperty = l, a.Material.CircleScanType = "CircleScan", a.Material .CircleScanSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n if(dis= 1 / 3 && t.time < 2 / 3 && 0 === this .u_radius1 ? (this.u_radius3 = t.time, this.u_radius2 = this.u_radius3 - 1 / 3) : t .time >= 2 / 3 ? (this.u_radius3 = t.time, this.u_radius2 = this.u_radius3 - 1 / 3, this .u_radius1 = this.u_radius3 - 2 / 3) : t.time < 1 / 3 && 0 !== this.u_radius2 && 0 !== this.u_radius1 ? (this.u_radius1 = t.time, this.u_radius2 = t.time + 1 / 3, this .u_radius3 = t.time + 2 / 3) : t.time >= 1 / 3 && t.time < 2 / 3 && 0 !== this .u_radius1 && (this.u_radius1 = t.time - 1 / 3, this.u_radius2 = t.time, this .u_radius3 = t.time + 1 / 3), t.u_radius1 = this.u_radius1, t.u_radius2 = this .u_radius2, t.u_radius3 = this.u_radius3, t }, l.prototype.equals = function(e) { return this === e || e instanceof l && a.Property.equals(this._color, e._color) }, a.CircleScanMultiMaterialProperty = l, a.Material.CircleScanMultiType = "CircleScanMulti", a .Material.CircleScanMultiSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n dis = dis * 2.0;\n if(dis < u_radius1)\n\n {\n float f = dis / u_radius1;\n material.alpha = pow(f, 9.0);\n }else if(dis < u_radius2){\n float f = dis / u_radius2;\n material.alpha = pow(f, 9.0);\n }else if(dis < u_radius3){\n float f = dis / u_radius3;\n material.alpha = pow(f, 9.0);\n }else{\n material.alpha = 0.0;\n }\n return material;\n }", a.Material._materialCache.addMaterial(a.Material.CircleScanMultiType, { fabric: { type: a.Material.CircleScanMultiType, uniforms: { color: new a.Color(1, 0, 0, 1), time: 0, u_radius1: 0, u_radius2: 0, u_radius3: 0 }, source: a.Material.CircleScanMultiSource }, translucent: function(e) { return !0 } })); e = { name: "CircleScanMulti", position: e, ellipse: { height: r ? void 0 : s, semiMinorAxis: t, semiMajorAxis: t, material: new a.CircleScanMultiMaterialProperty(i, o) } }; return n.entities.add(e) }, Ii.prototype.AddRadarScanPostStage = function(e, t, i, o, r) { var n = this._viewer, a = this._cesium, s = this._core.defaultValue(this._position.height, 0); function l(e, t) { this._definitionChanged = new a.Event, this._color = void 0, this._angle = 60, this.range = 360, this._colorSubscription = void 0, this.color = e, this.duration = t, this.isReturn = !1, this .isGradient = !0, this._time = (new Date).getTime() } a.RadarScanMaterialProperty || (Object.defineProperties(l.prototype, { isConstant: { get: function() { return !1 } }, definitionChanged: { get: function() { return this._definitionChanged } }, color: a.createPropertyDescriptor("color") }), l.prototype.getType = function(e) { return "RadarScan" }, l.prototype.getValue = function(e, t) { return (t = a.defined(t) ? t : {}).color = a.Property.getValueOrClonedDefault(this._color, e, a.Color.WHITE, t.color), t.time = ((new Date).getTime() - this._time) % this .duration / this.duration, t._angle = this._angle, t.range = this.range, t.gradient = this.isGradient, this.isReturn ? (void 0 === this.old && (this.old = t.time), .5 < this .old && t.time < .5 && (t.inverse = !t.inverse), this.old = t.time, t.gradient ? t .inverse ? (t.angle2 = this.range * (1 - t.time), t._angle = this.range - t.angle2, t._angle > this._angle && (t._angle = this._angle), t.angle1 = t.angle2 - t ._angle, t.angle1 < 0 && (t._angle = t.angle2, t.angle1 = 0)) : (t.angle1 = this .range * t.time, t._angle = t.angle1, t._angle > this._angle && (t._angle = this ._angle), t.angle2 = t.angle1 + t._angle, t.angle2 > this.range && (t .angle2 = this.range)) : (t.range = this.range - this._angle, t.angle1 = t .range * (t.inverse ? 1 - t.time : t.time), t.angle2 = t.angle1 + this._angle) ) : (t.inverse = !1, t.angle1 = this.range * t.time, t.angle2 = t.angle1 + this ._angle, t.angle2 > this.range && (t.angle2 = t.angle2 - this.range)), t }, l.prototype.equals = function(e) { return this === e || e instanceof l && a.Property.equals(this._color, e._color) }, a.RadarScanMaterialProperty = l, a.Material.RadarScanType = "RadarScan", a.Material .RadarScanSource = "float getAngle(in vec2 dv)\n {\n if(dv.y == 0.0 && dv.x > 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n if(dv.y > 0.0)\n {\n rAngle = 360.0 + rAngle;\n }\n }\n return rAngle;\n }\n float ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n }\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float f = 0.0;\n float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n if(nowAngle < angle2 && nowAngle > angle1)\n {\n if(gradient){\n f = (nowAngle - angle1) / _angle;\n material.alpha = f;\n if(inverse){\n material.alpha = 1.0 - material.alpha;\n }\n }else{\n material.alpha = 1.0;\n }\n }else if(nowAngle < range && nowAngle > angle1 && angle2 < _angle){\n if(gradient){\n f = (nowAngle - angle1) / _angle;\n material.alpha = f;\n if(inverse){\n material.alpha = 1.0 - material.alpha;\n }\n }else{\n material.alpha = 1.0;\n }\n }else if(nowAngle < angle2 && nowAngle > 0.0 && angle2 < _angle){\n if(gradient){\n f = (nowAngle + range - angle1) / _angle;\n material.alpha = f;\n if(inverse){\n material.alpha = 1.0 - material.alpha;\n }\n }else{\n material.alpha = 1.0;\n }\n }else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n }", a.Material._materialCache.addMaterial(a.Material.RadarScanType, { fabric: { type: a.Material.RadarScanType, uniforms: { color: new a.Color(1, 0, 0, 1), time: 0, angle2: 0, angle1: 0, _angle: 60, range: 360, inverse: !1, gradient: !0 }, source: a.Material.RadarScanSource }, translucent: function(e) { return !0 } })); e = { name: "RadarScan", position: e, ellipse: { height: r ? void 0 : s, semiMinorAxis: t, semiMajorAxis: t, material: new a.RadarScanMaterialProperty(i, o) } }; return n.entities.add(e) }, Ii.prototype.setRadius = function(e) { this.item && (this.item.ellipse.semiMinorAxis = parseFloat(e), this.item.ellipse.semiMajorAxis = parseFloat(e)) }, Ii.prototype.setTime = function(e) { this.item && (this.item.ellipse.material.duration = parseFloat(e)) }, Ii.prototype.setRadarAngle = function(e) { var t; this.item && "RadarScan" === this.item.ellipse.material.getType() && (t = this.item.ellipse.material .range, this.item.ellipse.material._angle = t < e ? t : parseFloat(e)) }, Ii.prototype.setRadarRange = function(e) { this.item && "RadarScan" === this.item.ellipse.material.getType() && (this.item.ellipse.material.range = 360 < e ? 360 : parseFloat(e)) }, Ii.prototype.setRadarIsReturn = function(e) { this.item && "RadarScan" === this.item.ellipse.material.getType() && (this.item.ellipse.material .isReturn = e) }, Ii.prototype.setRadarIsGradient = function(e) { this.item && "RadarScan" === this.item.ellipse.material.getType() && (this.item.ellipse.material .isGradient = e) }, Ii.prototype.setPosition = function(e) { this.item && (this.item.position = new Cesium.Cartesian3.fromDegrees(e.lon, e.lat)) }, Ii.prototype.remove = function() { this._viewer.entities.remove(this.item) }, Ii.prototype.setTreeobj = function(e) { this.treeobj = e }, Ii.prototype.deleteObject = function() { this.item && this._viewer.entities.remove(this.item) }, Ii.prototype.setVisibility = function(e) { this.item && (this.item.show = e) }, Di.prototype.depthTestAgainstTerrain = function(e) { this._viewer.scene.globe.depthTestAgainstTerrain = e }, Di.prototype.show = function() { return this._viewer.scene.globe.depthTestAgainstTerrain }; var x, Li, Mi, Ai, Ri, Oi = [1, 1e5]; function Hi(e, t) { var i, o; if (!(x.canvas.width <= 0 || x.canvas.height <= 0)) return o = x.camera.getPickRay(e), o && (i = x.scene .globe.pick(o, x.scene)), o = x.scene.pick(e), (o = o && o.id instanceof Cesium.Entity ? void 0 : o) && (o = x.scene.pickPosition(e)) ? o : i } function Vi(e, t) { this._normalShadowMap = e.scene.shadowMap, x = e, Cesium.Scene.prototype.screenToWorld = Hi, this._viewer = e, this._cesium = t, this._core = new f, this._getPosition = new et(e, t), this ._startPositionCartesian = null, this._startPositionCartographic = null, this._currentPosition = null, this._prevRadius = null, this._currentRadius = null, this._currentFovHorizontal = null, this ._currentFovVertical = null, this._viewshedDirection = null, this._scratchCartesian3 = new Cesium .Cartesian3, this._texture = null, this._canEnlarge = !1, this._viewshedPrimitive = null, this ._eventListener = null, this._viewshedMap = void 0, this._firstTime = !0, this._editingMode = !1, this ._isSliderClicked = !1, this._currentObject = void 0, this._setNewPosition = !1, this ._setNewPositionCanDrag = !1, this._setNewName = !1, this._listControl = void 0, this ._addingViewshedMode = !1, this._initialCameraParams = {}, this._isCancelledTerrain = !1, this ._isCancelledPrimitives = !1, this._isSpherical = !1, this._occluder = void 0, this ._horizonCullingDistanceFromPoint = void 0, this._mousePositionX = void 0, this._mousePositionY = void 0, this._zAxisNewPosition = void 0, this._startingRepoZHeight = void 0, this._viewshedCartoPos = void 0, this._propertiesChanged = !1, this._calculations = [], this._exposures = [], this ._calculating = !1, this._calculatingExposure = !1, this.viewshedCalculateNormals = !1, this._txtUnit = "meters_short", this.isLoadingScreenOn = !1, this._primitiveColor = Cesium.Color.WHITE, this ._predefinedPrimitiveColors = { BEYOND_THE_HORIZON: Cesium.Color.WHITE, DEFAULT: Cesium.Color.WHITE }, this._layersStorage = null, this.getId = function() { return "Viewshed" }, this.maxNumViewshed = 8, _i = 53 * Cesium.Math.RADIANS_PER_DEGREE, fi = 53 * Cesium.Math .RADIANS_PER_DEGREE, yi = 6371010, vi = { ABOVE_SEA_LEVEL: 0, ABOVE_GROUND_LEVEL: 1, ABOVE_MODEL: 2 }, Ci = new Cesium.Cartesian3, Ti = new Cesium.Matrix4, wi = new Cesium.Cartesian4, bi = new Cesium .Cartesian3, Ti = new Cesium.Matrix4, (Si = new Array(4))[0] = new Cesium.Cartesian4(-1, -1, 1, 1), Si[ 1] = new Cesium.Cartesian4(1, -1, 1, 1), Si[2] = new Cesium.Cartesian4(1, 1, 1, 1), Si[3] = new Cesium.Cartesian4(-1, 1, 1, 1) } function ki(e, t) { this._viewer = e, this._cesium = t } function Fi(e, t, i, h, m, d) { const { Pass: o, defined: r, PerspectiveFrustum: n, PerspectiveOffCenterFrustum: a, OrthographicFrustum: s, OrthographicOffCenterFrustum: l } = Cesium; Li = Li || new n, Mi = Mi || new a, Ai = Ai || new s, Ri = Ri || new l; let u = e._us, c = u._frameState, p = c.camera, g = p._scene, _ = g._view, f = _.frustumCommandsList, y = f.length; var v, C, w, b = g._globeTranslucencyState, T = b.translucent; function S(e, t, i, o) { if (!d || d(e, t)) if (h && m) { var r = e; var n = h; var a = m; var s = i; var l = o; const c = Cesium.defined; var t = t._frameState, u = r.derivedCommands; c(u) && (u = (r = t.useLogDepth && c(u.logDepth) ? u.logDepth.command : r).derivedCommands, c(u[ n]) && (r = u[n][a]).execute(s, l)) } else e.execute(i, o) } for (var P = r(p.frustum.fov) ? p.frustum.clone(Li) : r(p.frustum.infiniteProjectionMatrix) ? p.frustum .clone(Mi) : r(p.frustum.width) ? p.frustum.clone(Ai) : p.frustum.clone(Ri), E = 0; E < y; ++E) { var x = y - E - 1, I = f[x], D = i.framebuffer; if (i.framebuffer = t, P.near = 0 != x ? I.near * g.opaqueFrustumNearOffset : I.near, P.far = I.far, u .updateFrustum(P), u.updatePass(o.GLOBE), w = I.commands[o.GLOBE], C = I.indices[o.GLOBE], T) b .executeGlobeCommands(I, S, globeTranslucencyFramebuffer, g, i); else for (v = 0; v < C; ++v) S(w[v], g, e, i); for (u.updatePass(o.CESIUM_3D_TILE), w = I.commands[o.CESIUM_3D_TILE], C = I.indices[o.CESIUM_3D_TILE], v = 0; v < C; ++v) S(w[v], g, e, i); for (u.updatePass(o.OPAQUE), w = I.commands[o.OPAQUE], C = I.indices[o.OPAQUE], v = 0; v < C; ++v) S(w[ v], g, e, i); for (u.updatePass(o.TRANSLUCENT), w = I.commands[o.TRANSLUCENT], C = I.indices[o.TRANSLUCENT], v = 0; v < C; ++v) S(w[v], g, e, i); i.framebuffer = D } } Vi.prototype.setOptions = function(e) { this._currentObject = { viewshedPrimitive: this._viewshedPrimitive, viewshedMap: this._viewshedMap, viewshedObjOptions: e || {} } }, Vi.prototype.startDraw = function(e) { this._viewshedPrimitive && (x.scene.primitives.remove(this._viewshedPrimitive), this ._viewshedPrimitive = null), this._core.setDepthTest("open", this._viewer), this._core.mouse( this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this._eventListener && this ._eventListener.destroy(), this._eventListener = new Cesium.ScreenSpaceEventHandler(x.scene.canvas), void 0 === this._viewshedDefaultNamingArray && (this._viewshedDefaultNamingArray = new Array(this .maxNumViewshed)), this._addingViewshedMode = !0, this._editingMode = !1, this ._currentObject = { viewshedPrimitive: this._viewshedPrimitive, viewshedMap: this._viewshedMap, viewshedObjOptions: e || {} }, this._isSpherical = e.isSpherical, this._setNewPosition = !1, "pc" != this._core.getBrowser() .pc ? (this._eventListener.setInputAction($.proxy(this.setViewshedPositionMobile, this), Cesium .ScreenSpaceEventType.LEFT_CLICK), x.scene.preRender.addEventListener(this.onPreFrameMobile, this)) : (this._eventListener.setInputAction($.proxy(this.setViewshedPosition, this), Cesium .ScreenSpaceEventType.LEFT_CLICK), x.scene.preRender.addEventListener(this.onPreFrame, this)), this.end = e => { this.end = void 0, x.scene.preRender.removeEventListener(this.onPreFrame, this); try { x.scene.preRender.removeEventListener(this.onPreFrameMobile, this) } catch (e) {} this._eventListener && this._eventListener.destroy(), this._core.setDepthTest("close", this ._viewer), this._core.mouse(this._viewer.container, 0) } }, Vi.prototype.close = function() { x.scene.preRender.removeEventListener(this.onPreFrame, this); try { x.scene.preRender.removeEventListener(this.onPreFrameMobile, this) } catch (e) {} this._eventListener && this._eventListener.destroy(), this._viewshedPrimitive && (x.scene.primitives .remove(this._viewshedPrimitive), this._viewshedPrimitive = null); var e, t = x.scene, i = { context: x.scene.context, lightCamera: t._sunCamera }, i = (t.shadowMap.destroy(), t.shadowMap = new Cesium.ShadowMap(i), t.shadowMap); this._currentObject && this._currentObject.viewshedObjOptions && this._currentObject.viewshedObjOptions .color && this._currentObject.viewshedObjOptions.color.default && (e = this._currentObject .viewshedObjOptions.color.default, i._color = new Cesium.Cartesian3(e.r, e.g, e.b)), i .enabled = !0, i.debugShow = !1, i.guid = void 0, i.show = !0, i.maximumDistance = 1e4, i .debugCreateRenderStates(), i.dirty = !0, x.scene.globe.shadows = Cesium.ShadowMode.fromCastReceive( !0, !0), x.scene.globe.show = !0, t.skyAtmosphere.show = !0, x.scene.shadowMap = this ._normalShadowMap, this._startPositionCartesian = null, this.resetAllVariables(), this._core .setDepthTest("close", this._viewer), this._core.mouse(this._viewer.container, 0) }, Vi.prototype.setVisibility = function(e) { this._viewshedPrimitive.show = e, x.shadowMap.enabled = e }, Vi.prototype.reset = function() { var e, t = x.scene, i = { context: x.scene.context, lightCamera: t._sunCamera }, i = (t.shadowMap.destroy(), t.shadowMap = new Cesium.ShadowMap(i), t.shadowMap); this._currentObject && this._currentObject.viewshedObjOptions && this._currentObject.viewshedObjOptions .color && this._currentObject.viewshedObjOptions.color.default && (e = this._currentObject .viewshedObjOptions.color.default, i._color = new Cesium.Cartesian3(e.r, e.g, e.b)), i .enabled = !0, i.debugShow = !1, i.guid = void 0, i.show = !0, i.maximumDistance = 1e4, i .debugCreateRenderStates(), i.dirty = !0, x.scene.globe.shadows = Cesium.ShadowMode.fromCastReceive( !0, !0), x.scene.globe.show = !0, t.skyAtmosphere.show = !0, x.scene.shadowMap = this ._normalShadowMap }, Vi.prototype.addViewshed = function(e = {}) { this._viewshedPrimitive && this.close(); var t = new Cesium.HeadingPitchRange(e.heading, e.pitch, .01), i = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height); this._currentRadius = e.distance || 1e3, this._isSpherical = e.isSpherical, this._currentObject = this .CreateViewshed(i, this._currentRadius, t, e), this._isSpherical ? this .createViewshedSpherePrimitive(i) : this.createViewshedCameraPrimitive(i, this._currentObject .viewshedMap._lightCamera) }, Vi.prototype.CreateViewshed = function(e, t, i, o) { var r = x.scene, n = new Cesium.Camera(r), a = x.scene.context, a = (n.frustum.fov = 53 * Math.PI / 180, n.frustum.aspectRatio = 1, n.frustum.near = 1, n.frustum .far = t, n.lookAt(e, i), { context: a, lightCamera: n, cascadesEnabled: !1, isPointLight: this._isSpherical, pointLightRadius: t }), n = (r.shadowMap = new Cesium.ShadowMap(a), r.shadowMap), a = (o.color && (n._viewshed_Back = new Cesium.Cartesian3(o.color.Back.r, o.color.Back.g, o.color .Back.b), n._viewshed_Fore = new Cesium.Cartesian3(o.color.Fore.r, o.color.Fore.g, o .color.Fore.b)), n.enabled = !0, n.debugShow = !1, n.guid = Cesium.createGuid(), n.show = ! 0, n.maximumDistance = 1e4, n._pointLightRadius = t, n.debugCreateRenderStates(), n._distance = t, n.dirty = !0, x.scene.globe.shadows = Cesium.ShadowMode.fromCastReceive(!0, !0), x.scene .globe.show = !0, r.skyAtmosphere.show = !0, {}); return a.position = e, a.distance = t, a.direction = i, a.viewshedObjOptions = o, a.guid = this._cesium .createGuid(), a.viewshedObjOptions.originalDirection = i, a.type = "viewshed", a.viewshedMap = n, a }, Vi.prototype.resetAllVariables = function() { this._startPositionCartesian = null, this._startPositionCartographic = null, this._currentPosition = null, this._currentRadius = null, this._currentFovHorizontal = null, this._currentFovVertical = null, this._setNewPosition = !1, this._currentObject = void 0, this._viewshedMap = void 0, this ._canEnlarge = !1, this._zAxisNewPosition = void 0, this._viewshedDirection = null }, Vi.prototype.setViewshedPosition = function(e) { var i, t, o; this._setNewPosition || (this._canEnlarge && null != this._viewshedPrimitive ? (this._canEnlarge = !1, this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE), this ._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK), this ._currentObject.viewshedObjOptions.end && this._currentObject.viewshedObjOptions.end(), this ._core.mouse(this._viewer.container, 0), null != this._viewshedMap && null != this ._viewshedPrimitive && (t = this._viewshedPrimitive._camera, this._currentObject .viewshedObjOptions.initialHeading = t.heading, this._currentObject.viewshedObjOptions .initialPitch = t.pitch, this._currentObject.viewshedObjOptions.initialRoll = t.roll, this._currentObject.viewshedObjOptions.altitudeMethod = Cesium.defaultValue(this ._currentObject.viewshedObjOptions.altitudeMethod, 2), o = { displayName: this._currentObject.viewshedObjOptions.name, color: this._currentObject.viewshedObjOptions.color, hFOV: t.frustum.fov, vFOV: t.frustum.fovy, aspectRatio: t.frustum.aspectRatio, height: this._currentObject.viewshedObjOptions.height, distance: this._currentObject.viewshedObjOptions.distance, xPos: this._currentObject.viewshedObjOptions.xPos, yPos: this._currentObject.viewshedObjOptions.yPos, altitudeMethod: this._currentObject.viewshedObjOptions.altitudeMethod, pickHeight: this._currentObject.viewshedObjOptions.pickHeight, horizonCullingDistanceFromViewshed: this._horizonCullingDistanceFromPoint, initialHeading: this._currentObject.viewshedObjOptions.initialHeading, initialPitch: this._currentObject.viewshedObjOptions.initialPitch, initialRoll: this._currentObject.viewshedObjOptions.initialRoll }, t = this.CreateViewshed(t.position, Cesium.defaultValue(this._currentObject .viewshedObjOptions.distance, this._currentRadius), new Cesium .HeadingPitchRange(t.heading, t.pitch, .01), o), this._eventListener .removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK), this._eventListener .removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN), this._eventListener .removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP), this._eventListener .removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE), -1 != t && (this .resetAllVariables(), this._currentObject = t, o = x.scene.primitives._primitives, $ .grep(o, function(e) { return !0 === e.isViewshed }), i = [], o.forEach(function(e, t) { e.isViewshed && i.push(t) }), 1 < i.length && (t = i[i.length - 2], o = x.scene.primitives._primitives[t], x .scene.primitives.remove(o))))) : Cesium.defined(e) && void 0 !== this ._currentObject && void 0 !== (t = this._getPosition.getMousePosition(e)) && (o = 0, this ._startPositionCartographic = x.scene.globe.ellipsoid.cartesianToCartographic(t), this ._currentObject.viewshedObjOptions.pickHeight = this._startPositionCartographic.height, void 0 !== this._currentObject.viewshedObjOptions.height && (o = this._currentObject .viewshedObjOptions.height), e = new Cesium.Cartesian3.fromRadians(this ._startPositionCartographic.longitude, this._startPositionCartographic.latitude, this ._startPositionCartographic.height + 0 + o), this._startPositionCartesian = e, t = this ._startPositionCartesian, o = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, 0), yi), this._occluder = new Cesium.Occluder(o, t), this._canEnlarge = !0, this._eventListener .setInputAction($.proxy(this.onMouseMove, this), Cesium.ScreenSpaceEventType.MOUSE_MOVE))) }, Vi.prototype.update = function(t = {}) { if (this._currentObject && this._currentObject.viewshedMap) { var i, o = this._currentObject.direction; Object.assign(o, t); let e = this._currentObject.position; void 0 === t.lon && void 0 === t.lat && void 0 === t.height || (i = this._core.toDegrees(e), Object .assign(i, t), e = Cesium.Cartesian3.fromDegrees(i.lon, i.lat, i.height), this ._currentObject.position = e), void 0 !== t.distance && (this._currentRadius = t.distance), this._currentRadius ? this._currentObject.viewshedMap._lightCamera.frustum.far = this ._currentRadius : this._currentRadius = this._currentObject.viewshedMap._lightCamera.frustum .far, this._currentObject.viewshedMap._lightCamera.lookAt(e, o), this._isSpherical ? this .createViewshedSpherePrimitive(e) : this.createViewshedCameraPrimitive(e, this._currentObject .viewshedMap._lightCamera) } }, Vi.prototype.setViewshedPositionMobile = function(e) { var i, t, o; this._setNewPosition || (this.onMouseMove(e), this.createViewshedCameraPrimitive(), this._canEnlarge && null != this._viewshedPrimitive ? (this._currentObject.viewshedObjOptions.end && this ._currentObject.viewshedObjOptions.end(), this._core.mouse(this._viewer.container, 0), this .createViewshedMap(), null != this._viewshedMap && null != this._viewshedPrimitive && (t = this._viewshedPrimitive._camera, this._currentObject.viewshedObjOptions.initialHeading = t.heading, this._currentObject.viewshedObjOptions.initialPitch = t.pitch, this ._currentObject.viewshedObjOptions.initialRoll = t.roll, this._currentObject .viewshedObjOptions.altitudeMethod = Cesium.defaultValue(this._currentObject .viewshedObjOptions.altitudeMethod, 2), o = { displayName: this._currentObject.viewshedObjOptions.name, color: this._currentObject.viewshedObjOptions.color, hFOV: t.frustum.fov, vFOV: t.frustum.fovy, aspectRatio: t.frustum.aspectRatio, height: this._currentObject.viewshedObjOptions.height, distance: this._currentObject.viewshedObjOptions.distance, xPos: this._currentObject.viewshedObjOptions.xPos, yPos: this._currentObject.viewshedObjOptions.yPos, altitudeMethod: this._currentObject.viewshedObjOptions.altitudeMethod, pickHeight: this._currentObject.viewshedObjOptions.pickHeight, horizonCullingDistanceFromViewshed: this._horizonCullingDistanceFromPoint, initialHeading: this._currentObject.viewshedObjOptions.initialHeading, initialPitch: this._currentObject.viewshedObjOptions.initialPitch, initialRoll: this._currentObject.viewshedObjOptions.initialRoll }, t = this.CreateViewshed(t.position, Cesium.defaultValue(this._currentObject .viewshedObjOptions.distance, this._currentRadius), new Cesium .HeadingPitchRange(t.heading, t.pitch, .01), o), this._eventListener .removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK), this._eventListener .removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN), this._eventListener .removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP), this._eventListener .removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE), -1 != t && (this ._currentObject = t, o = x.scene.primitives._primitives, $.grep(o, function(e) { return !0 === e.isViewshed }), i = [], o.forEach(function(e, t) { e.isViewshed && i.push(t) }), 1 < i.length && (t = i[i.length - 2], o = x.scene.primitives._primitives[t], x .scene.primitives.remove(o))))) : Cesium.defined(e) && void 0 !== this ._currentObject && void 0 !== (t = this._getPosition.getMousePosition(e)) && (o = 0, this ._startPositionCartographic = x.scene.globe.ellipsoid.cartesianToCartographic(t), this ._currentObject.viewshedObjOptions.pickHeight = this._startPositionCartographic.height, void 0 !== this._currentObject.viewshedObjOptions.height && (o = this._currentObject .viewshedObjOptions.height), e = new Cesium.Cartesian3.fromRadians(this ._startPositionCartographic.longitude, this._startPositionCartographic.latitude, this ._startPositionCartographic.height + 0 + o), this._startPositionCartesian || (this ._startPositionCartesian = e), t = this._startPositionCartesian, o = new Cesium .BoundingSphere(new Cesium.Cartesian3(0, 0, 0), yi), this._occluder = new Cesium.Occluder(o, t), this._canEnlarge = !0, this._eventListener.setInputAction($.proxy(this.onMouseMove, this), Cesium.ScreenSpaceEventType.MOUSE_MOVE))) }, Vi.prototype.onMouseMove = function(e) { var t, i, o, r; Cesium.defined(e) && (i = {}, null != (t = this._getPosition.getMousePosition(e)) ? null != i .pickPrimitive && null != i.pickPrimitive._camera || (i = {}, this._setNewPosition ? this ._setNewPositionCanDrag ? (o = void 0, r = x.scene.globe.ellipsoid.cartesianToCartographic( t), this._currentObject.viewshedObjOptions.pickHeight = r.height, this ._currentObject.viewshedObjOptions.terrainHeight = x.scene.globe.getHeight(r), o = this ._zAxisNewPosition ? (e = e.endPosition.y - this._startingRepoZ.y, e = -1 * Cesium .Cartesian3.magnitude(Cesium.Cartesian3.subtract(this._currentObject.position, x .camera.position, this._scratchCartesian3), this._scratchCartesian3) * (e / x .canvas.height), null == this._viewshedCartoPos && (this._viewshedCartoPos = new Cesium.Cartographic.fromCartesian(this._currentObject.position)), new Cesium .Cartesian3.fromRadians(this._viewshedCartoPos.longitude, this._viewshedCartoPos .latitude, this._viewshedCartoPos.height + e)) : this._currentObject .viewshedObjOptions.altitudeMethod == vi.ABOVE_SEA_LEVEL ? new Cesium.Cartesian3 .fromRadians(r.longitude, r.latitude, this._startingRepoZHeight) : t, this ._newPosition = o) : (e = Cesium.Matrix4.multiplyByVector(x.camera._viewMatrix, Cesium .Cartesian4.fromElements(t.x, t.y, t.z, 1, wi), wi), r = Cesium.Matrix4 .multiplyByVector(x.camera.frustum.projectionMatrix, e, wi), o = Cesium.Cartesian3 .divideByScalar(r, r.w, bi), e = Math.floor((.5 * o.x + .5) * x.canvas.width), r = Math .floor((.5 * o.y + .5) * x.canvas.height), this._mousePositionX = e, this ._mousePositionY = r) : null != this._startPositionCartesian && (Cesium.Cartesian3 .subtract(t, this._startPositionCartesian, i), isNaN(i.x) || isNaN(i.y) || isNaN(i.z) || (this._viewshedDirection = Cesium.Cartesian3.normalize(i, this._scratchCartesian3), this ._currentRadius = Cesium.Cartesian3.magnitude(i)))) : (this._mousePositionX = void 0, this._mousePositionY = void 0)) }, Vi.prototype.createViewshedSpherePrimitive = function(e, t) { try { var i = null != e ? e : this._startPositionCartesian, o = null != t ? t : this._currentRadius; if (o <= 1) return !1; null != this._viewshedPrimitive && x.scene.primitives.remove(this._viewshedPrimitive); var r = Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i), new Cesium.Cartesian3(0, 0, 0), Ti), n = new Cesium.GeometryInstance({ geometry: new Cesium.SphereOutlineGeometry({ radius: o, stackPartitions: 12, slicePartitions: 12 }), modelMatrix: r, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1, 1, 1, .5)) } }), a = (this._viewshedPrimitive = x.scene.primitives.add(new Cesium.Primitive({ geometryInstances: n, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, renderState: { lineWidth: 1 } }), allowPicking: !1, asynchronous: !1 })), new Cesium.Camera(x.scene)); a.position = i, a.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, this ._scratchCartesian3), this._viewshedPrimitive._camera = a } catch (e) { return !1 } return this._viewshedPrimitive }, Vi.prototype.createViewshedCameraPrimitive = function(e, t) { null != this._viewshedPrimitive && x.scene.primitives.remove(this._viewshedPrimitive); var i = new Cesium.Camera(x.scene); if (this._startPositionCartesian || e) return i.position = null != e ? e : this._startPositionCartesian, null == this._viewshedDirection || isNaN(this._viewshedDirection.x) || isNaN(this ._viewshedDirection.y) || (i.direction = this._viewshedDirection.clone(), i.up = x.scene .globe.ellipsoid.geodeticSurfaceNormal(i.position, Ci)), i.frustum.isViewshed = !0, i .frustum.fov = Cesium.defaultValue(this._currentObject.viewshedObjOptions.fov, _i), i.frustum ._fovy = Cesium.defaultValue(this._currentObject.viewshedObjOptions.fovy, fi), i.frustum .aspectRatio = Math.tan(i.frustum.fov / 2) / Math.tan(i.frustum._fovy / 2), i.frustum.near = 1, !(this._currentRadius <= 1) && (i.frustum.far = Cesium.defaultValue(this._currentObject .viewshedObjOptions.distance, this._currentRadius), this._viewshedPrimitive = x.scene .primitives.add(new Cesium.DebugCameraPrimitive({ camera: t || i, color: this._primitiveColor })), this._viewshedPrimitive._numFrustrums = 0, this._viewshedPrimitive ._outlineOnlyFrustum = !0, this._viewshedPrimitive.update = this.updateViewshedPrimitive, this._viewshedPrimitive) }, Vi.prototype.createViewshedMap = function() { null == x.scene.viewsheds && x.scene.viewsheds, null != this._viewshedPrimitive._camera && this ._canEnlarge && (null == this._viewshedMap ? (this._viewshedMap = new Cesium.ShadowMap({ context: x.scene.context, lightCamera: this._viewshedPrimitive._camera, enabled: 1, isSpotLight: !0, fromLightSource: !0, softShadows: !1, isPointLight: this._isSpherical, pointLightRadius: Cesium.defaultValue(this._currentObject.viewshedObjOptions .distance, this._currentRadius) }), this._viewshedMap.show = !0, this._viewshedMap.isPreviewMode = !0, this._viewshedMap .guid = "SamplerViewshed", this._viewshedMap) : (this._viewshedMap._lightCamera.direction = this._viewshedPrimitive._camera.direction, this._viewshedMap._lightCamera.frustum.far = Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance, this._currentRadius))) }, Vi.prototype.updateViewshedPrimitive = function(e) { if (this.show) { if (this._updateOnChange && (this._outlinePrimitive = this._outlinePrimitive && this ._outlinePrimitive.destroy()), !Cesium.defined(this._outlinePrimitive)) { for (var t, i, o = this._camera, r = o.frustum, n = e.frustumSplits, a = n.length - 1, s = ((a = this._numFrustrums) <= 0 && ((n = Oi)[0] = this._camera.frustum.near, n[1] = this._camera.frustum.far, a = 1), this._camera.viewMatrix), l = (Cesium.defined(o .frustum.fovy) ? (o = this._camera.frustum.projectionMatrix, o = Cesium.Matrix4 .multiply(o, s, Ti), i = Cesium.Matrix4.inverse(o, Ti)) : t = Cesium.Matrix4 .inverseTransformation(s, Ti), new Float64Array(12 * (a + 1) + 3)), u = 0; u < a + 1; ++ u) for (var c = 0; c < 4; ++c) { var h, m, d = Cesium.Cartesian4.clone(Si[c], Vi[c]); Cesium.defined(i) ? (m = 1 / (d = Cesium.Matrix4.multiplyByVector(i, d, d)).w, Cesium .Cartesian3.multiplyByScalar(d, m, d), Cesium.Cartesian3.subtract(d, this ._camera.positionWC, d), Cesium.Cartesian3.normalize(d, d), m = Cesium .Cartesian3.dot(this._camera.directionWC, d), Cesium.Cartesian3 .multiplyByScalar(d, n[u] / m, d), Cesium.Cartesian3.add(d, this._camera .positionWC, d)) : (Cesium.defined(r._offCenterFrustum) && (r = r ._offCenterFrustum), m = u === a ? (h = n[u - 1], n[u]) : (h = n[u], n[u + 1]), d.x = .5 * (d.x * (r.right - r.left) + r.left + r.right), d.y = .5 * (d .y * (r.top - r.bottom) + r.bottom + r.top), d.z = .5 * (d.z * (h - m) - h - m), d.w = 1, Cesium.Matrix4.multiplyByVector(t, d, d)), l[12 * u + 3 * c] = d.x, l[12 * u + 3 * c + 1] = d.y, l[12 * u + 3 * c + 2] = d.z } l[12 * a + 12] = this._camera.positionWC.x, l[12 * a + 12 + 1] = this._camera.positionWC.y, l[ 12 * a + 12 + 2] = this._camera.positionWC.z; o = new Cesium.BoundingSphere.fromVertices(l), s = new Cesium.GeometryAttributes; s.position = new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: l }); var p, g, _ = new Uint16Array(8 * (2 * a + 1 + 1)); for (u = 0; u < a + 1; ++u) _[p = 8 * u] = g = 4 * u, _[p + 1] = g + 1, _[p + 2] = g + 1, _[p + 3] = g + 2, _[p + 4] = g + 2, _[p + 5] = g + 3, _[p + 6] = g + 3, _[p + 7] = g; for (u = 0; u < a; ++u) _[p = 8 * (a + 1 + u)] = g = 4 * u, _[p + 1] = g + 4, _[p + 2] = g + 1, _[p + 3] = g + 5, _[p + 4] = g + 2, _[p + 5] = g + 6, _[p + 6] = g + 3, _[p + 7] = g + 7; _[p += 8] = g + 8, _[p + 1] = g + 1, _[p + 2] = g + 8, _[p + 3] = g + 2, _[p + 4] = g + 8, _[p + 5] = g + 3, _[p + 6] = g + 8, _[p + 7] = g + 4, this._outlinePrimitive = new Cesium .Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: { attributes: s, indices: _, primitiveType: Cesium.PrimitiveType.LINES, boundingSphere: o }, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(this._color) }, id: this.id, pickPrimitive: this }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0 }), asynchronous: !1 }) } this._outlinePrimitive.isViewshedPart = !0, this._outlinePrimitive.update(e) } }, Vi.prototype.getHorizonDistance = function(e) { return Math.sqrt(Math.pow(yi + e, 2) - Math.pow(yi, 2)) }, Vi.prototype.onPreFrame = function(e) { var t, i, o, r; null != this._currentObject && null != this._currentObject.viewshedPrimitive && null != this ._currentObject.viewshedMap && (t = new Cesium.Cartographic.fromCartesian(this._currentObject .viewshedPrimitive._camera.position), i = this.getHorizonDistance(t.height), this ._currentObject.viewshedMap.horizonCullingDistanceFromViewshed = i, i = x.scene.globe.getHeight( t), this._currentObject.viewshedMap.isBelowGround = t.height < i + .5), null != this ._currentObject && this._currentObject.viewshedMap, null != this._newPosition && this.toPreviewMode( this._currentObject), this._canEnlarge && null != this._currentRadius && this._prevRadius != this._currentRadius ? (this._prevRadius = this._currentRadius, (this._isSpherical ? this .createViewshedSpherePrimitive() : this.createViewshedCameraPrimitive()) && this .createViewshedMap()) : null != this._currentObject && this._setNewPosition && null != this ._mousePositionX && null != this._mousePositionY && (this.getPosXAndY(), this._currentObject .viewshedObjOptions.isSpherical ? (this._currentObject.viewshedMap._lightCamera.position = this ._newPosition, this._currentObject.viewshedPrimitive = this.createViewshedSpherePrimitive( this._newPosition, this._currentObject.distance)) : (this.checkIfMouseOnPosition(), null != this._newPosition && (this._currentObject.viewshedObjOptions.altitudeMethod == vi .ABOVE_GROUND_LEVEL && null == this._zAxisNewPosition ? (o = Cesium.Cartographic .fromCartesian(this._newPosition.clone()), r = Cesium.Cartesian3.fromRadians(o .longitude, o.latitude, x.scene.globe.getHeight(o) + this._currentObject .startingAltitudeAboveGround), this._currentObject.viewshedPrimitive._camera .position = r) : this._currentObject.viewshedObjOptions.altitudeMethod == vi .ABOVE_MODEL && null == this._zAxisNewPosition ? (o = Cesium.Cartographic.fromCartesian( this._newPosition.clone()), r = Cesium.Cartesian3.fromRadians(o.longitude, o .latitude, o.height + this._currentObject.startingAltitudeAboveModel), this ._currentObject.viewshedPrimitive._camera.position = r) : this._currentObject .viewshedPrimitive._camera.position = this._newPosition, this.adjustDirections()))) }, Vi.prototype.onPreFrameMobile = function(e) { var t, i, o, r; null != this._currentObject && null != this._currentObject.viewshedPrimitive && null != this ._currentObject.viewshedMap && (t = new Cesium.Cartographic.fromCartesian(this._currentObject .viewshedPrimitive._camera.position), i = this.getHorizonDistance(t.height), this ._currentObject.viewshedMap.horizonCullingDistanceFromViewshed = i, i = x.scene.globe.getHeight( t), this._currentObject.viewshedMap.isBelowGround = t.height < i + .5), null != this ._currentObject && this._currentObject.viewshedMap, null != this._newPosition && this.toPreviewMode( this._currentObject), this._canEnlarge && null != this._currentRadius ? (this._prevRadius = this ._currentRadius, (this._isSpherical ? this.createViewshedSpherePrimitive() : this .createViewshedCameraPrimitive()) && this.createViewshedMap()) : null != this ._currentObject && this._setNewPosition && null != this._mousePositionX && null != this ._mousePositionY && (this.getPosXAndY(), this._currentObject.viewshedObjOptions.isSpherical ? (this ._currentObject.viewshedMap._lightCamera.position = this._newPosition, this._currentObject .viewshedPrimitive = this.createViewshedSpherePrimitive(this._newPosition, this ._currentObject.distance)) : (this.checkIfMouseOnPosition(), null != this ._newPosition && (this._currentObject.viewshedObjOptions.altitudeMethod == vi .ABOVE_GROUND_LEVEL && null == this._zAxisNewPosition ? (o = Cesium.Cartographic .fromCartesian(this._newPosition.clone()), r = Cesium.Cartesian3.fromRadians(o .longitude, o.latitude, x.scene.globe.getHeight(o) + this._currentObject .startingAltitudeAboveGround), this._currentObject.viewshedPrimitive._camera .position = r) : this._currentObject.viewshedObjOptions.altitudeMethod == vi .ABOVE_MODEL && null == this._zAxisNewPosition ? (o = Cesium.Cartographic.fromCartesian( this._newPosition.clone()), r = Cesium.Cartesian3.fromRadians(o.longitude, o .latitude, o.height + this._currentObject.startingAltitudeAboveModel), this ._currentObject.viewshedPrimitive._camera.position = r) : this._currentObject .viewshedPrimitive._camera.position = this._newPosition, this.adjustDirections()))) }, ki.prototype.createSkylineAnalysis = function(e) { this.clear(); var e = { color: e.color || "#ff0000", scale: e.scale || 1 }, t = Cesium.Color.fromCssColorString(e.color); let i = Viewer.scene.postProcessStages; var o = Cesium.createGuid(), o = new Cesium.PostProcessStage({ name: "czm_edge_detection_" + o, fragmentShader: "uniform sampler2D depthTexture;\n uniform float length;\n uniform vec4 color;\n varying vec2 v_textureCoordinates;\n void main(void)\n {\n float directions[3];\n directions[0] = -1.0;\n directions[1] = 0.0;\n directions[2] = 1.0;\n float scalars[3];\n scalars[0] = 3.0;\n scalars[1] = 10.0;\n scalars[2] = 3.0;\n float padx = czm_pixelRatio / czm_viewport.z;\n float pady = czm_pixelRatio / czm_viewport.w;\n float horizEdge = 0.0;\n float vertEdge = 0.0;\n for (int i = 0; i < 3; ++i)\n {\n float dir = directions[i];\n float scale = scalars[i];\n horizEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\n horizEdge += texture2D(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\n vertEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\n vertEdge += texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\n }\n float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\n gl_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\n }\n ", uniforms: { length: .25, color: Cesium.Color.clone(Cesium.Color.BLACK) } }), r = new Cesium.PostProcessStage({ name: "czm_skylinetemp", fragmentShader: "uniform sampler2D colorTexture;uniform sampler2D depthTexture;varying vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){gl_FragColor = color;}else{gl_FragColor = vec4(1.0,0.0,0.0,1.0);}}" }), n = new Cesium.PostProcessStage({ name: "czm_skylinetemp1", fragmentShader: "uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;varying vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture2D(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0&&silhouetteColor.a>0.0){gl_FragColor = vec4(1.0,0.0,0.0,1.0);}else{gl_FragColor = vec4(0.0,0.0,0.0,1.0);;}}", uniforms: { redTexture: r.name, silhouetteTexture: o.name, length: .25 } }), t = new Cesium.PostProcessStage({ name: "czm_skylinebold", fragmentShader: "uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform float scale;uniform vec4 skylineColor;varying vec2 v_textureCoordinates;void main(void){float padx = czm_pixelRatio / czm_viewport.z;float pady = czm_pixelRatio / czm_viewport.w;vec4 color = texture2D(colorTexture, v_textureCoordinates);gl_FragColor = color;float scaleB = 3.0;int search = 0;for(float i=0.0;i<10.0;i++){for(float j=0.0;j<10.0;j++){vec2 redCoordi = v_textureCoordinates + vec2(i*padx,j*pady);vec4 redcolor=texture2D(redTexture, redCoordi);if(redcolor.r == 1.0){gl_FragColor = skylineColor;search = 1;break;}if(j>=scale)break;}if(i>=scale||search>0)break;}}", uniforms: { redTexture: n.name, skylineColor: t, scale: e.scale } }); this.postProccessStage = new Cesium.PostProcessStageComposite({ name: "czm_skyline", stages: [o, r, n, t], inputPreviousStageTexture: !1, uniforms: o.uniforms }), i.add(this.postProccessStage) }, ki.prototype.clear = function() { this.postProccessStage && this._viewer.scene.postProcessStages.remove(this.postProccessStage) }; const Gi = ` vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1) const float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1) const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; // tidy overflow return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } // NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { return linearClipZ * ( near - far ) - near; } // NOTE: https://twitter.com/gonnavis/status/1377183786949959682 float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); } `, Ni = "uniform sampler2D czm_selectedIdTexture; \nuniform float czm_selectedIdTextureStep; \nuniform float czm_selectedIdTextureWidth; \nbool czm_selected(vec4 id) \n{ \n bool selected = false;\n for (int i = 0; i < 1024000; i++) \n { \n vec4 selectedId = texture2D(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \n if (all(equal(id, selectedId))) \n { \n return true; \n } \n if(float(i)>czm_selectedIdTextureWidth)break;\n } \n return false; \n} \n\n"; function Bi(e) { const { defaultValue: r, BoundingRectangle: i, Pass: F, Sampler: n, DrawCommand: G, Color: h, ShaderSource: v, defined: C, ClearCommand: t, RenderState: m, Texture: d, PixelDatatype: a, PixelFormat: s, Framebuffer: N } = Cesium; this._selectedIdTexture = null; let { name: B, vertexShader: w, fragmentShader: b, uniforms: p, renderStateProcess: g, beforeUpdate: _, renderType: f, textureScale: o, pixelFormat: j, pixelDatatype: z, sampler: U, viewportScale: l, shaderRedefine: T, overrideViewport: u } = e, S = "renderPass_" + B.replace(/[\.\\\/\-]/g, "_"), P = `czm_non_${S}_main`, E = `czm_${S}_main`, y = "_cache_" + S, x = S + "Command", I = null, c = null, D = null, L = null, M, A = new t({ color: h.TRANSPARENT, depth: 1 }), R = new i, O = this; if (u && i.clone(u, R), T = T || "add", f = f || "all", (o = o || 1) < 0 || 8 < o) throw new Cesium .DeveloperError("CesiumRenderPass:textureScale必须大于0小于等于8"); function W(t, i, o, r) { var n = t.shaderCache.getDerivedShaderProgram(i, S); if (!C(n)) { var a = i._attributeLocations, s = i.fragmentShaderSource, l = i.vertexShaderSource, u = i._vertexShaderText, c = (y = s.sources).length; let e = !!L && function() { if (L) { var e = L.selected || L.parentSelected; if (e.length) return e } }(); var h = Ni, m = /texture2D\s?\(\s?tile_pickTexture\s?,\s?tile_featureSt\s?\)/.test(o), o = (h += "varying" != r || m ? ` bool czm_selected(){ return czm_selected(${o}); }` : ` varying float me_isSelected; bool czm_selected(){ bool isSelected= me_isSelected>0.0000001; if(!isSelected){ isSelected= czm_selected(${o}); } return isSelected; } `, Ni + ` varying float me_isSelected; bool czm_selected(){ return czm_selected(${o}); } `), d = !1, p = !1; if (/attribute\s?vec3\s?normal\s?;/.test(u) || /\n\s?vec3\s?normal\s?;/.test(u) ? d = !0 : /varying\s?vec3\s?v_normal\s?;/.test(u) && (p = !0), b) { var g = !1; for (f = 0; f < c; ++f) if (/vec4\s?packDepthToRGBA\s?\(/.test(y[f])) { g = !0; break } for (var u = (g ? "" : Gi) + (e ? h : "") + v.replaceMain(b, E) + "void main() \n{ \n" + ( "replace" != T ? ` ${P}(); ` : "") + ` ${E}(); ` + "} \n", _ = new Array(c + 1), f = 0; f < c; ++f) _[f] = v.replaceMain(y[f], P); _[c] = u, d ? s.defines.push("HAS_NORMAL") : p && s.defines.push("HAS_V_NORMAL"), s = new v({ sources: _, defines: s.defines }) } if (w || b) { var y, c = (y = l.sources).length, g = !1; for (f = 0; f < c; ++f) if (/vec4\s?packDepthToRGBA\s?\(/.test(y[f])) { g = !0; break } e = e && "varying" == r && !m, d ? l.defines.push("HAS_NORMAL") : p && l.defines.push( "HAS_V_NORMAL"); for (h = (g ? "" : Gi) + (e ? o : "") + v.replaceMain(w || "void main(){}", E) + "void main() \n{ \n" + ("replace" != T ? ` ${P}(); ` : "") + (e ? " me_isSelected=czm_selected()?1.:0.;\n" : "") + ` ${E}(); ` + "} \n", _ = new Array(c + 1), f = 0; f < c; ++f) _[f] = v.replaceMain(y[f], P); _[c] = h, l = new v({ sources: _, defines: l.defines }) } n = t.shaderCache.createDerivedShaderProgram(i, S, { vertexShaderSource: l, fragmentShaderSource: s, attributeLocations: a }) } return n } function Y(t, i, o) { let r = t; var n, a, s = i._frameState, l = t.derivedCommands; if (C(l)) { let e = (l = (t = s.useLogDepth && C(l.logDepth) ? l.logDepth.command : t).derivedCommands) .renderPass; C(l.renderPass) || (e = l.renderPass = {}), C(e[x]) && (n = e[x].shaderProgram, a = e[x] .renderState), e[x] = G.shallowClone(t, e[x]), C(n) && e.shaderProgramId === t.shaderProgram .id ? (e[x].shaderProgram = n, e[x].renderState = a) : (s = t.shaderProgram, l = r ._pickIdQualifier = new RegExp("uniform\\s?vec4\\s?" + t.pickId, "g").test(s ._fragmentShaderText) ? "uniform" : "varying", e[x].shaderProgram = W(o, s, t.pickId, l), e[x].renderState = (n = i, a = t.renderState, n._renderPassCache = n._renderPassCache || {}, n._renderPassCache[y] = n._renderPassCache[y] || {}, o = (n = n._renderPassCache[ y])[a.id], C(o) || (s = m.getState(a), "function" == typeof g && g.call(O, s), o = m .fromCache(s), n[a.id] = o), o), e.shaderProgramId = t.shaderProgram.id); var u, c = e[x].uniformMap; if (!c.__created && (c.czm_selectedIdTexture = function() { return L._selectedIdTexture }, c.czm_selectedIdTextureWidth = function() { return L._selectedIdTexture ? L._selectedIdTexture.width : 0 }, c.czm_selectedIdTextureStep = function() { return L._selectedIdTexture ? 1 / L._selectedIdTexture.width : -1 }, p)) for (var h in c.__created = !0, p) p.hasOwnProperty(h) && ("function" != typeof p[h] ? c[h] = function(t) { return function() { var e = p[t]; return "function" == typeof e ? e() : e } }(h) : c[h] = p[h], ("string" == typeof(u = c[h]()) || u instanceof d || u instanceof HTMLImageElement || u instanceof HTMLCanvasElement || u instanceof HTMLVideoElement) && (c[h + "Dimensions"] = function(t, i) { return function() { var e = t[i](); if (C(e)) return e.dimensions } }(c, h))) } } function H(e, t, i) { var o = t.width, t = t.height; c && c.width === o && c.height === t && i === M || (M = i, c && (c.destroy(), I.destroy(), I = void 0, c = void 0), D && (D.destroy(), D = void 0), c = new d({ context: e, width: o, height: t, pixelFormat: r(j, s.RGBA), pixelDatatype: r(z, a.FLOAT), sampler: r(U, n.NEAREST) }), D = new d({ context: e, width: o, height: t, pixelFormat: s.DEPTH_COMPONENT, pixelDatatype: a.UNSIGNED_SHORT, sampler: n.NEAREST }), I = new N({ colorTextures: [c], context: e, destroyAttachments: !1, depthTexture: D })) } function V(e) { u || (R = i.clone(e.viewport, R), l ? (R.x = R.width * l.x, R.y = R.height * l.y, R.width *= l.width, R .height *= l.height) : (R.width *= o, R.height *= o)); let t = Object.assign({}, e.passState); return t.viewport = R, t } function k(e, t) { var i = e._us._frameState.camera._scene, o = i._view; try { if (w || b) { for (var r, n = V(o), a = ("function" == typeof _ && _.call(O, i, t), H(e, R, i.hdr, o .sceneFramebuffer), i), s = a._view.frustumCommandsList, l = s.length, u = 0; u < l; ++ u) for (var c = s[l - u - 1], h = 0; h < c.commands.length; h++) { var m = c.commands[h], d = c.indices[h]; if (!L || h != F.GLOBE) for (r = 0; r < d; ++r) Y(m[r], a, a._context) } Fi(e, I, n, "renderPass", x, "all" != f && L && L._selectedIdTexture ? Q : null) } else { var p = V(o); "function" == typeof _ && _.call(O, i, t), H(e, R, i.hdr, o.sceneFramebuffer), Fi(e, I, p) } } catch (e) { console.error(e) } } function Q(e, t) { var i = L && (L.selected || L.parentSelected); if (!L || !i || !i.length) return !1; if (!e.pickId || "uniform" != e._pickIdQualifier) return !0; let o = !0, r = e.owner; var n = "selected" == f; if (r && r.isObject3D) { for (let e = 0; e < i.length; e++) if (i[e] == r) return n; return !n } let a = e.uniformMap; if (a[e.pickId]) { var s = a[e.pickId](); o = !n; for (let e = 0; e < i.length; e++) { var l = i[e], u = l.pickId ? [l.pickId] : l.pickIds || l._pickIds; for (let e = 0; e < u.length; e++) { var c = u[e]; if (c.color == s || h.equals(c.color, s)) return n } } } return o } function q(e) { var t; I && (t = e._us._frameState.camera._scene._view, A.framebuffer = I, A.execute(e, t.passState), A .framebuffer = void 0) } this.update = k, this.clear = q, Object.defineProperties(this, { texture: { get() { return c } }, depthTexture: { get() { return D } }, stage: { get() { return L }, set(e) { if (L != e) if (L && O.prevStageUpdate && (L.update = O.prevStageUpdate, O.prevStageUpdate = null, O.prevStageExecute = null), L = e) { let o = L.update; O.prevStageUpdate = o, L.update = function(e, t) { var i; q(e), o.call(L, e, t), L.enabled && (!w && !b || (i = L.selected || L.parentSelected) && i.length) && k(e, t) } } } } }) } function ji(e) { this._viewer = e, this._core = new f } function zi(e, t) { this._viewer = e, this._cesium = t, this._scene = e.scene, this._core = new f, this._getPosition = new et(e, t), this.num = 100, this.buffs = [], this.tooltip = this._core.CreateTooltip() } function Ui(e, t) { this._viewer = e, this._cesium = t, this._scene = e.scene, this._core = new f, this.tooltip = this._core .CreateTooltip(), this._getPosition = new et(e, t), this.FlattenIsDraw = !1, this.wallArr = [], this .heightsort = [], this.FlattenPolygon = [], this.showWall = !0, this.deepth = 100, this.bottomImg = window.SmartEarthRootUrl + D.bottomplane, this.wallImg = window.SmartEarthRootUrl + D.wall } function Wi(e, t) { this._viewer = e, this._cesium = t, this._scene = e.scene, this._core = new f, this.currentSpeed = "1x", this.currentTime = null, this.currentPlayMode = "1", this.timer = null } function Yi(e, t) { this._viewer = e, this._cesium = t } function Qi(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._getPosition = new et(e, t) } function qi(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._getPosition = new et(this ._viewer, this._cesium), this.tooltip = this._core.CreateTooltip(), this.sunshineOption = {}, this .loadingImg = window.SmartEarthRootUrl + D.loading } function I(e) { this._viewer = e, this._cesium = Cesium, this._core = new f, this._tree = V, this._color = new m(this ._viewer, this._cesium), this.modelEditData = { lon: 0, lat: 0, height: 0, scale: 1, r_x: 0, r_y: 0, r_z: 0, rotate: !1, rootTransform: void 0 } } function Ji(e) { this._viewer = e } function L(e, t) { this._viewer = e, this._cesium = t, this._measureTerrainPerimeter = new K(this._viewer, this._cesium), this ._measureTerrainHeight = new Z(this._viewer, this._cesium), this._measureTerrainArea = new oe(this ._viewer, this._cesium), this._measureTerrainkPerimeter = new re(this._viewer, this._cesium), this ._elevationContour = new ye(this._viewer, this._cesium), this._createTerrainProfile = new ve(this ._viewer, this._cesium), this._createterrainExaggeration = new Qt(this._viewer, this._cesium), this ._createcurtaincontrast = new qt(this._viewer, this._cesium), this._createindoormode = new Zt(this ._viewer, this._cesium), this._createWeather = new hi(this._viewer, this._cesium), this ._UndergroundMode = new di(this._viewer, this._cesium), this._StreetView = new gi(this._viewer, this ._cesium), this._depthTestAgainstTerrain = new Di(this._viewer, this._cesium), this ._create3DViewshed = new Vi(this._viewer, this._cesium), this._skylineAnalysis = new ki(this._viewer, this._cesium), this._EdgeStage = new ji(this._viewer, this._cesium), this._bufferAnalysis = new zi( this._viewer, this._cesium), this._shadowsAnalysis = new Wi(this._viewer, this._cesium), this ._screenshot = new Yi(this._viewer, this._cesium), this._PointFly = new Qi(this._viewer, this._cesium), this._SunshineAnalysis = new qi(this._viewer, this._cesium) } function Xi(e, t) { this._viewer = e, this._cesium = t } function Ki(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function $i(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._points = [], this._xjwz = null, this._polygonsd = [], this._rectangle = null } function M(e, t) { this._viewer = e, this._cesium = t, this._Color = new m(this._viewer, this._cesium), this._core = new f, this._getPosition = new et(this._viewer, this._cesium), this._tree = V, this._points = [], this ._polylines = [] } function A(e, t) { this._viewer = e, this._cesium = t, this._Color = new m(this._viewer, this._cesium), this._core = new f, this._getPosition = new et(this._viewer, this._cesium), this._tree = V, this._points = [], this._lable = null, this._entity = null, this.polygon1, this.id = "0", this.curCanvas = "a" } function R(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function Zi(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function O(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._viewEvent = null, this .positions = [], this._getPosition = new et(this._viewer, this._cesium), this.objId = Number((new Date) .getTime() + "" + Number(1e3 * Math.random()).toFixed(0)), this.handler = new this._cesium .ScreenSpaceEventHandler(this._viewer.scene.canvas), this.modifyHandler = new this._cesium .ScreenSpaceEventHandler(this._viewer.scene.canvas), this.style = null, this.state = 0, this .gonRectangleArr = [] } function H(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._getPosition = new et(this._viewer, this ._cesium), this._tree = V, this._postion = { Altitude: 0, AltitudeType: 0, Cartesian: !0, Distance: 0, Pitch: 0, Roll: 0, X: 0, Y: 0, Yaw: 0 }, this.positions = [], this.objId = Number((new Date).getTime() + "" + Number(1e3 * Math.random()) .toFixed(0)), this.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.modifyHandler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.style = null, this.state = 0, this.gonCircleArr = [], this.radius = 0 } function k(e, t) { this.objId = Number((new Date).getTime() + "" + Number(1e3 * Math.random()).toFixed(0)), this._viewer = e, this._cesium = t, this._core = new f, this._getPosition = new et(this._viewer, this._cesium), this ._tree = V, this.modifyPoint = null, this._color = new m(this._viewer, this._cesium), this.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.modifyHandler = new this ._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this._position = void 0, this._points = [], this._listeners = {}, this._point = null } function F(e, t) { this._viewer = e, this._cesium = t, this._tree = V, this._core = new f, this._Color = new m(this._viewer, this._cesium), this._postion = { Altitude: 0, AltitudeType: 0, Cartesian: !0, Distance: 0, Pitch: 0, Roll: 0, X: 0, Y: 0, Yaw: 0 } } function G(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._getPosition = new et(this._viewer, this ._cesium), this._tree = V, this._entityFly = null } ji.prototype.createEdgeStage = function(e = {}) { this.clear(); var t = "OutlineEffect"; const { PostProcessStage: i, PostProcessStageComposite: o, Sampler: r, TextureMagnificationFilter: n, TextureMinificationFilter: a } = Cesium; let s = this._core.defaultValue(e.width, 2), l = this._core.defaultValue(e.thresholdAngle, 10) * Math.PI / 180, u = !1, c = !1, h = Cesium.Color.fromCssColorString(e.visibleColor || "#00a8e0"), m = Cesium.Color.fromCssColorString(e.hiddenColor || "#4d4d4d"), d = this._core.defaultValue(e.showGlow, !0), p = this._core.defaultValue(e.edgeGlow, 1), g = 3, _ = !1, f = new Bi({ name: t + "Pass", vertexShader: ` varying vec3 vOutlineNormal; void main(){ #ifdef HAS_NORMAL vOutlineNormal = normal; #else #ifdef HAS_V_NORMAL vOutlineNormal = v_normal; #else vOutlineNormal=vec3(0.); #endif #endif } `, fragmentShader: ` varying vec3 vOutlineNormal; void main(){ // if(!czm_selected())discard; if(length(vOutlineNormal)>0.)gl_FragColor=vec4( vOutlineNormal ,gl_FragColor.a); } `, sampler: new r({ minificationFilter: a.LINEAR, magnificationFilter: n.LINEAR }), renderType: "all" }); var e = new i({ name: t + "Mask", uniforms: { outlineWidth() { return s }, devicePixelRatio: devicePixelRatio, thresholdAngle: function() { return l }, useSingleColor: function() { return u }, showOutlineOnly: function() { return c }, visibleEdgeColor: function() { return h }, hiddenEdgeColor: function() { return m }, maskTexture() { return f.texture }, maskDepthTexture() { return f.depthTexture } }, fragmentShader: ` uniform sampler2D colorTexture; uniform vec2 colorTextureDimensions; uniform sampler2D depthTexture; uniform sampler2D maskTexture; uniform sampler2D maskDepthTexture; uniform float thresholdAngle; uniform bool showOutlineOnly; uniform float outlineWidth; uniform float devicePixelRatio; uniform vec3 visibleEdgeColor; uniform vec3 hiddenEdgeColor; uniform bool useSingleColor; varying vec2 v_textureCoordinates; float lengthSq(vec3 v){ return v.x * v.x + v.y * v.y + v.z * v.z; } float normal_angleTo(vec3 a,vec3 b){ float denominator = sqrt( lengthSq(a) * lengthSq(b) ); if ( denominator == 0. ) return czm_pi / 2.; float theta = dot(a, b ) / denominator; // clamp, to handle numerical problems return acos( clamp( theta, - 1., 1. ) ); } float compareNormal(vec4 n1,vec4 n2){ if( abs ( normal_angleTo( n1.xyz , n2.xyz ) ) < thresholdAngle ){ return 0.; }else{ return 1.; } } float compareDepth(const in vec2 uv){ float maskDepth = czm_readDepth( maskDepthTexture, uv); float nonDepth = czm_readDepth( depthTexture, uv); return maskDepth>nonDepth?1.:0.; } void main(){ vec2 vUv=v_textureCoordinates; // vec4 color = texture2D( colorTexture, vUv); vec4 maskColor = texture2D( maskTexture, vUv); if( maskColor.a < 0.0001){ // gl_FragColor =color; discard; return; } vec2 invSize = outlineWidth / colorTextureDimensions; vec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize); vec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy); vec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy); vec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw); vec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw); float d; if(showOutlineOnly){ float diff1 = (c1.a - c2.a)*0.5; float diff2 = (c3.a - c4.a)*0.5; d = length( vec2(diff1, diff2) ); } else{ float diff1 = compareNormal(c1,c2)*0.5; float diff2 = compareNormal(c3,c4)*0.5; d = length( vec2(diff1, diff2) ); } if(useSingleColor==false){ float dp1 = compareDepth( vUv + uvOffset.xy); float dp2 = compareDepth( vUv - uvOffset.xy); float dp3 = compareDepth( vUv + uvOffset.yw); float dp4 = compareDepth( vUv - uvOffset.yw); float a1 = min(dp1, dp2); float a2 = min(dp3, dp4); float visibilityFactor = min(a1, a2); vec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor; // gl_FragColor =color+ vec4( edgeColor , 1. ) * vec4(d); gl_FragColor = vec4( edgeColor , 1. ) * vec4(d); //gl_FragColor = vec4( 0.06, 0.9, 1.0 , 1. ) * vec4(d); }else{ // gl_FragColor =color+ vec4( visibleEdgeColor , 1. ) * vec4(d); gl_FragColor = vec4( visibleEdgeColor , 1. ) * vec4(d); //gl_FragColor = vec4( 0.06, 0.9, 1.0 , 1. ) * vec4(d); } } ` }), y = (f.stage = e, this.createBlurStage(t + "Blur1", 4, 1, .75)), v = this.createBlurStage(t + "Blur2", 4, 4, .5), v = new o({ name: t + "BlurComposite", stages: [e, y, v], inputPreviousStageTexture: !0 }), e = new i({ name: t + "Additive", uniforms: { showGlow: function() { return d }, edgeGlow: function() { return p }, edgeStrength: function() { return g }, edgeOnly() { return _ }, maskTexture() { return f.texture }, lineTexture: e.name, edgeTexture1: y.name, edgeTexture2: v.name }, fragmentShader: ` uniform sampler2D colorTexture; uniform sampler2D edgeTexture1; uniform sampler2D edgeTexture2; uniform sampler2D lineTexture; uniform sampler2D maskTexture; uniform bool showGlow; uniform float edgeGlow; uniform bool edgeOnly; uniform float edgeStrength; varying vec2 v_textureCoordinates; void main(){ vec2 vUv =v_textureCoordinates; vec4 edgeColor=texture2D( lineTexture, vUv); vec4 color=texture2D( colorTexture, vUv); float opacity=1.; if(edgeOnly){ vec4 maskColor=texture2D( maskTexture, vUv); opacity=1.-maskColor.a; gl_FragColor = maskColor; return; } if(showGlow){ float visFactor= 1.;//czm_selected()?1.:0.; vec4 edgeValue1 = texture2D(edgeTexture1, vUv); vec4 edgeValue2 = texture2D(edgeTexture2, vUv); vec4 glowColor = edgeValue1 + edgeValue2 * edgeGlow; gl_FragColor = opacity * color + edgeColor + edgeStrength * (1. - edgeColor.r) * glowColor; } else{ gl_FragColor = opacity * color + edgeColor; } } ` }); const C = new o({ name: t + "Composite", stages: [v, e], inputPreviousStageTexture: !1 }); function w(e) { Object.defineProperties(e, { showGlow: { get() { return d }, set(e) { d = e } }, edgeGlow: { get() { return p }, set(e) { p = e } }, edgeStrength: { get() { return g }, set(e) { g = e } }, thresholdAngle: { get() { return l }, set(e) { l = e } }, showOutlineOnly: { get() { return c }, set(e) { c = e } }, edgeOnly: { get() { return _ }, set(e) { _ = e } }, useSingleColor: { get() { return u }, set(e) { u = e } }, outlineWidth: { get() { return s }, set(e) { s = e } }, visibleEdgeColor: { get() { return h }, set(e) { h = e } }, hiddenEdgeColor: { get() { return m }, set(e) { m = e } } }) } return w(C), C._uniforms = C._uniforms || {}, w(C._uniforms), C.selected = [1], C.enabled = !0, this ._viewer.postProcessStages.add(C), this.postProccessStage = C, this }, ji.prototype.createBlurStage = function(e, t, i, o) { const { Cartesian2: r, PostProcessStage: n, PostProcessStageComposite: a, PostProcessStageSampleMode: s } = Cesium; var l = new r(1, 0), u = new r(0, 1), t = { defines: { MAX_RADIUS: t }, fragmentShader: "\n varying vec2 v_textureCoordinates;\n uniform sampler2D colorTexture;\n uniform vec2 colorTextureDimensions;\n uniform vec2 direction;\n uniform float kernelRadius;\n \n float gaussianPdf(in float x, in float sigma) {\n return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n }\n void main() { vec2 vUv=v_textureCoordinates;\n vec2 invSize = 1.0 / colorTextureDimensions; float weightSum = gaussianPdf(0.0, kernelRadius); vec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum; vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS); vec2 uvOffset = delta; for( int i = 1; i <= MAX_RADIUS; i ++ ) { float w = gaussianPdf(uvOffset.x, kernelRadius); vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += ((sample1 + sample2) * w); weightSum += (2.0 * w); uvOffset += delta; } gl_FragColor = diffuseSum/weightSum; }" }, l = (this.parseDefines(t), new n({ name: e + "_x_direction", fragmentShader: t.fragmentShader, textureScale: o, forcePowerOfTwo: !0, uniforms: { kernelRadius: i, direction: l }, sampleMode: s.LINEAR })), t = new n({ name: e + "_y_direction", fragmentShader: t.fragmentShader, textureScale: o, forcePowerOfTwo: !0, uniforms: { kernelRadius: i, direction: u }, sampleMode: s.LINEAR }); return new a({ name: e, stages: [l, t], inputPreviousStageTexture: !0 }) }, ji.prototype.parseDefines = function(e) { let t = []; for (const o in e.defines) { var i; e.defines.hasOwnProperty(o) && (i = e.defines[o], t.push("#define " + o + " " + i)) } return t = t.join("\n") + "\n", e.fragmentShader && (e.fragmentShader = t + e.fragmentShader), e .vertexShader && (e.vertexShader = t + e.vertexShader), e }, ji.prototype.clear = function() { this.postProccessStage && this._viewer.scene.postProcessStages.remove(this.postProccessStage), this .postProccessStage = void 0 }, zi.prototype.changeBurr = function(e) { if (this.num = e, this.this_buff) switch (this.type) { case "point": this.setPointBuff(this.num); break; case "polyline": this.setPolylineBuff(this.num); break; case "polygon": this.setPolygonBuff(this.num) } }, zi.prototype.DrawPoint = function(e, o) { this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = null), this.this_buff && this .this_buff.entity && this._viewer.entities.remove(this.this_buff.entity); var r = this._viewer, n = this._cesium; let t, a; return "number" == typeof e ? (t = e, a = {}) : "object" == typeof e && (a = e, t = a.radius), this .num = t || this.num, this.drawHandler = new n.ScreenSpaceEventHandler(r.scene.canvas), this .this_buff = { entity: null, buff: null }, this.type = "point", this.positions = [], this._core.mouse(this._viewer.container, 1, window .SmartEarthRootUrl + D.draw), this.drawHandler.setInputAction(function(e) { var t, i, e = this._getPosition.getMouseDegrees(e); e && (t = e.lon, i = e.lat, this.positions.push(t, i), this.this_buff.entity = r.entities .add({ name: "新建缓冲点", position: n.Cartesian3.fromDegrees(t, i), point: { pixelSize: 10, color: n.Color.YELLOW, outlineWidth: 3, outlineColor: n.Color.YELLOW.withAlpha(.4), heightReference: 1 } }), this.buffs.push(this.this_buff.entity), this.this_buff.entity = void 0, this .setPointBuff(this.num, a), o && "function" == typeof o && o(e), this.end && this .end()) }.bind(this), n.ScreenSpaceEventType.LEFT_CLICK), this.end = () => { this.tooltip.show(!1), this.drawHandler.destroy(), this._core.mouse(this._viewer.container, 0), this.drawHandler = null, this.end = void 0 }, this.drawHandler.setInputAction(function(e) { this.tooltip.showAt(e.endPosition, "点击绘制点") }.bind(this), n.ScreenSpaceEventType.MOUSE_MOVE), this }, zi.prototype.setPointBuff = function(e, t) { var i = Cesium_turf.point(this.positions), i = this.getBuff(i, e); this.this_buff.buff || (this.this_buff.buff = this.addBufferPolyogn(i, t), this.buffs.push(this .this_buff.buff)) }, zi.prototype.DrawPolyline = function(e, t) { this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = null), this.this_buff && this .this_buff.entity && this._viewer.entities.remove(this.this_buff.entity); var i = this._viewer, o = this._cesium; let r, n; "number" == typeof e ? (r = e, n = {}) : "object" == typeof e && (n = e, r = n.radius), this.num = r || this.num; var a = 0; return this.drawHandler = new o.ScreenSpaceEventHandler(i.scene.canvas), this.this_buff = { entity: null, buff: null }, this.type = "polyline", this.positions = [], this._core.mouse(this._viewer.container, 1, window .SmartEarthRootUrl + D.draw), this.drawHandler.setInputAction(function(e) { var t, e = this._getPosition.getMouseDegrees(e); e && (t = e.lon, e = e.lat, this.positions.push(t, e), 0 === a && (this.positions.push(t, e), this.this_buff.entity = i.entities.add({ name: "新建缓冲线", polyline: { positions: o.Cartesian3.fromDegreesArray(this.positions), width: 2, material: new o.ColorMaterialProperty(o.Color.YELLOW), clampToGround: !0, zIndex: 1 } }), this.this_buff.entity.polyline.positions = new o.CallbackProperty( function() { return o.Cartesian3.fromDegreesArray(this.positions) }.bind(this), !1)), a++) }.bind(this), o.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(function(e) { this.end && this.end() }.bind(this), o.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { return this.tooltip.show(!1), this.drawHandler.destroy(), this._core.mouse(this._viewer .container, 0), this.drawHandler = null, this.end = void 0, "cancel" === e ? (i.entities .remove(this.this_buff.entity), void(this.this_buff = void 0)) : (this.positions .length <= 4 ? (window.layuiLayer && window.layuiLayer.msg("当前点数小于两点,请重新绘制"), i.entities .remove(this.this_buff.entity), this.this_buff = void 0) : (this.positions.pop(), this.positions.pop(), this.this_buff.entity.polyline.positions = o.Cartesian3 .fromDegreesArray(this.positions), this.buffs.push(this.this_buff.entity), this .this_buff.entity = void 0, this.positions = this.degreesArrayToPoints(this .positions), this.setPolylineBuff(this.num, n)), void(t && "function" == typeof t && t(this))) }, this.drawHandler.setInputAction(function(e) { var t; 0 === a ? this.tooltip.showAt(e.endPosition, "点击开始绘制折线") : (1 === a ? this.tooltip.showAt(e .endPosition, "点击绘制折线") : this.tooltip.showAt(e.endPosition, "右击结束绘制"), (e = this._getPosition.getMouseDegrees(e)) && (t = e.lon, e = e.lat, this.positions .splice(this.positions.length - 2, 2), this.positions.push(t, e))) }.bind(this), o.ScreenSpaceEventType.MOUSE_MOVE), this }, zi.prototype.setPolylineBuff = function(e, t) { var i = Cesium_turf.lineString(this.positions), i = this.getBuff(i, e); this.this_buff.buff || (this.this_buff.buff = this.addBufferPolyogn(i, t), this.buffs.push(this .this_buff.buff)) }, zi.prototype.DrawPolygon = function(e, t) { this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = null), this.this_buff && this .this_buff.entity && this._viewer.entities.remove(this.this_buff.entity); var i = this._viewer, o = this._cesium; let r, n; "number" == typeof e ? (r = e, n = {}) : "object" == typeof e && (n = e, r = n.radius), this.num = r || this.num; var a = 0; this.drawHandler = new o.ScreenSpaceEventHandler(i.scene.canvas), this.this_buff = { entity: null, buff: null }, this.type = "polygon", this.positions = []; let s = this; return this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this.drawHandler .setInputAction(function(e) { var t, e = this._getPosition.getMouseDegrees(e); e && (t = e.lon, e = e.lat, this.positions.push(t, e), 0 === a ? (this.positions.push(t, e), this.this_buff.entity = i.entities.add({ name: "临时线", polyline: { positions: new o.CallbackProperty(function() { return o.Cartesian3.fromDegreesArray(s.positions) }, !1), clampToGround: !0, material: new o.ColorMaterialProperty(o.Color.YELLOW.withAlpha(.5)), width: 3 } })) : 1 === a && (this.this_buff.entity && i.entities.remove(this.this_buff .entity), this.this_buff.entity = i.entities.add({ name: "新建缓冲面", polygon: { hierarchy: new o.PolygonHierarchy(o.Cartesian3.fromDegreesArray(this .positions)), material: new o.ColorMaterialProperty(o.Color.YELLOW.withAlpha(.5)), zIndex: 1 } }), this.this_buff.entity.polygon.hierarchy = new o.CallbackProperty( function() { return new o.PolygonHierarchy(o.Cartesian3.fromDegreesArray(this .positions)) }.bind(this), !1)), a++) }.bind(this), o.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(function(e) { this.end && this.end() }.bind(this), o.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => (this.tooltip.show(!1), this .drawHandler.destroy(), this._core.mouse(this._viewer.container, 0), this.drawHandler = null, this.end = void 0, "cancel" === e ? (i.entities.remove(this.this_buff.entity), void(this .this_buff = void 0)) : (this.positions.length <= 6 ? (window.layuiLayer && window .layuiLayer.msg("当前点数小于三点,请重新绘制"), i.entities.remove(this.this_buff.entity), this .this_buff = void 0) : (this.positions.pop(), this.positions.pop(), this.this_buff .entity.polygon.hierarchy = o.Cartesian3.fromDegreesArray(this.positions), this.buffs .push(this.this_buff.entity), this.this_buff.entity = void 0, this.positions = this .degreesArrayToPoints(this.positions), this.positions.push(this.positions[0]), this .setPolygonBuff(this.num, n)), void(t && "function" == typeof t && t(this)))), this .drawHandler.setInputAction(function(e) { var t; 0 === a ? this.tooltip.showAt(e.endPosition, "点击开始绘制多边形") : (a < 3 ? this.tooltip.showAt(e .endPosition, "点击绘制多边形") : this.tooltip.showAt(e.endPosition, "右击结束绘制"), (e = this._getPosition.getMouseDegrees(e)) && (t = e.lon, e = e.lat, this.positions .splice(this.positions.length - 2, 2), this.positions.push(t, e))) }.bind(this), o.ScreenSpaceEventType.MOUSE_MOVE), this }, zi.prototype.setPolygonBuff = function(e, t) { var i = Cesium_turf.polygon([this.positions]), i = this.getBuff(i, e); this.this_buff.buff || (this.this_buff.buff = this.addBufferPolyogn(i, t), this.buffs.push(this .this_buff.buff)) }, zi.prototype.getBuff = function(e, t, i = {}) { var o = Cesium_turf.buffer(e, t, { units: "meters", ...i }).geometry.coordinates, r = this.pointsToDegreesArray(o[0]); let n = { positions: Cesium.Cartesian3.fromDegreesArray(r) }; if (1 < o.length) { n.holes = []; for (let e = 1, t; e < o.length; e++) r = this.pointsToDegreesArray(o[e]), t = Cesium.Cartesian3 .fromDegreesArray(r), n.holes.push(t) } return n }, zi.prototype.pointsToDegreesArray = function(e) { let t = []; return e.map(e => { t.push(e[0]), t.push(e[1]) }), t }, zi.prototype.degreesArrayToPoints = function(t) { let i = []; for (let e = 0; e < t.length - 1; e += 2) i.push([t[e], t[e + 1]]); return i }, zi.prototype.addBufferPolyogn = function(e, t = {}) { let i, o; return i = e.positions, e.holes && (o = [], e.holes.forEach(e => { o.push(new Cesium.PolygonHierarchy(e)) })), this._viewer.entities.add({ polygon: { hierarchy: new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(i, o) }, !1), material: Cesium.Color.RED.withAlpha(.6), outline: !0, outlineColor: Cesium.Color.YELLOW, outlineWidth: 10, zIndex: 0, ...t } }) }, zi.prototype.clearBuff = function() { var t = this._viewer; 0 < this.buffs.length && (this.buffs.forEach(function(e) { t.entities.remove(e) }), this.buffs.length = 0) }, Ui.prototype.draw = function(e = 100, i = {}, o) { if (!this.FlattenIsDraw) { if (this.deepth = e || this.deepth, this.showWall = this._core.defaultValue(i.showWall, !0), i .positions) return this.create(i.positions), "function" == typeof o && o(), this; this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = null), this.FlattenIsDraw = !0; var r, n, a = this._viewer, s = this._cesium, l = (this.clear(), []), u = [], c = 0, h = (this.drawHandler = new s.ScreenSpaceEventHandler(a.scene.canvas), this.tooltip); let t; return this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this .drawHandler.setInputAction(e => { n = this._getPosition.getMousePosition(e.position); e = this._core.toDegrees(n); l.push(n), u.push(e.lon, e.lat, e.height), 0 === c ? (l.push(n), u.push(e.lon, e.lat, e .height), t = a.entities.add({ name: "临时线", polyline: { positions: new s.CallbackProperty(() => l, !1), clampToGround: !0, material: new s.ColorMaterialProperty(s.Color.YELLOW.withAlpha(.3)), width: 3 } })) : 1 === c && (t && a.entities.remove(t), r = a.entities.add({ name: null, polygon: { hierarchy: new s.CallbackProperty(function() { return new s.PolygonHierarchy(s.Cartesian3 .fromDegreesArrayHeights(u)) }, !1), material: s.Color.YELLOW.withAlpha(.3) } })), c++ }, s.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { 0 === c ? h.showAt(e.endPosition, "左键点击开始绘制点") : (1 === c ? h.showAt(e.endPosition, "点击添加第二个点") : h.showAt(e.endPosition, "右键结束绘制"), n = this._getPosition .getMousePosition(e.endPosition), e = this._core.toDegrees(n), u.splice(u .length - 3, 3), l.splice(l.length - 1, 1), l.push(n), u.push(e.lon, e.lat, e.height)) }, s.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(function(e) { this.end && this.end() }.bind(this), s.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { h.show(!1), this._core.mouse(this._viewer.container, 0), this.drawHandler.destroy(), this .drawHandler = null, t && a.entities.remove(t), r && a.entities.remove(r), this .FlattenIsDraw = !1, this.end = void 0, "cancel" === e || l.length < 3 || (c < 2 ? c = 0 : (c = 0, this.create(u), "function" == typeof o && o(u))) }, this } }, Ui.prototype.create = function(t) { let i = Cesium.Cartesian3.fromDegreesArrayHeights(t); if (this.boundingSphere = Cesium.BoundingSphere.fromPoints(i), i.push(i[0]), this.showWall) { this.originHeight = 1e5; for (let e = 2; e < t.length; e += 3) this.originHeight > t[e] && (this.originHeight = t[e]); var o, r, e = this._viewer.entities.add({ name: "地形开挖底面", polygon: { hierarchy: new Cesium.PolygonHierarchy(i), material: new Cesium.ImageMaterialProperty({ image: this._core.defaultValue(this.bottomImg), repeat: new Cesium.Cartesian2(1, 1) }), height: this.originHeight - this.deepth } }); this.FlattenPolygon.push(e); for (let e = 0; e < i.length - 1; e++) o = this._core.toDegrees(i[e]), r = this._core.toDegrees(i[ e + 1]), this.calculateWall(o.lon, o.lat, r.lon, r.lat) } this.groundClipping(i) }, Ui.prototype.groundClipping = function(e) { var t = this._viewer.scene.globe, i = e.concat(); i.splice(i.length - 1, 1); for (var o = 0; o < i.length - 1; o++) i[o].x === i[o + 1].x && i[o].y === i[o + 1].y && (i.splice(o, 1), o--); for (var r = i.length, n = (this.PolygonIsClockwise(i) && i.reverse(), []), o = 0; o < r; ++o) { var a = (o + 1) % r, s = Cesium.Cartesian3.add(i[o], i[a], new Cesium.Cartesian3), s = Cesium.Cartesian3.multiplyByScalar(s, .5, s), l = Cesium.Cartesian3.normalize(s, new Cesium.Cartesian3), a = Cesium.Cartesian3.subtract(i[a], s, new Cesium.Cartesian3), a = Cesium.Cartesian3.normalize(a, a), a = Cesium.Cartesian3.cross(a, l, new Cesium.Cartesian3), a = Cesium.Cartesian3.normalize(a, a), l = new Cesium.Plane(a, 0), l = Cesium.Plane.getPointDistance(l, s); n.push(new Cesium.ClippingPlane(a, l)) } this.clippingPlane = new Cesium.ClippingPlaneCollection({ planes: n }), t.multiClippingPlanes ? t.multiClippingPlanes.add(this.clippingPlane) : t.multiClippingPlanes = new Cesium.MultiClippingPlaneCollection({ collections: [this.clippingPlane], edgeWidth: 1, edgeColor: Cesium.Color.WHITE }) }, Ui.prototype.PolygonIsClockwise = function(e) { if (3 <= e.length) return !(0 < (e[1].x - e[0].x) * (e[2].y - e[1].y) - (e[1].y - e[0].y) * (e[2].x - e[ 1].x)) }, Ui.prototype.calculateWall = function(e, t, i, o) { var r, n, a = Cesium.Math.lerp(e, i, .01) - e, s = Cesium.Math.lerp(t, o, .01) - t, l = [], u = []; l.push(e, t), n = Cesium.Cartesian3.fromDegrees(e, t), u.push(Cesium.Cartographic.fromCartesian(n)); for (var c = 0; c < 100; c++) { var h = e + (c + 1) * a, m = t + (c + 1) * s; l.push(h, m), n = Cesium.Cartesian3.fromDegrees(h, m), u.push(Cesium.Cartographic.fromCartesian(n)) } l.push(i, o), n = Cesium.Cartesian3.fromDegrees(i, o), u.push(Cesium.Cartographic.fromCartesian(n)); var d = []; this._core.getHeightsFromLonLat(this._viewer, u).then(e => { if (e) { for (r = e, c = 0; c < r.length; c++) d.push(this.originHeight - this.deepth); this.createWall(l, r, d) } }) }, Ui.prototype.createWall = function(e, t, i) { e = this._viewer.entities.add({ name: "地形开挖岩墙", wall: { positions: Cesium.Cartesian3.fromDegreesArray(e), maximumHeights: t, minimumHeights: i, material: new Cesium.ImageMaterialProperty({ image: this.wallImg, repeat: new Cesium.Cartesian2(1, 1) }) } }); this.wallArr.push(e) }, Ui.prototype.setDeepth = function(i) { this.FlattenPolygon[0] && this.FlattenPolygon[0].polygon.height.setValue(this.originHeight - i), this .wallArr.forEach(e => { let t = e.wall.minimumHeights.getValue(); (t = Array(t.length)).fill(this.originHeight - i), e.wall.minimumHeights.setValue(t) }) }, Ui.prototype.setVisibility = function(t) { var i = this._viewer; if (this.wallArr.forEach(e => { e.show = t }), i.scene.globe.multiClippingPlanes && this.clippingPlane) { let e = i.scene.globe.multiClippingPlanes; t && !e.contains(this.clippingPlane) ? e.add(this.clippingPlane) : !t && e.contains(this .clippingPlane) && e.remove(this.clippingPlane, !1) } this.FlattenPolygon.forEach(e => { e.show = t }) }, Ui.prototype.deleteObject = Ui.prototype.clear = function() { var t = this._viewer; this.wallArr.forEach(e => { t.entities.remove(e) }), this.wallArr = [], t.scene.globe.multiClippingPlanes && this.clippingPlane && (t.scene.globe .multiClippingPlanes.remove(this.clippingPlane), this.clippingPlane = void 0), this .FlattenPolygon.forEach(e => { t.entities.remove(e) }), this.FlattenPolygon = [], this.FlattenIsDraw = !1 }, Wi.prototype.createAnalysis = function() { return this.shadows = !0, this.currentSpeed = 1, this.currentPlayMode = "1", this.Forword(), this }, Wi.prototype.setCurrentTime = function(e) { e = new Date(e), e = this._cesium.JulianDate.fromDate(e); this._viewer.clock.currentTime = e.clone() }, Wi.prototype.getCurrentTime = function(e) { this.currentSpeed = $(this._viewer.container).find( ".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(), clearInterval(this.timer), timer = null, timer = setInterval(function() { this.currentTime = function(e, t) { var i = (e = e.replace(/January|Jan/, "01").replace(/February|Feb/, "02").replace( /March|Mar/, "03").replace(/April|Apr/, "04").replace(/May/, "05") .replace(/June|Jun/, "06").replace(/July|Jul/, "07").replace(/August|Aug/, "08").replace(/September|Sept/, "09").replace(/October|Oct/, "10") .replace(/November|Nov/, "11").replace(/December|Dec/, "12")).split(" "); e = i[2] + "-" + i[0] + "-" + i[1]; t = t.split(" ")[0]; i = new Date(Date.parse(e + " " + t)); return i = i.getTime() / 1e3 + 28800, new Date(1e3 * parseInt(i)).toLocaleString( "chinese", { hour12: !1 }).replace(/年|月|\//g, "-").replace(/日/g, " ") }(this._viewer.animation.viewModel.dateLabel, this._viewer.animation.viewModel .timeLabel), e && "function" == typeof e && e(this.currentTime) }, 1e3) }, Wi.prototype.SpeedIncress = function(e) { this._viewer.animation.viewModel.faster(), this.currentSpeed = $(this._viewer.container).find( ".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(), e && "function" == typeof e && e(this.currentSpeed) }, Wi.prototype.SpeedDecress = function(e) { this._viewer.animation.viewModel.slower(), this.currentSpeed = $(this._viewer.container).find( ".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(), e && "function" == typeof e && e(this.currentSpeed) }, Wi.prototype.Forword = function(e) { this._viewer.animation.viewModel.playForwardViewModel.command(), this.currentPlayMode = "1", "-" == this .currentSpeed[0] && (this.currentSpeed = this.currentSpeed.slice(1)), e && "function" == typeof e && e(this.currentSpeed) }, Wi.prototype.Bacword = function(e) { this._viewer.animation.viewModel.playReverseViewModel.command(), this.currentPlayMode = "2", "-" !== this.currentSpeed[0] && (this.currentSpeed = "-" + this.currentSpeed), e && "function" == typeof e && e(this.currentSpeed) }, Wi.prototype.Pause = function() { this._viewer.animation.viewModel.pauseViewModel.command() }, Object.defineProperties(Wi.prototype, { shadows: { get: function() { return this._viewer.shadows }, set: function(e) { this._viewer.shadows = e } }, currentSpeed: { get: function() { return $(this._viewer.container).find( ".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2) .html() }, set: function(e) { e = e.toString().replace("x", ""), this._viewer.clock.multiplier = parseFloat(e) } } }), Yi.prototype.createScreenshot = function(e = "png") { var t = this._viewer.scene.canvas.toDataURL("image/" + e), i = document.createElement("a"); i.download = "截图." + e, i.href = t, i.click() }, Yi.prototype.createScreenshotCompared = function(e, t) { var i = this._viewer.scene.canvas, o = i.toDataURL("image/png"); (t || layuiLayer).open({ title: e || "截图对比", type: 1, skin: "other-class", shade: 0, shadeClose: !0, resize: !1, moveOut: !0, area: [.7 * i.width + "px", .7 * i.height + 42 + "px"], content: '' }) }, Qi.prototype.setPointFly = function(i) { i = i || {}; let t = this._core.CreateTooltip(), o = this._viewer, r = this, n = !1, a, s; i.pitch && (i.pitch = Cesium.Math.toRadians(i.pitch)); let l, u, c = 360 / (i.time || 30), h = function() { var e = Cesium.JulianDate.secondsDifference(o.clock.currentTime, o.clock.startTime), e = Cesium.Math.toRadians(e * c) + l; o.scene.camera.setView({ destination: u, orientation: { heading: e, pitch: r.pitch } }), o.scene.camera.moveBackward(r.distance), 0 <= Cesium.JulianDate.compare(o.clock .currentTime, o.clock.stopTime) && o.clock.onTick.removeEventListener(h) }, m = e => { u = e, r.pitch = i.pitch || o.camera.pitch, r.distance = i.distance, r.distance || (r.distance = Cesium.Cartesian3.distance(o.camera.position, e)), l = o.camera.heading; let t = Cesium.JulianDate.fromDate(new Date); o.clock.startTime = t.clone(), o.clock.currentTime = t.clone(), o.clock.clockRange = Cesium .ClockRange.CLAMPED, o.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK, o.clock.onTick .addEventListener(h), i.hideImage || (a = r._viewer.entities.add({ id: r._core.getuid(), name: "定点", position: u, billboard: { horizontalOrigin: r._cesium.HorizontalOrigin.CENTER, verticalOrigin: r._cesium.VerticalOrigin.BOTTOM, scale: r._core.defaultValue(i.scale, 1), image: r._core.defaultValue(i.image, window.SmartEarthRootUrl + D.mark), disableDepthTestDistance: Number.POSITIVE_INFINITY } })) }; return i.position ? m(i.position) : (this.drawHandler && this.drawHandler.destroy(), this._core.mouse( this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), (s = new Cesium .ScreenSpaceEventHandler(o.scene.canvas)).setInputAction(function(e) { n ? r.end && r.end() : (t.showAt(e.position, "点击结束绕飞"), n = !0, e = r._getPosition .getMouseDegrees(e), e = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), m(e)) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), s.setInputAction(function(e) { n || t.showAt(e.endPosition, "点击选择定位点"), n && t.showAt(e.endPosition, "点击结束绕飞") }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), s.setInputAction(function(e) { r.distance -= e * r.distance / 2e3, r.distance < 1 && (r.distance = 1) }, Cesium.ScreenSpaceEventType.WHEEL), this.drawHandler = s), this.end = e => { this.end = void 0, t.show(!1), s && s.destroy(), r._viewer.entities.remove(a), a = void 0, r ._core.mouse(r._viewer.container, 0), o.clock.onTick.removeEventListener(h), i.end && i .end() }, this }, qi.prototype.PointSunshineAnalysis = function(e, t) { if (this._viewer.entities.remove(this._viewer.entities.getById("1")), this._viewer.entities.remove(this ._viewer.entities.getById("point")), null == e) throw "无效参数"; if ("Cartesian3" != e.constructor.name) throw "传入参数必须是三维坐标"; this._viewer.scene.sun.show || (this._viewer.scene.sun.show = !0); var i = this._viewer.scene.context.uniformState.sunPositionWC, i = new Cesium.Cartesian3(i.x - e.x, i.y - e.y, i.z - e.z), o = Math.sqrt(i.x * i.x + i.y * i.y + i.z * i.z), i = new Cesium.Cartesian3(i.x / o, i.y / o, i.z / o), o = new Cesium.Cartesian3(e.x + 200 * i.x, e.y + 200 * i.y, e.z + 200 * i.z); this.pickFromRay(e, o, t) }, qi.prototype.sunshineAnalysisPoint = function(t, i) { t = t || {}, this.sunshineOption = t; var o = this, r = this._viewer; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas), V.states = 1, this._core.mouse(this ._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this.drawHandler.setInputAction( function(e) { var e = o._getPosition.getMousePosition(e); o.PointSunshineAnalysis(e), e && (e = r.entities.add({ id: o._core.getuid(), name: "Point", position: e, point: { pixelSize: 16, color: o._cesium.Color.BLUE, outlineWidth: o._core.defaultValue(t.outlineWidth, 2), outlineColor: o._cesium.Color.WHITE.withAlpha(.6), heightReference: o._cesium.HeightReference.CLAMP_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY, distanceDisplayCondition: new o._cesium.DistanceDisplayCondition(0, 1e8) } }), o.drawHandler.destroy(), o.drawHandler = void 0, o.tooltip.show(!1), setTimeout( function() { V.states = 0 }, 100), o._core.mouse(o._viewer.container, 0, "0"), i && "function" == typeof i && i(e)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(function(e) { o.tooltip.showAt(e.endPosition, "点击绘制点") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, qi.prototype.sunshineAnalysisPolygon = function(i, t) { i = i || {}, this.sunshineOption = i; var o, r, n = this, a = this._viewer, s = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.loading || this.addLoading(), this.remove(), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(a .scene.canvas), V.states = 1, []); return this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this.drawHandler .setInputAction(function(e) { var t, e = n._getPosition.getMousePosition(e); e && (s.length || (t = Cesium.Cartographic.fromCartesian(e), n.sunshineOption .defaultHeight = t.height, s.push(e)), s.push(e), 2 !== s.length || r || (r = a .entities.add({ name: "临时线", polyline: { positions: new n._cesium.CallbackProperty(function() { return s }, !1), clampToGround: !0, material: n._cesium.Color.LIME.withAlpha(.6), width: 3 } })), 3 !== s.length || o || (r && a.entities.remove(r), i.clampToGround = n ._core.defaultValue(i.clampToGround, !0), o = a.entities.add({ id: n._core.getuid(), name: "新建面", polygon: { hierarchy: new n._cesium.CallbackProperty(function() { return new n._cesium.PolygonHierarchy(s) }, !1), material: new n._cesium.ImageMaterialProperty({ image: null, repeat: new n._cesium.Cartesian2(1, 1), color: n._cesium.Color.LIME.withAlpha(.6) }), perPositionHeight: !n._core.defaultValue(i.clampToGround, !1), heightReference: i.clampToGround ? 1 : 0, outline: n._core.defaultValue(i.outline, !1), outlineColor: n._cesium.Color.WHITE.withAlpha(.6), distanceDisplayCondition: new n._cesium.DistanceDisplayCondition(0, 1e8) } }))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(function(e) { 0 === s.length ? n.tooltip.showAt(e.endPosition, "点击添加第一个点") : 1 === s.length ? n.tooltip .showAt(e.endPosition, "点击添加第二个点") : (n.tooltip.showAt(e.endPosition, "点击添加点,右键结束绘制"), ( e = n._getPosition.getMousePosition(e)) && (s.pop(), s.push(e))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.end = function(e) { n.drawHandler.destroy(), n.drawHandler = void 0, n.tooltip.show(!1), n.end = void 0, setTimeout( function() { V.states = 0 }, 100), n._core.mouse(n._viewer.container, 0, "0"), r && a.entities.remove(r), o && a .entities.remove(o), "cancel" === e || s.length < 3 || setTimeout(() => { n.analysis(o, i.start || "2019-09-17 13:00", i.end || "2019-09-17 15:00", i .interval || 60, t) }, 100) }, this.drawHandler.setInputAction(function(e) { n.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, qi.prototype.analysis = function(e, t, i, o, r) { var n = new Date(t), a = new Date(i), s = 0, l = this, t = this.sunshineOption.startHeight || this.sunshineOption.defaultHeight, u = l.getPoint(e, this.sunshineOption.spacing || 10, t, t + l._core.defaultValue(this.sunshineOption .addHeight, 30)); this._viewer.scene.sun.show || (this._viewer.scene.sun.show = !0); let c = this._viewer.clock.currentTime.clone(); function h() { var t, e = n.getTime() + 6e4 * o * s, e = new Date(e); a < e ? (l.createPoint(u), l._viewer.clock.currentTime = c, l.isLoading(!1), r && "function" == typeof r && r(u)) : (t = function(e) { var t = e; for (let e = 0; e < u.length; e++) l.Sunshine(u[e], t) ? u[e].through++ : u[e].out++; s++, h() }, l.SetTimeNow(e), setTimeout(() => { var e = l._viewer.scene.context.uniformState.sunPositionWC; t(e) }, 100)) } 1500 < (a - n) / (6e4 * o) * u.length ? window.layuiLayer && window.layuiLayer.msg("当前分析时间过长,是否继续分析?", { time: 0, btn: ["继续", "取消"], btnAlign: "c", yes: e => { layuiLayer.close(e), l.isLoading(!0), h() }, btn2: () => { r && "function" == typeof r && r(u) } }) : (l.isLoading(!0), h()) }, qi.prototype.createPoint = function(e) { this.ResultPoint = this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection); for (var t = 0; t < e.length; t++) { var i = e[t], o = e[t].through + e[t].out, o = e[t].out / o, r = "", o = (.7 <= o ? r = this._cesium.Color.BLUE : o < .7 && .3 <= o ? r = this._cesium.Color.YELLOW : o < .3 && (r = this._cesium.Color.RED), { id: { isshowderData: !0, data: "阴影率:" + 100 * (1 - o) + "%" }, position: this._cesium.Cartesian3.fromDegrees(i.lon, i.lat, i.height), color: r }); this.ResultPoint.add(o) } this.showResultTooltip(!0) }, qi.prototype.showResultTooltip = function(e) { if (this.ResultTooltipHandler && (this.ResultTooltipHandler.destroy(), this.ResultTooltipHandler = void 0, this.tooltip.show(!1)), e) { let i = this; this.ResultTooltipHandler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); let e; this.ResultTooltipHandler.setInputAction(function(t) { clearTimeout(e), e = setTimeout(() => { var e = i._viewer.scene.pick(t.endPosition); e && e.id && e.id.isshowderData ? i.tooltip.showAt(t.endPosition, e.id .data) : i.tooltip.show(!1) }, 50) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE) } }, qi.prototype.getPoint = function(e, t, i, o) { for (var r = [], n = e.polygon.hierarchy.getValue().positions, a = 0; a < n.length; a++) { var s = this._cesium.Math.toDegrees(this._cesium.Cartographic.fromCartesian(n[a]).longitude), l = this._cesium.Math.toDegrees(this._cesium.Cartographic.fromCartesian(n[a]).latitude); r.push(s), r.push(l) } for (var e = this.getTheBottomPoint(r), u = this.scanningPolygon(e, t, t, r), c = [], h = (o - i) / t, m = 0; m < h; m++) for (var d = 0; d < u.length; d++) { var p = u[d], p = { lon: p.lon, lat: p.lat, height: i + t * m, through: 0, out: 0, color: "" }; c.push(p) } return c }, qi.prototype.getTheBottomPoint = function(e) { for (var t = 90, i = 0, o = 1; o < e.length; o += 2) t = t < e[o] ? t : (i = o) && e[o]; return { lon: e[i - 1], lat: e[i] } }, qi.prototype.scanningPolygon = function(e, t, i, o) { for (var r, n, a, s = [], l = 180, u = -180, c = -90, h = 0; h < o.length; h += 2) c = c > o[h + 1] ? c : o[h + 1], l = l < o[h] ? l : o[h], u = u > o[h] ? u : o[h]; var i = this.GetPositionFromA_D(e.lat, e.lon, i, 0), m = this.GetPositionFromA_D(e.lat, e.lon, t, 90)[0] - e.lon, d = i[1] - e.lat; for (s.push({ lon: e.lon, lat: e.lat }), (a = { lon: e.lon, lat: e.lat }).lat += d; a.lat <= c; a.lat += d) { for (r = { lon: a.lon - m, lat: a.lat }, n = { lon: a.lon + m, lat: a.lat }, this.IsInPolygon(a.lon, a.lat, o) && s.push({ lon: a.lon, lat: a.lat }); r.lon >= l; r.lon -= m) this.IsInPolygon(r.lon, r.lat, o) && s.push({ lon: r.lon, lat: r.lat }); for (; n.lon <= u; n.lon += m) this.IsInPolygon(n.lon, n.lat, o) && s.push({ lon: n.lon, lat: n.lat }) } return s }, qi.prototype.GetPositionFromA_D = function(e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = 6356725 + 21412 * (90 - e) / 90; return [180 * (r / (o * Math.cos(e * Math.PI / 180)) + t * Math.PI / 180) / Math.PI, 180 * (i / o + e * Math.PI / 180) / Math.PI] }, qi.prototype.IsInPolygon = function(e, t, i) { var o, r, n, a, s = 0; if (i.length < 6) return !1; i.push(i[0], i[1]); for (var l = 0; l < i.length - 2; l += 2) o = i[l], n = i[l + 1], r = i[l + 2], a = i[l + 3], (n <= t && t < a || a <= t && t < n) && 0 < Math.abs(n - a) && o - (o - r) * (n - t) / (n - a) <= e && s++; return s % 2 != 0 }, qi.prototype.SetTimeNow = function(e) { e = new this._cesium.JulianDate.fromDate(e); this._viewer.clock.currentTime = e }, qi.prototype.Sunshine = function(e, t) { e = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height); return this.pickFromRay(e, t) }, qi.prototype.jiance = function(e, t) { var i = !1, e = this._cesium.Cartographic.fromCartesian(e), t = this._cesium.Cartographic.fromCartesian(t), o = {}, r = (o.longitude = e.longitude / Math.PI * 180, o.latitude = e.latitude / Math.PI * 180, o .czheight = e.height, {}); r.longitude = t.longitude / Math.PI * 180, r.latitude = t.latitude / Math.PI * 180, r.czheight = t .height; for (var n = 0; n < 20; n++) { var a = {}, s = (a.longitude = this._cesium.Math.lerp(o.longitude, r.longitude, .01 * (n + 1)), a.latitude = this._cesium.Math.lerp(o.latitude, r.latitude, .01 * (n + 1)), a.czheight = o.czheight - .01 * (o.czheight - r.czheight) * (n + 1), new this._cesium.Cartographic(this._cesium.Math .toRadians(a.longitude), this._cesium.Math.toRadians(a.latitude), 0)), s = this._viewer.scene.sampleHeight(s); this._cesium.Cartesian3.fromDegrees(a.longitude, a.latitude, s), a.zsheight = s, a.zsheight > a .czheight && (i = !0) } return i }, qi.prototype.pickFromRay = function(e, t) { t = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t, e, new Cesium.Cartesian3), new Cesium .Cartesian3), e = new Cesium.Ray(e, t), t = this._viewer.scene.pickFromRay(e, []); let i = !1; return i = t && t.object ? !0 : i }, qi.prototype.remove = function() { this.ResultPoint && this._viewer.scene.primitives.remove(this.ResultPoint), this.ResultPoint = void 0, this.ResultTooltipHandler && (this.ResultTooltipHandler.destroy(), this.ResultTooltipHandler = void 0, this.tooltip.show(!1)), this.showResultTooltip(!1) }, qi.prototype.addLoading = function() { var e = document.createElement("div"), t = (e.id = "cesiumLoading", e.style.cssText = "width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;", document.createElement("img")); t.style.cssText = "position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;", t.src = this.loadingImg, e.appendChild(t), this.loading = e, this._viewer.container.appendChild(e) }, qi.prototype.isLoading = function(e) { this.loading.style.display = e ? "block" : "none" }, qi.prototype.removeLoading = function() { this.loading && this.loading.remove(), this.loading = void 0 }, I.prototype.create3DTilesets = function(e, t, i, o, r, n, a) { var t = { url: t }, s = ("string" == typeof i.lightColor && (c = i.lightColor.split(","), i.lightColor = new this ._cesium.Cartesian3(c[0], c[1], c[2])), this._core.extend(t, i, !0)), l = (s.time && (s.availability = new this._cesium.TimeIntervalCollection([new this._cesium .TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time .start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE }) ]), this.availability = s.availability), o.effects && (s.fShaderBody = o.fShaderBody || this .getEffectsShader(o.effectsMaxHeight)), new this._cesium.Cesium3DTileset(s)), u = this, c = s.id || u._core.getuid(), t = (l.id = c, l.Level = s.Level, u.item = l, setTimeout(function() { var e = u._viewer.scene.primitives.add(l), e = (null != o.maximumscreenspaceerror && (l.maximumScreenSpaceError = o .maximumscreenspaceerror), null != s.maximumscreenspaceerror && (l .maximumScreenSpaceError = s.maximumscreenspaceerror), null != s .maximumMemoryUsage && (l.maximumMemoryUsage = s.maximumMemoryUsage), null != o .pointcloudshading && (l.pointCloudShading.maximumAttenuation = u.checkZero(o .pointcloudshading.maximumattenuation), l.pointCloudShading .baseResolution = o.pointcloudshading.baseresolution, l.pointCloudShading .geometricErrorScale = o.pointcloudshading.geometricerrorscale, l .pointCloudShading.attenuation = o.pointcloudshading.attenuation, l .pointCloudShading.eyeDomeLighting = o.pointcloudshading.eyedomelighting, l .pointCloudShading.eyeDomeLightingStrength = o.eyeDomeLightingStrength, l .pointCloudShading.eyeDomeLightingRadius = o.eyeDomeLightingRadius), l .readyPromise.then(function(e) { var t; null != o.groundheight && u.setHeight(o.groundheight), null != o .groundHeight && u.setHeight(o.groundHeight), o.groundCenter && u .setPosition(o.groundCenter), u.boundingSphereCenter || (u .getCenter(), t = u._cesium.Cartographic.fromCartesian(u .boundingSphereCenter), u.modelEditData.lon = u._cesium.Math .toDegrees(t.longitude), u.modelEditData.lat = u._cesium.Math .toDegrees(t.latitude), u.modelEditData.height = t.height), (o .heading || o.pitch || o.roll) && u.setEditData({ r_y: o.roll, r_x: o.pitch, r_z: o.heading }), o.edit && u.setEditData(o.edit), "function" == typeof a && a(u) }).otherwise(function(e) { console.log(e) }), l.Level && (u.Level = 0, u._viewer.scene.preRender.addEventListener( function() { u.isShow && u._viewer.camera.positionCartographic && u .oldCameraHeight !== u._viewer.camera.positionCartographic .height && (u.oldCameraHeight = u._viewer.camera .positionCartographic.height, u.Level = u.getLevel(), u .Level > l.Level && !l.show ? l.show = !0 : u.Level < l .Level && l.show && (l.show = !1)) })), u.sd = e, n ? u.isShow = !0 : u.setVisibility(!1), u.setStyle(o)); l.style = new u._cesium.Cesium3DTileStyle(e) }), { id: c, name: e = u._core.isnull(e) ? "新建模型" : e, checked: n, pId: u._core.isnull(r) ? 0 : r, type: "3DTilesets", item: u }); return u.setTreeobj(t), u._tree.insertGroupId(t, u._core.isnull(r) ? 0 : r), this }, I.prototype.getLevel = function() { var e, t, i, o = this._viewer.camera; try { i = o && o.positionCartographic && o.positionCartographic.height ? (e = this._viewer.scene.globe .getHeight(o.positionCartographic) || 0, t = o.positionCartographic.height - e, Math.round( 80955.31 / (1 + Math.pow(t / 91610.74, 7096758e-11)) - 40467.74)) : 0 } catch (e) {} return i }, I.prototype.setVisibility = function(e) { this.isShow = e, this.item.show = e, this.item._availability && !e ? this.item._availability = void 0 : this.availability && e && (this.item._availability = this.availability) }, I.prototype.checkZero = function(e) { e = parseFloat(e); return 0 === e ? void 0 : e }, I.prototype.getVisibility = function() { return this.item.show }, I.prototype.deleteObject = function() { try { this._viewer.scene.primitives.remove(this.item) } catch (e) { console.log(e.message) } }, I.prototype.restore = function() { this.modelEditData = { lon: 0, lat: 0, height: 0, scale: 1, r_x: 0, r_y: 0, r_z: 0, rotate: !1, modelMatrix: this.modelEditData.modelMatrix, rootTransform: this.modelEditData.rootTransform, originalMatrix: this.modelEditData.originalMatrix }; var e = this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter); this.modelEditData.lon = this._cesium.Math.toDegrees(e.longitude), this.modelEditData.lat = this._cesium .Math.toDegrees(e.latitude), this.modelEditData.height = e.height, this.item.modelMatrix = this .modelEditData.modelMatrix.clone(), this.modelEditData.rootTransform.equals(Cesium.Matrix4 .IDENTITY) ? this.item.modelMatrix = this.modelEditData.originalMatrix.clone() : (this.item._root .transform = this.modelEditData.originalMatrix.clone(), this.modelEditData.rotate = !0), this .moveModelEnd && (this.moveModelEnd(), this.moveModelEnd = void 0), this.rotatePointPosition = void 0, this.moveEndCenter = void 0 }, I.prototype.setHeight = function(e) { var t, i; e = Number(e), isNaN(e) || null != this.item && null != this.item.boundingSphere && (this .boundingSphereCenter || this.getCenter(), i = this._cesium.Cartographic.fromCartesian(this .boundingSphereCenter), this.restore(), this.modelEditData.height = e, t = this._cesium .Cartesian3.fromRadians(i.longitude, i.latitude, 0), i = this._cesium.Cartesian3.fromRadians(i .longitude, i.latitude, e), e = this._cesium.Cartesian3.subtract(i, t, new this._cesium .Cartesian3), this.item.modelMatrix = this._cesium.Matrix4.fromTranslation(e)) }, I.prototype.setPosition = function(e, t) { null != this.item && null != this.item.boundingSphere && e && (this.boundingSphereCenter || this .getCenter(), this.setEditData({ lon: e[0], lat: e[1], height: t ? this.boundingSphereCenterHeight : e[2] })) }, I.prototype.setEditData = function(e) { if (null != this.item && null != this.item.boundingSphere) { if (this.boundingSphereCenter || this.getCenter(), e && (this.modelEditData = this._core.extend(this .modelEditData, e, !0)), this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY)) return e = Cesium.Cartesian3.multiplyByScalar(this.boundingSphereCenter, -1, new Cesium .Cartesian3), e = Cesium.Matrix4.fromTranslation(e), s = this._cesium.Cartesian3 .fromDegrees(this.modelEditData.lon, this.modelEditData.lat, this.modelEditData.height), s = Cesium.Matrix4.fromTranslation(s), t = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians( this.modelEditData.r_x)), i = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(this .modelEditData.r_y)), o = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(this .modelEditData.r_z)), r = Cesium.Matrix4.fromRotationTranslation(t), n = Cesium.Matrix4 .fromRotationTranslation(i), a = Cesium.Matrix4.fromRotationTranslation(o), e = Cesium .Matrix4.multiply(r, e, new Cesium.Matrix4), Cesium.Matrix4.multiply(n, e, e), Cesium .Matrix4.multiply(a, e, e), s = Cesium.Matrix4.multiply(s, e, new Cesium.Matrix4), void(this .item.modelMatrix = s); var t = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(this.modelEditData.r_x)), i = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(this.modelEditData.r_y)), o = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(this.modelEditData.r_z)), r = Cesium.Matrix4.fromRotationTranslation(t), n = Cesium.Matrix4.fromRotationTranslation(i), a = Cesium.Matrix4.fromRotationTranslation(o), e = Cesium.Cartesian3.fromDegrees(this.modelEditData.lon, this.modelEditData.lat, this .modelEditData.height), s = Cesium.Transforms.eastNorthUpToFixedFrame(e), t = (Cesium.Matrix4.multiply(s, r, s), Cesium.Matrix4.multiply(s, n, s), Cesium.Matrix4 .multiply(s, a, s), Cesium.Matrix4.fromUniformScale(this.modelEditData.scale)); Cesium.Matrix4.multiply(s, t, s), this.item._root.transform = s } }, I.prototype.getCenter = function() { var e; this.boundingSphereCenter || (e = this._cesium.Cartographic.fromCartesian(this.item.boundingSphere .center), this.boundingSphereCenter = this.item.boundingSphere.center.clone(), this .boundingSphereCenterHeight = e.height, this.boundingSphereRadius = this.item.boundingSphere .radius, this.modelEditData.rootTransform = this.item._root.transform.clone(), this .modelEditData.modelMatrix = this.item.modelMatrix.clone(), this.modelEditData.rootTransform .equals(Cesium.Matrix4.IDENTITY) ? this.modelEditData.originalMatrix = this.item.modelMatrix .clone() : (this.modelEditData.originalMatrix = this.item._root.transform.clone(), this .modelEditData.rotate = !0)) }, I.prototype.arge = function(e, t, i) { var o = Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)), e = Math.sqrt(Math.pow(e.x - i.x, 2) + Math.pow(e.y - i.y, 2)), t = Math.sqrt(Math.pow(t.x - i.x, 2) + Math.pow(t.y - i.y, 2)), i = (Math.pow(o, 2) + Math.pow(e, 2) - Math.pow(t, 2)) / (2 * o * e); return Math.round(180 * Math.acos(i) / Math.PI) }, I.prototype.moveModel = function(i = {}) { var o, r, n, a, s, l, u, c, h, m, d = this, p = this._viewer, g = (this.moveHandler && (this.moveHandler.destroy(), this.moveHandler = void 0, this._viewer .entities.remove(this.movePoint), this._viewer.entities.remove(this.rotatePoint)), !1), _ = !1, f = (d.moveEndCenter || (n = d._cesium.Cartographic.fromCartesian(this.boundingSphereCenter), d .moveEndCenter = { lon: this.modelEditData.lon, lat: this.modelEditData.lat }), a = d.moveEndCenter.lon, s = d.moveEndCenter.lat, l = u = 0, this._viewer.entities.add({ name: "tilesetMovePoint", position: new d._cesium.CallbackProperty(function() { return d._cesium.Cartesian3.fromDegrees(a + l, s + u, d .boundingSphereCenterHeight) }, !1), billboard: { image: i.moveImg || window.SmartEarthRootUrl + D.move, color: this._cesium.Color.BLUE, disableDepthTestDistance: Number.POSITIVE_INFINITY, scaleByDistance: new Cesium.NearFarScalar(0, 1, 1e6, 0) } })), y = (this.rotatePointPosition || (this.rotatePointPosition = { lon: d.moveEndCenter.lon + 9e-6 * this.boundingSphereRadius, lat: d.moveEndCenter.lat }), this._viewer.entities.add({ show: !!i.rotate, name: "tilesetRotatePoint", position: new d._cesium.CallbackProperty(function() { return d._cesium.Cartesian3.fromDegrees(d.rotatePointPosition.lon, d .rotatePointPosition.lat, d.boundingSphereCenterHeight) }, !1), billboard: { image: i.rotateImg || window.SmartEarthRootUrl + D.rotate, color: this._cesium.Color.BLUE, disableDepthTestDistance: Number.POSITIVE_INFINITY, scaleByDistance: new Cesium.NearFarScalar(0, 1, 1e6, 0) } })), v = (y.oldPosition = { lon: d.moveEndCenter.lon + 9e-6 * this.boundingSphereRadius, lat: d.moveEndCenter.lat }, this.movePoint = f, this.rotatePoint = y, this.moveHandler = new this._cesium .ScreenSpaceEventHandler(p.scene.canvas), d._core.CreateTooltip()); function C(e) { var t = p.scene; t.screenSpaceCameraController.enableRotate = e, t.screenSpaceCameraController.enableTranslate = e, t .screenSpaceCameraController.enableZoom = e, t.screenSpaceCameraController.enableTilt = e, t .screenSpaceCameraController.enableLook = e } this.moveHandler.setInputAction(function(e) { var t = p.scene.pick(e.position); d._cesium.defined(t) && (g || _ || !(t.id == f || t.tileset == d.item || t.primitive && t .primitive.tileset == d.item || t.content && t.content.tileset == d.item) ? g || _ || t.id != y || (c = d._cesium.SceneTransforms.wgs84ToWindowCoordinates(d._viewer .scene, f.position.getValue()), h = d._cesium.SceneTransforms .wgs84ToWindowCoordinates(d._viewer.scene, d._cesium.Cartesian3.fromDegrees(a + l + 9e-6 * d.boundingSphereRadius, s + u, d.boundingSphereCenterHeight)), C( !(_ = !0)), v.show(!1)) : (o = p.camera.getPickRay(e.position), (r = o ? p .scene.globe.pick(o, p.scene) : r) && (n = d._cesium.Cartographic .fromCartesian(r), a = d._cesium.Math.toDegrees(n.longitude), s = d._cesium .Math.toDegrees(n.latitude), l = d.moveEndCenter.lon - a, u = d .moveEndCenter.lat - s), f.oldPosition = { lon: a + l, lat: s + u }, y.oldPosition = { lon: d.rotatePointPosition.lon, lat: d.rotatePointPosition.lat }, C(!(g = !0)), v.show(!1))) }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.moveHandler.setInputAction(function(t) { if (g) o = p.camera.getPickRay(t.endPosition), (r = o ? p.scene.globe.pick(o, p.scene) : r) && (n = d._cesium.Cartographic.fromCartesian(r), a = d._cesium.Math.toDegrees(n .longitude), s = d._cesium.Math.toDegrees(n.latitude), d.rotatePointPosition = { lon: y.oldPosition.lon + (a + l - f.oldPosition.lon), lat: y.oldPosition.lat + (s + u - f.oldPosition.lat) }, d.modelEditData.lon = a + l, d.modelEditData.lat = s + u, d.setEditData(), i .callback && i.callback.move && i.callback.move()); else if (_) { if (o = p.camera.getPickRay(t.endPosition), r = o ? p.scene.globe.pick(o, p.scene) : r) { n = d._cesium.Cartographic.fromCartesian(r), d.rotatePointPosition = { lon: d._cesium.Math.toDegrees(n.longitude), lat: d._cesium.Math.toDegrees(n.latitude) }, m = t.endPosition; let e = d.arge(c, h, m); d.rotatePointPosition.lat - s - u < 0 && (e = -e), d.rotateZ(e), i.callback && i .callback.rotate && i.callback.rotate(e) } } else { var e = p.scene.pick(t.endPosition); d._cesium.defined(e) ? g || _ || !(e.id == f || e.tileset == d.item || e.primitive && e .primitive.tileset == d.item || e.content && e.content.tileset == d.item) ? g || _ || e.id != y ? v.show(!1) : v.showAt(t.endPosition, "点击拖拽旋转模型,右键结束编辑") : v.showAt( t.endPosition, "点击拖拽移动模型,右键结束编辑") : v.show(!1) } }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.moveHandler.setInputAction(function(e) { C(!(_ = g = !1)), d.moveEndCenter = { lon: a + l, lat: s + u } }, this._cesium.ScreenSpaceEventType.LEFT_UP), this.moveHandler.setInputAction(function(e) { d.moveModelEnd(), d.moveModelEnd = void 0 }, this._cesium.ScreenSpaceEventType.RIGHT_DOWN), this.moveModelEnd = () => { d.moveHandler.destroy(), d._viewer.entities.remove(f), d._viewer.entities.remove(y), C(!0), v .show(!1) } }, I.prototype.clippingModel = function(t = {}) { var i, e, o = this, r = this._viewer, n = (this.moveHandler && (this.moveHandler.destroy(), this.moveHandler = void 0, this._viewer .entities.remove(this.movePoint), this._viewer.entities.remove(this.rotatePoint)), this .clippingHandler && (this.clippingHandler.destroy(), this.clippingHandler = void 0, o .planeEntities && o.planeEntities.forEach(e => { o._viewer.entities.remove(e) }), o.planeEntities = []), o.planeEntities = [], this.targetY || (t.start ? this.targetY = t .start : this.targetY = 0), this.clippingPlanes || (this.clippingPlanes = new this._cesium .ClippingPlaneCollection({ planes: [new this._cesium.ClippingPlane(new this._cesium.Cartesian3(0, 0, -1), 0)], edgeWidth: 1 }), this.item.clippingPlanes = this.clippingPlanes), this.boundingSphereCenter || this .getCenter(), this.item.boundingSphere), a = this.boundingSphereRadius; this._cesium.Matrix4.equals(this.item.root.transform, this._cesium.Matrix4.IDENTITY) || (e = this ._cesium.Matrix4.getTranslation(this.item.root.transform, new Cesium.Cartesian3), e = this ._cesium.Cartographic.fromCartesian(e), e = this._cesium.Cartographic.fromCartesian(this.item .boundingSphere.center).height - e.height, this.clippingPlanes.modelMatrix = this._cesium .Matrix4.fromTranslation(new this._cesium.Cartesian3(0, 0, e))); for (var s = 0; s < this.clippingPlanes.length; ++s) { var l = this.clippingPlanes.get(s), l = r.entities.add({ name: "modelClippingPlane", position: n.center, plane: { dimensions: new Cesium.Cartesian2(1.2 * a, 1.2 * a), material: Cesium.Color.WHITE.withAlpha(.1), plane: new Cesium.CallbackProperty(function(e) { return function() { return e.distance = o.targetY, e } }(l), !1), outline: !0, outlineColor: Cesium.Color.WHITE } }); o.planeEntities.push(l) } this.clippingHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas); var u = o._core.CreateTooltip(); this.clippingHandler.setInputAction(function(e) { e = r.scene.pick(e.position); o._cesium.defined(e) && e.id && "modelClippingPlane" === e.id.name && ((i = e.id.plane) .material = o._cesium.Color.WHITE.withAlpha(.05), i.outlineColor = o._cesium.Color .WHITE, r.scene.screenSpaceCameraController.enableInputs = !1) }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.clippingHandler.setInputAction(e => { var t; Cesium.defined(i) ? (t = e.startPosition.y - e.endPosition.y, this.targetY += .1 * t, u .showAt(e.endPosition, "移动鼠标平移裁切面")) : u.showAt(e.endPosition, "长按左键上下拖动裁切面,右键取消") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.clippingHandler.setInputAction(e => { Cesium.defined(i) && (i.material = Cesium.Color.WHITE.withAlpha(.1), i.outlineColor = Cesium .Color.WHITE, i = void 0), r.scene.screenSpaceCameraController.enableInputs = !0 }, this._cesium.ScreenSpaceEventType.LEFT_UP), this.clippingHandler.setInputAction(e => { o.endClipping(), t.end && t.end() }, this._cesium.ScreenSpaceEventType.RIGHT_DOWN), this.endClipping = () => { o.clippingHandler.destroy(), u.show(!1), o.planeEntities && o.planeEntities.forEach(e => { o._viewer.entities.remove(e) }), o.planeEntities = [] } }, I.prototype.rotateX = function(e) { this.modelEditData.r_x = e, this.setEditData() }, I.prototype.rotateY = function(e) { this.modelEditData.r_y = e, this.setEditData() }, I.prototype.rotateZ = function(e) { this.modelEditData.r_z = e, this.setEditData() }, I.prototype.setTreeobj = function(e) { this.treeobj = e }, Object.defineProperties(I.prototype, { style: { get: function() { return this.item.style } } }), I.prototype.export = function() { var e = this.item.url, t = this.item.show, i = this.item.shadows; return { type: "3DTilesets", treeobj: { name: this.treeobj.name }, style: { url: e, show: t, shadows: i } } }, I.prototype.setTreeobj = function(e) { this.treeobj = e }, I.prototype.setItem = function(e) { this.item = e }, I.prototype.setShowStyle = function(e) { this.item.style, this.item.style = new this._cesium.Cesium3DTileStyle({ show: !0 }) }, I.prototype.setStyle = function(e) { var t = [], i = { color: void 0, show: !0 }, o = !0; if (e.colors instanceof Array) { for (var r = 0; r < e.colors.length; r++) { var n = [], a = e.colors[r].color, s = e.colors[r].condition; /^\[/.test(s) && (s = s.replace(/^\[/, "${").replace(/\]/, "}")), a = this._core.isHtmlColor( a) ? this._color.colorFromHtmlColor(a) : (1 < (a = /^rgb/.test(a) ? this._color .rgbaStringToRgbaObj(a) : a).r && (a.r = a.r / 255), 1 < a.g && (a.g = a.g / 255), 1 < a.b && (a.b = a.b / 255), 1 < a.a && (a.a = a.a / 255), this._color.createColor(a.r, a.g, a.b, a.a)), n.push(s), n.push(a), t.push(n) } i.color = {}, i.color.conditions = t } else e.colors && (i.color = e.colors); return e.show && /\[/.test(e.show) ? o = e.show.replace(/^\[/, "${").replace(/\]/, "}") : e.show && (o = e.show), i.show = o, i }, Object.defineProperties(I.prototype, { luminanceAtZenith: { get: function() { return this.item.luminanceAtZenith }, set: function(e) { this.item.luminanceAtZenith = e } }, groundHeight: { get: function() { return null != this.item && null != this.item.boundingSphere ? this._cesium.Cartographic .fromCartesian(this.item.boundingSphere.center).altitude : 0 }, set: function(e) { this.setHeight(e) } }, lon: { get: function() { return this.modelEditData.lon }, set: function(e) { this.modelEditData.lon = e, this.setEditData() } }, lat: { get: function() { return this.modelEditData.lat }, set: function(e) { this.modelEditData.lat = e, this.setEditData() } }, height: { get: function() { return this.modelEditData.height }, set: function(e) { this.modelEditData.height = e, this.setEditData() } }, scale: { get: function() { return this.modelEditData.scale }, set: function(e) { this.modelEditData.scale = e, this.setEditData() } }, material: { set: function(e) { this._core.isHtmlColor(e) || (e = "rgba(" + (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r + "," + e.g + "," + e.b + "," + e.a + ")"), this .item.style = new this._cesium.Cesium3DTileStyle({ color: "color('" + e + "')" }) } }, dynamicScreenSpaceErrorDensity: { get: function() { return this.item.dynamicScreenSpaceErrorDensity }, set: function(e) { this.item.dynamicScreenSpaceErrorDensity = e } }, shadows: { get: function() { return this.item.shadows }, set: function(e) { this.item.shadows = e } }, classificationType: { get: function() { return this.item.classificationType }, set: function(e) { this.item.classificationType = e } }, dynamicScreenSpaceErrorHeightFalloff: { get: function() { return this.item.dynamicScreenSpaceErrorHeightFalloff }, set: function(e) { this.item.dynamicScreenSpaceErrorHeightFalloff = e } }, dynamicScreenSpaceErrorFactor: { get: function() { return this.item.dynamicScreenSpaceErrorFactor }, set: function(e) { this.item.dynamicScreenSpaceErrorFactor = e } }, imageBasedLightingFactor_x: { get: function() { return null == this.item.imageBasedLightingFactor ? 0 : this.item .imageBasedLightingFactor.x }, set: function(e) { this.item.imageBasedLightingFactor = new this._cesium.Cartesian2(e, this.item .imageBasedLightingFactor_y) } }, imageBasedLightingFactor_y: { get: function() { return null == this.item.imageBasedLightingFactor ? 0 : this.item .imageBasedLightingFactor.y }, set: function(e) { this.item.imageBasedLightingFactor = new this._cesium.Cartesian2(e, this.item .imageBasedLightingFactor_y) } } }), I.prototype.getEffectsShader = function(e = 150) { return ` float vtxf_a11 = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0; float vtxf_a12 = v_elevationPos.z / ${(e=parseInt(e))/2}.0 + sin(vtxf_a11) * 0.1; gl_FragColor *= vec4(vtxf_a12, vtxf_a12, vtxf_a12, 1.0); float vtxf_a13 = fract(czm_frameNumber / 240.0); float vtxf_h = clamp(v_elevationPos.z / ${e}.0, 0.0, 1.0); vtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0; float vtxf_diff = step(0.005, abs(vtxf_h - vtxf_a13)); gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - vtxf_diff); ` }, I.prototype.getType = function() { return { label: "模型", value: "3DTileset" } }, Ji.prototype.start = function(e, t = {}) { this.time = t.time, this.attr = t.attr, this.attrType = t.attrType, this.startPosition = t .startPosition, this.endPosition = t.endPosition, this.colors = t.colors || ["rgb(255,0,0)", "rgb(255,152,0)", "rgb(0,255,0)" ]; let i = new I(this._viewer); return this.tiltModel = i.create3DTilesets("拆迁模型", e, {}, { groundCenter: this.startPosition }, "0", !0, e => { this.progress = 0, this.useColor(t.useColor) }), this.tiltModel.position = "start", this }, Ji.prototype.useColor = function(e = !1) { this._useColor = e, this.currentProgress(this.progress) }, Ji.prototype.currentProgress = function(t) { this.progress = t; let i, o = []; var r = parseInt((.5 < t ? 1 - t : t) * this.time * 2); if ("string" === this.attrType) { for (let e = 1; e < r; e++) i = .5 < t ? this._useColor ? this.colors[0] : "rgba(255, 255, 255, 0)" : this._useColor ? this.colors[2] : "rgba(255, 255, 255, 0)", o.push([ "${" + this.attr + "} === '" + e + "'", i ]); i = this._useColor ? this.colors[1] : "rgba(255, 255, 255, 0)", o.push(["${" + this.attr + "} === '" + r + "'", i ]), .5 < t ? o.push(["true", this._useColor ? this.colors[2] : "rgba(255, 255, 255, 1)"]) : o .push(["true", this._useColor ? this.colors[0] : "rgba(255, 255, 255, 1)"]) } else o = this._useColor ? .5 < t ? [ ["${" + this.attr + "} < " + r, this.colors[0]], ["${" + this.attr + "} === " + r, this.colors[1]], ["true", this.colors[2]] ] : [ ["${" + this.attr + "} < " + r, this.colors[2]], ["${" + this.attr + "} === " + r, this.colors[1]], ["true", this.colors[1]] ] : [ ["${" + attr + "} <= " + r, "rgba(255, 255, 255, 0)"], ["true", "rgba(255, 255, 255, 1)"] ]; this.tiltModel.item.style = new Cesium.Cesium3DTileStyle({ color: { conditions: o } }), .5 < t && "start" === this.tiltModel.position ? (this.tiltModel.setPosition(this.endPosition), this.tiltModel.position = "end") : t <= .5 && "end" === this.tiltModel.position && (this .tiltModel.setPosition(this.startPosition), this.tiltModel.position = "start") }, Ji.prototype.deleteObject = function() { this.tiltModel && this.tiltModel.deleteObject() }, L.prototype.measureTerrainPerimeter = function(e) { return this._measureTerrainPerimeter.measureTerrainPerimeter(e) }, L.prototype.depthTestAgainstTerrain = function(e) { return this._depthTestAgainstTerrain.depthTestAgainstTerrain(e) }, L.prototype.DrawPointBuffer = function(e, t, i) { return this._bufferAnalysis.DrawPoint(e, t, i) }, L.prototype.DrawPolylineBuffer = function(e, t, i) { return this._bufferAnalysis.DrawPolyline(e, t, i) }, L.prototype.DrawPolygonBuffer = function(e, t, i) { return this._bufferAnalysis.DrawPolygon(e, t, i) }, L.prototype.TerrainExcavation = function(e = 100, t, i) { let o = new Ui(this._viewer, this._cesium); return o.draw(e, t, i) }, L.prototype.ShadowsAnalysis = function() { return this._shadowsAnalysis.createAnalysis() }, L.prototype.createSkylineAnalysis = function(e) { return this._skylineAnalysis.createSkylineAnalysis(e) }, L.prototype.createEdgeStage = function(e) { return this._EdgeStage.createEdgeStage(e) }, L.prototype.clearSkylineAnalysis = function() { return this._skylineAnalysis.clear() }, L.prototype.createScreenshot = function(e) { return this._screenshot.createScreenshot(e) }, L.prototype.ScreenshotCompared = function(e) { return this._screenshot.createScreenshotCompared(e) }, L.prototype.setPointFly = function(e) { return this._PointFly.setPointFly(e) }, L.prototype.createCircleScan = function(e, t, i, o, r) { return new Ii(this._viewer, this._cesium).createCircleScan(e, t, i, o, r) }, L.prototype.createMultiCircleScan = function(e, t, i, o, r) { return new Ii(this._viewer, this._cesium).createMultiCircleScan(e, t, i, o, r) }, L.prototype.createSectorScan = function(e, t, i, o, r, n, a) { return new Ii(this._viewer, this._cesium).createSectorScan(e, t, i, o, r, n, a) }, L.prototype.createRadarScan = function(e, t, i, o, r) { return new Ii(this._viewer, this._cesium).createRadarScan(e, t, i, o, r) }, L.prototype.UndergroundModelOpen = function(e, t) { return this._UndergroundMode.UndergroundModelOpen(e, t) }, L.prototype.UndergroundModelClose = function() { return this._UndergroundMode.close() }, L.prototype.UndergroundMode = function(e, i) { if (e) { this._viewer.scene.globe.translucency.enabled || (this._viewer.scene.globe.translucency.enabled = ! 0, this._viewer.scene.screenSpaceCameraController.enableCollisionDetection = !1, this ._viewer.scene.globe.translucency.backFaceAlpha = 0, this.undergroundValue("set")), this ._viewer.scene.globe.translucency.frontFaceAlpha = void 0 !== i ? i : .5; let t = this._viewer; return { get alpha() { return t.scene.globe.translucency.frontFaceAlpha }, set alpha(e) { t.scene.globe.translucency.frontFaceAlpha = e } } } this._viewer.scene.globe.translucency.enabled && (this._viewer.scene.globe.translucency.enabled = !1, this._viewer.scene.screenSpaceCameraController.enableCollisionDetection = !0, this._viewer.scene .globe.translucency.backFaceAlpha = 1, this.undergroundValue("get")) }, L.prototype.undergroundValue = function(e) { "set" === e ? (this.defaultUnderground = { highDynamicRange: this._viewer.scene.highDynamicRange, skyBox: this._viewer.scene.skyBox.show, fog: this._viewer.scene.fog.enabled, undergroundColor: this._viewer.scene.globe.undergroundColor }, this._viewer.scene.highDynamicRange = !1, this._viewer.scene.skyBox.show = !1, this._viewer .scene.fog.enabled = !1, this._viewer.scene.globe.undergroundColor = void 0) : (this._viewer .scene.highDynamicRange = this.defaultUnderground.highDynamicRange, this._viewer.scene.skyBox .show = this.defaultUnderground.skyBox, this._viewer.scene.fog.enabled = this.defaultUnderground .fog, this._viewer.scene.globe.undergroundColor = this.defaultUnderground.undergroundColor) }, L.prototype.StreetViewOpen = function(e, t, i) { return this._StreetView.StreetViewOpen(e, t, i) }, L.prototype.ExitStreetView = function() { return this._StreetView.exit() }, L.prototype.createWeather = function(e, t, i) { return this._createWeather.createWeather(e, t, i) }, L.prototype.createParticleEffect = function(e, t, i, o) { let r = new mi(this._viewer, this._cesium); return this._Particle || (this._Particle = {}), this._Particle[e] || (this._Particle[e] = []), this ._Particle[e].push(r), r.createParticleEffect(e, t, i, o) }, L.prototype.removeParticleEffect = function(e) { this._Particle && (this._Particle[e] && this._Particle[e].forEach(e => { e.deleteObject() }), this._Particle[e] = []) }, L.prototype.demolition = function(e, t) { let i = new Ji(this._viewer); return i.start(e, t) }, L.prototype.measureTerrainHeight = function(e) { return this._measureTerrainHeight.measureTerrainHeight(e) }, L.prototype.createindoormode = function() { return this._createindoormode.createIndoormode() }, L.prototype.Indoormodeclose = function() { return this._createindoormode.Indoormodeclose() }, L.prototype.createterrainExaggeration = function(e) { return this._createterrainExaggeration.createterrainExaggeration(e) }, L.prototype.createCurtainContrast = function(e, t) { return this._createcurtaincontrast.curtainContrast(e, t) }, L.prototype.clearCurtainContrast = function() { return this._createcurtaincontrast.close() }, L.prototype.measureTerrainArea = function(e) { return this._measureTerrainArea.measureTerrainArea(e) }, L.prototype.measureTerrainkPerimeter = function(e) { return this._measureTerrainkPerimeter.measureTerrainkPerimeter(e) }, L.prototype.createElevationContour = function(e, t, i) { return this._elevationContour.createElevationContour(e, t, i) }, L.prototype.createTerrainProfile = function(e) { return this._createTerrainProfile.createTerrainProfile(e) }, L.prototype.create3DViewshed = function(e) { return this._create3DViewshed.startDraw(e), this._create3DViewshed }, L.prototype.set3DViewshedOptions = function(e) { return this._create3DViewshed.setOptions(e), this._create3DViewshed }, L.prototype.add3DViewshed = function(e) { return this._create3DViewshed.addViewshed(e), this._create3DViewshed }, L.prototype.close3DViewshed = function() { return this._create3DViewshed.close() }, L.prototype.createlineOfSight = function(e, t) { return new Ke(this._viewer, this._cesium).createlineOfSight(e, t) }, L.prototype.createSightLine = function(e) { let t = new Yt(this._viewer); return t.createSightLine(e) }, L.prototype.SunshineAnalysisPoint = function(e, t) { return this._SunshineAnalysis.sunshineAnalysisPoint(e, t) }, L.prototype.SunshineAnalysisPolygon = function(e, t) { return this._SunshineAnalysis.sunshineAnalysisPolygon(e, t) }, Xi.prototype.Highvolume = function(e = []) { var t = this._cesium.PostProcessStageLibrary.createEdgeDetectionStage(); t.uniforms.color = this._cesium.Color.BLUE, t.uniforms.length = .01, t.selected = e, this._viewer.scene .postProcessStages.add(this._cesium.PostProcessStageLibrary.createSilhouetteStage([t])) }, Ki.prototype.createCircleScan = function(e, t, i, o) { e = new this._cesium.Cartographic.fromDegrees(e.lon, e.lat), i = i ? this._cesium.Color .fromCssColorString(i) : new Cesium.Color(1, 0, 0, 1), this.item = this.AddCircleScanPostStage(e, this._cesium.defaultValue(t, 1500), i, this._cesium.defaultValue(o, 4e3)), e = { id: this._core.getuid(), name: "新建扩散圆扫描", pId: 0, type: "scan", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, Ki.prototype.createMultiCircleScan = function(e, t, i, o) { e = new this._cesium.Cartographic.fromDegrees(e.lon, e.lat), i = i ? this._cesium.Color .fromCssColorString(i) : new Cesium.Color(1, 0, 0, 1), this.item = this.AddCircleScanMultiPostStage( e, this._cesium.defaultValue(t, 1500), i, this._cesium.defaultValue(o, 4e3)), e = { id: this._core.getuid(), name: "新建扩散圆扫描", pId: 0, type: "scan", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, Ki.prototype.createRadarScan = function(e, t, i, o) { e = new this._cesium.Cartographic.fromDegrees(e.lon, e.lat), i = i ? this._cesium.Color .fromCssColorString(i) : new Cesium.Color(1, 0, 0, 1), this.item = this.AddRadarScanPostStage(e, this._cesium.defaultValue(t, 1500), i, this._cesium.defaultValue(o, 4e3)), e = { id: this._core.getuid(), name: "新建雷达扫描", pId: 0, type: "scan", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, Ki.prototype.createSectorScan = function(e, t, i, o, r, n) { this._viewer; var a = this._cesium, e = new a.Cartographic.fromDegrees(e.lon, e.lat), i = i ? a.Color.fromCssColorString(i) : new a.Color(1, 0, 0, 1), e = (this.item = this.AddSectorScanPostStage(e, a.defaultValue(t, 1500), i, o, r, a.defaultValue(n, 4e3)), { id: this._core.getuid(), name: "新建扇形扩散扫描", pId: 0, type: "scan", item: this }); return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, Ki.prototype.AddSectorScanPostStage = function(e, t, i, o, r, n) { var a = this._viewer, s = this._cesium, l = s.Cartographic.toCartesian(e), u = new s.Cartesian4(l.x, l.y, l.z, 1), l = new s.Cartographic(e.longitude, e.latitude, e.height + 500), e = s.Cartographic.toCartesian(l), c = new s.Cartesian4(e.x, e.y, e.z, 1), h = ((new Date).getTime(), new s.Cartesian4), m = new s.Cartesian4, d = new s.Cartesian3, l = new s.PostProcessStage({ fragmentShader: "uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius;\nuniform float u_maxRadius;\nuniform vec4 u_scanColor;\nuniform float u_angle;\nuniform float u_yaw;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nfloat getAngle(in vec3 dv)\n{\n if(dv.y == 0.0 && dv.x > 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float angle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n angle = 180.0 + angle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n angle = 180.0 + angle;\n }\n if(dv.y > 0.0)\n {\n angle = 360.0 + angle;\n }\n }\n return angle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nvoid main()\n{\n gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n float depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n if(dis < u_radius)\n {\n vec3 worldCoordi = (czm_inverseView * vec4(prjOnPlane,1.0)).xyz - (czm_inverseView * u_scanCenterEC).xyz; \n float angle = getAngle(worldCoordi);\n float maxAngle = fract((u_yaw + (u_angle/2.0))/360.0)*360.0;\n float minAngle = fract((u_yaw - (u_angle/2.0) + 360.0)/360.0)*360.0;\n bool showPixel = false; \n if(minAngle < maxAngle)\n {\n showPixel = angle > minAngle && angle < maxAngle;\n }\n else\n {\n showPixel = angle > minAngle || angle < maxAngle;\n }\n if(showPixel)\n {\n float f = dis / u_radius;\n f = 1.0 - f;\n gl_FragColor = mix(gl_FragColor, u_scanColor, f);\n float intensity =step(0.001,ripple(dis + 0.1, 0.1, 15.0));\n gl_FragColor.rgb += gl_FragColor.rgb * intensity;\n }\n }\n}\n", uniforms: { u_scanCenterEC: function() { return s.Matrix4.multiplyByVector(a.camera._viewMatrix, u, h) }, u_scanPlaneNormalEC: function() { var e = s.Matrix4.multiplyByVector(a.camera._viewMatrix, u, h), t = s.Matrix4.multiplyByVector(a.camera._viewMatrix, c, m); return d.x = t.x - e.x, d.y = t.y - e.y, d.z = t.z - e.z, s.Cartesian3 .normalize(d, d), d }, u_radius: function() { return t }, u_angle: function() { return o }, u_yaw: function() { return r + 150 }, u_maxRadius: t, u_scanColor: i } }); return a.scene.postProcessStages.add(l) }, Ki.prototype.AddCircleScanPostStage = function(e, t, i, o) { var r = this._viewer, n = this._cesium, a = n.Cartographic.toCartesian(e), s = new n.Cartesian4(a.x, a.y, a.z, 1), a = new n.Cartographic(e.longitude, e.latitude, e.height + 500), e = n.Cartographic.toCartesian(a), l = new n.Cartesian4(e.x, e.y, e.z, 1), u = (new Date).getTime(), c = new n.Cartesian4, h = new n.Cartesian4, m = new n.Cartesian3, a = new n.PostProcessStage({ fragmentShader: "uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nif(dis < u_radius)\n{\nfloat f = 1.0 -abs(u_radius - dis) / u_radius;\nf = pow(f, 4.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n", uniforms: { u_scanCenterEC: function() { return n.Matrix4.multiplyByVector(r.camera._viewMatrix, s, c) }, u_scanPlaneNormalEC: function() { var e = n.Matrix4.multiplyByVector(r.camera._viewMatrix, s, c), t = n.Matrix4.multiplyByVector(r.camera._viewMatrix, l, h); return m.x = t.x - e.x, m.y = t.y - e.y, m.z = t.z - e.z, n.Cartesian3 .normalize(m, m), m }, u_radius: function() { return t * (((new Date).getTime() - u) % o) / o }, u_scanColor: i } }); return r.scene.postProcessStages.add(a) }, Ki.prototype.AddCircleScanMultiPostStage = function(e, t, i, o) { var r = this._viewer, n = this._cesium, a = n.Cartographic.toCartesian(e), s = new n.Cartesian4(a.x, a.y, a.z, 1), a = new n.Cartographic(e.longitude, e.latitude, e.height + 500), e = n.Cartographic.toCartesian(a), l = new n.Cartesian4(e.x, e.y, e.z, 1), u = (new Date).getTime(), c = new n.Cartesian4, h = new n.Cartesian4, m = new n.Cartesian3, d = 0, p = 0, g = 0, a = new n.PostProcessStage({ fragmentShader: "uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius1;\nuniform float u_radius2;\nuniform float u_radius3;\nuniform float u_maxRadius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nif(dis < u_radius1)\n{\nfloat f = dis / u_radius1;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}else if(dis < u_radius2){\nfloat f = dis / u_radius2;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}else if(dis < u_radius3){\nfloat f = dis / u_radius3;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n", uniforms: { u_scanCenterEC: function() { return n.Matrix4.multiplyByVector(r.camera._viewMatrix, s, c) }, u_scanPlaneNormalEC: function() { var e = n.Matrix4.multiplyByVector(r.camera._viewMatrix, s, c), t = n.Matrix4.multiplyByVector(r.camera._viewMatrix, l, h); return m.x = t.x - e.x, m.y = t.y - e.y, m.z = t.z - e.z, n.Cartesian3 .normalize(m, m), m }, u_radius1: function() { return d }, u_radius2: function() { return p }, u_radius3: function() { var e = t * (((new Date).getTime() - u) % o) / o; return e < t / 3 && 0 === p && 0 === d ? g = e : t / 3 <= e && e < 2 * t / 3 && 0 === d ? p = (g = e) - t / 3 : 2 * t / 3 <= e ? (p = (g = e) - t / 3, d = g - 2 * t / 3) : e < t / 3 && 0 !== p && 0 !== d ? (p = (d = e) + t / 3, g = e + 2 * t / 3) : t / 3 <= e && e < 2 * t / 3 && 0 !== d && (d = e - t / 3, g = (p = e) + t / 3), g }, u_maxRadius: t, u_scanColor: i } }); return r.scene.postProcessStages.add(a) }, Ki.prototype.AddRadarScanPostStage = function(e, t, i, o) { var r = this._viewer, n = this._cesium, a = n.Cartographic.toCartesian(e), s = new n.Cartesian4(a.x, a.y, a.z, 1), a = new n.Cartographic(e.longitude, e.latitude, e.height + 500), a = n.Cartographic.toCartesian(a), l = new n.Cartesian4(a.x, a.y, a.z, 1), a = new n.Cartographic(e.longitude + n.Math.toRadians(.001), e.latitude, e.height), e = n.Cartographic.toCartesian(a), u = new n.Cartesian4(e.x, e.y, e.z, 1), c = new n.Quaternion, h = new n.Matrix3, m = (new Date).getTime(), d = new n.Cartesian4, p = new n.Cartesian4, g = new n.Cartesian4, _ = new n.Cartesian3, f = new n.Cartesian3, a = new n.PostProcessStage({ fragmentShader: "uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform vec3 u_scanLineNormalEC;\nuniform float u_radius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nbool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\n{\nvec3 v01 = testPt - ptOnLine;\nnormalize(v01);\nvec3 temp = cross(v01, lineNormal);\nfloat d = dot(temp, u_scanPlaneNormalEC);\nreturn d > 0.5;\n}\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\n{\nvec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\nreturn length(tempPt - ptOnLine);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nfloat twou_radius = u_radius * 2.0;\nif(dis < u_radius)\n{\nvec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;\nfloat f = 0.0;\nif(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz))\n{\nfloat dis1= length(prjOnPlane.xyz - lineEndPt);\nf = abs(twou_radius -dis1) / twou_radius;\nf = pow(f, 3.0);\n}\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n", uniforms: { u_scanCenterEC: function() { return n.Matrix4.multiplyByVector(r.camera._viewMatrix, s, d) }, u_scanPlaneNormalEC: function() { var e = n.Matrix4.multiplyByVector(r.camera._viewMatrix, s, d), t = n.Matrix4.multiplyByVector(r.camera._viewMatrix, l, p); return _.x = t.x - e.x, _.y = t.y - e.y, _.z = t.z - e.z, n.Cartesian3 .normalize(_, _), _ }, u_radius: t, u_scanLineNormalEC: function() { var e = n.Matrix4.multiplyByVector(r.camera._viewMatrix, s, d), t = n.Matrix4.multiplyByVector(r.camera._viewMatrix, l, p), i = n.Matrix4.multiplyByVector(r.camera._viewMatrix, u, g), t = (_.x = t.x - e.x, _.y = t.y - e.y, _.z = t.z - e.z, n.Cartesian3 .normalize(_, _), f.x = i.x - e.x, f.y = i.y - e.y, f.z = i.z - e.z, (( new Date).getTime() - m) % o / o); return n.Quaternion.fromAxisAngle(_, t * n.Math.PI * 2, c), n.Matrix3 .fromQuaternion(c, h), n.Matrix3.multiplyByVector(h, f, f), n.Cartesian3 .normalize(f, f), f }, u_scanColor: i } }); return r.scene.postProcessStages.add(a) }, Ki.prototype.remove = function() { this._viewer.scene.postProcessStages.remove(this.item) }, Ki.prototype.setTreeobj = function(e) { this.treeobj = e }, Ki.prototype.deleteObject = function() { this.item && this._viewer.scene.postProcessStages.remove(this.item) }, Ki.prototype.setVisibility = function(e) { this.item && (this.item.enabled = e) }, $i.prototype.executeScopefieldvision = function() { var h = this, t = (e.prototype._init = function() { var e = this; this.options.polygon.hierarchy = new h._cesium.CallbackProperty(function() { return e.hierarchy }, !1), this.polygon = h._viewer.entities.add(this.options), h.item = this.polygon }, e); function e(e) { this.options = { name: "", polygon: { fill: !0, hierarchy: [], height: 0, perPositionHeight: !0, heightReference: h._cesium.HeightReference.CLAMP_TO_GROUND, material: h._cesium.Color.YELLOW.withAlpha(.3) } }, this.hierarchy = e, this._init() } var m = new this._cesium.ScreenSpaceEventHandler(h._viewer.scene.canvas), d = [], p = void 0; return m.setInputAction(function(e) { e = h._viewer.scene.camera.pickEllipsoid(e.position, h._viewer.scene.globe.ellipsoid); 0 == d.length && d.push(e.clone()), d.push(e) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), m.setInputAction(function(e) { e = h._viewer.scene.camera.pickEllipsoid(e.endPosition, h._viewer.scene.globe.ellipsoid); 2 <= d.length && (h._cesium.defined(p) ? null != e && (d.pop(), e.y += 1 + Math.random(), d .push(e)) : p = new t(d)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), m.setInputAction(function(e) { m.destroy(); for (var t = { polygon: {}, positions: [], area: [] }, i = (t.polygon = p, []), o = 0; o < d.length; o++) { var r = h._cesium.Cartographic.fromCartesian(d[o]), n = h._cesium.Math.toDegrees(r.longitude), a = h._cesium.Math.toDegrees(r.latitude), r = r.height; i.push({ lon: n, lat: a, hei: r }), h._polygonsd.push([n, a]) } t.positions = i; var s = h._viewer.camera.heading, l = h._viewer.camera.pitch, u = h._viewer.camera.roll, c = h._viewer.camera.position.clone(), s = (h._xjwz = { orientation: { heading: s, pitch: l, roll: u }, position: c }, h._viewer.scene.camera.moveEnd.addEventListener(function() { var e, t, i, o = h._viewer.camera.computeViewRectangle(); o != h._rectangle && (e = (h._rectangle = o).west / Math.PI * 180, t = o .north / Math.PI * 180, i = o.east / Math.PI * 180, o = o.south / Math.PI * 180, h.exports([(e + i) / 2, (t + o) / 2], h ._polygonsd) || null != h._xjwz && h._viewer.camera.setView({ destination: h._xjwz.position, orientation: h._xjwz.orientation })) }), 0), l = (h._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (s = V .selectedItem.id), h._core.getuid()); V.insertGroupId({ id: l, name: "视野范围面" + l, pId: h._core.isnull(s) ? 0 : s, type: "polygon", item: h }, h._core.isnull(s) ? 0 : s), "function" == typeof method && method(t) }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, $i.prototype.exports = function(e, t) { for (var i = e[0], o = e[1], r = !1, n = 0, a = t.length - 1; n < t.length; a = n++) { var s = t[n][0], l = t[n][1], u = t[a][0], c = t[a][1]; o < l != o < c && i < (u - s) * (o - l) / (c - l) + s && (r = !r) } return r }, M.prototype.createPolyline = function(e, t, i, o, r) { var n = []; if (e[0].x || e[0].y) if (void 0 !== e[0].z) for (a = 0; a < e.length; a++) n.push(this._cesium.Cartesian3.fromDegrees(e[a].x, e[a].y, e[a] .z)); else for (a = 0; a < e.length; a++) n.push(this._cesium.Cartesian3.fromDegrees(e[a].x, e[a].y)); else if (2 === e[0].length) for (var a = 0; a < e.length; a++) n.push(this._cesium.Cartesian3.fromDegrees(e[a][0], e[a][1])); else if (3 === e[0].length) for (var a = 0; a < e.length; a++) n.push(this._cesium.Cartesian3.fromDegrees(e[a][0], e[a][1], e[a] [2])); i = 2 !== i, this.item = this._viewer.entities.add({ polyline: { positions: n, width: 10, material: new this._cesium.PolylineGlowMaterialProperty({ outlineColor: this._cesium.Color.BLACK, color: new m(this._viewer, this._cesium).colorFromHtmlColor(t) }), clampToGround: i } }), t = { id: this.item.id, name: r, pId: this._core.isnull(o) ? 0 : o, type: "polyline", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, M.prototype.getstyles = function() { var e = {}; return e.show = !this.item.polyline.show || this.item.polyline.show.getValue(), e.positions = this.item .polyline.positions.getValue().toString(), e.width = this.item.polyline.width.toString(), e .granularity = this.item.polyline.granularity ? this.item.polyline.granularity.toString() : null, e .material = {}, e.material.color = this.item.polyline.material && this.item.polyline.material .color && this.item.polyline.material.color._value ? "rgba" + this.item.polyline.material.color .toString() : null, e.material.outlineColor = this.item.polyline.material.outlineColor && this.item .polyline.material.outlineColor._value ? "rgba" + this.item.polyline.material.outlineColor .toString() : null, e.material.outlineWidth = this.item.polyline.material.outlineWidth && this.item .polyline.material.outlineWidth._value ? this.item.polyline.material.outlineWidth.toString() : null, e.classificationType = this.item.polyline.classificationType ? this.item.polyline.classificationType .toString() : null, e.near = this.item.polyline.distanceDisplayCondition ? this.item.polyline .distanceDisplayCondition._value.near : null, e.far = this.item.polyline.distanceDisplayCondition ? this.item.polyline.distanceDisplayCondition._value.far : null, e }, M.prototype.createLink = function(e, t, i) { i = i || {}; var o, r, n, a, s = [], l = [], u = (e.lon && e.lat ? void 0 !== e.height ? (s.push(this._cesium.Cartesian3.fromDegrees(e.lon, e .lat, e.height)), s.push(this._cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height)), l .push({ x: e.lon, y: e.lat, z: e.height }, { x: t.lon, y: t.lat, z: t.height })) : (s.push(this._cesium.Cartesian3.fromDegrees(e.lon, e.lat)), s.push(this._cesium .Cartesian3.fromDegrees(t.lon, t.lat)), l.push({ x: e.lon, y: e.lat, z: 0 }, { x: t.lon, y: t.lat, z: 0 })) : e.x && e.y ? (void 0 !== e.z ? (s.push(this._cesium.Cartesian3.fromDegrees(e.x, e.y, e .z)), s.push(this._cesium.Cartesian3.fromDegrees(t.x, t.y, t.z))) : (s.push(this._cesium .Cartesian3.fromDegrees(e.x, e.y)), s.push(this._cesium.Cartesian3.fromDegrees(t.x, t.y)), e.z = 0, t.z = 0), l.push(e, t)) : 2 === e.length ? (s.push(this._cesium.Cartesian3 .fromDegrees(e[0], e[1])), s.push(this._cesium.Cartesian3.fromDegrees(t[0], t[1])), l .push({ x: e[0], y: e[1], z: 0 }, { x: t[0], y: t[1], z: 0 })) : 3 === e.length && (s.push(this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2])), s .push(this._cesium.Cartesian3.fromDegrees(t[0], t[1], t[2])), l.push({ x: e[0], y: e[1], z: e[2] }, { x: t[0], y: t[1], z: t[2] })), 1 === i.lineType ? i.material = new this._cesium.PolylineDashMaterialProperty({ color: this._core.defaultValue(i.lineColor && this._cesium.Color.fromCssColorString(i .lineColor), this._cesium.Color.AQUAMARINE) }) : 2 === i.lineType ? i.material = new this._cesium.PolylineGlowMaterialProperty({ glowPower: .3, color: this._core.defaultValue(i.lineColor && this._cesium.Color.fromCssColorString(i .lineColor), this._cesium.Color.BLUE) }) : i.material = this._core.defaultValue(i.lineColor && this._cesium.Color.fromCssColorString(i .lineColor), this._cesium.Color.AQUAMARINE), i.cylinder && (e = l[1].z - l[0].z, t = Cesium .Cartesian3.fromDegrees(l[0].x, l[0].y, 0), n = Cesium.Cartesian3.fromDegrees(l[1].x, l[0] .y, 0), n = this._core.getSpaceDistancem([t, n], this._cesium), o = 0 == e ? Math.PI / 2 : Math.atan(n / e), r = this._core.getSpaceDistancem(s, this._cesium), C = Cesium .Cartesian3.fromDegrees(l[0].x, l[1].y, 0), n = this._core.getSpaceDistancem([t, C], this ._cesium), t = Math.asin(n / r), l[0].x > l[1].x && l[0].y > l[1].y ? t = e < 0 ? -t : t : l[0].x > l[1].x && l[0].y < l[1].y ? t = 0 <= e ? -t : t : l[0].x < l[1].x && l[0].y <= l[1].y ? (o = 0 != e ? -o : o, t = 0 < e ? -t : t) : l[0].x < l[1].x && l[0].y > l[1].y && ( t = e < 0 ? -t : t, o = -o), a = new Cesium.HeadingPitchRoll(0, o, t)), s[0]), c = (this.item = this._viewer.entities.add({ position: new this._cesium.CallbackProperty(function() { return u }, !1), orientation: i.cylinder ? new this._cesium.CallbackProperty(function() { return Cesium.Transforms.headingPitchRollQuaternion(u, a) }, !1) : void 0, polyline: { positions: s, width: this._core.defaultValue(i.width, 2), material: i.material, clampToGround: !1 }, cylinder: i.cylinder ? { length: this._core.defaultValue(i.length, 20), topRadius: this._core.defaultValue(i.size, 8), bottomRadius: this._core.defaultValue(i.size, 8), material: this._core.defaultValue(i.pointColor && this._cesium.Color .fromCssColorString(i.pointColor), this._cesium.Color.RED) } : void 0, point: i.cylinder ? void 0 : { color: this._core.defaultValue(i.pointColor && this._cesium.Color .fromCssColorString(i.pointColor), this._cesium.Color.RED), outlineColor: this._core.defaultValue(i.outlineColor && this._cesium.Color .fromCssColorString(i.outlineColor), this._cesium.Color.YELLOW), outlineWidth: this._core.defaultValue(i.outlineWidth, 2), pixelSize: this._core.defaultValue(i.size, 8) } }), this._core.defaultValue(i.num, 200)), h = this._cesium.Math.lerp(l[0].x, l[1].x, 1 / c) - l[0].x, m = this._cesium.Math.lerp(l[0].y, l[1].y, 1 / c) - l[0].y, d = this._cesium.Math.lerp(l[0].z, l[1].z, 1 / c) - l[0].z, p = []; p.push(s[0]); for (let e = 0; e < c; e++) { var g = l[0].x + (e + 1) * h, _ = l[0].y + (e + 1) * m, f = l[0].z + (e + 1) * d; p.push(this._cesium.Cartesian3.fromDegrees(g, _, f)) } p.push(s[1]); var y = this._core.defaultValue(i.speed, 1), v = 0, C = (this._viewer.clock.onTick.addEventListener(function() { v += y, ((v = parseInt(v)) >= p.length - 1 && 0 < y || v <= 0 && y < 0) && (y = -y), u = p[v] }), { id: this.item.id, name: "新建链路", pId: 0, type: "polyline", item: this }); return this.setTreeobj(C), this._tree.insertGroupId(C, 0), this }, M.prototype.createLinkPros = function(o) { this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this._tree .removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium .ScreenSpaceEventHandler(this._viewer.scene.canvas); var r = [], n = null, t = "0米", i = null, a = this, s = "", l = this._core.CreateTooltip(), u = { point: a._cesium.Color.RED, polyline: a._cesium.Color.BLUE }, c = (this._tree.handler.setInputAction(function(e) { (i = a._getPosition.getMousePosition(e)) && (0 === r.length ? l.showAt(e.endPosition, "左键开始绘制!") : l.showAt(e.endPosition, "右键结束绘制!"), 2 <= r.length && (a._cesium .defined(n) ? (r.length > a._points.length && r.pop(), r.push(i)) : n = new c(r) )) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function( e) { a._viewer.camera.getPickRay(e.position), (i = a._getPosition.getMousePosition(e)) && ( 0 != r.length && r.length > a._points.length ? (r.pop(), r.push(i)) : r.push(i, i), 2 <= r.length && (a._cesium.defined(n) || (n = new c(r)), t = a._core .getSpaceDistance(r, a._cesium)), s = "总长:" + t) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function( e) { a.end && a.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { var t, i; l.show(!1), a._tree && a._tree.handler.destroy(), a._core.mouse(a._viewer.container, 0, "0"), a.end = void 0, n && (t = { width: 4, lineColor: "#0000ff" }, i = n.positions, a._tree && a._tree.endtemporaryItem(), a._points[a._points .length - 1] && (a._points[a._points.length - 1].label.text = s), a._viewer .entities.remove(a.item), "cancel" === e || r.length < 2 || (a.item = a._viewer .entities.add({ name: "新建链路", polyline: { positions: i, width: a._core.defaultValue(t.width, 2), material: a._core.getLinkMaterial(t.lineColor, t.pointColor, t .time), clampToGround: !0 } }), o && o(a.item))) }, e.prototype._init = function() { var e = this, t = (this.options.polyline.positions = new a._cesium.CallbackProperty(function() { return e.positions }, !1), a._viewer.entities.add(this.options)); a.item = t, a._tree.temporaryItem.obj.push(t), a._core.getuid() }, e); function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: u.polyline, width: 3, clampToGround: !0 } }, this.positions = e, this._init() } return this }, M.prototype.createLandingLine = function(e, t = {}) { var i = [], e = (e.lon && e.lat ? (i.push(Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height)), i.push(Cesium .Cartesian3.fromDegrees(e.lon, e.lat, 0))) : Array.isArray(e) ? (i.push(Cesium.Cartesian3 .fromDegrees(e[0], e[1], e[2])), i.push(Cesium.Cartesian3.fromDegrees(e[0], e[1], 0))) : e instanceof Cesium.Cartesian3 && (i.push(e), e = this._core.toDegrees(e), i.push(Cesium .Cartesian3.fromDegrees(e.lon, e.lat, 0))), this.item = this._viewer.entities.add({ name: "新建接地线", polyline: { positions: new Cesium.CallbackProperty(function() { return i }, !1), width: this._core.defaultValue(t.width, 2), material: Cesium.Color.fromCssColorString(t.color || "#fff") } }), this.positions = { get value() { return i }, set value(e) { i[0] = e; let t = Cesium.Cartographic.fromCartesian(e); t.height = 0, i[1] = Cesium.Cartographic.toCartesian(t) } }, { id: this.item.id, name: "新建接地线", pId: 0, type: "polyline", item: this }); return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, M.prototype.createLinkPro = function(e, t, i) { i = i || {}; var o = [], r = [], r = (e.lon && e.lat ? void 0 !== e.height ? (o.push(this._cesium.Cartesian3.fromDegrees(e.lon, e .lat, e.height)), o.push(this._cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height)), r .push({ x: e.lon, y: e.lat, z: e.height }, { x: t.lon, y: t.lat, z: t.height })) : (o.push(this._cesium.Cartesian3.fromDegrees(e.lon, e.lat)), o.push(this._cesium .Cartesian3.fromDegrees(t.lon, t.lat)), r.push({ x: e.lon, y: e.lat, z: 0 }, { x: t.lon, y: t.lat, z: 0 })) : e.x && e.y ? (void 0 !== e.z ? (o.push(this._cesium.Cartesian3.fromDegrees(e.x, e.y, e .z)), o.push(this._cesium.Cartesian3.fromDegrees(t.x, t.y, t.z))) : (o.push(this._cesium .Cartesian3.fromDegrees(e.x, e.y)), o.push(this._cesium.Cartesian3.fromDegrees(t.x, t.y)), e.z = 0, t.z = 0), r.push(e, t)) : 2 === e.length ? (o.push(this._cesium.Cartesian3 .fromDegrees(e[0], e[1])), o.push(this._cesium.Cartesian3.fromDegrees(t[0], t[1])), r .push({ x: e[0], y: e[1], z: 0 }, { x: t[0], y: t[1], z: 0 })) : 3 === e.length && (o.push(this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2])), o .push(this._cesium.Cartesian3.fromDegrees(t[0], t[1], t[2])), r.push({ x: e[0], y: e[1], z: e[2] }, { x: t[0], y: t[1], z: t[2] })), this.item = this._viewer.entities.add({ name: "新建链路", polyline: { positions: o, width: this._core.defaultValue(i.width, 2), material: this._core.getLinkMaterial(i.lineColor, i.pointColor, i.time), clampToGround: i.clampToGround } }), { id: this.item.id, name: "新建链路", pId: 0, type: "polyline", item: this }); return this.setTreeobj(r), this._tree.insertGroupId(r, 0), this }, M.prototype.executePolyline = function(t, l) { var u = this, i = (e.prototype._init = function() { var e = this; this.options.polyline.positions = new u._cesium.CallbackProperty(function() { return e.positions }, !1), this.polyline = u._viewer.entities.add(this.options), u.item = this.polyline }, e); function e(e) { this.options = { polyline: { show: !0, positions: [], material: new u._cesium.PolylineOutlineMaterialProperty({ color: u._core.defaultValue(t.color, u._cesium.Color.YELLOW) }), clampToGround: u._core.defaultValue(t.clampToGround, !0), width: u._core.defaultValue(t.width, 3) } }, this.positions = e, this._init() } var c = new u._cesium.ScreenSpaceEventHandler(u._viewer.scene.canvas), h = [], m = void 0, d = this._core.CreateTooltip(); return this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), c.setInputAction( function(e) { e = u._getPosition.getMousePosition(e); 0 == h.length && h.push(e.clone()), h.push(e) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), c.setInputAction(function(e) { 0 === h.length ? d.showAt(e.endPosition, "左键开始绘制!") : d.showAt(e.endPosition, "右键结束绘制!"); e = u._getPosition.getMousePosition(e); 2 <= h.length && (u._cesium.defined(m) ? null != e && (h.pop(), e.y += 1 + Math.random(), h .push(e)) : m = new i(h)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), c.setInputAction(function(e) { d.show(!1); var t = { polyline: {}, positions: [], positionsp: [], distance: [], setDistance: function() { alert("qq") } }; c.destroy(), t.polyline = m; for (var i = [], o = 0; o < h.length; o++) { var r = u._cesium.Cartographic.fromCartesian(h[o]), n = u._cesium.Math.toDegrees(r.longitude), a = u._cesium.Math.toDegrees(r.latitude), r = r.height; i.push({ lon: n, lat: a, hei: r }) } t.positions = i; for (var s = 1; s < h.length; s++) t.distance[s - 1] = X(h[s - 1].y, h[s - 1].x, h[s].y, h[ s].x); t.positionsp = h, u._core.mouse(u._viewer.container, 0, "0"), "function" == typeof l && l(t) }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, M.prototype.executePolyline1 = function(t, e) { this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this._tree .removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium .ScreenSpaceEventHandler(this._viewer.scene.canvas); var i, o, r = [], n = null, a = "0米", s = null, l = this, u = "", c = this._core.CreateTooltip(), h = { name: "", spot: [], distance: [], label: [], ployline: [] }, m = { point: l._cesium.Color.RED, polyline: l._cesium.Color.YELLOW }, d = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (m.point = e.point), "" != e .polyline && null != e.polyline && (m.polyline = e.polyline)), this._tree.handler .setInputAction(function(e) { (s = l._getPosition.getMousePosition(e)) && (0 === r.length ? c.showAt(e.endPosition, "左键开始绘制!") : c.showAt(e.endPosition, "右键结束绘制!"), 2 <= r.length && (l._cesium .defined(n) ? (r.length > l._points.length && r.pop(), r.push(s)) : n = new d( r), a = l._core.getSpaceDistance(r, l._cesium)), o && (l._viewer.entities .remove(o), o = void 0), o = l._viewer.entities.add({ name: "空间直线距离", position: r[r.length - 1], label: { text: "总长:" + a, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), l._tree.temporaryItem.obj.push(o)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function( e) { l._viewer.camera.getPickRay(e.position), (s = l._getPosition.getMousePosition(e)) && ( 0 != r.length && r.length > l._points.length ? (r.pop(), r.push(s)) : r.push(s, s), 2 <= r.length && (l._cesium.defined(n) || (n = new d(r)), a = l._core .getSpaceDistance(r, l._cesium)), o && (l._viewer.entities.remove(o), o = void 0), u = "总长:" + (e = a), i = l._viewer.entities.add({ name: "空间直线距离", position: r[r.length - 1], point: { pixelSize: 5, color: m.point, outlineColor: l._cesium.Color.WHITE, outlineWidth: 2, clampToGround: !0 }, label: { text: e, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), l._tree.temporaryItem.obj.push(i), l._points.push(i), h.spot.push(s), h .distance.push(a), h.label.push(i)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function( e) { l.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = function(e) { c.show(!1), l._tree && l._tree.endtemporaryItem(), l.end = void 0, o && (l._viewer.entities .remove(o), o = void 0, r.pop()), l._points[l._points.length - 1] && (l._points[l ._points.length - 1].label.text = u), l._tree && l._tree.handler.destroy(), l._core .mouse(l._viewer.container, 0, "0"), "cancel" === e ? l.deleteObject() : (r.length < 2 && l.deleteObject(), "" != t && null != t && "function" == typeof t && t(h)) }, p.prototype._init = function() { var e = this, t = (this.options.polyline.positions = new l._cesium.CallbackProperty(function() { return e.positions }, !1), l._viewer.entities.add(this.options)), t = (l.item = t, l._tree.temporaryItem.obj.push(t), h.ployline.push(t), l._core .getuid()); h.name = "新建空间距离" + t }, p); function p(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: m.polyline, width: 3, clampToGround: !1 } }, this.positions = e, this._init() } return this }, M.prototype.executeHorizontal = function(t, e) { var i, o, c = this, r = (this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), n = null, a = "0米", s = null, c = this, l = "", u = this._core.CreateTooltip(), h = { spot: [], distance: [], label: [], ployline: [] }, m = { point: c._cesium.Color.RED, polyline: c._cesium.Color.YELLOW }, d = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (m.point = e.point), "" != e .polyline && null != e.polyline && (m.polyline = e.polyline)), this._tree.handler .setInputAction(function(e) { (s = c._getPosition.getMousePosition(e)) && (0 === r.length ? u.showAt(e.endPosition, "左键开始绘制!") : u.showAt(e.endPosition, "右键结束绘制!"), 2 <= r.length && (c._cesium .defined(n) ? (r.pop(), r.push(s)) : n = new p(r), a = c._core.getSpaceDistance( r, c._cesium)), c._viewer.entities.remove(o), o = c._viewer.entities.add({ name: "空间直线距离", position: r[r.length - 1], label: { text: "总长:" + a, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), c._tree.temporaryItem.obj.push(o)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function( e) { c._viewer.camera.getPickRay(e.position), (s = c._getPosition.getMousePosition(e)) && (d( s), 0 == r.length && r.push(s.clone()), r.push(s), l = "总长:" + (e = a), i = c._viewer.entities.add({ name: "空间直线距离", position: r[r.length - 1], point: { pixelSize: 5, color: m.point, outlineColor: c._cesium.Color.WHITE, outlineWidth: 2, clampToGround: !0 }, label: { text: e, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), c._tree.temporaryItem.obj.push(i), c._points.push(i), h.spot.push(s), h .distance.push(a), h.label.push(i)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), function(e) { polylineCartographic.push(e); var t = []; if (1 < polylineCartographic.length) { var i = polylineCartographic[polylineCartographic.length - 2], o = polylineCartographic[polylineCartographic.length - 1], r = 1e7 * Math.abs(i.longitude - o.longitude), n = 1e7 * Math.abs(i.latitude - o.latitude), a = (n < r && (n = r), parseInt(n / 10)); (a = 1e3 < a ? 1e3 : a) < 2 && (a = 2); for (var s = 0; s < a; ++s) t.push(new c._cesium.Cartographic(c._cesium.Math.lerp(i .longitude, o.longitude, s / (a - 1)), c._cesium.Math.lerp(i.latitude, o .latitude, s / (a - 1)))) } else t = polylineCartographic; if (0 < t.length) for (var l = 0; l < t.length; l++) { var e = t[l], u = c._viewer.scene.globe.getHeight(e); c._cesium.Cartesian3.fromDegrees(e.longitude / Math.PI * 180, e.latitude / Math.PI * 180, u) } }), p = (this._tree.handler.setInputAction(function(e) { u.show(!1), c._tree.endtemporaryItem(), c._viewer.entities.remove(o), c._points[c ._points.length - 1].label.text = l, c._tree.handler.destroy(), r.pop(), "" != t && null != t && "function" == typeof t && t(h) }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), g.prototype._init = function() { var e = this, t = (this.options.polyline.positions = new c._cesium.CallbackProperty(function() { return e.positions }, !1), c._viewer.entities.add(this.options)); c.item = t, c._tree.temporaryItem.obj.push(t), h.ployline.push(t) }, g); function g(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: m.polyline, width: 3, clampToGround: !1 } }, this.positions = e, this._init() } return this }, M.prototype.executeHorizontals = function(t, e) { this._tree.removeHandler(), this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D .draw), this._tree.starttemporaryItem(this._viewer); var h, m = this, d = [], p = "", g = [], _ = void 0, i = m._viewer.scene, l = i.globe.ellipsoid, f = { name: "", spot: [], distance: [], label: [], polyline: [] }, y = { point: m._cesium.Color.RED, polyline: m._cesium.Color.YELLOW }, e = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (y.point = e.point), "" != e .polyline && null != e.polyline && (y.polyline = e.polyline)), new m._cesium .BillboardCollection), u = (i.primitives.add(e), new m._cesium.WebMercatorProjection), o = (this._tree.handler = new m._cesium.ScreenSpaceEventHandler(i.canvas), this._core .CreateTooltip()), v = [], C = (this._tree.handler.setInputAction(function(e) { 0 === d.length ? o.showAt(e.endPosition, "左键开始绘制!") : o.showAt(e.endPosition, "右键结束绘制!"), (e = m._getPosition.getMousePosition(e, f.polyline.concat(f.label))) && m._cesium.Ellipsoid.WGS84.cartesianToCartographic(e) && (e = e, d.length < 1 || (m ._cesium.defined(_) ? (_.path.pop(), _.path.push(e), v.pop(), v.push(e)) : _ = new w(d, m._cesium), e = C(v), h && (m._viewer.entities.remove(h), h = void 0), h = m._viewer.entities.add({ name: "空间直线距离", position: _.path[_.path.length - 1], label: { text: "总长:" + e, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }))) }, m._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { e = m._getPosition.getMousePosition(e, f.polyline.concat(f.label)); if (n = e ? m._cesium.Ellipsoid.WGS84.cartesianToCartographic(e) : n) { 0 < v.length && v.pop(); var t = n, i = (g.push(t), []); if (1 < g.length) { var o = g[g.length - 2], r = g[g.length - 1], n = 1e7 * Math.abs(o.longitude - r.longitude), a = 1e7 * Math.abs(o.latitude - r.latitude), s = (a < n && (a = n), parseInt(a / 10)); (s = 1e3 < s ? 1e3 : s) < 2 && (s = 2); for (var l = 0; l < s; ++l) i.push(new m._cesium.Cartographic(m._cesium.Math .lerp(o.longitude, r.longitude, l / (s - 1)), m._cesium.Math.lerp(o .latitude, r.latitude, l / (s - 1)))); i.push(r.clone()) } else i = g; if (0 < i.length) for (var u = 0; u < i.length; u++) { var t = i[u], c = m._viewer.scene.globe.getHeight(t), c = m._cesium.Cartesian3.fromRadians(t.longitude, t.latitude, c); v.push(c) } 0 === d.length ? d.push(e, e) : d.push(e), m._cesium.defined(_) || (_ = new w(d, m ._cesium)), h && (m._viewer.entities.remove(h), h = void 0); n = "0米", a = (_ && (n = C(v)), v.push(e), p = "总长:" + n, f.spot.push(e), f.distance .push(n), m._viewer.entities.add({ position: e, point: { pixelSize: 5, color: y.point, outlineColor: m._cesium.Color.WHITE, outlineWidth: 1, clampToGround: !0 }, label: { text: n, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } })); f.label.push(a), m._points.push(a) } }, m._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function() { m.end() }, m._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = function(e) { m._tre && m._tree.endtemporaryItem(), h && m._viewer.entities.remove(h), m._points[m._points .length - 1] && (m._points[m._points.length - 1].label.text = p), m._tree && m._tree .handler.destroy(), m.end = void 0, m._core.mouse(m._viewer.container, 0, "0"), d.pop(), o.show(!1), "cancel" === e ? m.deleteObject() : (d.length < 2 && m.deleteObject(), "" != t && null != t && "function" == typeof t && t(f)) }, function(e) { for (var t, i, o, r, n = 0, a = "0米", s = 0; s < e.length - 1; s++) o = l .cartesianToCartographic(e[s]), t = (r = u.project(o)).x, i = r.y, o = l .cartesianToCartographic(e[s + 1]), o = (r = u.project(o)).x, r = r.y, n += Math.sqrt(( t - o) * (t - o) + (i - r) * (i - r)); return 0 < n && (a = n.toFixed(2) + "米"), a = 1 <= n / 1e3 ? (n / 1e3).toFixed(2) + "千米" : a }), w = (r.prototype._init = function(e) { var t = this, i = (this.options.polyline.positions = new m._cesium.CallbackProperty(function() { return t.path }, !1), this.lineEntity = m._viewer.entities.add(this.options), m.item = this .lineEntity, f.polyline.push(this.lineEntity), m._core.getuid()); f.name = "新建水平距离" + i }, r); function r(e, t) { if (!m._cesium.defined(e)) throw new m._cesium.DeveloperError("positions is required!"); if (e.length < 2) throw new m._cesium.DeveloperError("positions 的长度必须大于等于2"); m._cesium.Material.fromType(m._cesium.Material.ColorType).uniforms.color = new m._cesium.Color(1, 1, 0, .5), this.options = { name: "直线", polyline: { show: !0, positions: [], material: y.polyline, width: 3, clampToGround: !0 } }, this.path = e, this._init(m._cesium) } return this }, M.prototype.getHeight = function(e) { var t = this._cesium.Cartographic.fromCartesian(e[0]), e = this._cesium.Cartographic.fromCartesian(e[1]).height - t.height; return e = e < 1e3 ? e.toFixed(2) + "米" : (e /= 1e3).toFixed(2) + "千米" }, M.prototype.executeHeight = function(t) { var r = this, n = (this._tree.starttemporaryItem(this._viewer), this._tree.removeHandler(), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), i = null, a = 0, o = this._core.CreateTooltip(), s = null, l = (this._tree.handler.setInputAction(function(e) { (s = r._getPosition.getMousePosition(e)) && (0 === n.length ? o.showAt(e.endPosition, "左键开始绘制!") : o.showAt(e.endPosition, "右键结束绘制!"), 2 <= n.length && (r._cesium .defined(i) ? (n.pop(), n.push(s)) : i = new l(n), 1 < n.lenght && (a = r._core .getHeight(n, r._cesium)))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function( e) { (s = r._getPosition.getMousePosition(e)) && (e = a + "米", 0 == n.length ? (n.push(s .clone()), n.push(s), e = r._viewer.entities.add({ name: "高度", position: n[0], point: { pixelSize: 5, color: r._cesium.Color.RED, outlineColor: r._cesium.Color.WHITE, outlineWidth: 2, clampToGround: !0, heightReference: r._cesium.HeightReference.none }, label: { text: e, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), r._tree.temporaryItem.obj.push(e), r._points.push(e)) : 1 <= n.length && (r ._tree.endtemporaryItem(), "" != t && null != t && "function" == typeof t && t( n))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function( e) { r._tree.handler.destroy(); var t = a + "米", i = r._cesium.Cartographic.fromCartesian(n[0]), o = r._cesium.Cartographic.fromCartesian(n[1]), i = r._cesium.Cartesian3.fromDegrees(cesium.Math.toDegrees(i.longitude), r._cesium .Math.toDegrees(i.latitude), o.height), o = r._viewer.entities.add({ name: "直线距离", position: i, point: { pixelSize: 5, color: r._cesium.Color.RED, outlineColor: r._cesium.Color.WHITE, outlineWidth: 2, clampToGround: !0, heightReference: r._cesium.HeightReference.none }, label: { text: t, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); r._tree.temporaryItem.obj.push(o), r._points.push(o) }, this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), e.prototype._init3 = function() { var o = this, e = (this.options.polyline.positions = new r._cesium.CallbackProperty(function() { var e = [], t = (e.push(o.positions[0]), r._cesium.Cartographic.fromCartesian(o .positions[0])); try { var i = r._cesium.Cartographic.fromCartesian(o.positions[1]) } catch (e) { return } t = r._cesium.Cartesian3.fromDegrees(r._cesium.Math.toDegrees(t.longitude), r._cesium.Math.toDegrees(t.latitude), i.height); return e.push(t), e }, !1), r._viewer.entities.add(this.options)); r.item = e, r._tree.temporaryItem.obj.push(e) }, e); function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: r._cesium.Color.YELLOW, clampToGround: !0, width: 3 }, ellipse: { show: !1, material: r._cesium.Color.GREEN.withAlpha(.5), clampToGround: !0, outline: !0 } }, this.positions = e, this._init3() } return this }, M.prototype.executeHeightTe = function(t) { this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this._tree .removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium .ScreenSpaceEventHandler(this._viewer.scene.canvas); var r, i = [], o = null, n = null, a = this, s = { name: "", spot: [], kjdistance: "", spdistance: "", gddistance: "", point: [], polyline: [] }, l = !1, u = this._core.CreateTooltip(); function c(e) { var t, i, o = a._cesium.Cartographic.fromCartesian(e[0]), r = a._cesium.Cartographic.fromCartesian(e[1]); return r.height, r.height, o.height, r = 0 < r.height - o.height ? (t = a._cesium.Cartesian3 .fromDegrees(a._cesium.Math.toDegrees(o.longitude), a._cesium.Math.toDegrees(o.latitude), r .height), i = [e[1], t], [e[0], t]) : (t = a._cesium.Cartesian3.fromDegrees(a._cesium .Math.toDegrees(r.longitude), a._cesium.Math.toDegrees(r.latitude), o.height), i = [e[ 0], t ], [e[1], t]), { new: t, eq_height: i, eq_lon_lat: r } } this._tree.handler.setInputAction(function(e) { 0 === i.length ? u.showAt(e.endPosition, "左键开始绘制!") : u.showAt(e.endPosition, "中键开启/关闭吸附,右键结束!"), (n = a._getPosition.getMousePosition(e, s.polyline.concat(s .point), 0, l)) && 2 <= i.length && (a._cesium.defined(o) ? (i.pop(), i.push(n .clone()), r = c(i)) : (o = new h(i), e = a._viewer.entities.add({ name: "高度测量", position: new a._cesium.CallbackProperty(function() { return i[1] }, !1), point: { pixelSize: 5, color: a._cesium.Color.RED, outlineColor: a._cesium.Color.WHITE, outlineWidth: 2, heightReference: a._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), a._tree.temporaryItem.obj.push(e), s.point.push(e), a._points.push(e), r = c(i), e = a._viewer.entities.add({ position: new a._cesium.CallbackProperty(function() { return a._cesium.Cartesian3.midpoint(r.eq_lon_lat[0], r .eq_lon_lat[1], new a._cesium.Cartesian3) }, !1), name: "等经纬度", polyline: { show: !0, positions: new a._cesium.CallbackProperty(function() { return r.eq_lon_lat }, !1), material: a._cesium.Color.GOLD, width: 2 }, label: { text: new a._cesium.CallbackProperty(function() { var e = "米", t = i = a.getHeight(r.eq_lon_lat); t = -1 !== i.indexOf("千米") ? i.replace(e = "千米", "") : i .replace("米", ""); var i = (t = parseFloat(t)) < 0 ? (t = Math.abs(t)) + e : t + e; return s.gddistance = i = "高度:" + i }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), s.polyline.push(e), a._polylines.push(e), e = a._viewer.entities.add({ position: new a._cesium.CallbackProperty(function() { return a._cesium.Cartesian3.midpoint(r.eq_height[0], r .eq_height[1], new a._cesium.Cartesian3) }, !1), name: "等高度直线", polyline: { show: !0, positions: new a._cesium.CallbackProperty(function() { return r.eq_height }, !1), material: a._cesium.Color.GOLD, width: 2 }, label: { text: new a._cesium.CallbackProperty(function() { var e = a._core.getHorizontalDistance(r.eq_height, a ._cesium); return s.spdistance = "水平距离:" + e }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), s.polyline.push(e), a._polylines.push(e))) }, a._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { (n = a._getPosition.getMousePosition(e, s.polyline.concat(s.point), 0, l)) && (0 == i .length ? (i.push(n.clone()), i.push(n.clone()), r = c(i), e = a._viewer.entities.add({ name: "高度测量", position: i[0], point: { pixelSize: 5, color: a._cesium.Color.RED, outlineColor: a._cesium.Color.WHITE, outlineWidth: 2, heightReference: a._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), a._tree.temporaryItem.obj.push(e), s.point.push(e), a._points.push(e)) : 2 <= i .length && (a._cesium.defined(o) ? (i.pop(), i.push(n.clone()), r = c(i)) : (o = new h( i), e = a._viewer.entities.add({ name: "高度测量", position: new a._cesium.CallbackProperty(function() { return i[1] }, !1), point: { pixelSize: 5, color: a._cesium.Color.RED, outlineColor: a._cesium.Color.WHITE, outlineWidth: 2, heightReference: a._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), a._tree.temporaryItem.obj.push(e), s.point.push(e), a._points.push(e), r = c(i), e = a._viewer.entities.add({ position: new a._cesium.CallbackProperty(function() { return a._cesium.Cartesian3.midpoint(r.eq_lon_lat[0], r .eq_lon_lat[1], new a._cesium.Cartesian3) }, !1), name: "等经纬度", polyline: { show: !0, positions: new a._cesium.CallbackProperty(function() { return r.eq_lon_lat }, !1), material: a._cesium.Color.GOLD, width: 2 }, label: { text: new a._cesium.CallbackProperty(function() { var e = "米", t = i = a.getHeight(r.eq_lon_lat); t = -1 !== i.indexOf("千米") ? i.replace(e = "千米", "") : i .replace("米", ""); var i = (t = parseFloat(t)) < 0 ? (t = Math.abs(t)) + e : t + e; return s.gddistance = i = "高度:" + i }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), s.polyline.push(e), a._polylines.push(e), e = a._viewer.entities.add({ position: new a._cesium.CallbackProperty(function() { return a._cesium.Cartesian3.midpoint(r.eq_height[0], r .eq_height[1], new a._cesium.Cartesian3) }, !1), name: "等高度直线", polyline: { show: !0, positions: new a._cesium.CallbackProperty(function() { return r.eq_height }, !1), material: a._cesium.Color.GOLD, width: 2 }, label: { text: new a._cesium.CallbackProperty(function() { var e = a._core.getHorizontalDistance(r.eq_height, a ._cesium); return s.spdistance = "水平距离:" + e }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), s.polyline.push(e), a._polylines.push(e)))) }, a._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { l = !l }, a._cesium.ScreenSpaceEventType.MIDDLE_CLICK), this._tree.handler.setInputAction(function(e) { a.end() }, a._cesium.ScreenSpaceEventType.RIGHT_CLICK), this._tree.handler.setInputAction(function(e) { a.end() }, a._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this.end = function(e) { a._tree.handler.destroy(), u.show(!1), a.end = void 0, a._tree.endtemporaryItem(), a._core .mouse(a._viewer.container, 0, "0"), "cancel" === e ? a.deleteObject() : "" != t && null != t && "function" == typeof t && t(s) }; e.prototype._init = function() { var o = this, e = (this.options.polyline.positions = new a._cesium.CallbackProperty(function() { return o.positions }, !1), this.options.position = new a._cesium.CallbackProperty(function() { return a._cesium.Cartesian3.midpoint(r.eq_height[0], r.eq_height[1], new a ._cesium.Cartesian3) }, !1), this.options.label.text = new a._cesium.CallbackProperty(function() { i = o.positions, e = a._cesium.Cartographic.fromCartesian(i[0]), i = a._cesium .Cartographic.fromCartesian(i[1]), (t = new a._cesium.EllipsoidGeodesic) .setEndPoints(e, i), t = t.surfaceDistance; var e, t, i = t = 1e3 <= (t = Math.sqrt(Math.pow(t, 2) + Math.pow(i.height - e .height, 2))) ? (t / 1e3).toFixed(2) + "千米" : t.toFixed(2) + "米"; return s.kjdistance = "空间距离:" + i }, !1), a._viewer.entities.add(this.options)), e = (a.item = e, a._tree.temporaryItem.obj.push(e), s.polyline.push(e), a._core.getuid()); s.name = "新建垂直高度" + e }; var h = e; function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: a._cesium.Color.GOLD, width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, 20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } return this }, M.prototype.executeHeightTe1 = function(t) { this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this ._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); var i = [], o = null, r = null, n = null, a = null, s = this, l = { spot: [], kjdistance: "", spdistance: "", gddistance: "", point: [], polyline: [] }, u = this._core.CreateTooltip(); function c(e) { var t = s._cesium.Cartographic.fromCartesian(e[0]), e = s._cesium.Cartographic.fromCartesian(e[1]); e.height, e.height, t.height, s._cesium.Cartesian3.fromDegrees(s._cesium.Math.toDegrees(t .longitude), s._cesium.Math.toDegrees(t.latitude), e.height) } this._tree.handler.setInputAction(function(e) { 0 === i.length ? u.showAt(e.endPosition, "左键开始绘制!") : u.showAt(e.endPosition, "右键结束绘制!"), ( a = s._getPosition.getMousePosition(e)) && 2 <= i.length && (s._cesium.defined(o) ? (i.pop(), i.push(a.clone()), c(i)) : o = new h(i), s._cesium.define(r) || (r = new m(i)), s._cesium.define(n) || (n = new p(i))) }, s._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { 0 == i.length && (a = s._getPosition.getMousePosition(e)) && (i.push(a.clone()), i.push(a .clone()), c(i), e = s._viewer.entities.add({ name: "高度测量", position: i[0], point: { pixelSize: 5, color: s._cesium.Color.RED, outlineColor: s._cesium.Color.WHITE, outlineWidth: 2, heightReference: s._cesium.HeightReference.none } }), s._tree.temporaryItem.obj.push(e), l.point.push(e)) }, s._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { s._tree.handler.destroy(), u.show(!1), s._tree.endtemporaryItem(), "" != t && null != t && "function" == typeof t && t(l) }, s._cesium.ScreenSpaceEventType.RIGHT_CLICK); e.prototype._init = function() { var o = this, e = (this.options.polyline.positions = new s._cesium.CallbackProperty(function() { return o.positions }, !1), this.options.position = new s._cesium.CallbackProperty(function() { return o.positions[1].clone() }, !1), this.options.label.text = new s._cesium.CallbackProperty(function() { i = o.positions, e = s._cesium.Cartographic.fromCartesian(i[0]), i = s._cesium .Cartographic.fromCartesian(i[1]), (t = new s._cesium.EllipsoidGeodesic) .setEndPoints(e, i), t = t.surfaceDistance; var e, t, i = t = 1e3 <= (t = Math.sqrt(Math.pow(t, 2) + Math.pow(i.height - e .height, 2))) ? (t / 1e3).toFixed(2) + "千米" : t.toFixed(2) + "米"; return l.kjdistance = "空间距离:" + i }, !1), s._viewer.entities.add(this.options)); s._tree.temporaryItem.obj.push(e), l.polyline.push(e) }; var h = e; function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: s._cesium.Color.GOLD, width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } d.prototype._init = function() { var o = this, e = (this.options.polyline.positions = new s._cesium.CallbackProperty(function() { return o.positions }, !1), this.options.position = new s._cesium.CallbackProperty(function() { return o.positions[1].clone() }, !1), this.options.label.text = new s._cesium.CallbackProperty(function() { i = o.positions, e = s._cesium.Cartographic.fromCartesian(i[0]), i = s._cesium .Cartographic.fromCartesian(i[1]), (t = new s._cesium.EllipsoidGeodesic) .setEndPoints(e, i), t = t.surfaceDistance; var e, t, i = t = 1e3 <= (t = Math.sqrt(Math.pow(t, 2) + Math.pow(i.height - e .height, 2))) ? (t / 1e3).toFixed(2) + "千米" : t.toFixed(2) + "米"; return l.kjdistance = "空间距离:" + i }, !1), s._viewer.entities.add(this.options)); s._tree.temporaryItem.obj.push(e), l.polyline.push(e) }; var m = d; function d(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: s._cesium.Color.GOLD, width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } g.prototype._init = function() { var o = this, e = (this.options.polyline.positions = new s._cesium.CallbackProperty(function() { return o.positions }, !1), this.options.position = new s._cesium.CallbackProperty(function() { return o.positions[1].clone() }, !1), this.options.label.text = new s._cesium.CallbackProperty(function() { i = o.positions, e = s._cesium.Cartographic.fromCartesian(i[0]), i = s._cesium .Cartographic.fromCartesian(i[1]), (t = new s._cesium.EllipsoidGeodesic) .setEndPoints(e, i), t = t.surfaceDistance; var e, t, i = t = 1e3 <= (t = Math.sqrt(Math.pow(t, 2) + Math.pow(i.height - e .height, 2))) ? (t / 1e3).toFixed(2) + "千米" : t.toFixed(2) + "米"; return l.kjdistance = "空间距离:" + i }, !1), s._viewer.entities.add(this.options)); s._tree.temporaryItem.obj.push(e), l.polyline.push(e) }; var p = g; function g(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: s._cesium.Color.GOLD, width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } return this }, M.prototype.executeAngle = function(t) { this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this._tree .removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium .ScreenSpaceEventHandler(this._viewer.scene.canvas); var o, r, n, a, s = [], l = null, u = null, c = this, h = { name: "", spot: [], kjdistance: "", spdistance: "", gddistance: "", point: [], polyline: [], labels: [] }, m = !1, d = this._core.CreateTooltip(); function p(e) { var t, i, o = c._cesium.Cartographic.fromCartesian(e[0]), r = c._cesium.Cartographic.fromCartesian(e[1]); return r.height, r.height, o.height, r = 0 < r.height - o.height ? (t = c._cesium.Cartesian3 .fromDegrees(c._cesium.Math.toDegrees(o.longitude), c._cesium.Math.toDegrees(o.latitude), r .height), i = [e[1], t], [e[0], t]) : (t = c._cesium.Cartesian3.fromDegrees(c._cesium .Math.toDegrees(r.longitude), c._cesium.Math.toDegrees(r.latitude), o.height), i = [e[ 0], t ], [e[1], t]), { new: t, eq_height: i, eq_lon_lat: r } } this._tree.handler.setInputAction(function(e) { var t, i; 0 === s.length ? d.showAt(e.endPosition, "左键开始绘制!") : d.showAt(e.endPosition, "中键开启/关闭吸附,右键结束!"), (u = c._getPosition.getMousePosition(e, h.polyline.concat(h .point), 0, m)) && 2 <= s.length && (e = c._core.ElevationAngle(n, u, c._cesium), i = t = "", i = n.z <= u.z ? (t = "角度:" + (90 - Math.abs(e)).toFixed(2), "角度:" + Math.abs(e).toFixed(2)) : (t = "角度:" + Math.abs(e).toFixed(2), "角度:" + (90 - Math.abs(e)).toFixed(2)), r.label.text = t, c._cesium.defined(l) ? (a.position .setValue(u), a.label.text = i) : (a = c._viewer.entities.add({ position: u, name: "等经纬度", label: { text: i, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), h.labels.push(a), c._points.push(a)), c._cesium.defined(l) ? (s.pop(), s.push(u .clone()), o = p(s)) : (l = new g(s), e = c._viewer.entities.add({ name: "角度测量", position: new c._cesium.CallbackProperty(function() { return s[1] }, !1), point: { pixelSize: 5, color: c._cesium.Color.RED, outlineColor: c._cesium.Color.WHITE, outlineWidth: 2, heightReference: c._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), c._tree.temporaryItem.obj.push(e), h.point.push(e), c._points.push(e), o = p(s), t = c._viewer.entities.add({ position: new c._cesium.CallbackProperty(function() { return s[0] }, !1), name: "等经纬度", polyline: { show: !0, positions: new c._cesium.CallbackProperty(function() { return o.eq_lon_lat }, !1), material: c._cesium.Color.GOLD, width: 2 } }), h.polyline.push(t), c._polylines.push(t), i = c._viewer.entities.add({ position: new c._cesium.CallbackProperty(function() { return s[1] }, !1), name: "等高度直线", polyline: { show: !0, positions: new c._cesium.CallbackProperty(function() { return o.eq_height }, !1), material: c._cesium.Color.GOLD, width: 2 } }), h.polyline.push(i), c._polylines.push(i))) }, c._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { var t; (u = c._getPosition.getMousePosition(e, h.polyline.concat(h.point), 0, m)) && (0 == s .length ? (n = u, r = c._viewer.entities.add({ position: u, name: "等经纬度", label: { text: "0", font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), h.labels.push(r), t = c._viewer.entities.add({ position: new c._cesium.CallbackProperty(function() { return c._cesium.Cartesian3.midpoint(o.eq_lon_lat[0], o .eq_lon_lat[1], new c._cesium.Cartesian3) }, !1), label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), s.push(u.clone()), s.push(u.clone()), o = p(s), e = c._viewer.entities.add({ name: "高度测量", position: s[0], point: { pixelSize: 5, color: c._cesium.Color.RED, outlineColor: c._cesium.Color.WHITE, outlineWidth: 2, heightReference: c._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), c._tree.temporaryItem.obj.push(e), h.point.push(e), c._points.push(r, e)) : 2 <= s .length && (c._cesium.defined(l) ? (s.pop(), s.push(u.clone()), o = p(s)) : (l = new g( s), e = c._viewer.entities.add({ name: "高度测量", position: new c._cesium.CallbackProperty(function() { return s[1] }, !1), point: { pixelSize: 5, color: c._cesium.Color.RED, outlineColor: c._cesium.Color.WHITE, outlineWidth: 2, heightReference: c._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), c._tree.temporaryItem.obj.push(e), h.point.push(e), c._points.push(e), o = p(s), t = c._viewer.entities.add({ position: new c._cesium.CallbackProperty(function() { return c._cesium.Cartesian3.midpoint(o.eq_lon_lat[0], o .eq_lon_lat[1], new c._cesium.Cartesian3) }, !1), name: "等经纬度", polyline: { show: !0, positions: new c._cesium.CallbackProperty(function() { return o.eq_lon_lat }, !1), material: c._cesium.Color.GOLD, width: 2 }, label: { text: new c._cesium.CallbackProperty(function() { var e = "米", t = i = c.getHeight(o.eq_lon_lat); t = -1 !== i.indexOf("千米") ? i.replace(e = "千米", "") : i .replace("米", ""); var i = (t = parseFloat(t)) < 0 ? (t = Math.abs(t)) + e : t + e; return h.gddistance = i = "高度:" + i }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), h.polyline.push(t), c._polylines.push(t), e = c._viewer.entities.add({ position: new c._cesium.CallbackProperty(function() { return c._cesium.Cartesian3.midpoint(o.eq_height[0], o .eq_height[1], new c._cesium.Cartesian3) }, !1), name: "等高度直线", polyline: { show: !0, positions: new c._cesium.CallbackProperty(function() { return o.eq_height }, !1), material: c._cesium.Color.GOLD, width: 2 }, label: { text: new c._cesium.CallbackProperty(function() { var e = "角度:" + (e = c._core.ElevationAngle(firtP, u, c ._cesium)).toFixed(2); return h.spdistance = e }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(60, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), h.polyline.push(e), c._polylines.push(e)))) }, c._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { m = !m }, c._cesium.ScreenSpaceEventType.MIDDLE_CLICK), this._tree.handler.setInputAction(function(e) { c.end() }, c._cesium.ScreenSpaceEventType.RIGHT_CLICK), this._tree.handler.setInputAction(function(e) { c.end() }, c._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this.end = function(e) { c._tree.handler.destroy(), d.show(!1), c._tree.endtemporaryItem(), c.end = void 0, c._core .mouse(c._viewer.container, 0, "0"), "cancel" === e ? c.deleteObject() : "" != t && null != t && "function" == typeof t && (this.labels = h.labels, t(h)) }; e.prototype._init = function() { var e = this, t = (this.options.polyline.positions = new c._cesium.CallbackProperty(function() { return e.positions }, !1), this.options.position = new c._cesium.CallbackProperty(function() { return c._cesium.Cartesian3.midpoint(e.positions[0], e.positions[1], new c ._cesium.Cartesian3) }, !1), c._viewer.entities.add(this.options)), t = (c.item = t, c._tree.temporaryItem.obj.push(t), h.polyline.push(t), c._core.getuid()); h.name = "新建垂直高度" + t }; var g = e; function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: c._cesium.Color.GOLD, width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } return this }, M.prototype.executeHeightDg = function(e) { this._tree.removeHandler(); var r, n = this, a = (this._tree.handler = new n._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas), []), t = null, i = null, o = (this._tree.handler.setInputAction(function(e) { (i = n._getPosition.getMousePosition(e)) && 2 <= a.length && (n._cesium.defined(t) ? (a .pop(), a.push(i.clone()), r = point_conf(a)) : t = new o(a)) }, n._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { 0 == a.length && (i = n._getPosition.getMousePosition(e)) && (a.push(i.clone()), a.push( i.clone()), n._viewer.entities.add({ parent: measure_entities, name: "多边形面积", position: a[0], point: { pixelSize: 5, color: n._cesium.Color.RED, outlineColor: n._cesium.Color.WHITE, outlineWidth: 2, heightReference: n._cesium.HeightReference.none } })) }, n._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { n._tree.handler.destroy(); var t = [], i = [], o = (t.push(a[0].clone()), t.push(r.clone()), n.getHeight(t)); n._viewer.entities.add({ parent: measure_entities, name: "等经纬度", position: t[0].clone(), polyline: { show: !0, clampToGround: !0, positions: t, material: new n._cesium.PolylineDashMaterialProperty({ color: n._cesium.Color.RED }), width: 2 }, label: { text: o, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), i.push(r.clone()), i.push(a[1].clone()), o = getDistance(i) + "千米", n._viewer .entities.add({ parent: measure_entities, name: "等高度直线", position: i[0].clone(), polyline: { show: !0, positions: i, clampToGround: !0, material: new n._cesium.PolylineDashMaterialProperty({ color: n._cesium.Color.RED }), width: 2 }, label: { text: o, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(60, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }) }, n._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), s.prototype._init = function() { var e = this; this.options.polyline.positions = new n._cesium.CallbackProperty(function() { return e.positions }, !1), this.options.position = new n._cesium.CallbackProperty(function() { return e.positions[1].clone() }, !1), this.options.label.text = new n._cesium.CallbackProperty(function() { return getSpaceDistance(e.positions) }, !1), n._viewer.entities.add(this.options) }, s); function s(e) { this.options = { parent: measure_entities, name: "直线", polyline: { show: !0, positions: [], clampToGround: !0, material: n._cesium.Color.GOLD, width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } }, M.prototype.executeAnge = function(t) { var i, o = this, r = (this._tree.removeHandler(), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this ._viewer.scene.canvas), []), n = null, a = "", s = null, l = 0, u = { spot: [], distance: 0, label: {}, angle: 0 }, c = (this._tree.handler.setInputAction(function(e) { o._viewer.camera.getPickRay(e.endPosition), (s = o._getPosition.getMousePosition(e)) && (2 <= r.length && (o._cesium.defined(n) ? (r.pop(), r.push(s)) : n = new h(r), a = o ._core.getSpaceDistance(r, o._cesium)), e = a, o._viewer.entities.remove(i), 1 < r.length && (l = (180 * Math.atan2(r[1].y - r[0].y, r[1].x - r[0].x) / Math .PI).toFixed(0), i = o._viewer.entities.add({ name: "空间直线距离", position: r[r.length - 1], label: { text: e + ";" + l + "度", font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }))) }, o._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), h = (this._tree.handler.setInputAction(function(e) { 0 < c && (o._tree.handler.destroy(), r.pop()), o._viewer.camera.getPickRay(e.position), (s = o._getPosition.getMousePosition(e)) && (0 == r.length && r.push(s.clone()), r .push(s), u.spot.push(s), u.distance = a, u.label = i, o._points.push(i), u .angle = l, 1 == c && "" != t && null != t && "function" == typeof t && t(u), c += 1) }, o._cesium.ScreenSpaceEventType.LEFT_CLICK), e.prototype._init6 = function() { var e = this, t = (this.options.polyline.positions = new o._cesium.CallbackProperty(function() { return e.positions }, !1), o._viewer.entities.add(this.options)); o.item = t }, e); function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: o._cesium.Color.YELLOW, width: 3, clampToGround: !0 } }, this.positions = e, this._init6() } return this }, M.prototype.executeProfile = function(e, i) { var o, r = this, n = (this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), a = [], s = null, l = e.parameterd, u = e.objid, c = e.cyjj, a = [], h = 0, m = this._core.CreateTooltip(), d = null, p = { spot: [], min: 0, max: 0, distance: 0, label: {}, cys: 0, gcs: [] }, g = (this._tree.handler.setInputAction(function(e) { 0 === n.length ? m.showAt(e.endPosition, "左键开始绘制!") : m.showAt(e.endPosition, "再次点击结束绘制!"); var t = r._viewer.camera.getPickRay(e.endPosition); d = r._viewer.scene.globe.pick(t, r._viewer.scene), r._viewer.scene.pick(e .endPosition) && (t = r._viewer.scene.pickPosition(e.endPosition)) && (d = t), d && (2 <= n.length && (r._cesium.defined(s) ? (n.pop(), n.push(d)) : s = new _(n), h = r ._core.getSpaceDistance(n, r._cesium)), e = h, r._viewer.entities.remove(o), 1 < n.length && ((180 * Math.atan2(n[1].y - n[0].y, n[1].x - n[0].x) / Math.PI) .toFixed(0), o = r._viewer.entities.add({ name: "空间直线距离", position: n[n.length - 1], label: { text: e, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), r._tree.temporaryItem.obj.push(o), r._points.push(o))) }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), _ = (this._tree.handler.setInputAction(function(e) { 0 < g && (r._tree.handler.destroy(), n.pop(), m.show(!1)); var t = r._viewer.camera.getPickRay(e.position); d = r._viewer.scene.globe.pick(t, r._viewer.scene), r._viewer.scene.pick(e.position) && (t = r._viewer.scene.pickPosition(e.position)) && (d = t), d && (0 == n.length && n .push(d.clone()), a.push(d), n.push(d), p.spot.push(d), p.label = o, 1 == g ? (r ._tree.endtemporaryItem(), r._core.getPmfx(a, l, c, r._cesium, r._viewer, function(e) { p.distance = e.juli, p.gcs = e.gcs, p.gcs = e.gcs, p.cys = e.cys, p .max = e.max, p.min = e.min, p.obj = r, m.show(!1), "" != i && null != i && "function" == typeof i && i(p) })) : (e.position.x, e.position.y), g += 1) }, r._cesium.ScreenSpaceEventType.LEFT_CLICK), t.prototype._init10 = function() { var e = this, t = (this.options.polyline.positions = new r._cesium.CallbackProperty(function() { return e.positions }, !1), r._viewer.entities.add(this.options)), t = (r.item = t, r._tree.temporaryItem.obj.push(t), r._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || V.selectedItem.id, r._core.getuid()), t = { id: t, name: "新建剖面分析" + t, pId: r._core.isnull(u) ? 0 : u, type: "polyline", item: r }; r.setTreeobj(t), V.insertGroupId(t, r._core.isnull(u) ? 0 : u) }, t); function t(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: r._cesium.Color.YELLOW, width: 2, clampToGround: !0 } }, this.positions = e, this._init10() } return this }, M.prototype.executeProfilePro = function(e, t) { var i = this, o = (this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), r = null, n = e.parameterd, a = e.objid, s = e.cyjj, l = this._core.CreateTooltip(), u = null, c = { spot: [], min: 0, max: 0, distance: 0, label: {}, cys: 0, gcs: [] }, h = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this._tree .handler.setInputAction(function(e) { 3 <= o.length ? l.showAt(e.endPosition, "右键结束绘制") : l.showAt(e.endPosition, "点击绘制剖面点"); var t = i._viewer.camera.getPickRay(e.endPosition); u = i._viewer.scene.globe.pick(t, i._viewer.scene), i._viewer.scene.pick(e .endPosition) && (t = i._viewer.scene.pickPosition(e.endPosition)) && (u = t), u && 2 <= o.length && (i._cesium.defined(r) ? (o.pop(), o.push(u)) : r = new h(o)) }, i._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { i.end() }, i._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = function(e) { i._tree.handler.destroy(), i._core.mouse(i._viewer.container, 0), i._tree .endtemporaryItem(), "pc" == i._core.getBrowser().pc && o.pop(), l.show(!1), i.end = void 0, "cancel" === e ? i.item && i._viewer.entities.remove(i.item) : o.length <= 1 ? window .layuiLayer && window.layuiLayer.msg("剖面点小于两点,请重新绘制") : (c.spot = o, i._core.getPmfxPro( o, n, s, i._cesium, i._viewer, function(e) { c.distance = e.juli, c.gcs = e.gcs, c.cys = e.cys, c.max = e.max, c.min = e .min, c.allPoint = e.allPoint, "" != t && null != t && "function" == typeof t && t(c) })) }, this._tree.handler.setInputAction(function(e) { var t = i._viewer.camera.getPickRay(e.position); u = i._viewer.scene.globe.pick(t, i._viewer.scene), i._viewer.scene.pick(e.position) && (t = i._viewer.scene.pickPosition(e.position)) && (u = t), u && (0 === o.length && o .push(u.clone()), o.push(u), 2 < o.length && (i._cesium.defined(r) || (r = new h(o)))) }, i._cesium.ScreenSpaceEventType.LEFT_CLICK), m.prototype._init10 = function() { var e = this, t = (this.options.polyline.positions = new i._cesium.CallbackProperty(function() { return e.positions }, !1), i._viewer.entities.add(this.options)), t = (i.item = t, i._tree.temporaryItem.obj.push(t), i._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || V.selectedItem.id, i._core.getuid()), t = { id: t, name: "新建剖面分析" + t, pId: i._core.isnull(a) ? 0 : a, type: "polyline", item: i }; i.setTreeobj(t), V.insertGroupId(t, i._core.isnull(a) ? 0 : a) }, m); function m(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: i._cesium.Color.YELLOW, width: 2, clampToGround: !0 } }, this.positions = e, this._init10() } return this }, M.prototype.executeAngeSdcs = function(o) { var r, n = this, a = (this._tree.removeHandler(), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this ._viewer.scene.canvas), []), s = null, l = [], u = this._core.CreateTooltip(), c = "", h = null, m = 0, d = { spot: [], distance: 0, label: {}, angle: 0 }, p = (this._tree.handler.setInputAction(function(e) { var t, i; 0 === a.length ? u.showAt(e.endPosition, "左键开始绘制!") : u.showAt(e.endPosition, "再次点击结束绘制!"), n._viewer.camera.getPickRay(e.endPosition), (h = n._getPosition .getMousePosition(e)) && 2 <= a.length && (n._cesium.defined(s) ? (a.pop(), a .push(h)) : s = new g(a), c = n._core.getSpaceDistance(a, n._cesium), 2 <= p && (n._viewer.entities.remove(r), e = n._cesium.Cartographic.fromCartesian(a[a .length - 1]), t = n._cesium.Math.toDegrees(e.longitude), i = n._cesium .Math.toDegrees(e.latitude), e = e.height, l[2] = { lon: t, lat: i, hei: e }, m = n._core.Angle(l[0], l[1], l[2]).toFixed(1), r = n._viewer.entities .add({ name: "三点角度测量", position: a[a.length - 1], label: { text: m + "度", font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), n._points.push(r))) }, n._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), g = (this._tree.handler.setInputAction(function(e) { var t, i; 1 < p && (n._tree.handler.destroy(), a.pop()), n._viewer.camera.getPickRay(e.position), (h = n._getPosition.getMousePosition(e)) && (0 == a.length && a.push(h.clone()), a .push(h), e = n._cesium.Cartographic.fromCartesian(a[a.length - 1]), t = n ._cesium.Math.toDegrees(e.longitude), i = n._cesium.Math.toDegrees(e.latitude), e = e.height, l.push({ lon: t, lat: i, hei: e }), d.spot.push(h), d.distance = c, 2 == p && (u.show(!1), d.label = r, d .angle = m, "" != o && null != o && "function" == typeof o && o(d)), p += 1) }, n._cesium.ScreenSpaceEventType.LEFT_CLICK), e.prototype._init6 = function() { var e = this, t = (this.options.polyline.positions = new n._cesium.CallbackProperty(function() { return e.positions }, !1), n._viewer.entities.add(this.options)); n.item = t }, e); function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: n._cesium.Color.YELLOW, width: 3, clampToGround: !1 } }, this.positions = e, this._init6() } return this }, M.prototype.executeAngeSd = function(o) { this._tree.removeHandler(); var r = [], n = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this), a = [], s = void 0, l = [], u = [], c = (this._tree.starttemporaryItem(this._viewer), this._core.CreateTooltip()), h = (e.prototype._init = function() { var e = this; this.options.polyline.positions = new n._cesium.CallbackProperty(function() { return e.positionsp }, !1), this.polyline = n._viewer.entities.add(this.options), n._tree.temporaryItem.obj .push(this.polyline), n.item = this.polyline }, e); function e(e) { this.options = { polyline: { show: !0, positions: [], material: n._cesium.Color.YELLOW, width: 3, clampToGround: !1 } }, this.positionsp = e, this._init() } this._tree.handler = new n._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas); var m = [], d = void 0; if (0 < this._points.length) for (var t = 0; t < this._points.length; t++) this._viewer.entities.remove(this._points[t]); return this._tree.handler.setInputAction(function(e) { var t, i, e = n._getPosition.getMousePosition(e); e && (l.push(e), n._cesium.Cartographic.fromCartesian(e), 0 == m.length ? (m.push(e .clone()), m.push(e.clone()), s = e.clone()) : (e = n._core.ElevationAngle(s, e, n ._cesium), 1 == r.length ? u.push("俯仰角1 " + e.toFixed(2)) : u.push("俯仰角2 " + e.toFixed(2)), d = void 0, (m = []).push(s.clone()), m.push(s.clone()), d = new h(m), r.push(d.polyline)), 2 <= u.length && (c.show(!1), e = n._core .ThreePointAzimuth(l[0], l[1], l[2], n._cesium), u.push("水平角 " + e.toFixed(2)), e = n._viewer.entities.add({ name: "三点角度测量", position: l[1], label: { text: u[0], font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), n._tree.temporaryItem.obj.push(e), t = n._viewer.entities.add({ name: "三点角度测量", position: l[2], label: { text: u[1], font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), n._tree.temporaryItem.obj.push(t), i = n._viewer.entities.add({ name: "三点角度测量", position: l[0], label: { text: u[2], font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), n._tree.temporaryItem.obj.push(i), a.push(e), a.push(t), a.push(i), m.pop(), n._tree.handler.destroy(), n._core.mouse(n._viewer.container, 0, "0"), n._tree .endtemporaryItem(), n._points = a, n._polylines = r, n._polylines1 = r, "" != o && null != o && "function" == typeof o && o({ polylines: r, labels: a, angles: u }))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { var t = n._getPosition.getMousePosition(e); t && (0 === m.length ? c.showAt(e.endPosition, "左键开始绘制!") : m.length <= 3 ? c.showAt(e .endPosition, "点击绘制目标点!") : c.showAt(e.endPosition, "再次点击结束绘制!"), 2 <= m .length && (n._cesium.defined(d) ? null != t && (m.pop(), t.y += 1 + Math.random(), m.push(t)) : (d = new h(m), r.push(d.polyline)))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, M.prototype.deleteObject = function() { if (this.item && this.item.item ? this._viewer.entities.remove(this.item.item) : this._viewer.entities .remove(this.item), this._points && 0 < this._points.length) { for (var e = 0; e < this._points.length; e++) this._viewer.entities.remove(this._points[e]); this._points = [] } if (this._polylines && 0 < this._polylines.length) { for (e = 0; e < this._polylines.length; e++) this._viewer.entities.remove(this._polylines[e]); this._polylines = [] } if (this.labels && 0 < this.labels.length) { for (e = 0; e < this.labels.length; e++) this._viewer.entities.remove(this.labels[e]); this.labels = [] } if (this.item && this.item._points && 0 < this.item._points.length) { for (e = 0; e < this.item._points.length; e++) this._viewer.entities.remove(this.item._points[e]); this.item._points = [] } if (this.item && this.item._polylines && 0 < this.item._polylines.length) { for (e = 0; e < this.item._polylines.length; e++) this._viewer.entities.remove(this.item._polylines[ e]); this.item._polylines = [] } }, M.prototype.setHeightType = function(e) { try { 1 == e ? this.item._polyline.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._polyline.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this .item._polyline.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, M.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show._value, t = this.item.polyline.positions.getValue(), i = null == this.item.polyline.width ? void 0 : this.item.polyline.width._value, o = this.item.polyline.material, r = (null != o && (o = { color: null == o.color ? void 0 : "rgba(" + o.color._value.red + "," + o.color._value .green + "," + o.color._value.blue + "," + o.color._value.alpha + ")", image: null == o.image ? void 0 : o.image._value, diffusemap: null == o.diffusemap ? void 0 : o.diffusemap._value, alphamap: null == o.alphamap ? void 0 : o.alphamap._value }), null == this.item.polyline.clampToGround ? void 0 : this.item.polyline.clampToGround._value), n = this.item.polyline.distanceDisplayCondition, a = null == n ? void 0 : n._value.near, n = null == n ? void 0 : n._value.far; return { type: "polyline", treeobj: { name: this.treeobj.name }, style: { show: e, positions: t, width: i, material: o, clampToGround: r, near: a, far: n } } }, M.prototype.setVisibility = function(e) { if (this.item && this.item.item ? this.item.item.show = e : this.item.show = e, this.item && this.item ._points && 0 < this.item._points.length) for (var t = 0; t < this.item._points.length; t++) this.item._points[t].show = e; if (this._polylines && 0 < this._polylines.length) for (t = 0; t < this._polylines.length; t++) this._polylines[t].show = e; if (this._points && 0 < this._points.length) for (t = 0; t < this._points.length; t++) this._points[t].show = e; if (this.item && this.item._polylines && 0 < this.item._polylines.length) for (t = 0; t < this.item._polylines.length; t++) this.item._polylines[t].show = e }, M.prototype.getVisibility = function() { return this.item.show }, M.prototype.setOutlinewidth = function(e) { this.item._polyline.material.outlineWidth = e }, M.prototype.setMaterial = function(e) { try { this._core.extend({ outlineWidth: 3 }, e, !0); this.item._polyline.material = new this._cesium.PolylineGlowMaterialProperty(e), this.item .material = this.item._polyline.material } catch (e) { console.log(e) } return this }, M.prototype.setPolylineWall = function(e) { try { for (var t = [], i = [], o = this.item._polyline.positions.getValue(), r = this._viewer.scene.globe .ellipsoid, n = 0; n < o.length; n++) { var a = new this._cesium.Cartesian3(o[n].x, o[n].y, o[n].z), s = r.cartesianToCartographic(a), l = this._cesium.Math.toDegrees(s.latitude), u = this._cesium.Math.toDegrees(s.longitude); t.push(u), t.push(l), i.push(e) } t = this._cesium.Cartesian3.fromDegreesArray(t), this.item.wall = new this._cesium.WallGraphics({ positions: t, minimumHeights: i, material: this.item._polyline.material.color._value }) } catch (e) { console.log(e) } return this }, M.prototype.setRadius = function(e) { try { for (var t = [], i = this.item._polyline.positions.getValue(), o = this._viewer.scene.globe .ellipsoid, r = 0; r < i.length; r++) { var n = new this._cesium.Cartesian3(i[r].x, i[r].y, i[r].z), a = o.cartesianToCartographic(n), s = this._cesium.Math.toDegrees(a.latitude), l = this._cesium.Math.toDegrees(a.longitude); t.push(l), t.push(s) } t = this._cesium.Cartesian3.fromDegreesArray(t), this.item.corridor = new this._cesium .CorridorGraphics({ positions: t, width: e, show: !0, outline: !0, material: this._cesium.Color.RED.withAlpha(.4), heightReference: this._cesium.HeightReference.none }) } catch (e) { console.log(e) } return this }, M.prototype.setGlow = function(e) { try { this.item._polyline.material = e ? new this._cesium.PolylineGlowMaterialProperty({ glowPower: .2, taperPower: .5, color: this.item._polyline.material.color }) : new this._cesium.PolylineOutlineMaterialProperty({ color: this.item._polyline.material.color, outlineWidth: this.item._polyline.material.outlineWidth, outlineColor: this.item._polyline.material.outlineColor }), this.item.material = this.item._polyline.material } catch (e) { console.log(e) } return this }, M.prototype.setMaterialAlpha = function(e) { try { this.item._polyline.material.color._value.alpha = e, this.item.material = this.item._polyline .material } catch (e) { console.log(e) } return this }, M.prototype.setType = function(e) { try { "PolylineDashMaterialProperty" == e ? this.item._polyline.material = new this._cesium .PolylineDashMaterialProperty({ color: this.item._polyline.material.color }) : "PolylineArrowMaterialProperty" == e ? this.item._polyline.material = new this._cesium .PolylineArrowMaterialProperty({ color: this.item._polyline.material.color }) : "PolylineOutlineMaterialProperty" == e && (this.item._polyline.material = new this._cesium .PolylineOutlineMaterialProperty({ color: this.item._polyline.material.color })) } catch (e) { console.log(e) } return this }, M.prototype.setMaterialColor = function(e) { try { this.item._polyline.material.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, M.prototype.setOutlineColor = function(e) { try { this.item._polyline.material.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, M.prototype.setClampToGround = function(e) { try { this.item._polyline.clampToGround = e } catch (e) { console.log(e) } return this }, M.prototype.setWidth = function(e) { try { this.item._polyline.width = e } catch (e) { console.log(e) } return this }, M.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._polyline.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, Object.defineProperties(M.prototype, { HighLight: { set: function(e) { e && (this.item.material = this.item.polyline.material), this.item.polyline.material = e ? new this._cesium.PolylineGlowMaterialProperty({ glowPower: .8, color: this._cesium.Color.ORANGERED.withAlpha(.9) }) : this.item.material } }, polylinemMterial: { set: y.debounce(function(e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this ._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && ( e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.polyline.material = e, this.item.material = this.item.polyline .material) }, 500), get: function() { var e = this.item.polyline.material; if (e) try { return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } }, polylinemArcType: { set: y.debounce(function(e) { this._core.isnull(e) || (this.item.polyline.arcType = e) }, 500), get: function() { var e = this.item.polyline.arcType; if (e) return e._value } }, polylineWidth: { set: y.debounce(function(e) { this._core.isnull(e) || (e = parseFloat(e), this.item.polyline.width = e) }, 500), get: function() { var e = this.item.polyline.width; if (e) return e._value } } }), Object.defineProperties(M.prototype, { rectangle: { get: function() { return this.item.rectangle }, set: function(e) { this.item.rectangle = e } } }), Object.defineProperties(M.prototype, { polyline: { get: function() { return this.item.polyline }, set: function(e) { this.item.polyline = e } } }), Object.defineProperties(M.prototype, { polygon: { get: function() { return this.item.polygon }, set: function(e) { this.item.polygon = e } } }), Object.defineProperties(M.prototype, { point: { get: function() { return this.item.point }, set: function(e) { this.item.point = e } } }), Object.defineProperties(M.prototype, { label: { get: function() { return this.item.label }, set: function(e) { this.item.label = e } } }), Object.defineProperties(M.prototype, { model: { get: function() { return this.item.model }, set: function(e) { this.item.model = e } } }), M.prototype.setItem = function(e) { this.item = e }, M.prototype.setTreeobj = function(e) { this.treeobj = e }, Object.defineProperties(M.prototype, { wall: { get: function() { return this.item.wall }, set: function(e) { this.item.wall = e } } }), Object.defineProperties(M.prototype, { polylineTempOptions: { get: function() { return { positions: [], arcType: ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE } } } }), Object.defineProperties(M.prototype, { MaterialColor: { get: function() { return new m(this._viewer, this._cesium).toHtmlColor("rgb(" + 255 * this.item._polyline .material.color._value.red + "," + 255 * this.item._polyline.material.color ._value.green + "," + 255 * this.item._polyline.material.color._value.blue + ")" ) } }, Height: { get: function() { return this.item._polyline.height } }, Visibility: { get: function() { return this.item.show } }, Outlinewidth: { get: function() { return this.item._polyline.material.outlineWidth._value } }, OutlineColor: { get: function() { var e = this.item._polyline.material.outlineColor; return e ? (e = e._value, new m(this._viewer, this._cesium).toHtmlColor("rgb(" + 255 * e .red + "," + 255 * e.green + "," + 255 * e.blue + ")")) : "#ff0000" } }, ClampToGround: { get: function() { return this.item._polyline.clampToGround } }, Width: { get: function() { return this.item._polyline.width._value } }, Type: { get: function() { return this.item._polyline.material instanceof this._cesium .PolylineDashMaterialProperty ? "PolylineDashMaterialProperty" : this.item._polyline .material instanceof this._cesium.PolylineArrowMaterialProperty ? "PolylineArrowMaterialProperty" : "PolylineOutlineMaterialProperty" } }, Glow: { get: function() { return this.item._polyline.material instanceof this._cesium.PolylineGlowMaterialProperty } }, MaterialAlpha: { get: function() { return 100 * this.item._polyline.material.color._value.alpha } } }), M.prototype.CreatePolyline = function(e, t, i, o, r) { this._Geometry = e; for (var i = { color: this._cesium.Color.YELLOW, outlineColor: this._cesium.Color.BLACK, width: 10, show: !0, AltitudeType: this._cesium.defaultValue(i, 999) }, n = (t && "" !== t && (i.color = new m(this._viewer, this._cesium).colorFromHtmlColor(t)), []), a = 0; a < e.length; a++) n.push(this._cesium.Cartesian3.fromDegrees(e[a].x, e[a].y)); this.item = this._viewer.entities.add({ name: r, polyline: { positions: n, width: i.width, material: new this._cesium.PolylineGlowMaterialProperty({ outlineColor: i.outlineColor, color: i.color }) } }); t = { id: this.item.id, name: r, pId: this._core.isnull(o) ? 0 : o, type: "polyline", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, M.prototype.forceEndHanlder = function() { this.handler && (this.handler.destroy(), this.handler = void 0), this._tree.handler && (this._tree .handler.destroy(), this._tree.handler = void 0) }, A.prototype.createPolygon = function(e, t, i, o, r) { var n = []; if (e[0] instanceof Array) { if (2 === e[0].length) { for (var a = 0; a < e.length; a++) n.push(e[a][0], e[a][1]); s = this._cesium.Cartesian3.fromDegreesArray(n) } else if (3 === e[0].length) { for (a = 0; a < e.length; a++) n.push(e[a][0], e[a][1], e[a][2]); s = this._cesium.Cartesian3.fromDegreesArrayHeights(n) } } else if (e[0].z) { for (a = 0; a < e.length; a++) n.push(e[a].x, e[a].y, e[a].z); s = this._cesium.Cartesian3.fromDegreesArrayHeights(n) } else { for (a = 0; a < e.length; a++) n.push(e[a].x, e[a].y); s = this._cesium.Cartesian3.fromDegreesArray(n) } "string" == typeof t && (t = { fillColor: t }), this.item = this._viewer.entities.add({ name: r, polygon: { hierarchy: new this._cesium.PolygonHierarchy(s), material: new m(this._viewer, this._cesium).colorFromHtmlColor(t.fillColor), heightReference: this._core.defaultValue(i, 1), perPositionHeight: 1 !== i, outline: !0, outlineWidth: this._core.defaultValue(t.outlineWidth, 1), outlineColor: new m(this._viewer, this._cesium).colorFromHtmlColor(this._core .defaultValue(t.outlineColor, t.fillColor)) } }); var s = { id: this.item.id, name: r || "新建面" + this._core.getuid(), pId: this._core.isnull(o) ? 0 : o, type: "polygon", item: this }; return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(o) ? 0 : o), this }, A.prototype.getstyles = function() { var e = {}; return e.show = !this.item.polygon.show || this.item.polygon.show._value, e.hierarchy = this.item .polygon.hierarchy ? this.item.polygon.hierarchy.getValue().positions.toString() : null, e.height = this.item.polygon.height ? this.item.polygon.height._value : null, e.heightReference = this.item .polygon.heightReference ? this.item.polygon.heightReference._value : null, e.extrudedHeight = this .item.polygon.extrudedHeight ? this.item.polygon.extrudedHeight.getValue() : null, e .extrudedHeightReference = this.item.polygon.extrudedHeightReference ? this.item.polygon .extrudedHeightReference.toString() : null, e.stRotation = this.item.polygon.stRotation ? this.item .polygon.stRotation._value : null, e.granularity = this.item.polygon.granularity ? this.item.polygon .granularity._value : null, e.fill = this.item.polygon.fill ? this.item.polygon.fill._value : null, e.material = {}, e.material.color = this.item.polygon.material && this.item.polygon.material .color && this.item.polygon.material.color._value ? "rgba" + this.item.polygon.material.color .toString() : null, e.material.image = this.item.polygon.material && this.item.polygon.material .image ? this.item.polygon.material.image._value : null, e.material.repeat = this.item.polygon .material && this.item.polygon.material.repeat && this.item.polygon.material.repeat._value ? this .item.polygon.material.repeat._value : null, e.outline = this.item.polygon.outline ? this.item .polygon.outline._value : null, e.outlineWidth = this.item.polygon.outlineWidth ? this.item.polygon .outlineWidth._value : null, e.outlineColor = this.item.polygon.outlineColor && this.item.polygon .outlineColor._value ? "rgba" + this.item.polygon.outlineColor.toString() : null, e .perPositionHeight = this.item.polygon.perPositionHeight ? this.item.polygon.perPositionHeight .toString() : null, e.closeTop = this.item.polygon.closeTop ? this.item.polygon.closeTop .toString() : null, e.closeBottom = this.item.polygon.closeBottom ? this.item.polygon.closeBottom .toString() : null, e.arcType = this.item.polygon.arcType ? this.item.polygon.arcType.toString() : null, e.classificationType = this.item.polygon.classificationType ? this.item.polygon .classificationType.toString() : null, e.near = this.item.polygon.distanceDisplayCondition ? this .item.polygon.distanceDisplayCondition._value.near : null, e.far = this.item.polygon .distanceDisplayCondition ? this.item.polygon.distanceDisplayCondition._value.far : null, e }, A.prototype.createCloudMap = function(e, t, i, o) { var r = [], n = this, t = (r.push(t.minx, t.miny), r.push(t.maxx, t.miny), r.push(t.maxx, t.maxy), r.push(t.minx, t.maxy), this._cesium.Cartesian3.fromDegreesArray(r)), a = (o = this._core.defaultValue(o, 1), 0), s = 0, r = (this.item = this._viewer.entities.add({ name: e, polygon: { hierarchy: new this._cesium.PolygonHierarchy(t), material: new Cesium.ImageMaterialProperty({ image: new this._cesium.CallbackProperty(function() { return 30 < (s += o) && (s = 0, ++a > i.length - 1 && (a = 0)), i[a] }, !1), color: new this._cesium.CallbackProperty(function() { return n._cesium.Color.WHITE.withAlpha(s < 15 ? .5 + s / 30 : 1.5 - s / 30) }, !1), repeat: new n._cesium.Cartesian2(1, 1) }) } }), { id: this.item.id, name: e, pId: 0, type: "polygon", item: this }); return this.setTreeobj(r), this._tree.insertGroupId(r, 0), this }, A.prototype.createSector = function(e, t, c, i, o) { var r = { fillColor: this._cesium.Color.YELLOW.withAlpha(.5), outlineColor: this._cesium.Color.YELLOW }, o = 2 * Math.PI / 360 * o, n = Math.sin(o) * t, i = function(e, t, i) { var o = { a: 6378137, b: 6356752.3142, f: 1 / 298.257223563 }; function r(e) { return e * Math.PI / 180 } function n(e) { return 180 * e / Math.PI } var a = o.a, s = o.b, o = o.f, l = +e.lon, e = +e.lat, u = i, i = r(t), t = Math.sin(i), i = Math.cos(i), e = (1 - o) * Math.tan(r(e)), c = 1 / Math.sqrt(1 + e * e), h = e * c, m = Math.atan2(e, i), e = c * t, d = 1 - e * e, a = d * (a * a - s * s) / (s * s), p = 1 + a / 16384 * (4096 + a * (a * (320 - 175 * a) - 768)), g = a / 1024 * (256 + a * (a * (74 - 47 * a) - 128)), _ = u / (s * p), f = 2 * Math.PI; for (; 1e-12 < Math.abs(_ - f);) { var y = Math.cos(2 * m + _), v = Math.sin(_), C = Math.cos(_); f = _, _ = u / (s * p) + g * v * (y + g / 4 * (C * (2 * y * y - 1) - g / 6 * y * (4 * v * v - 3) * (4 * y * y - 3))) } a = h * v - c * C * i, a = Math.atan2(h * C + c * v * i, (1 - o) * Math.sqrt(e * e + a * a)), t = Math.atan2(v * t, c * C - h * v * i), c = o / 16 * d * (4 + o * (4 - 3 * d)); return { lon: l + n(t - (1 - c) * o * e * (_ + c * v * (y + c * C * (2 * y * y - 1)))), lat: n(a) } }(e, i, Math.cos(o) * t), o = { lon: e.lon, lat: e.lat, height: e.height }, t = { lon: i.lon, lat: i.lat, height: e.height + n }, l = 6378137, u = 6356725, h = this, i = function(e, t) { var i = [], o = function(e, t, i, o) { var r = p(e), n = p(i), a = p(i) - p(e), s = p(o) - p(t); return a = (a = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(r) * Math.cos(n) * Math.pow(Math.sin(s / 2), 2)))) * l, a = Math.round(1e4 * a) / 1e4, { anglew: h._core.TwoPointAzimuth(t, e, o, i), distance: a } }(e.lat, e.lon, t.lat, t.lon), r = o.anglew, n = o.distance; i.push(e.lon, e.lat, e.height); for (var a = r - c / 2, s = null; a < r + c / 2; a++) s = function(e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = u + (l - u) * (90 - e) / 90, n = o * Math.cos(e * Math.PI / 180), r = 180 * (r / n + t * Math.PI / 180) / Math.PI, n = 180 * (i / o + e * Math.PI / 180) / Math.PI; return [r, n] }(e.lat, e.lon, n, a), i.push(s[0], s[1], t.height + 10 * a); return i }(o, t), e = document.createElement("canvas"), n = (e.id = "0-a", e.width = 800, e.height = 800, document.body.appendChild(e), document .createElement("canvas")), m = (n.id = "0-b", n.width = 800, n.height = 800, "a"), d = (document.body.appendChild(n), 1), o = new Cesium.CallbackProperty(function(e, t) { var i = document.getElementById("0-" + m), o = i.getContext("2d"); function r(e, t, i) { o.beginPath(), o.arc(400, 800, i, n(e), n(t), !1), o.stroke() } function n(e) { return (e -= 90) * Math.PI / 180 } o.strokeStyle = "red", o.lineWidth = 15, o.clearRect(0, 0, 800, 800); var a, s, l, u = o.createLinearGradient(0, 800, 0, 0); return u.addColorStop(0, "rgba(255,0,0,0.6)"), u.addColorStop(1, "rgba(255,0,0,0)"), a = - c / 2, s = c / 2, l = d + 600, o.beginPath(), o.arc(400, 800, l, n(a), n(s), !1), o .stroke(), o.lineTo(400, 800), o.closePath(), o.fillStyle = u, o.fill(), r(-c / 2, c / 2, d + 100), r(-c / 2, c / 2, d + 200), r(-c / 2, c / 2, d + 300), r(-c / 2, c / 2, d + 400), r(-c / 2, c / 2, d + 500), r(-c / 2, c / 2, d + 600), d < 100 ? d += 1 : d = 1, m = "a" === m ? "b" : "a", i }, !1); function p(e) { return e * Math.PI / 180 } return this.item = this._viewer.entities.add({ polygon: { hierarchy: new this._cesium.PolygonHierarchy(this._cesium.Cartesian3 .fromDegreesArrayHeights(i)), material: new this._cesium.ImageMaterialProperty({ image: o, transparent: !0 }), perPositionHeight: !0, outlineColor: r.outlineColor } }), this }, A.prototype.setImageMaterialProperty = function() { var r = this, e = document.createElement("canvas"), t = (e.id = "0-a", e.width = 700, e.height = 100, document.createElement("canvas")), e = (t.id = "0-b", t.width = 700, t.height = 100, document.body.appendChild(e), document.body .appendChild(t), new r._cesium.CallbackProperty(function(e, t) { var i = document.getElementById("0-" + r.curCanvas), o = i.getContext("2d"); return i.strokeStyle = "1px solid red", o.strokeStyle = "red", o.fillStyle = "red", o .save(), o.translate(100, 100), o.arc(0, 0, 100, 0, 180 * Math.PI / 180), o .restore(), o.stroke(), r.curCanvas = "a" === r.curCanvas ? "b" : "a", i }, !1)); return new r._cesium.ImageMaterialProperty({ image: e, transparent: !0 }) }, A.prototype.executeSector = function(t, e) { var i, o, n, a, l = this, r = (this._tree.starttemporaryItem(this._viewer), this._tree.removeHandler(), this._viewer), s = 0, u = { fillColor: l._cesium.Color.YELLOW.withAlpha(.5), outlineColor: l._cesium.Color.YELLOW }, c = (e && e.fillColor && (u.fillColor = e.fillColor), e && e.outlineColor && (u.outlineColor = e .outlineColor), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(l._viewer .scene.canvas), this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D .draw), []), h = this._core.CreateTooltip(), m = (this.item = void 0, this.end = e => { l._tree.handler.destroy(), l._tree.handler = null, h.show(!1), l._core.mouse(l._viewer .container, 0, "0"), this.end = void 0, "cancel" === e ? l.item && r.entities .remove(l.item) : (l.item && (l.item.polygon.hierarchy = new l._cesium.PolygonHierarchy( l._cesium.Cartesian3.fromDegreesArray(c))), "function" == typeof t && t(l .item, { position: i, angle: n, distance: a })) }, this._tree.handler.setInputAction(function(e) { e = l._getPosition.getMouseDegrees(e); 0 === s ? (i = { lon: e.lon, lat: e.lat, height: e.height }, s++) : l.end && l.end() }, l._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { l.end && l.end("cancel") }, l._cesium.ScreenSpaceEventType.RIGHT_CLICK), this._tree.handler.setInputAction(function(e) { 0 === s ? h.showAt(e.endPosition, "点击开始绘制") : (h.showAt(e.endPosition, "再次点击结束绘制,右键取消"), o = l._getPosition.getMouseDegrees(e), c = function(e, t) { var i = [], t = function(e, t, i, o) { var r = p(e), n = p(i), a = p(i) - p(e), s = p(o) - p(t); return a = (a = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(r) * Math.cos(n) * Math.pow(Math.sin( s / 2), 2)))) * m, a = Math.round(1e4 * a) / 1e4, { angle: l._core.TwoPointAzimuth(t, e, o, i), distance: a } }(e.lat, e.lon, t.lat, t.lon); n = t.angle, a = t.distance, i.push(e.lon, e.lat); for (var o = n - 30, r = null; o < n + 30; o++) r = function(e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = d + (m - d) * (90 - e) / 90, n = o * Math.cos(e * Math.PI / 180), r = 180 * (r / n + t * Math.PI / 180) / Math.PI, n = 180 * (i / o + e * Math.PI / 180) / Math.PI; return [r, n] }(e.lat, e.lon, a, o), i.push(r[0], r[1]); return i }(i, o), l.item || (l.item = r.entities.add({ polygon: { hierarchy: new l._cesium.PolygonHierarchy(l._cesium.Cartesian3 .fromDegreesArray(c)), material: new l._cesium.ColorMaterialProperty(u.fillColor), outlineColor: u.outlineColor, fill: !0 } }), l.item.polygon.hierarchy = new l._cesium.CallbackProperty(function() { return new l._cesium.PolygonHierarchy(l._cesium.Cartesian3 .fromDegreesArray(c)) }, !1))) }, l._cesium.ScreenSpaceEventType.MOUSE_MOVE), 6378137), d = 6356725; function p(e) { return e * Math.PI / 180 } return this }, A.prototype.executePolygon = function(t, s) { var l = this, i = (this._tree.starttemporaryItem(this._viewer), this._tree.removeHandler(), e.prototype._init = function() { var e = this; this.options.polygon.hierarchy = new l._cesium.CallbackProperty(function() { return e.hierarchy }, !1), this.polygon = l._viewer.entities.add(this.options), l.item = this.polygon, l ._tree.temporaryItem.obj.push(this.polygon) }, e); function e(e) { this.options = { name: "", polygon: { hierarchy: [], heightReference: l._core.defaultValue(t.heightReference, 1), perPositionHeight: 0 === t.heightReference, material: l._core.defaultValue(t.material, l._cesium.Color.YELLOW.withAlpha(.5)) } }, this.hierarchy = e, this._init() } this._tree.handler = new this._cesium.ScreenSpaceEventHandler(l._viewer.scene.canvas); var u = [], o = {}, c = void 0, h = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this._core .CreateTooltip()); return this._tree.handler.setInputAction(function(e) { e = l._getPosition.getMousePosition(e); 0 == u.length && u.push(e.clone()), u.push(e), o = new l._cesium.PolygonHierarchy(u) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { 0 === u.length ? h.showAt(e.endPosition, "左键开始绘制!") : u.length <= 2 ? h.showAt(e .endPosition, "点击继续绘制!") : h.showAt(e.endPosition, "右键结束绘制!"); e = l._getPosition.getMousePosition(e); 2 <= u.length && (l._cesium.defined(c) ? null != e && (u.pop(), e.y += 1 + Math.random(), u .push(e), o = new l._cesium.PolygonHierarchy(u)) : (o = new l._cesium .PolygonHierarchy(u), c = new i(o))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { l._tree.endtemporaryItem(), l._tree.handler.destroy(), h.show(!1); for (var t = { polygon: {}, positions: [], area: [] }, i = (t.polygon = c, []), o = 0; o < u.length; o++) { var r = l._cesium.Cartographic.fromCartesian(u[o]), n = l._cesium.Math.toDegrees(r.longitude), a = l._cesium.Math.toDegrees(r.latitude), r = r.height; i.push({ lon: n, lat: a, hei: r }) } t.positions = i, l._core.mouse(l._viewer.container, 0, "0"), "function" == typeof s && s(t) }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, A.prototype.executePolygonvideo = function(a, t) { var s = this, i = (this._tree.starttemporaryItem(this._viewer), this._tree.removeHandler(), e.prototype._init = function() { var e = this; this.options.polygon.hierarchy = new s._cesium.CallbackProperty(function() { return e.hierarchy }, !1), this.polygon = s._viewer.entities.add(this.options), m.style.transform = "rotate(" + t.angle + "deg)", this.polygon.polygon.stRotation = s._cesium.Math .toRadians(t.angle), s.item = this.polygon, s._tree.temporaryItem.obj.push(this.polygon) }, e); function e(e) { this.options = { name: "", polygon: { hierarchy: [], heightReference: s._cesium.HeightReference.CLAMP_TO_GROUND, classificationType: s._cesium.ClassificationType.BOTH, material: s._cesium.Color.YELLOW.withAlpha(.5) } }, this.hierarchy = e, this._init() } this._tree.handler = new this._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas); var l = [], o = {}, r = void 0, u = this._core.CreateTooltip(), c = s._core.getuid(), n = document.getElementById("videoToolbar"), h = (n || ($(".cesium-viewer").append('
'), n = document.getElementById( "videoToolbar")), ''), m = ($(n).append(h), document.getElementById("video" + c)); m.style.transform = "rotate(" + t.angle + "deg)"; let d; return this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this._tree .handler.setInputAction(function(e) { e = s._getPosition.getMousePosition(e); if (0 == l.length && l.push(e.clone()), l.push(e), 2 !== l.length || d || (d = s._viewer .entities.add({ name: "临时线", polyline: { positions: new Cesium.CallbackProperty(() => l, !1), clampToGround: !0, material: new Cesium.ColorMaterialProperty(Cesium.Color.YELLOW .withAlpha(.5)), width: 3 } })), 3 <= l.length && !r) return d && s._viewer.entities.remove(d), o = new s ._cesium.PolygonHierarchy(l), void(r = new i(o)); o = new s._cesium.PolygonHierarchy(l) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { 0 === l.length ? u.showAt(e.endPosition, "左键开始绘制!") : l.length <= 2 ? u.showAt(e .endPosition, "点击继续绘制!") : u.showAt(e.endPosition, "右键结束绘制!"), 2 <= l.length && (( e = s._getPosition.getMousePosition(e)) && (l.pop(), l.push(e), o = new s ._cesium.PolygonHierarchy(l))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { s.end && s.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { if (s._tree.endtemporaryItem(), s._tree.handler.destroy(), u.show(!1), s._core.mouse(s._viewer .container, 0, "0"), this.end = void 0, d && s._viewer.entities.remove(d), "cancel" === e || l.length < 3) s.item && s._viewer.entities.remove(s.item); else { m.play(), s.item.polygon.material = m; for (var e = { polygon: {}, positions: [], area: [] }, t = (e.polygon = s.item, []), i = 0; i < l.length; i++) { var o = s._cesium.Cartographic.fromCartesian(l[i]), r = s._cesium.Math.toDegrees(o.longitude), n = s._cesium.Math.toDegrees(o.latitude), o = o.height; t.push({ lon: r, lat: n, hei: o }) } e.positions = t, e.id = c, "function" == typeof a && a(e) } }, this }, A.prototype.addVideoPolygon = function(e, t) { var i, o = []; if (e[0] instanceof Array) { if (2 === e[0].length) { for (var r = 0; r < e.length; r++) o.push(e[r][0], e[r][1]); i = this._cesium.Cartesian3.fromDegreesArray(o) } else if (3 === e[0].length) { for (r = 0; r < e.length; r++) o.push(e[r][0], e[r][1], e[r][2]); i = this._cesium.Cartesian3.fromDegreesArrayHeights(o) } } else if (e[0].z) if (e[0].x < 180 && -180 < e[0].x && e[0].y < 90 && -90 < e[0].y) { for (r = 0; r < e.length; r++) o.push(e[r].x, e[r].y, e[r].z); i = this._cesium.Cartesian3.fromDegreesArrayHeights(o) } else i = e; else { for (r = 0; r < e.length; r++) o.push(e[r].x, e[r].y); i = this._cesium.Cartesian3.fromDegreesArray(o) } var n = document.getElementById("videoToolbar"), a = (n || ($(".cesium-viewer").append('
'), n = document.getElementById( "videoToolbar")), this._core.getuid()), s = '', n = ($(n).append(s), document.getElementById("video" + a)), s = (n.play(), this._core.defaultValue(t.heightReference, 1)), a = this._core.defaultValue(t.color, "#FFFFFF"); return this.item = this._viewer.entities.add({ name: "面贴视频", polygon: { hierarchy: new Cesium.PolygonHierarchy(i), material: new Cesium.ImageMaterialProperty({ image: n, color: Cesium.Color.fromCssColorString(a) }), heightReference: s, perPositionHeight: 1 !== s, stRotation: Cesium.Math.toRadians(t.angle || 0), rotation: Cesium.Math.toRadians(t.rotation || 0) } }), this }, A.prototype.addVideoBox = function(e, t) { e instanceof Array ? i = this._cesium.Cartesian3.fromDegrees(...e) : e.x ? i = this._cesium.Cartesian3 .fromDegrees(e.x, e.y, e.z) : e.lon && (i = this._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e .height)); var i, e = document.getElementById("videoToolbar"), o = (e || ($(".cesium-viewer").append('
'), e = document.getElementById( "videoToolbar")), this._core.getuid()), r = '', e = ($(e).append(r), document.getElementById("video" + o)), r = (e.play(), this._core.defaultValue(t.color, "#FFFFFF")); return this.item = this._viewer.entities.add({ name: "盒子贴视频", position: i, orientation: Cesium.Transforms.headingPitchRollQuaternion(i, new Cesium.HeadingPitchRoll( Cesium.Math.toRadians(t.heading || 0), Cesium.Math.toRadians(t.pitch || 0), Cesium.Math.toRadians(t.roll || 0))), box: { dimensions: new Cesium.Cartesian3(t.long || 100, t.width || 100, t.height || 100), material: new Cesium.ImageMaterialProperty({ image: e, color: Cesium.Color.fromCssColorString(r) }) } }), this }, A.prototype.deleteObject = function() { if (this._viewer.entities.remove(this.item), 0 < this._points.length) { for (var e = 0; e < this._points.length; e++) this._viewer.entities.remove(this._points[e]); this._points = [] } try { this._viewer.scene.primitives.remove(this.item) } catch (e) { console.log(e) } this.item = void 0 }, A.prototype.executePolygoncl = function(t, e) { this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer); var i, o, r = this, n = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this._tree .handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this._core .CreateTooltip()), a = [], s = {}, l = [], u = null, c = null, h = { point: r._cesium.Color.RED, polyline: r._cesium.Color.YELLOW, polygon: r._cesium.Color.YELLOW.withAlpha(.5) }, m = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (h.point = e.point), "" != e .polyline && null != e.polyline && (h.polyline = e.polyline), "" != e.polygon && null != e .polygon && (h.polygon = e.polygon)), { mj: 0, label: [], polygon: [] }); let d; this._tree.handler.setInputAction(function(e) { var t, i; 0 === a.length ? n.showAt(e.endPosition, "左键开始绘制!") : a.length <= 3 ? n.showAt(e .endPosition, "点击继续绘制!") : n.showAt(e.endPosition, "右键结束绘制!"), (c = r._getPosition .getMousePosition(e)) && (e = r._cesium.Cartographic.fromCartesian(c), t = r._cesium .Math.toDegrees(e.longitude), i = r._cesium.Math.toDegrees(e.latitude), e.height, 2 <= a.length && (r._cesium.defined(u) ? (a.pop(), a.push(c), s = new r._cesium .PolygonHierarchy(a), l.pop(), l.push([t, i])) : (s = new r._cesium .PolygonHierarchy(a), u = new p(s)), e = r._core.getArea(l, a), r._viewer .entities.remove(o), o = r._viewer.entities.add({ name: "多边形面积", position: new Cesium.CallbackProperty(function() { let t = new Cesium.Cartesian3; return a.forEach(e => { Cesium.Cartesian3.add(t, e, t) }), Cesium.Cartesian3.divideByScalar(t, a.length, new Cesium.Cartesian3) }, !1), label: { text: e, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), r._tree.temporaryItem.obj.push(o), m.label = o)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { var t, i; (c = r._getPosition.getMousePosition(e)) && (e = r._core.getArea(l, a), i = r._cesium .Cartographic.fromCartesian(c), t = r._cesium.Math.toDegrees(i.longitude), i = r._cesium .Math.toDegrees(i.latitude), 0 == a.length && (a.push(c.clone()), l.push([t, i])), a .push(c), l.push([t, i]), s = new r._cesium.PolygonHierarchy(a), 2 === a.length && (d = r._viewer.entities.add({ name: "临时线", polyline: { positions: new Cesium.CallbackProperty(() => a, !1), clampToGround: !1, material: h.polygon, width: 3 } })), 3 <= a.length && (d && r._viewer.entities.remove(d), r._cesium.defined(u) || ( s = new r._cesium.PolygonHierarchy(a), u = new p(s)), r._viewer.entities.remove( o), o = r._viewer.entities.add({ name: "多边形面积", position: new Cesium.CallbackProperty(function() { let t = new Cesium.Cartesian3; return a.forEach(e => { Cesium.Cartesian3.add(t, e, t) }), Cesium.Cartesian3.divideByScalar(t, a.length, new Cesium .Cartesian3) }, !1), label: { text: e, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), r._tree.temporaryItem.obj.push(o), m.label = o)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { r.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = function(e) { n.show(!1), r._viewer.entities.remove(o), r._tree.handler.destroy(), r.end = void 0, r._core .mouse(r._viewer.container, 0, "0"), d && r._viewer.entities.remove(d), "cancel" === e || a .length < 3 ? r.item && r._viewer.entities.remove(r.item) : (e = r._core.getArea(l, a), i = e, e = r._viewer.entities.add({ name: "多边形面积", position: new Cesium.CallbackProperty(function() { let t = new Cesium.Cartesian3; return a.forEach(e => { Cesium.Cartesian3.add(t, e, t) }), Cesium.Cartesian3.divideByScalar(t, a.length, new Cesium .Cartesian3) }, !1), label: { text: e, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), r._tree.endtemporaryItem(), r._points.push(e), r._lable = e, m.mj = i, m.label = e, "" != t && null != t && "function" == typeof t && t(m)) }; g.prototype._init = function() { var e = this; this.options.polygon.hierarchy = new r._cesium.CallbackProperty(function() { return e.hierarchy }, !1), this.polygon = r._viewer.entities.add(this.options), r.item = this.polygon, r ._entity = this.polygon, r._tree.temporaryItem.obj.push(this.polygon), m.polygon = this .polygon }; var p = g; function g(e) { this.options = { name: "多边形", polygon: { hierarchy: [], perPositionHeight: !0, material: h.polygon, classificationType: r._cesium.ClassificationType.BOTH } }, this.hierarchy = e, this._init() } return this }, A.prototype.executePolygonym = function(i) { var e, t, o = this, r = (this._tree.starttemporaryItem(this._viewer), this._tree.removeHandler(), this._tree.handler = new o._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas), []), n = {}, a = null, s = null, l = (this._tree.handler.setInputAction(function(e) { e = o._viewer.camera.getPickRay(e.endPosition); s = o._viewer.scene.globe.pick(e, o._viewer.scene), 2 <= r.length && (o._cesium.defined( a) ? (r.pop(), r.push(s), n = new o._cesium.PolygonHierarchy(r)) : (n = new o._cesium.PolygonHierarchy(r), a = new l(n))) }, o._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { e = o._viewer.camera.getPickRay(e.position), s = o._viewer.scene.globe.pick(e, o._viewer .scene), 0 == r.length && (r.push(s.clone()), n = new o._cesium .PolygonHierarchy(r)), r.push(s), n = new o._cesium.PolygonHierarchy(r), e = o ._cesium.Cartographic.fromCartesian(r[r.length - 1]), o._cesium.Math.toDegrees(e .longitude), o._cesium.Math.toDegrees(e.latitude), e.height, e = o._viewer .entities.add({ name: "多边形面积", position: r[r.length - 1], point: { pixelSize: 5, color: o._cesium.Color.RED, outlineColor: o._cesium.Color.WHITE, outlineWidth: 2, heightReference: o._cesium.HeightReference.CLAMP_TO_GROUND } }); o._tree.temporaryItem.obj.push(e), o._points.push(e) }, o._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { o._tree.handler.destroy(), o._tree.endtemporaryItem(), r.pop(), n = new o._cesium .PolygonHierarchy(r); var t = o._viewer.entities.add({ name: "多边形面积", position: new Cesium.CallbackProperty(function() { let t = new Cesium.Cartesian3; return r.forEach(e => { Cesium.Cartesian3.add(t, e, t) }), Cesium.Cartesian3.divideByScalar(t, r.length, new Cesium .Cartesian3) }, !1), label: { text: "平方千米", font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: o._cesium.HeightReference.CLAMP_TO_GROUND } }); o._tree.temporaryItem.obj.push(t), o._points.push(t), "" != i && null != i && "function" == typeof i && i(a) }, o._cesium.ScreenSpaceEventType.RIGHT_CLICK), u.prototype._init = function() { var e = this, t = (this.options.polygon.hierarchy = new o._cesium.CallbackProperty(function() { return e.hierarchy }, !1), o._viewer.entities.add(this.options)); o._tree.temporaryItem.obj.push(t), o.item = t }, e = 0, o._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (e = V .selectedItem.id), t = { id: t = o._core.getuid(), name: "新建面" + t, pId: o._core.isnull(e) ? 0 : e, type: "polygon", item: o }, o.setTreeobj(t), V.insertGroupId(t, o._core.isnull(e) ? 0 : e), u); function u(e) { this.options = { name: "多边形", polygon: { hierarchy: [], perPositionHeight: !0, material: o._cesium.Color.SKYBLUE.withAlpha(.4), extrudedHeight: 0 } }, this.hierarchy = e, this._init() } return this }, A.prototype.executePolygonymsd = function(_ = {}, i) { this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer); var h, f = this, y = (this._tree.handler = new f._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this ._core.CreateTooltip()), v = {}, C = [], w = null, m = null, o = "0", b = 0, T = 1e3, r = 10, S = !1, P = []; this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw); let E, x; function I() { f.end(); let t = r / 20; f.waterTimer = setInterval(function() { var e; b < T && (b += t, f.item._polygon.extrudedHeight.setValue(b), T <= b && (clearInterval(f .waterTimer), f.waterTimer = void 0, b = T, f._viewer.entities.remove(f .item), f.polygon1 = new f._cesium.PolygonGeometry({ polygonHierarchy: new f._cesium.PolygonHierarchy(C), extrudedHeight: T, height: 0, vertexFormat: f._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT }), e = new f._cesium.Primitive({ geometryInstances: new f._cesium.GeometryInstance({ geometry: f.polygon1 }), appearance: new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { type: "Water", uniforms: { baseWaterColor: _.watherColor || Cesium.Color.SKYBLUE.withAlpha( .6), blendColor: _.watherColor || Cesium .Color.SKYBLUE.withAlpha(.6), normalMap: _.url, frequency: _.frequency || 1e3, animationSpeed: _.watherSpeed || .01, amplitude: _.amplitude || 10 } } }) }), show: !0 }), f._viewer.scene.primitives.add(e), f.item = e, "" != i && null != i && "function" == typeof i && i(b), f._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (o = V.selectedItem.id), e = { id: e = f._core.getuid(), name: "新建淹没分析" + e, pId: f._core.isnull(o) ? 0 : o, type: "polygon", item: f }, f.setTreeobj(e), V.insertGroupId(e, f._core.isnull(o) ? 0 : o))) }, 50) } this._tree.handler.setInputAction(function(e) { if (S) void 0 === b ? y.showAt(e.endPosition, "点击拾取初始水面高度") : void 0 === T && y.showAt(e .endPosition, "点击拾取最大淹没高度"); else { 4 <= C.length ? y.showAt(e.endPosition, "右键结束绘制") : y.showAt(e.endPosition, "点击左键绘制淹没区域"); e = f._viewer.camera.getPickRay(e.endPosition); if (h = f._viewer.scene.globe.pick(e, f._viewer.scene), 2 <= C.length) { if (f._cesium.defined(w)) if (_.rectangle) x = f._core.toDegrees(h), C = [Cesium.Cartesian3.fromDegrees(E .lon, E.lat), Cesium.Cartesian3.fromDegrees(E.lon, x.lat), Cesium .Cartesian3.fromDegrees(x.lon, x.lat), Cesium.Cartesian3.fromDegrees(x .lon, E.lat) ], v = new f._cesium.PolygonHierarchy(C), w.hierarchy = v; else { for (var e = C[0], e = f._viewer.scene.globe.ellipsoid .cartesianToCartographic(e), t = Cesium.Math.toDegrees(e.latitude), e = Cesium.Math.toDegrees(e.longitude), i = C[C.length - 2], i = f ._viewer.scene.globe.ellipsoid.cartesianToCartographic(i), o = Cesium.Math.toDegrees(i.latitude), i = Cesium.Math.toDegrees(i .longitude), r = f._viewer.scene.globe.ellipsoid .cartesianToCartographic(h), n = Cesium.Math.toDegrees(r.latitude), r = Cesium.Math.toDegrees(r.longitude), a = Cesium_turf.lineString([ [e, t], [r, n] ]), s = Cesium_turf.lineString([ [i, o], [r, n] ]), l = !0, u = 0; u < P.length && 2 <= P.length; u++) { var c = P[u]; if (0 == u) { if (Cesium_turf.lineIntersect(s, c).features.length) { l = !1, y.innerHTML = '不允许出现交叉面!'; break } } else if (u == P.length - 1) { if (Cesium_turf.lineIntersect(a, c).features.length) { l = !1, y.innerHTML = '不允许出现交叉面!'; break } } else { if (Cesium_turf.lineIntersect(a, c).features.length) return l = !1, void(y.innerHTML = '不允许出现交叉面!' ); if (Cesium_turf.lineIntersect(s, c).features.length) { l = !1, y.innerHTML = '不允许出现交叉面!'; break } } } if (!l) return; C.pop(), C.push(h), v = new f._cesium.PolygonHierarchy(C) } else v = new f._cesium.PolygonHierarchy(C), w = new d(v); m || (m = f._viewer.entities.add({ polyline: { positions: new Cesium.CallbackProperty(function() { return C.concat([C[0]]) }, !1), clampToGround: !0, width: 3 } }), f._points.push(m)) } } }, f._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { e = f._getPosition.getMousePosition(e); if (e) if (S) { var t = f._cesium.Cartographic.fromCartesian(e); if (void 0 === b) b = t.height; else if (void 0 === T) { if ((T = t.height) < b) return window.layuiLayer && window.layuiLayer.msg( "最大淹没高度小于初始水面高度,请重新拾取"), void(b = T = void 0); I() } } else { if (0 == C.length && (C.push(e.clone()), v = new f._cesium.PolygonHierarchy(C)), 2 <= C.length) if (0 == P.length) { var i = C[0], o = f._viewer.scene.globe.ellipsoid.cartesianToCartographic(i), r = Cesium.Math.toDegrees(o.latitude), n = Cesium.Math.toDegrees(o.longitude), a = C[1], s = f._viewer.scene.globe.ellipsoid.cartesianToCartographic(a), l = Cesium.Math.toDegrees(s.latitude), u = Cesium.Math.toDegrees(s.longitude), c = Cesium_turf.lineString([ [n, r], [u, l] ]); P.push(c) } else { if (2 <= P.length) { for (var i = C[0], o = f._viewer.scene.globe.ellipsoid .cartesianToCartographic(i), r = Cesium.Math.toDegrees(o .latitude), n = Cesium.Math.toDegrees(o.longitude), a = C[C .length - 2], s = f._viewer.scene.globe.ellipsoid .cartesianToCartographic(a), l = Cesium.Math.toDegrees(s .latitude), u = Cesium.Math.toDegrees(s.longitude), t = f ._viewer.scene.globe.ellipsoid.cartesianToCartographic(e), a = Cesium.Math.toDegrees(t.latitude), t = Cesium.Math.toDegrees(t .longitude), h = Cesium_turf.lineString([ [n, r], [t, a] ]), m = Cesium_turf.lineString([ [u, l], [t, a] ]), d = !0, p = 0; p < P.length && 2 <= P.length; p++) { var g = P[p]; if (0 == p) { if (Cesium_turf.lineIntersect(m, g).features.length) { d = !1, y.innerHTML = '不允许出现交叉面!'; break } } else if (p == P.length - 1) { if (Cesium_turf.lineIntersect(h, g).features.length) { d = !1, y.innerHTML = '不允许出现交叉面!'; break } } else { if (Cesium_turf.lineIntersect(h, g).features.length) return d = !1, void(y.innerHTML = '不允许出现交叉面!' ); if (Cesium_turf.lineIntersect(m, g).features.length) { d = !1, y.innerHTML = '不允许出现交叉面!'; break } } } if (!d) return } i = C[C.length - 2], o = f._viewer.scene.globe.ellipsoid .cartesianToCartographic(i), r = Cesium.Math.toDegrees(o.latitude), n = Cesium.Math.toDegrees(o.longitude), s = f._viewer.scene.globe.ellipsoid .cartesianToCartographic(e), l = Cesium.Math.toDegrees(s.latitude), u = Cesium.Math.toDegrees(s.longitude), c = Cesium_turf.lineString([ [n, r], [u, l] ]); P.push(c) } C.push(e), v = new f._cesium.PolygonHierarchy(C), _.rectangle && (E ? (x = f ._core.toDegrees(e), C = [Cesium.Cartesian3.fromDegrees(E.lon, E.lat), Cesium.Cartesian3.fromDegrees(E.lon, x.lat), Cesium.Cartesian3 .fromDegrees(x.lon, x.lat), Cesium.Cartesian3.fromDegrees(x.lon, E .lat) ], v = new f._cesium.PolygonHierarchy(C), w.hierarchy = v, _ .pointSelect ? S = !(T = b = void 0) : I()) : E = f._core.toDegrees(e)); t = f._cesium.Cartographic.fromCartesian(C[C.length - 1]), a = (f._cesium.Math .toDegrees(t.longitude), f._cesium.Math.toDegrees(t.latitude), t.height, f ._viewer.entities.add({ name: "多边形", position: e, point: { pixelSize: 5, color: f._cesium.Color.RED, outlineColor: f._cesium.Color.WHITE, outlineWidth: 1, heightReference: f._cesium.HeightReference.CLAMP_TO_GROUND } })); f._tree.temporaryItem.obj.push(a), f._points.push(a) } }, f._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { S || C.length <= 3 || (y.show(!1), C.pop(), v = new f._cesium.PolygonHierarchy(C), _ .pointSelect ? S = !(T = b = void 0) : I()) }, f._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { if (y.show(!1), f._core.mouse(f._viewer.container, 0), f._tree.handler.destroy(), f._tree .endtemporaryItem(), f.end = void 0, "cancel" === e && !this.waterTimer && (f.item && f ._viewer.entities.remove(f.item), 0 < this._points.length)) { for (var t = 0; t < this._points.length; t++) this._viewer.entities.remove(this._points[t]); this._points = [] } }; e.prototype._init = function() { var e = this, t = (this.options.polygon.hierarchy = new f._cesium.CallbackProperty(function() { return e.hierarchy }, !1), f._viewer.entities.add(this.options)); f.item = t, f._tree.temporaryItem.obj.push(t); try { null != _ && "" != _ && (0 < _.waterHeight && (b = _.waterHeight), 0 < _.targetHeight && ( T = _.targetHeight), 0 < _.spood && (r = _.spood), "" != _.GroupID && null != _ .GroupID && (o = _.GroupID)) } catch (e) { console.log(e) } }; var d = e; function e(e) { this.options = { name: "多边形", polygon: { hierarchy: [], material: f._cesium.Color.SKYBLUE.withAlpha(.5), heightReference: f._cesium.HeightReference.NONE, extrudedHeight: 0 } }, this.hierarchy = e, this._init() } return this }, A.prototype.endWater = function() { this.end && this.end(), this.waterTimer && clearInterval(this.waterTimer), this._tree .endtemporaryItem(), this.deleteObject() }, A.prototype.executePolygonymsdtt = function(o, e) { this._tree.removeHandler(); var r = this, n = (this._tree.starttemporaryItem(this._viewer), this._tree.handler = new r._cesium .ScreenSpaceEventHandler(r._viewer.scene.canvas), []), t = null, i = null, a = (this._tree.handler.setInputAction(function(e) { e = r._viewer.camera.getPickRay(e.endPosition); i = r._viewer.scene.globe.pick(e, r._viewer.scene), 2 <= n.length && (r._cesium.defined( t) ? (n.pop(), n.push(i)) : t = new a(n), new r._cesium.PolygonHierarchy(n)) }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function(e) { e = r._viewer.camera.getPickRay(e.position), i = r._viewer.scene.globe.pick(e, r._viewer .scene), 0 == n.length && (n.push(i.clone()), new r._cesium.PolygonHierarchy( n)), n.push(i), new r._cesium.PolygonHierarchy(n), e = r._cesium.Cartographic .fromCartesian(n[n.length - 1]), r._cesium.Math.toDegrees(e.longitude), r._cesium .Math.toDegrees(e.latitude), e.height, e = r._viewer.entities.add({ name: "多边形面积", position: n[n.length - 1], point: { pixelSize: 5, color: r._cesium.Color.RED, outlineColor: r._cesium.Color.WHITE, outlineWidth: 2, heightReference: r._cesium.HeightReference.CLAMP_TO_GROUND } }); r._tree.temporaryItem.obj.push(e), r._points.push(e) }, r._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { r._tree.handler.destroy(), r._viewer.entities.remove(r.item), r.polygon1 = new r._cesium .PolygonGeometry({ polygonHierarchy: new r._cesium.PolygonHierarchy(n), extrudedHeight: 0, height: 0, vertexFormat: r._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT }); var t = new r._cesium.Primitive({ geometryInstances: new r._cesium.GeometryInstance({ geometry: r.polygon1 }), appearance: new r._cesium.EllipsoidSurfaceAppearance({ aboveGround: !0 }), show: !0 }), i = new r._cesium.Material({ fabric: { type: "Water", uniforms: { normalMap: o.url, frequency: 100, animationSpeed: .01, amplitude: 10 } } }), i = (t.appearance.material = i, r._viewer.scene); r.polygon1 = i.primitives.add(t), r._tree.endtemporaryItem(), n.pop(), new r._cesium .PolygonHierarchy(n) }, r._cesium.ScreenSpaceEventType.RIGHT_CLICK), s.prototype._init = function() { var e = this, t = (this.options.polygon.hierarchy = new r._cesium.CallbackProperty(function() { return e.hierarchy }, !1), r._viewer.entities.add(this.options)), t = (r.item = t, r._tree.temporaryItem.obj.push(t), 0), i = (r._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (t = V .selectedItem.id), r._core.getuid()), i = { id: i, name: "新建水面" + i, pId: r._core.isnull(t) ? 0 : t, type: "polyline", item: r }; r.setTreeobj(i), V.insertGroupId(i, r._core.isnull(t) ? 0 : t) }, s); function s(e) { this.options = { name: "多边形", polygon: { hierarchy: [], material: r._cesium.Color.SKYBLUE.withAlpha(.4), heightReference: r._cesium.HeightReference.NONE, extrudedHeight: 0 } }, this.hierarchy = e, this._init() } return this }, A.prototype.executePolygontdmj = function(t, e) { var i, o, r = this, n = (this._tree.starttemporaryItem(this._viewer), this._core.mouse(this._viewer.container, 1, window .SmartEarthRootUrl + D.draw), this._tree.removeHandler(), { mj: 0, label: [], polygon: [] }), a = !0, s = [], l = void 0, u = this._viewer.scene, c = u.globe.ellipsoid, h = { point: r._cesium.Color.RED, polyline: r._cesium.Color.YELLOW, polygon: r._cesium.Color.YELLOW.withAlpha(.5) }, m = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (h.point = e.point), "" != e .polyline && null != e.polyline && (h.polyline = e.polyline), "" != e.polygon && null != e .polygon && (h.polygon = e.polygon)), this._core.CreateTooltip()), d = (this._tree.handler = new r._cesium.ScreenSpaceEventHandler(u.canvas), 0); this._tree.handler.setInputAction(function(e) { 0 === s.length ? m.showAt(e.endPosition, "左键开始绘制!") : s.length <= 2 ? m.showAt(e .endPosition, "点击继续绘制!") : m.showAt(e.endPosition, "右键结束绘制!"), o && (r._viewer .entities.remove(o), o = void 0); var e = r._getPosition.getMousePosition(e, [n.polygon, n.label]); e && r._cesium.Ellipsoid.WGS84.cartesianToCartographic(e) && a && (s.pop(), s.push(e), 3 <= s.length && (e = (e = String(g(l.path.positions))).substr(0, e.indexOf(".", 0)), d = e.length < 6 ? e + "平方米" : (e = (e = String(e / 1e6)).substr(0, e.indexOf(".", 0) + 3)) + "平方千米", n.mj = d, o = r._viewer.entities.add({ name: "多边形面积", position: new Cesium.CallbackProperty(function() { let t = new Cesium.Cartesian3; return s.forEach(e => { Cesium.Cartesian3.add(t, e, t) }), Cesium.Cartesian3.divideByScalar(t, s.length, new Cesium.Cartesian3) }, !1), label: { text: d, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: r._cesium.HeightReference.CLAMP_TO_GROUND } }), r._tree.temporaryItem.obj.push(o), r._points.push(o), n.label = o)) }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE); let p; this._tree.handler.setInputAction(function(e) { var e = r._getPosition.getMousePosition(e, [n.polygon, n.label]); e && a && (s.length || s.push(e.clone()), s.push(e), i = new r._cesium.PolygonHierarchy(s), o && (r._viewer.entities.remove(o), o = void 0), 2 === s.length && (p = r._viewer .entities.add({ name: "临时线", polyline: { positions: new Cesium.CallbackProperty(() => s, !1), clampToGround: !0, material: h.polygon, width: 3 } })), 3 <= s.length && !r._cesium.defined(l) && (p && r._viewer.entities.remove( p), l = new y(i, r._cesium)), 3 <= s.length && (e = (e = String(g(l.path .positions))).substr(0, e.indexOf(".", 0)), d = e.length < 6 ? e + "平方米" : ( e = (e = String(e / 1e6)).substr(0, e.indexOf(".", 0) + 3)) + "平方千米", n.mj = d, o = r._viewer.entities.add({ name: "多边形面积", position: new Cesium.CallbackProperty(function() { let t = new Cesium.Cartesian3; return s.forEach(e => { Cesium.Cartesian3.add(t, e, t) }), Cesium.Cartesian3.divideByScalar(t, s.length, new Cesium.Cartesian3) }, !1), label: { text: d, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: r._cesium.HeightReference.CLAMP_TO_GROUND } }), r._tree.temporaryItem.obj.push(o), r._points.push(o), n.label = o)) }, r._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function() { r.end && r.end() }, r._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = function(e) { r._tree.handler.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_CLICK), r._tree.handler .removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), r._cesium .trackedEntity = void 0, r.end = void 0, r._tree.endtemporaryItem(), a = !1, m.show(!1), r ._tree.handler.destroy(), r._core.mouse(r._viewer.container, 0, "0"), p && r._viewer .entities.remove(p), "cancel" === e ? r.deleteObject() : (s.length < 3 && r.deleteObject(), "" != t && null != t && "function" == typeof t && t(n)) }; var g = function(e) { for (var t = new Array(e.length), i = 0; i < e.length; i++) t[i] = _(c.cartesianToCartographic( e[i])); for (var o = 0, i = 0; i < t.length; i++) o += t[i].longitude; o /= t.length; for (i = 0; i < t.length; i++) t[i] = r._core.Gauss_to_XY(t[i].longitude, t[i].latitude, o, r ._cesium); return Math.abs(f(t)) }, _ = function(e) { return e.longitude = e.longitude / Math.PI * 180, e.latitude = e.latitude / Math.PI * 180, e }, f = function(e) { for (var t = 0, i = 0; i < e.length; i++) { var o = e[i], r = i < e.length - 1 ? e[i + 1] : e[0]; t += o.x * r.y - r.x * o.y } return t / 2 }, y = (v.prototype._init = function(e) { var t = this; this.options.polygon.hierarchy = new r._cesium.CallbackProperty(function() { return t.path }, !1), this.polygonEntity = r._viewer.entities.add(this.options), r.item = this .polygonEntity, r._tree.temporaryItem.obj.push(this.polygonEntity), n.polygon = this .polygonEntity, r._entity = this.polygonEntity }, v); function v(e, t) { if (!r._cesium.defined(e)) throw new r._cesium.DeveloperError("positions is required!"); if (e.length < 3) throw new r._cesium.DeveloperError("positions 的长度必须大于等于3"); this.options = { polygon: { show: !0, hierarchy: void 0, classificationType: r._cesium.ClassificationType.BOTH, material: h.polygon } }, this.path = e, this._init(t) } return this }, A.prototype.spaceArea = function(r = {}, n) { var i, o = this, a = (this._tree.removeHandler(), this._core.mouse(this._viewer.container, 1, window .SmartEarthRootUrl + D.draw), { mj: 0, label: void 0, polygon: void 0 }), s = [], l = [], u = void 0, e = this._viewer.scene, c = { point: r.point || Cesium.Color.RED, polyline: r.polyline || Cesium.Color.YELLOW, polygon: r.polygon || Cesium.Color.YELLOW.withAlpha(.5) }, t = this._core.CreateTooltip(); this._tree.handler = new o._cesium.ScreenSpaceEventHandler(e.canvas); let h = !1; this._tree.handler.setInputAction(e => { 0 === s.length ? t.showAt(e.endPosition, "左键开始绘制!") : s.length <= 2 ? t.showAt(e .endPosition, "点击继续绘制!") : t.showAt(e.endPosition, "右键结束绘制!"), !h || (e = this ._getPosition.getMousePosition(e, [a.polygon, a.label])) && (s.pop(), s.push(e)) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); let m; this._tree.handler.setInputAction(e => { h = !0; let t = this._getPosition.getMousePosition(e, [a.polygon, a.label]); t && (s.length || s.push(t.clone()), s.push(t), e = this._core.toDegrees(t), l.push([e.lon, e.lat, e.height ]), i = new o._cesium.PolygonHierarchy(s), 2 === s.length && (m = this._viewer .entities.add({ name: "临时线", polyline: { positions: new Cesium.CallbackProperty(() => s, !1), clampToGround: !0, material: c.polygon, width: 3 } })), 3 <= s.length && !Cesium.defined(u) && (m && this._viewer.entities.remove( m), u = new d(i))) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(() => { o.end && o.end() }, Cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = i => { if (this.end = void 0, h = !1, t.show(!1), o._tree.handler.destroy(), o._core.mouse(o._viewer .container, 0, "0"), m && o._viewer.entities.remove(m), "cancel" === i) this .deleteObject(); else if (s.pop(), s.length < 3 && this.deleteObject(), 2 < l.length) { i = Cesium.BoundingSphere.fromPoints(s); let e = this._core.getSpaceArea(this._viewer, l, { onlyTerrain: r.onlyTerrain, distance: r.distance || i.radius / 20 }), t = e => { let { area: t, tin: i } = e, o = (a.mj = t, new Cesium.Cartesian3); s.forEach(e => { Cesium.Cartesian3.add(o, e, o) }); e = Cesium.Cartesian3.divideByScalar(o, s.length, new Cesium.Cartesian3), e = this ._viewer.entities.add({ name: "多边形面积", position: e, label: { text: t, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); this._points.push(e), r.tin && (this._viewer.entities.remove(a.polygon), i.features .forEach(e => { e.positions && (e = this._viewer.entities.add({ polygon: { hierarchy: new Cesium.PolygonHierarchy(e .positions), material: c.polygon, perPositionHeight: !0, outline: !0, outlineColor: Cesium.Color.YELLOW } }), this._points.push(e)) })), a.label = e, n && "function" == typeof n && n(a) }; r.onlyTerrain ? e.then(e => { t(e) }) : t(e) } }; p.prototype._init = function() { var e = this; this.options.polygon.hierarchy = new Cesium.CallbackProperty(function() { return e.path }, !1), this.polygonEntity = o._viewer.entities.add(this.options), o.item = this .polygonEntity, o._tree.temporaryItem.obj.push(this.polygonEntity), a.polygon = this .polygonEntity, o._entity = this.polygonEntity }; var d = p; function p(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("positions is required!"); if (e.length < 3) throw new Cesium.DeveloperError("positions 的长度必须大于等于3"); this.options = { polygon: { show: !0, hierarchy: void 0, classificationType: Cesium.ClassificationType.BOTH, material: c.polygon } }, this.path = e, this._init() } return this }, A.prototype.setVisibility = function(e) { if (0 < this._points.length) for (var t = 0; t < this._points.length; t++) this._points[t].show = e; this._lable && (this._lable.show = e), this.item.show = e }, A.prototype.getVisibility = function() { return this.item.show }, A.prototype.setRadius = function(e) { try { for (var t = [], i = this.item._polygon.hierarchy.getValue(), o = this._viewer.scene.globe .ellipsoid, r = 0; r < i.length; r++) { var n = new this._cesium.Cartesian3(i[r].x, i[r].y, i[r].z), a = o.cartesianToCartographic(n), s = this._cesium.Math.toDegrees(a.latitude), l = this._cesium.Math.toDegrees(a.longitude); t.push(l), t.push(s) } var u = new this._cesium.Cartesian3(i[0].x, i[0].y, i[0].z), c = o.cartesianToCartographic(u), s = this._cesium.Math.toDegrees(c.latitude), l = this._cesium.Math.toDegrees(c.longitude); t.push(l), t.push(s), t = this._cesium.Cartesian3.fromDegreesArray(t), this.item.corridor = new this ._cesium.CorridorGraphics({ positions: t, width: e, material: this._cesium.Color.RED.withAlpha(.4) }) } catch (e) { console.log(e) } return this }, A.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show._value, t = this.item.polygon.hierarchy.getValue(), i = null == this.item.polygon.height ? void 0 : this.item.polygon.height._value, o = null == this.item.polygon.extrudedHeight ? void 0 : this.item.polygon.extrudedHeight._value, r = null == this.item.polygon.stRotation ? void 0 : this.item.polygon.stRotation._value, n = null == this.item.polygon.fill ? void 0 : this.item.polygon.fill._value, a = this.item.polygon.material, s = (null != a && (a = { color: null == a.color ? void 0 : "rgba(" + a.color._value.red + "," + a.color._value .green + "," + a.color._value.blue + "," + a.color._value.alpha + ")", image: null == a.image ? void 0 : a.image._value, diffusemap: null == a.diffusemap ? void 0 : a.diffusemap._value, alphamap: null == a.alphamap ? void 0 : a.alphamap._value }), null == this.item.polygon.outline ? void 0 : this.item.polygon.outline._value), l = null == this.item.polygon.outlineColor ? void 0 : "rgba(" + this.item.polygon.outlineColor ._value.red + "," + this.item.polygon.outlineColor._value.green + "," + this.item.polygon .outlineColor._value.blue + "," + this.item.polygon.outlineColor._value.alpha + ")", u = null == this.item.polygon.outlineWidth ? void 0 : this.item.polygon.outlineWidth._value, c = null == this.item.polygon.perPositionHeight ? void 0 : this.item.polygon.perPositionHeight ._value, h = null == this.item.polygon.closeTop ? void 0 : this.item.polygon.closeTop._value, m = null == this.item.polygon.closeBottom ? void 0 : this.item.polygon.closeBottom._value, d = this.item.polygon.distanceDisplayCondition, p = null == d ? void 0 : d._value.near, d = null == d ? void 0 : d._value.far; return { type: "polygon", treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, hierarchy: t, height: i, extrudedHeight: o, stRotation: r, fill: n, material: a, outline: s, outlineColor: l, outlineWidth: u, perPositionHeight: c, closeTop: h, closeBottom: m, near: p, far: d } } }, A.prototype.setTreeobj = function(e) { this.treeobj = e }, A.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._polygon.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, A.prototype.setPolygonAlpha = function(e) { try { this.item._polygon.material.color._value.alpha = e } catch (e) { console.log(e) } return this }, A.prototype.setPolygonColor = function(e) { try { this.item._polygon.material.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, A.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._polygon.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, A.prototype.setPolygonImage = function(e) { try { this.item._polygon.material = new this._cesium.ImageMaterialProperty({ image: e }) } catch (e) { console.log(e) } return this }, A.prototype.setPolygonRepeat = function(e, t) { try { this.item._polygon.material.repeat = new this._cesium.Cartesian2(e, t) } catch (e) { console.log(e) } return this }, A.prototype.setOutlineColor = function(e) { try { this.item._polygon.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, A.prototype.setOutline = function(e) { try { this.item._polygon.outline = e } catch (e) { console.log(e) } return this }, A.prototype.setExtrudedHeight = function(e) { try { this.item._polygon.extrudedHeight = e } catch (e) { console.log(e) } return this }, A.prototype.setHeight = function(e) { try { this.item._polygon.height = e } catch (e) { console.log(e) } return this }, A.prototype.setHeightType = function(e) { try { 1 == e ? this.item._polygon.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._polygon.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this .item._polygon.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, Object.defineProperties(A.prototype, { rectangle: { get: function() { return this.item.rectangle }, set: function(e) { this.item.rectangle = e } } }), Object.defineProperties(A.prototype, { HighLight: { set: function(e) { e && (this.item.material = this.item.polygon.material), this.item.polygon.material = e ? new m(this._viewer, this._cesium).colorFromHtmlColor(this._core.selectedColor) : this.item.material } }, polygonShow: { set: y.debounce(function(e) { this.item.polygon.show = e }, 500), get: function() { return this.item.polygon.b } }, polygonHeight: { set: y.debounce(function(e) { this._core.isnull(e) || (/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, "")), this.item.polygon.height = e) }, 500), get: function() { var e = this.item.polygon.height; if (e) return e._value } }, polygonHeightReference: { set: y.debounce(function(e) { this._core.isnull(e) || (this.item.polygon.heightReference = e) }, 500), get: function() { var e = this.item.polygon.heightReference; if (e) return e._value } }, polygonExtrudedHeight: { set: y.debounce(function(e) { this._core.isnull(e) || (/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, "")), this.item.polygon.extrudedHeight = e) }, 500), get: function() { var e = this.item.polygon.extrudedHeight; if (e) return e._value } }, polygonExtrudedHeightReference: { set: y.debounce(function(e) { this._core.isnull(e) || (this.item.polygon.extrudedHeightReference = e) }, 500), get: function() { var e = this.item.polygon.extrudedHeightReference; if (e) return e._value } }, polygonFill: { set: y.debounce(function(e) { this.item.polygon.fill = e }, 500), get: function() { var e = this.item.polygon.fill; if (e) return e._value } }, polygonMaterial: { set: y.debounce(function(e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this ._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && ( e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.polygon.material = e, this.item.material = this.item.polygon .material) }, 500), get: function() { var e = this.item.polygon.material; try { return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value .green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } }, polygonMaterialAlpha: { set: y.debounce(function(e) { this._core.isnull(e) || (this.item.polygon.material.color.alpha = e) }, 500), get: function() { this.item.polygon.material; try { return this.item.polygon.material.color.alpha } catch (e) {} } }, polygonOutline: { set: y.debounce(function(e) { this._core.isnull(e) || (this.item.polygon.outline = e) }, 500), get: function() { var e = this.item.polygon.outline; if (e) return e._value } }, polygonOutlineColor: { set: y.debounce(function(e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this ._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && ( e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.polygon.outlineColor = e) }, 500), get: function() { var e = this.item.polygon.outlineColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value .green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, polygonOutlineWidth: { set: y.debounce(function(e) { this._core.isnull(e) || (/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, "")), this.item.polygon.outlineWidth = e) }, 500), get: function() { var e = this.item.polygon.outlineWidth; if (e) return e._value } } }), A.prototype.setItem = function(e) { this.item = e }, Object.defineProperties(A.prototype, { polyline: { get: function() { return this.item.polyline }, set: function(e) { this.item.polyline = e } } }), Object.defineProperties(A.prototype, { polygon: { get: function() { return this.item.polygon }, set: function(e) { this.item.polygon = e } } }), Object.defineProperties(A.prototype, { point: { get: function() { return this.item.point }, set: function(e) { this.item.point = e } } }), Object.defineProperties(A.prototype, { label: { get: function() { return this.item.label }, set: function(e) { this.item.label = e } } }), Object.defineProperties(A.prototype, { model: { get: function() { return this.item.model }, set: function(e) { this.item.model = e } } }), Object.defineProperties(A.prototype, { wall: { get: function() { return this.item.wall }, set: function(e) { this.item.wall = e } } }), Object.defineProperties(A.prototype, { polygonTempOptions: { get: function() { return { height: 0, extrudedHeight: 0, show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, stRotation: 1, granularity: this._cesium.Math.RADIANS_PER_DEGREE, perPositionHeight: !1, closeTop: !0, closeBottom: !0, shadows: ShadowMode.DISABLED, classificationType: ClassificationType.BOTH, arcType: ArcType.GEODESIC } } } }), Object.defineProperties(A.prototype, { Visibility: { get: function() { return this.item.show } }, PolygonColor: { get: function() { var e = this.item._polygon.material.color._value; if (e) return new m(this._viewer, this._cesium).toHtmlColor("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")") } }, PolygonAlpha: { get: function() { if (this.item._polygon.material.color) return this.item._polygon.material.color._value .alpha || 1 } }, Outline: { get: function() { if (this.item._polygon.outline) return this.item._polygon.outline._value } }, OutlineColor: { get: function() { var e = this.item._polygon.outlineColor; if (this.item._polygon.outlineColor) return e = e._value, new m(this._viewer, this ._cesium).toHtmlColor("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")") } }, ExtrudedHeight: { get: function() { if (this.item._polygon.extrudedHeight) return this.item._polygon.extrudedHeight._value } }, Height: { get: function() { return this.item._polygon.height } }, PolygonImage: { get: function() { if (this.item._polygon.material.uniforms) return this.item._polygon.material.uniforms .image } }, PolygonRepeat: { get: function() { if (this.item._polygon.material.uniforms) return this.item._polygon.material.repeat } } }), A.prototype.forceEndHanlder = function() { this._tree.handler && (this._tree.handler.destroy(), this._tree.handler = void 0) }, R.prototype.createBox = function(e, t, i, o) { var r = { id: this._core.getuid(), dimensions: new this._cesium.Cartesian3(4e5, 3e5, 5e5), material: this._cesium.Color.RED.withAlpha(.5), fill: !0, outline: !0, outlineColor: this._cesium.Color.BLACK }, r = this._core.extend(r, t, !0), t = (this.item = this._viewer.entities.add({ name: i, position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), box: r }), { id: this.item.id, name: i, pId: this._core.isnull(o) ? 0 : o, type: "box", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, R.prototype.getstyles = function() { var e = {}; return e.show = !this.item.box.show || this.item.box.show._value, e.heightReference = this.item.box .heightReference || void 0, e.fill = this.item.box.fill && this.item.box.fill._value ? this.item.box .fill._value : void 0, e.dimensions = this.item.box.dimensions ? this.item.box.dimensions .getValue() : void 0, e.shadows = this.item.box.shadows && this.item.box.shadows._value ? this.item.box .shadows._value : void 0, e.material = {}, e.material.color = this.item.box.material && this.item .box.material.color._value ? "rgba" + this.item.box.material.color.toString() : void 0, e.material .image = this.item.box.material && this.item.box.material.image._value ? this.item.box.material .image._value : void 0, e.material.repeat = this.item.box.material && this.item.box.material .repeat ? this.item.box.material.repeat._value : void 0, e.outline = this.item.box.outline && this .item.box.outline._value ? this.item.box.outline._value : void 0, e.outlineColor = this.item.box .outlineColor && this.item.box.outlineColor._value ? "rgba" + this.item.box.outlineColor .toString() : void 0, e.outlineWidth = this.item.box.outlineWidth && this.item.box.outlineWidth._value ? this.item.box.outlineWidth._value : void 0, e.near = this.item.box.distanceDisplayCondition ? this .item.box.distanceDisplayCondition._value.near : void 0, e.far = this.item.box .distanceDisplayCondition ? this.item.box.distanceDisplayCondition._value.far : void 0, e.position = this.item.position.getValue().toString(), e }, R.prototype.executeBox = function(i) { var o = this, r = (o.shape = { tempPoints: [], button: 0, position: {} }, new this._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas)), n = []; return r.setInputAction(function(e) { var e = o._viewer.scene.camera.pickEllipsoid(e.position, o._viewer.scene.globe.ellipsoid), e = o._cesium.Cartographic.fromCartesian(e), t = o._cesium.Math.toDegrees(e.longitude), e = o._cesium.Math.toDegrees(e.latitude), t = (n.push({ lon: t, lat: e }), 0 == o.shape.button && (o.box = o._viewer.entities.add({ name: "", position: o._cesium.Cartesian3.fromDegrees(n[0].lon, n[0].lat), box: { id: o._core.getuid(), dimensions: new o._cesium.Cartesian3(4e5, 3e5, 5e5), material: o._cesium.Color.RED.withAlpha(.5), fill: !0, outline: !0, outlineColor: o._cesium.Color.RED } }), o.item = o.box), 0), e = (o._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (t = V .selectedItem.id), o._core.getuid()), e = { id: e, name: "新建立方体" + e, pId: o._core.isnull(t) ? 0 : t, type: "box", item: o }; o.setTreeobj(e), o._tree.insertGroupId(e, o._core.isnull(t) ? 0 : t), "function" == typeof i && i({ polyline: {}, positions: [], distance: [] }), r.destroy() }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this }, R.prototype.executeExcavation = function(o, r) { var n = this, a = (n.shape = { tempPoints: [], button: 0, position: {} }, new this._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas)), s = []; return a.setInputAction(function(e) { var e = n._viewer.scene.camera.pickEllipsoid(e.position, n._viewer.scene.globe.ellipsoid), e = n._cesium.Cartographic.fromCartesian(e), t = n._cesium.Math.toDegrees(e.longitude), e = n._cesium.Math.toDegrees(e.latitude), t = (s.push({ lon: t, lat: e }), -o.z / 2), e = (0 == n.shape.button && (n.box = n._viewer.entities.add({ name: "", position: n._cesium.Cartesian3.fromDegrees(s[0].lon, s[0].lat, t), box: { id: n._core.getuid(), dimensions: new n._cesium.Cartesian3(o.x, o.y, o.z), material: n._cesium.Color.WHITE.withAlpha(.5), outline: !0, outlineColor: n._cesium.Color.WHITE } }), n.item = n.box, e = n._viewer.scene.globe, t = -o.x / 2, i = -o.y / 2, e .depthTestAgainstTerrain = !0, e.clippingPlanes = new n._cesium .ClippingPlaneCollection({ modelMatrix: n.box.computeModelMatrix(n._cesium.JulianDate.now()), planes: [new n._cesium.Plane(new n._cesium.Cartesian3(1, 0, 0), t), new n._cesium.Plane(new n._cesium.Cartesian3(-1, 0, 0), t), new n._cesium.Plane(new n._cesium.Cartesian3(0, 1, 0), i), new n ._cesium.Plane(new n._cesium.Cartesian3(0, -1, 0), i) ], edgeWidth: 1, edgeColor: n._cesium.Color.WHITE })), 0), t = (n._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (e = V .selectedItem.id), n._core.getuid()), i = { id: t, name: "新建立方体" + t, pId: n._core.isnull(e) ? 0 : e, type: "box", item: n }; n.setTreeobj(i), V.insertGroupId(i, n._core.isnull(e) ? 0 : e), "function" == typeof r && r({ polyline: {}, positions: [], distance: [] }), a.destroy() }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this }, R.prototype.executeBox1 = function(e) { var t, i = this, o = this, r = (i.shape = { points: [], button: 0, rect: null, entity: null }, new this._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas)); return r.setInputAction(function(e) { t = o._core.getPointFromWindowPoint(e.position, o._viewer), 2 <= i.shape.button && (r .removeInputAction(o._cesium.ScreenSpaceEventType.MOUSE_MOVE), r.removeInputAction(o ._cesium.ScreenSpaceEventType.LEFT_CLICK)), i.shape.button = i.shape.button + 1, t && (0 == i.shape.points.length ? (i.shape.points.push(o._viewer.scene.globe.ellipsoid .cartesianToCartographic(t)), i.shape.rect = o._cesium.Rectangle .fromCartographicArray(i.shape.points), i.shape.rect.east += 1e-6, i.shape.rect .north += 1e-6, i.shape.entity = o._viewer.entities.add({ rectangle: { coordinates: i.shape.rect, material: o._cesium.Color.BLACK.withAlpha(.4), outline: !0, outlineWidth: 2, outlineColor: o._cesium.Color.RED, height: 0 } }), i.bufferEntity = i.shape.entity) : 2 != i.shape.points.length && (r .removeInputAction(o._cesium.ScreenSpaceEventType.MOUSE_MOVE), r .removeInputAction(o._cesium.ScreenSpaceEventType.LEFT_CLICK))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), r.setInputAction(function(e) { var t; 0 != i.shape.points.length && (t = o._core.getPointFromWindowPoint(e.endPosition, o ._viewer)) && (e = o._viewer.camera.getPickRay(e.endPosition), e = o._viewer.scene .globe.pick(e, o._viewer.scene), i.shape.points[1] = o._viewer.scene.globe.ellipsoid .cartesianToCartographic(t), i.shape.rect = o._cesium.Rectangle .fromCartographicArray(i.shape.points), 2 == i.shape.button ? i.shape.entity .rectangle.extrudedHeight = e.z : (i.shape.rect.west == i.shape.rect.east && (i .shape.rect.east += 1e-6), i.shape.rect.south == i.shape.rect.north && (i .shape.rect.north += 1e-6), i.shape.entity.rectangle.coordinates = i.shape .rect)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, R.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show._value, t = null == this.item.box.dimensions ? void 0 : this.item.box.dimensions.getValue(), i = null == this.item.box.fill ? void 0 : this.item.box.fill._value, o = this.item.box.material, r = (null != o && (o = { color: null == o.color._value ? void 0 : "rgba(" + o.color._value.red + "," + o.color ._value.green + "," + o.color._value.blue + "," + o.color._value.alpha + ")", image: null == o.image ? void 0 : o.image._value, diffusemap: null == o.diffusemap ? void 0 : o.diffusemap._value, alphamap: null == o.alphamap ? void 0 : o.alphamap._value }), null == this.item.box.outline ? void 0 : this.item.box.outline._value), n = null == this.item.box.outlineColor ? void 0 : "rgba(" + this.item.box.outlineColor._value.red + "," + this.item.box.outlineColor._value.green + "," + this.item.box.outlineColor._value.blue + "," + this.item.box.outlineColor._value.alpha + ")", a = null == this.item.box.outlineWidth ? void 0 : this.item.box.outlineWidth._value, s = this.item.box.distanceDisplayCondition, l = null == s ? void 0 : s._value.near, s = null == s ? void 0 : s._value.far, u = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "box", position: { x: this._cesium.Math.toDegrees(u.longitude), y: this._cesium.Math.toDegrees(u.latitude), z: this._cesium.Math.toDegrees(u.height) }, treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, dimensions: t, fill: i, material: o, outline: r, outlineColor: n, outlineWidth: a, near: l, far: s } } }, R.prototype.setTreeobj = function(e) { this.treeobj = e }, R.prototype.setVisibility = function(e) { this.item.show = e }, R.prototype.setShow = function(e) { try { this.item._box.show = e } catch (e) { console.log(e) } return this }, R.prototype.getVolume = function() { try { var e = this.item._box.dimensions._value, t = e.x * e.y * e.z } catch (e) { console.log(e) } return t }, R.prototype.setBoxImage = function(e) { try { this.item._box.material = new this._cesium.ImageMaterialProperty({ image: e }) } catch (e) { console.log(e) } return this }, R.prototype.setBoxRepeat = function(e, t) { try { this.item._box.material.repeat = new this._cesium.Cartesian2(e, t) } catch (e) { console.log(e) } return this }, R.prototype.setHeightType = function(e) { try { 1 == e ? this.item._box.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._box.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this.item._box .heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, R.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._box.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, R.prototype.setFill = function(e) { try { this.item._box.fill = e } catch (e) { console.log(e) } return this }, R.prototype.setMaterialAlpha = function(e) { try { this.item._box.material.color._value.alpha = e, this.item._box.show = !0 } catch (e) { console.log(e) } return this }, R.prototype.setOutlineColor = function(e) { try { this.item._box.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, R.prototype.setMaterial = function(e) { try { this.item._box.material.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, R.prototype.setItem = function(e) { this.item = e }, R.prototype.deleteObject = function() { this._viewer.entities.remove(this.item) }, Object.defineProperties(R.prototype, { ColorAlpha: { get: function() { return this.item._box.color._value.alpha } }, Scale: { get: function() { return this.item._box.scale } }, Rotation: { get: function() { return this.item._box.rotation } }, Width: { get: function() { return this.item._box.width } }, Height: { get: function() { return this.item._box.heightReference } }, Color: { get: function() { return this._color.toHtmlColor("rgb(" + 255 * this.item._box.backgroundColor._value .red + "," + 255 * this.item._box.backgroundColor._value.green + "," + 255 * this.item._box.backgroundColor._value.blue + "," + 255 * this.item._box .backgroundColor._value.alpha + ")") } } }), R.prototype.CreateBox = function(e, t, i, o, r, n, a, s) { this._postion = e; var l, o = { dimensions: new this._cesium.Cartesian3(o, t, i), material: this._cesium.Color.YELLOW, outline: !0, outlineColor: this._cesium.Color.RED }, t = (r && "" !== r && (o.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(r)), n && "" !== n && (o.material = new m(this._viewer, this._cesium).colorFromHtmlColor(n)), (e .Yaw || e.Pitch || e.Roll) && (l = this._cesium.Transforms.headingPitchRollQuaternion(this ._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw), this._cesium.Math.toRadians(e .Pitch), this._cesium.Math.toRadians(e.Roll)))), this.item = this._viewer.entities.add({ name: s, position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), box: o, orientation: l }), { id: this.item.id, name: s, pId: this._core.isnull(a) ? 0 : a, type: "box", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(a) ? 0 : a), this }, Object.defineProperties(R.prototype, { Position: { Altitude: { get: function() { return this._postion.Altitude }, set: function(e) { try { this._postion.Altitude = e, this.item.position = this._cesium.Cartesian3 .fromDegrees(this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, AltitudeType: { get: function() { return this._postion.AltitudeType }, set: function(e) { try { this._postion.AltitudeType = e } catch (e) { console.log(e) } } }, Cartesian: { get: function() { return this._postion.Cartesian }, set: function(e) { try { this._postion.Cartesian = e } catch (e) { console.log(e) } } }, Distance: { get: function() { return this._postion.Distance }, set: function(e) { try { this._postion.Distance = e } catch (e) { console.log(e) } } }, Pitch: { get: function() { return this._postion.Pitch }, set: function(e) { try { this._postion.Pitch = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, Roll: { get: function() { return this._postion.Roll }, set: function(e) { try { this._postion.Roll = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, X: { get: function() { return this._postion.X }, set: function(e) { try { this._postion.X = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Y: { get: function() { return this._postion.Y }, set: function(e) { try { this._postion.Y = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Yaw: { get: function() { return this._postion.Yaw }, set: function(e) { try { this._postion.Yaw = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } } } }), Zi.prototype.createEllipsoid = function(e, t, i, o) { var r = { radii: new this._cesium.Cartesian3(60, 60, 60), material: this._cesium.Color.YELLOW }, r = this._core.extend(r, t, !0), t = (this.item = this._viewer.entities.add({ name: i, position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[1]), ellipsoid: r }), { id: this.item.id, name: i, pId: this._core.isnull(o) ? 0 : o, type: "ellipsoid", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, Zi.prototype.getstyles = function() { var e = {}; return e.show = !this.item.ellipsoid.show || this.item.ellipsoid.show._value, e.radii = this.item .ellipsoid.radii ? this.item.ellipsoid.radii.getValue() : void 0, e.innerRadii = this.item.ellipsoid .innerRadii ? this.item.ellipsoid.innerRadii.getValue() : void 0, e.minimumClock = this.item .ellipsoid.minimumClock ? this.item.ellipsoid.minimumClock._value : void 0, e.maximumClock = this .item.ellipsoid.maximumClock ? this.item.ellipsoid.maximumClock._value : void 0, e.minimumCone = this.item.ellipsoid.minimumCone ? this.item.ellipsoid.minimumCone._value : void 0, e.maximumCone = this.item.ellipsoid.maximumCone ? this.item.ellipsoid.maximumCone._value : void 0, e .heightReference = this.item.ellipsoid.heightReference && this.item.ellipsoid.heightReference ._value ? this.item.ellipsoid.heightReference._value : null, e.fill = this.item.ellipsoid.fill ? this.item.ellipsoid.fill._value : void 0, e.material = {}, e.material.color = this.item.ellipsoid .material && this.item.ellipsoid.material.color && this.item.ellipsoid.material.color._value ? "rgba" + this.item.ellipsoid.material.color.toString() : null, e.material.image = this.item .ellipsoid.material && this.item.ellipsoid.material.image ? this.item.ellipsoid.material.image ._value : void 0, e.material.repeat = this.item.ellipsoid.material && this.item.ellipsoid.material .repeat && this.item.ellipsoid.material.repeat._value ? this.item.ellipsoid.material.repeat._value : null, e.outline = this.item.ellipsoid.outline ? this.item.ellipsoid.outline._value : void 0, e .outlineWidth = this.item.ellipsoid.outlineWidth && this.item.ellipsoid.outlineWidth._value ? this .item.ellipsoid.outlineWidth._value : void 0, e.outlineColor = this.item.ellipsoid.outlineColor && this.item.ellipsoid.outlineColor._value ? "rgba" + this.item.ellipsoid.outlineColor.toString() : null, e.stackPartitions = this.item.ellipsoid.stackPartitions && this.item.ellipsoid.stackPartitions ._value ? this.item.ellipsoid.stackPartitions._value : void 0, e.slicePartitions = this.item .ellipsoid.slicePartitions && this.item.ellipsoid.slicePartitions._value ? this.item.ellipsoid .slicePartitions._value : void 0, e.subdivisions = this.item.ellipsoid.subdivisions && this.item .ellipsoid.subdivisions._value ? this.item.ellipsoid.subdivisions._value : void 0, e.near = this .item.ellipsoid.distanceDisplayCondition ? this.item.ellipsoid.distanceDisplayCondition._value .near : void 0, e.far = this.item.ellipsoid.distanceDisplayCondition ? this.item.ellipsoid .distanceDisplayCondition._value.far : void 0, e.position = this.item.position.getValue() .toString(), e }, Zi.prototype.executeEllipsoid = function(o) { var r = this, n = (r.shape = { tempPoints: [], button: 0, position: {} }, new this._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas)), a = [], s = []; return n.setInputAction(function(e) { var e = r._viewer.scene.camera.pickEllipsoid(e.position, r._viewer.scene.globe.ellipsoid), t = r._cesium.Cartographic.fromCartesian(e), i = r._cesium.Math.toDegrees(t.longitude), t = r._cesium.Math.toDegrees(t.latitude), t = (s.push({ lon: i, lat: t }), 0 == r.shape.button ? (a.push(e.clone()), a.push(e), r.shape.position = e, r .ellipsoid = r._viewer.entities.add({ name: "", position: r._cesium.Cartesian3.fromDegrees(s[0].lon, s[0].lat), ellipsoid: { radii: new r._cesium.Cartesian3(67500, 67500, 67500), material: r._cesium.Color.fromRandom({ alpha: 1 }) } }), r.item = r.ellipsoid) : 1 == r.shape.button && (i = X(s[0].lat, s[0].lon, s[ 1].lat, s[1].lon), r.item.ellipsoid.radii = new r._cesium.Cartesian3(i, i, i), n.destroy()), 0), e = (r._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (t = V .selectedItem.id), r._core.getuid()), i = { id: e, name: "新建球" + e, pId: r._core.isnull(t) ? 0 : t, type: "ellipsoid", item: r }; r.setTreeobj(i), V.insertGroupId(i, r._core.isnull(t) ? 0 : t), "function" == typeof o && o({ polyline: {}, positions: [], distance: [] }), r.shape.button = r.shape.button + 1 }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), n.setInputAction(function(e) { var t; 1 == r.shape.button && (e = r._viewer.camera.pickEllipsoid(e.endPosition, r._viewer.scene .globe.ellipsoid)) && (e = r._cesium.Cartographic.fromCartesian(e), t = r._cesium .Math.toDegrees(e.longitude), e = r._cesium.Math.toDegrees(e.latitude), Math.ceil(r ._viewer.camera.positionCartographic.height), s.push({ lon: t, lat: e }), t = X(s[0].lat, s[0].lon, s[s.length - 1].lat, s[s.length - 1].lon), r.item .ellipsoid.radii = new r._cesium.Cartesian3(t, t, t)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, Zi.prototype.setMaterialColor = function(e) { try { this.item._ellipsoid.material.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, Zi.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = null == this.item.ellipsoid.radii ? void 0 : this.item.ellipsoid.radii.getValue(), i = null == this.item.ellipsoid.fill ? void 0 : this.item.ellipsoid.fill.getValue(), o = this.item.ellipsoid.material, r = (null != o && (o = { color: null == o.color._value ? void 0 : "rgba(" + o.color._value.red + "," + o.color ._value.green + "," + o.color._value.blue + "," + o.color._value.alpha + ")", image: null == o.image ? void 0 : o.image._value, diffusemap: null == o.diffusemap ? void 0 : o.diffusemap._value, alphamap: null == o.alphamap ? void 0 : o.alphamap._value }), null == this.item.ellipsoid.outline ? void 0 : this.item.ellipsoid.outline._value), n = null == this.item.ellipsoid.outlineColor ? void 0 : "rgba(" + this.item.ellipsoid.outlineColor ._value.red + "," + this.item.ellipsoid.outlineColor._value.green + "," + this.item.ellipsoid .outlineColor._value.blue + "," + this.item.ellipsoid.outlineColor._value.alpha + ")", a = null == this.item.ellipsoid.outlineWidth ? void 0 : this.item.ellipsoid.outlineWidth.getValue(), s = this.item.ellipsoid.distanceDisplayCondition, l = null == s ? void 0 : s._value.near, s = null == s ? void 0 : s._value.far, u = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "ellipsoid", position: { x: this._cesium.Math.toDegrees(u.longitude), y: this._cesium.Math.toDegrees(u.latitude), z: this._cesium.Math.toDegrees(u.height) }, treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, radii: t, fill: i, material: o, outline: r, outlineColor: n, outlineWidth: a, near: l, far: s } } }, Zi.prototype.setTreeobj = function(e) { this.treeobj = e }, Zi.prototype.setVisibility = function(e) { this.item.show = e }, Zi.prototype.deleteObject = function() { this._viewer.entities.remove(this.item) }, Zi.prototype.setHeightType = function(e) { try { 1 == e ? this.item._ellipsoid.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._ellipsoid.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this .item._ellipsoid.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, Zi.prototype.setEllipsoidAlpha = function(e) { try { this.item._ellipsoid.material.color._value.alpha = e, this.item._ellipsoid.show = !0 } catch (e) { console.log(e) } return this }, Zi.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._ellipsoid.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, Zi.prototype.setEllipsoidImage = function(e) { try { this.item._ellipsoid.material = new this._cesium.ImageMaterialProperty({ image: e }) } catch (e) { console.log(e) } return this }, Zi.prototype.setEllipsoidRepeat = function(e, t) { try { this.item._ellipsoid.material.repeat = new this._cesium.Cartesian2(e, t) } catch (e) { console.log(e) } return this }, Zi.prototype.setMaterial = function(e) { try { this.item._ellipsoid.show = e } catch (e) { console.log(e) } return this }, Zi.prototype.setRadii = function(e) { try { this.item._ellipsoid.radii = new this._cesium.Cartesian3(e, e, e) } catch (e) { console.log(e) } return this }, Zi.prototype.setItem = function(e) { this.item = e }, Zi.prototype.CreateSphere = function(e, t, i, o, r, n, a, s) { this._postion = e; var l, t = { radii: this._cesium.defaultValue(new this._cesium.Cartesian3(t, t, t), new this._cesium .Cartesian3(60, 60, 60)), material: this._cesium.Color.RED, outline: !1, outlineColor: void 0 }, o = (o && "" !== o && (t.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(o), t .outline = !0), r && "" !== r && (t.material = new m(this._viewer, this._cesium) .colorFromHtmlColor(r)), (e.Yaw || e.Pitch || e.Roll) && (l = this._cesium.Transforms .headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw), this._cesium.Math .toRadians(e.Pitch), this._cesium.Math.toRadians(e.Roll)))), this.item = this ._viewer.entities.add({ name: s, position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), ellipsoid: t, orientation: l }), { id: this.item.id, name: name, pId: this._core.isnull(a) ? 0 : a, type: "ellipsoid", item: this }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(a) ? 0 : a), this }, Object.defineProperties(Zi.prototype, { Position: { Altitude: { get: function() { return this._postion.Altitude }, set: function(e) { try { this._postion.Altitude = e, this.item.position = this._cesium.Cartesian3 .fromDegrees(this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, AltitudeType: { get: function() { return this._postion.AltitudeType }, set: function(e) { try { this._postion.AltitudeType = e } catch (e) { console.log(e) } } }, Cartesian: { get: function() { return this._postion.Cartesian }, set: function(e) { try { this._postion.Cartesian = e } catch (e) { console.log(e) } } }, Distance: { get: function() { return this._postion.Distance }, set: function(e) { try { this._postion.Distance = e } catch (e) { console.log(e) } } }, Pitch: { get: function() { return this._postion.Pitch }, set: function(e) { try { this._postion.Pitch = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, Roll: { get: function() { return this._postion.Roll }, set: function(e) { try { this._postion.Roll = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, X: { get: function() { return this._postion.X }, set: function(e) { try { this._postion.X = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Y: { get: function() { return this._postion.Y }, set: function(e) { try { this._postion.Y = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Yaw: { get: function() { return this._postion.Yaw }, set: function(e) { try { this._postion.Yaw = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } } } }), O.prototype.createRectangle = function(o, r) { var n, a = this, s = this, l = (this._tree.removeHandler(), o = o || {}, a.shape = { points: [], button: 0, rect: null, entity: null }, { fillColor: this._cesium.Color.YELLOW.withAlpha(.4), outlineColor: this._cesium.Color.RED }), u = (o && o.fillColor && (l.fillColor = new m(this._viewer, this._cesium).colorFromHtmlColor( fillColor)), o && o.outlineColor && (l.outlineColor = new m(this._viewer, this._cesium) .colorFromHtmlColor(outlineColor)), this._tree.handler = new this._cesium .ScreenSpaceEventHandler(s._viewer.scene.canvas), this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), null), e = (this._tree.handler.setInputAction(function(e) { n = s._getPosition.getMousePosition(e, [a.shape.entity]); var t, i, e = s._getPosition.getMouseDegrees(e, [a.shape.entity]); 1 <= a.shape.button ? (t = { obj1: u, obj2: e }, i = { position: s._viewer.camera.position.clone(), orientation: { heading: s._viewer.camera.heading, pitch: s._viewer.camera.pitch, roll: s._viewer.camera.roll } }, "function" == typeof r && r({ originalCameraLocation: i, pointes: t, terrainExaggeration: "5", zj: "true" }), s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType .MOUSE_MOVE), s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType .LEFT_CLICK)) : u = e, a.shape.button = a.shape.button + 1, n && (0 == a .shape.points.length ? (a.shape.points.push(s._viewer.scene.globe.ellipsoid .cartesianToCartographic(n)), a.shape.rect = s._cesium.Rectangle .fromCartographicArray(a.shape.points), a.shape.rect.east += 1e-6, a.shape .rect.north += 1e-6, a.shape.entity = s._viewer.entities.add({ rectangle: { coordinates: a.shape.rect, material: l.fillColor, outline: !0, outlineWidth: 2, outlineColor: l.outlineColor, height: o && o.height, heightReference: o && o.heightReference } }), a.shape.entity.rectangle.coordinates = new s._cesium.CallbackProperty( function() { return a.shape.rect }, !1), a.bufferEntity = a.shape.entity, s.item = a.shape.entity) : (s ._core.mouse(s._viewer.container, 0, "0"), a.shape.entity.rectangle .coordinates = s._cesium.Rectangle.clone(a.shape.rect), s._tree.handler .removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE), s._tree .handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), s._tree.handler.setInputAction(function(e) { 0 != a.shape.points.length && (e = s._getPosition.getMousePosition(e, [a.shape .entity])) && (a.shape.points[1] = s._viewer.scene.globe.ellipsoid .cartesianToCartographic(e), a.shape.rect = s._cesium.Rectangle .fromCartographicArray(a.shape.points), a.shape.rect.west == a.shape.rect .east && (a.shape.rect.east += 1e-6), a.shape.rect.south == a.shape.rect .north && (a.shape.rect.north += 1e-6)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), t = (s._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (e = V.selectedItem.id), s ._core.getuid()), t = { id: t, name: "新建矩形" + t, pId: s._core.isnull(e) ? 0 : e, type: "rectangle", item: s }; return s.setTreeobj(t), V.insertGroupId(t, s._core.isnull(e) ? 0 : e), this }, O.prototype.getstyles = function() { var e = {}; return e.show = !this.item.rectangle.show || this.item.rectangle.show._value, e.coordinates = this.item .rectangle.coordinates ? { east: this.item.rectangle.coordinates.getValue().east, north: this.item.rectangle.coordinates.getValue().north, south: this.item.rectangle.coordinates.getValue().south, west: this.item.rectangle.coordinates.getValue().west } : [], e.height = this.item.rectangle.height ? this.item.rectangle.height.toString() : 0, e .heightReference = this.item.rectangle.heightReference ? this.item.rectangle.heightReference .toString() : 0, e.extrudedHeight = this.item.rectangle.extrudedHeight ? this.item.rectangle .extrudedHeight.getValue().toString() : 0, e.extrudedHeightReference = this.item.rectangle .extrudedHeightReference ? this.item.rectangle.extrudedHeightReference.toString() : 0, e.rotation = this.item.rectangle.rotation ? this.item.rectangle.rotation.toString() : 0, e.stRotation = this.item .rectangle.stRotation ? this.item.rectangle.stRotation.toString() : 0, e.granularity = this.item .rectangle.granularity && this.item.rectangle.granularity._value ? this.item.rectangle.granularity ._value : void 0, e.fill = this.item.rectangle.fill ? this.item.rectangle.fill._value : 0, e .outline = this.item.rectangle.outline ? this.item.rectangle.outline._value : 0, e.outlineWidth = this.item.rectangle.outlineWidth && this.item.rectangle.outlineWidth._value ? this.item.rectangle .outlineWidth._value.toString() : 1, e.outlineColor = this.item.rectangle.outlineColor && this.item .rectangle.outlineColor._value ? "rgba" + this.item.rectangle.outlineColor.toString() : null, e .material = {}, e.material.color = this.item.rectangle.material && this.item.rectangle.material .color && this.item.rectangle.material.color._value ? "rgba" + this.item.rectangle.material.color .toString() : null, e.material.image = this.item.rectangle.material && this.item.rectangle.material .image && this.item.rectangle.material.image._value ? this.item.rectangle.material.image .toString() : null, e.material.repeat = this.item.rectangle.material && this.item.rectangle.material .repeat && this.item.rectangle.material.repeat._value ? this.item.rectangle.material.repeat._value : null, e.classificationType = this.item.rectangle.classificationType ? this.item.rectangle .classificationType.toString() : null, e.near = this.item.rectangle.distanceDisplayCondition ? this .item.rectangle.distanceDisplayCondition._value.near : null, e.far = this.item.rectangle .distanceDisplayCondition ? this.item.rectangle.distanceDisplayCondition._value.far : null, e }, O.prototype.createRectangleOptimization = function(o, r) { var n, a = this, s = (this._tree.removeHandler(), a.shape = { points: [], button: 0, rect: null, entity: null }, { fillColor: this._cesium.Color.YELLOW.withAlpha(.4), outlineColor: this._cesium.Color.RED }), l = (o && o.fillColor && (s.fillColor = new m(this._viewer, this._cesium).colorFromHtmlColor( fillColor)), o && o.outlineColor && (s.outlineColor = new m(this._viewer, this._cesium) .colorFromHtmlColor(outlineColor)), this.handler = new this._cesium.ScreenSpaceEventHandler( a._viewer.scene.canvas), null), e = (this.handler.setInputAction(function(e) { n = a._core.getPointFromWindowPoint(e.position, a._viewer); var t, i, e = a._viewer.camera.pickEllipsoid(e.position, a._viewer.scene.globe .ellipsoid); 1 <= a.shape.button ? (t = { obj1: l, obj2: e }, i = { position: a._viewer.camera.position.clone(), orientation: { heading: a._viewer.camera.heading, pitch: a._viewer.camera.pitch, roll: a._viewer.camera.roll } }, "function" == typeof r && r({ originalCameraLocation: i, pointes: t, terrainExaggeration: "5", zj: "true" }), a.handler.removeInputAction(a._cesium.ScreenSpaceEventType.MOUSE_MOVE), a .handler.removeInputAction(a._cesium.ScreenSpaceEventType.LEFT_CLICK)) : l = e, a.shape.button = a.shape.button + 1, n && (0 == a.shape.points.length ? (a.shape .points.push(a._viewer.scene.globe.ellipsoid.cartesianToCartographic(n)), a .shape.rect = a._cesium.Rectangle.fromCartographicArray(a.shape.points), a .shape.rect.east += 1e-6, a.shape.rect.north += 1e-6, a.shape.entity = a ._viewer.entities.add({ rectangle: { coordinates: a.shape.rect, material: s.fillColor, outline: !0, outlineWidth: 2, outlineColor: s.outlineColor, height: o && o.height, heightReference: o && o.heightReference || 1 } }), a.shape.entity.objId = a.objId, a.shape.entity.rectangle.coordinates = new a._cesium.CallbackProperty(function() { return a.shape.rect }, !1), a._core.Entityadd(a), a.bufferEntity = a.shape.entity, a.item = a .shape.entity) : (a.state = 1, a.handler.removeInputAction(a._cesium .ScreenSpaceEventType.MOUSE_MOVE), a.handler.removeInputAction(a._cesium .ScreenSpaceEventType.LEFT_CLICK)), (i = a.createPoint(n, !1)).wz = a .gonRectangleArr.length, a.gonRectangleArr.push(i), a.positions.push(n)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction(function(e) { var t; 0 != a.shape.points.length && (t = a._core.getPointFromWindowPoint(e.endPosition, a ._viewer)) && (e = a._viewer.camera.getPickRay(e.endPosition), a._viewer.scene .globe.pick(e, a._viewer.scene), a.shape.points[1] = a._viewer.scene.globe .ellipsoid.cartesianToCartographic(t), a.shape.rect = a._cesium.Rectangle .fromCartographicArray(a.shape.points), a.shape.rect.west == a.shape.rect .east && (a.shape.rect.east += 1e-6), a.shape.rect.south == a.shape.rect .north && (a.shape.rect.north += 1e-6)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), t = (a._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (e = V.selectedItem.id), a ._core.getuid()), t = { id: t, name: "新建矩形" + t, pId: a._core.isnull(e) ? 0 : e, type: "rectangle", item: a }; return a.setTreeobj(t), V.insertGroupId(t, a._core.isnull(e) ? 0 : e), this }, O.prototype.startModify = function() { var o = "拖动修改位置,右击删除该点"; if (1 == this.state || 2 == this.state) { this.modifyHandler || (this.modifyHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene .canvas)); for (var r = this, e = 0; e < r.gonRectangleArr.length; e++) { var t = r.gonRectangleArr[e]; t && (t.show = !0) } this.modifyHandler.setInputAction(function(e) { e = r._viewer.scene.pick(e.position); if (Cesium.defined(e) && e.id) e.id.objId || (r.modifyPoint = e.id, o = "释放后完成修改"), r .forbidDrawWorld(!0); else { for (var t = 0; t < r.gonRectangleArr.length; t++) { var i = r.gonRectangleArr[t]; i && (i.show = !1) } r.modifyHandler && (r.modifyHandler.destroy(), r.modifyHandler = null) } }, Cesium.ScreenSpaceEventType.LEFT_DOWN), this.modifyHandler.setInputAction(function(e) { var t, i = r._viewer.scene.pick(e.endPosition); r._core.CreateTooltip(o, e.endPosition, !1), r.modifyPoint ? r.positions.length < 1 || ! r.modifyPoint || ((t = r.getCatesian3FromPX(e.endPosition, r._viewer, [r.shape .entity, r.modifyPoint ])) && (r.modifyPoint.position.setValue(t), r.shape.points[r.modifyPoint.wz] = r ._viewer.scene.globe.ellipsoid.cartesianToCartographic(t), r.shape.rect = r ._cesium.Rectangle.fromCartographicArray(r.shape.points), r.shape.rect .east += 1e-6, r.shape.rect.north += 1e-6), r._core.CreateTooltip(o, e .endPosition, !0)) : r._cesium.defined(i) && i.id && i.id.objId && r._core .CreateTooltip("拖动修改位置", e.endPosition, !0) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.modifyHandler.setInputAction(function(e) { r.forbidDrawWorld(!1), r.modifyPoint && (e = r.getCatesian3FromPX(e.position, r._viewer, [r.shape.entity, r.modifyPoint]), r.modifyPoint.position.setValue(e), r .shape.points[r.modifyPoint.wz] = r._viewer.scene.globe.ellipsoid .cartesianToCartographic(e), r.shape.rect = r._cesium.Rectangle .fromCartographicArray(r.shape.points), r.shape.rect.east += 1e-6, r.shape.rect .north += 1e-6, r.modifyPoint = null, r.forbidDrawWorld(!1), o = "拖动修改位置") }, Cesium.ScreenSpaceEventType.LEFT_UP) } }, O.prototype.createPoint = function(e, t) { if (e) return this._viewer.entities.add({ position: e, point: { pixelSize: 10, color: this._cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.CLAMP_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY }, show: t }) }, O.prototype.getCatesian3FromPX = function(e, t, i) { var o, r = t.scene.pick(e), n = t.scene.drillPick(e), a = null; if (i) { for (var s = 0; s < n.length; s++) if (n[s].id._id != i[0].id && n[s].id._id != i[1].id) { a = n[s].id; break } } else a = r; if (t.scene.pickPositionSupported && this._cesium.defined(a)) o = t.scene.pickPosition(e); else { r = t.camera.getPickRay(e); if (!r) return; o = t.scene.globe.pick(r, t.scene) } return o }, O.prototype.forbidDrawWorld = function(e) { this._viewer.scene.screenSpaceCameraController.enableRotate = !e, this._viewer.scene .screenSpaceCameraController.enableTilt = !e, this._viewer.scene.screenSpaceCameraController .enableTranslate = !e, this._viewer.scene.screenSpaceCameraController.enableInputs = !e }, O.prototype.CreateRectangle = function(e, t, i, o, r) { var n = this._core.getuid(), a = { outlineColor: this._cesium.Color.RED, material: this._cesium.Color.YELLOW.withAlpha(.5) }, i = (i && i.fillColor && (a.material = new m(this._viewer, this._cesium).colorFromHtmlColor(i .fillColor)), i && i.outlineColor && (a.outlineColor = new m(this._viewer, this._cesium) .colorFromHtmlColor(i.outlineColor)), (a = this._core.extend(a, i, !1)).coordinates = this .getCoordinates(t), this.item = this._viewer.entities.add({ id: n, name: e || "新建矩形", rectangle: a }), "function" == typeof r && r(this.item), this._core.isnull(V.selectedItem) || "group" != V .selectedItem.type || (o = V.selectedItem.id), { id: n, name: "新建矩形" + n, pId: this._core.isnull(o) ? 0 : o, type: "rectangle", item: this.item }); return this.setTreeobj(i), V.insertGroupId(i, this._core.isnull(o) ? 0 : o), this }, O.prototype.getCoordinates = function(e) { var t, i, o = e[0].lon > e[1].lon ? (t = e[1].lon, e[0].lon) : (t = e[0].lon, e[1].lon), e = e[0].lat > e[1].lat ? (i = e[0].lat, e[1].lat) : (i = e[1].lat, e[0].lat); return new this._cesium.Rectangle.fromDegrees(t, e, o, i) }, O.prototype.createRectanglelbj = function(e, o) { var r, n = this, a = this, t = (n.shape = { points: [], button: 0, rect: null, entity: null }, this._tree.removeHandler(), this.closeBrowseBorder(), 0), i = (null != e && null != e.id && (t = e.id), this._core.CreateTooltip()), s = (a._tree.handler = new this._cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas), null), l = null, e = (a._tree.handler.setInputAction(function(e) { r = a._core.getPointFromWindowPoint(e.position, a._viewer); var t, i, e = a._viewer.camera.pickEllipsoid(e.position, a._viewer.scene.globe .ellipsoid); 1 <= n.shape.button ? (t = { obj1: s, obj2: l = e }, i = { position: a._viewer.camera.position.clone(), orientation: { heading: a._viewer.camera.heading, pitch: a._viewer.camera.pitch, roll: a._viewer.camera.roll } }, a.llbj({ originalCameraLocation: i, pointes: t, terrainExaggeration: "5", zj: "true" }, n.shape.entity), "function" == typeof o && o(n.shape.entity), a._tree.handler .removeInputAction(a._cesium.ScreenSpaceEventType.LEFT_CLICK)) : s = e, n.shape .button = n.shape.button + 1, r && (0 == n.shape.points.length ? (n.shape.points .push(a._viewer.scene.globe.ellipsoid.cartesianToCartographic(r)), n.shape .rect = a._cesium.Rectangle.fromCartographicArray(n.shape.points), n.shape .rect.east += 1e-6, n.shape.rect.north += 1e-6, n.shape.entity = a._viewer .entities.add({ rectangle: { coordinates: n.shape.rect, material: a._cesium.Color.YELLOW.withAlpha(0), outline: !0, outlineWidth: 10, outlineColor: a._cesium.Color.YELLOW, height: 0 } }), n.shape.entity.rectangle.coordinates = new a._cesium.CallbackProperty( function() { return n.shape.rect }, !1), a.item = n.shape.entity) : 2 != n.shape.points.length && a._tree .handler.removeInputAction(a._cesium.ScreenSpaceEventType.MOUSE_MOVE)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), a._tree.handler.setInputAction(function(e) { var t; 0 == n.shape.points.length ? i.showAt(e.endPosition, "点击左键在球面上绘制矩形!") : l && i.showAt(e .endPosition, "请将视野缩放到范围内以开启边界浏览"), 0 == n.shape.points.length || l || (i .showAt(e.endPosition, "再次点击结束绘制!"), (t = a._core.getPointFromWindowPoint(e .endPosition, a._viewer)) && (e = a._viewer.camera.getPickRay(e .endPosition), a._viewer.scene.globe.pick(e, a._viewer.scene), n.shape .points[1] = a._viewer.scene.globe.ellipsoid.cartesianToCartographic(t), n .shape.rect = a._cesium.Rectangle.fromCartographicArray(n.shape.points), n .shape.rect.west == n.shape.rect.east && (n.shape.rect.east += 1e-6), n .shape.rect.south == n.shape.rect.north && (n.shape.rect.north += 1e-6))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), a._core.isnull(V.selectedItem) || "group" != V .selectedItem.type || V.selectedItem.id, a._core.getuid()), e = { id: e, name: "新建浏览边界" + e, pId: a._core.isnull(t) ? 0 : t, type: "rectangle", item: a }; return a.setTreeobj(e), V.insertGroupId(e, a._core.isnull(t) ? 0 : t), this }, O.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show._value, t = null == this.item.rectangle.coordinates ? void 0 : this.item.rectangle.coordinates._value, i = (null != t && (t = { east: t.east, north: t.north, south: t.south, west: t.west }), null == this.item.rectangle.height ? void 0 : this.item.rectangle.height._value), o = null == this.item.rectangle.extrudedHeight ? void 0 : this.item.rectangle.extrudedHeight._value, r = null == this.item.rectangle.rotation ? void 0 : this.item.rectangle.rotation._value, n = null == this.item.rectangle.stRotation ? void 0 : this.item.rectangle.stRotation._value, a = null == this.item.rectangle.fill ? void 0 : this.item.rectangle.fill._value, s = this.item.rectangle.material, l = (null != s && (s = { color: null == s.color._value ? void 0 : "rgba(" + s.color._value.red + "," + s.color ._value.green + "," + s.color._value.blue + "," + s.color._value.alpha + ")", image: null == s.image ? void 0 : s.image._value, diffusemap: null == s.diffusemap ? void 0 : s.diffusemap._value, alphamap: null == s.alphamap ? void 0 : s.alphamap._value }), null == this.item.rectangle.outline ? void 0 : this.item.rectangle.outline._value), u = null == this.item.rectangle.outlineColor ? void 0 : "rgba(" + this.item.rectangle.outlineColor ._value.red + "," + this.item.rectangle.outlineColor._value.green + "," + this.item.rectangle .outlineColor._value.blue + "," + this.item.rectangle.outlineColor._value.alpha + ")", c = null == this.item.rectangle.outlineWidth ? void 0 : this.item.rectangle.outlineWidth._value, h = this.item.rectangle.distanceDisplayCondition, m = null == h ? void 0 : h._value.near, h = null == h ? void 0 : h._value.far; return { type: "rectangle", treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, coordinates: t, height: i, extrudedHeight: o, rotation: r, stRotation: n, fill: a, material: s, outline: l, outlineColor: u, outlineWidth: c, near: m, far: h } } }, O.prototype.setTreeobj = function(e) { this.treeobj = e }, O.prototype.llbj = function(e, t) { for (var i, o, r = document.getElementById("toolTip"), t = (r.innerHTML = "请将视野缩放到范围内以开启边界浏览", t .rectangle), t = (t.height = void 0, t.heightReference = void 0, t.perPositionHeight = !1, e .pointes), n = [], a = (n.push(t.obj1), n.push(t.obj2), {}), s = 0; s < n.length; s++) o = this ._cesium.Cartographic.fromCartesian(n[s]), i = this._cesium.Math.toDegrees(o.longitude), o = this ._cesium.Math.toDegrees(o.latitude), 0 === s ? (a.west = i, a.north = o, a.east = i, a.south = o) : (i > a.west ? a.east = i : a.west = i, o > a.south ? a.north = o : a.south = o); n[0].x, n[1].x, n[0].y, n[1].y, n[0].z, this._viewer.camera.heading, this._viewer.camera.pitch, this ._viewer.camera.roll; var l = this._viewer.camera.heading, u = this._viewer.camera.pitch, c = this._viewer.camera.roll, h = this._viewer.camera.position.clone(), m = { orientation: { heading: l, pitch: u, roll: c }, position: h }, d = this; d.flyListener = function() { var e = d._viewer.camera.computeViewRectangle(), t = e.west / Math.PI * 180, i = e.north / Math.PI * 180, o = e.east / Math.PI * 180, e = e.south / Math.PI * 180; d.isInArea({ west: t, north: i, east: o, south: e }, a) ? (d._tree.removeHandler(), r.style.left = "50%", r.style.top = "50%", r.innerHTML = "边界浏览已开启,右键结束边界浏览", setTimeout(function() { r.style.display = "none" }, 2e3), d._viewer.scene.camera.changed.removeEventListener(d.flyListener), d .flyListener = void 0, d._tree.handler = new d._cesium.ScreenSpaceEventHandler(d._viewer .scene.canvas), d._viewEvent = function(e) { m = d.limitView(a, m) }, d._viewer.scene.camera.percentageChanged = .001, d._viewer.scene.camera.changed .addEventListener(d._viewEvent), d._tree.handler.setInputAction(function(e) { d.closeBrowseBorder() }, d._cesium.ScreenSpaceEventType.RIGHT_CLICK)) : (l = d._viewer.camera.heading, u = d ._viewer.camera.pitch, c = d._viewer.camera.roll, h = d._viewer.camera.position.clone(), m = { orientation: { heading: l, pitch: u, roll: c }, position: h }) }, this._viewer.scene.camera.percentageChanged = .001, this._viewer.scene.camera.changed .addEventListener(d.flyListener) }, O.prototype.closeBrowseBorder = function() { var e = document.getElementById("toolTip"); this._tree.endtemporaryItem(), this._tree.handler && this._tree.handler.destroy(), this.flyListener && ( this._viewer.scene.camera.changed.removeEventListener(this.flyListener), this.flyListener = void 0), this._viewEvent ? (this._viewer.scene.camera.changed.removeEventListener(this ._viewEvent), this._viewEvent = void 0, e.style.display = "block", e.innerHTML = "取消边界浏览", setTimeout(function() { e.style.display = "none" }, 1e3)) : e && (e.style.display = "none") }, O.prototype.limitView = function(e, t) { var i = this._viewer.camera.computeViewRectangle(), o = i.west / Math.PI * 180, r = i.north / Math.PI * 180, n = i.east / Math.PI * 180, i = i.south / Math.PI * 180; return this.isInArea({ west: o, north: r, east: n, south: i }, e) ? t = { orientation: { heading: this._viewer.camera.heading, pitch: this._viewer.camera.pitch, roll: this._viewer.camera.roll }, position: this._viewer.camera.position.clone() } : null !== t && this._viewer.camera.setView({ destination: t.position, orientation: t.orientation }), t }, O.prototype.isInArea = function(e, t) { var i = !1; return i = e.south > t.south && e.east < t.east && e.north < t.north && e.west > t.west ? !0 : i }, O.prototype.createRectangledxkz = function(i) { var o, r = this, n = this, a = (n.shape = { points: [], rect: null, entity: null }, null), s = null, l = new r._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas); function u(e) { return "EllipsoidTerrainProvider" == r._viewer.scene.terrainProvider.constructor.name ? r._viewer .camera.pickEllipsoid(e, r._viewer.scene.globe.ellipsoid) : (e = r._viewer.scene.camera .getPickRay(e), r._viewer.scene.globe.pick(e, r._viewer.scene)) } return l.setInputAction(function(e) { o = u(e.position); var t, e = r._viewer.camera.pickEllipsoid(e.position, r._viewer.scene.globe.ellipsoid); (a = null == a ? e : a).x == e.x && a.y == e.y && a.z == e.z || (s = e), o && (0 == n.shape .points.length ? (n.shape.points.push(r._viewer.scene.globe.ellipsoid .cartesianToCartographic(o)), n.shape.rect = r._cesium.Rectangle .fromCartographicArray(n.shape.points), n.shape.rect.east += 1e-6, n.shape.rect .north += 1e-6, n.shape.entity = r._viewer.entities.add({ rectangle: { coordinates: n.shape.rect, material: r._cesium.Color.BLACK.withAlpha(.4), outline: !0, outlineWidth: 2, outlineColor: r._cesium.Color.RED, height: 0 } }), n.bufferEntity = n.shape.entity) : (l.removeInputAction(r._cesium .ScreenSpaceEventType.MOUSE_MOVE), l.removeInputAction(r._cesium .ScreenSpaceEventType.LEFT_CLICK), e = { obj1: a, obj2: s }, t = { position: r._viewer.camera.position.clone(), orientation: { heading: r._viewer.camera.heading, pitch: r._viewer.camera.pitch, roll: r._viewer.camera.roll } }, "" != i && null != i && "function" == typeof i && i({ pointes: e, originalCameraLocation: t }))) }, r._cesium.ScreenSpaceEventType.LEFT_CLICK), l.setInputAction(function(e) { 0 != n.shape.points.length && (e = u(e.endPosition)) && (n.shape.points[1] = r._viewer.scene .globe.ellipsoid.cartesianToCartographic(e), n.shape.rect = r._cesium.Rectangle .fromCartographicArray(n.shape.points), n.shape.rect.west == n.shape.rect.east && (n .shape.rect.east += 1e-6), n.shape.rect.south == n.shape.rect.north && (n.shape .rect.north += 1e-6), n.shape.entity.rectangle.coordinates = n.shape.rect) }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, O.prototype.executeExcavation = function(e) { var i, o = this, r = this, n = (o.shape = { points: [], button: 0, rect: null, entity: null }, new this._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas)), a = [], t = (n.setInputAction(function(e) { var t; i = r._core.getPointFromWindowPoint(e.position, r._viewer), 2 <= o.shape.button && (e = o._viewer.scene.globe, o.shape.box = r._viewer.entities.add({ position: r._cesium.Cartesian3.fromDegrees(a[0].lon, a[0].lat, 100), box: { dimensions: new r._cesium.Cartesian3(1e4, 1e4, 1e4), material: r._cesium.Color.WHITE.withAlpha(.5), outline: !0, outlineColor: r._cesium.Color.WHITE } }), e.depthTestAgainstTerrain = !0, e.clippingPlanes = new o._cesium .ClippingPlaneCollection({ modelMatrix: o.shape.box.computeModelMatrix(r._cesium.JulianDate.now()), planes: [new r._cesium.Plane(new r._cesium.Cartesian3(1, 0, 0), -700), new r._cesium.Plane(new r._cesium.Cartesian3(-1, 0, 0), -700), new r._cesium.Plane(new r._cesium.Cartesian3(0, 1, 0), -700), new r._cesium.Plane(new r._cesium.Cartesian3(0, -1, 0), -700) ], edgeWidth: 1, edgeColor: r._cesium.Color.WHITE }), n.removeInputAction(r._cesium.ScreenSpaceEventType.MOUSE_MOVE), n .removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_CLICK)), o.shape.button = o.shape.button + 1, i && (0 == o.shape.points.length ? (o.shape.points.push(r ._viewer.scene.globe.ellipsoid.cartesianToCartographic(i)), e = r ._viewer.scene.camera.pickEllipsoid(movement.position, r._viewer.scene.globe .ellipsoid), e = r._cesium.Cartographic.fromCartesian(e), t = r._cesium .Math.toDegrees(e.longitude), e = r._cesium.Math.toDegrees(e.latitude), a .push({ lon: t, lat: e }), o.shape.rect = r._cesium.Rectangle.fromCartographicArray(o.shape .points), o.shape.rect.east += 1e-6, o.shape.rect.north += 1e-6, o.shape .entity = r._viewer.entities.add({ rectangle: { coordinates: o.shape.rect, material: r._cesium.Color.BLACK.withAlpha(.4), outline: !0, outlineWidth: 2, outlineColor: r._cesium.Color.RED, height: 0 } }), o.bufferEntity = o.shape.entity, r.item = o.shape.entity) : 2 != o.shape .points.length && (n.removeInputAction(r._cesium.ScreenSpaceEventType .MOUSE_MOVE), n.removeInputAction(r._cesium.ScreenSpaceEventType .LEFT_CLICK))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), n.setInputAction(function(e) { var t; 0 != o.shape.points.length && (t = r._core.getPointFromWindowPoint(e.endPosition, r ._viewer)) && (e = r._viewer.camera.getPickRay(e.endPosition), r._viewer.scene .globe.pick(e, r._viewer.scene), o.shape.points[1] = r._viewer.scene.globe .ellipsoid.cartesianToCartographic(t), o.shape.rect = r._cesium.Rectangle .fromCartographicArray(o.shape.points), o.shape.rect.west == o.shape.rect .east && (o.shape.rect.east += 1e-6), o.shape.rect.south == o.shape.rect .north && (o.shape.rect.north += 1e-6), o.shape.entity.rectangle.coordinates = o .shape.rect) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), s = (r._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (t = V.selectedItem.id), r ._core.getuid()), s = { id: s, name: "新建矩形" + s, pId: r._core.isnull(t) ? 0 : t, type: "rectangle", item: r }; return r.setTreeobj(s), V.insertGroupId(s, r._core.isnull(t) ? 0 : t), "function" == typeof e && e( ploylinejl), this }, O.prototype.deleteObject = function() { this._viewer.entities.remove(this.item), null != this._viewEvent && (this._tree.handler.destroy(), this ._viewer.scene.camera.changed.removeEventListener(this._viewEvent)) }, O.prototype.setVisibility = function(e) { this.item.show = e }, O.prototype.getVisibility = function() { return this.item.show }, O.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._rectangle.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, O.prototype.setRectangleAlpha = function(e) { try { this.item._rectangle.material.color._value.alpha = e, this.item._rectangle.show = !0 } catch (e) { console.log(e) } return this }, O.prototype.setRectangleColor = function(e) { try { this.item._rectangle.material.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, O.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._rectangle.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, O.prototype.setPolygonImage = function(e) { try { this.item._rectangle.material = new this._cesium.ImageMaterialProperty({ image: e }) } catch (e) { console.log(e) } return this }, O.prototype.setRectangleRepeat = function(e, t) { try { this.item._rectangle.material.repeat = new this._cesium.Cartesian2(e, t) } catch (e) { console.log(e) } return this }, O.prototype.setOutlineColor = function(e) { try { this.item._rectangle.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, O.prototype.setOutline = function(e) { try { this.item._rectangle.outline = e } catch (e) { console.log(e) } return this }, O.prototype.setExtrudedHeight = function(e) { try { this.item._rectangle.extrudedHeight = e } catch (e) { console.log(e) } return this }, O.prototype.setHeight = function(e) { try { this.item._rectangle.height = e } catch (e) { console.log(e) } return this }, Object.defineProperties(O.prototype, { rectangle: { get: function() { return this.item.rectangle }, set: function(e) { this.item.rectangle = e } } }), O.prototype.setItem = function(e) { this.item = e }, Object.defineProperties(O.prototype, { polyline: { get: function() { return this.item.polyline }, set: function(e) { this.item.polyline = e } } }), Object.defineProperties(O.prototype, { polygon: { get: function() { return this.item.polygon }, set: function(e) { this.item.polygon = e } } }), Object.defineProperties(O.prototype, { point: { get: function() { return this.item.point }, set: function(e) { this.item.point = e } } }), Object.defineProperties(O.prototype, { label: { get: function() { return this.item.label }, set: function(e) { this.item.label = e } } }), Object.defineProperties(O.prototype, { model: { get: function() { return this.item.model }, set: function(e) { this.item.model = e } } }), Object.defineProperties(O.prototype, { wall: { get: function() { return this.item.wall }, set: function(e) { this.item.wall = e } } }), Object.defineProperties(O.prototype, { polygonTempOptions: { get: function() { return { height: 0, extrudedHeight: 0, show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, stRotation: 1, granularity: this._cesium.Math.RADIANS_PER_DEGREE, perPositionHeight: !1, closeTop: !0, closeBottom: !0, shadows: ShadowMode.DISABLED, classificationType: ClassificationType.BOTH, arcType: ArcType.GEODESIC } } } }), H.prototype.createCircle = function(e, t, i, o) { var r = { id: this._core.getuid(), semiMinorAxis: 3e5, semiMajorAxis: 3e5, height: 2e5, material: this._cesium.Color.GREEN, outline: !0 }, r = this._Core.extend(r, t, !0), t = (this.item = this._viewer.entities.add({ position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), name: i, ellipse: r }), { id: this.item.id, name: i, pId: this._core.isnull(o) ? 0 : o, type: "circle", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), greenCircle }, H.prototype.getstyles = function() { var e = {}; return e.show = !this.item.ellipse.show || this.item.ellipse.show._value, e.height = this.item.ellipse .height && this.item.ellipse.height._value ? this.item.ellipse.height._value : void 0, e .semiMajorAxis = this.item.ellipse.semiMajorAxis && this.item.ellipse.semiMajorAxis.getValue() ? this.item.ellipse.semiMajorAxis.getValue() : void 0, e.semiMinorAxis = this.item.ellipse .semiMinorAxis && this.item.ellipse.semiMinorAxis.getValue() ? this.item.ellipse.semiMinorAxis .getValue() : void 0, e.heightReference = this.item.ellipse.heightReference && this.item.ellipse .heightReference._value ? this.item.ellipse.heightReference._value : void 0, e.extrudedHeight = this .item.ellipse.extrudedHeight && this.item.ellipse.extrudedHeight.getValue() ? this.item.ellipse .extrudedHeight.getValue() : void 0, e.extrudedHeightReference = this.item.ellipse .extrudedHeightReference && this.item.ellipse.extrudedHeightReference._value ? this.item.ellipse .extrudedHeightReference._value : void 0, e.rotation = this.item.ellipse.rotation && this.item .ellipse.rotation._value ? this.item.ellipse.rotation._value : void 0, e.stRotation = this.item .ellipse.stRotation && this.item.ellipse.stRotation._value ? this.item.ellipse.stRotation._value : void 0, e.granularity = this.item.ellipse.granularity && this.item.ellipse.granularity._value ? this .item.ellipse.granularity._value : void 0, e.fill = this.item.ellipse.fill ? this.item.ellipse.fill ._value : void 0, e.material = {}, e.material.color = this.item.ellipse.material && this.item .ellipse.material.color && this.item.ellipse.material.color._value ? "rgba" + this.item.ellipse .material.color.toString() : void 0, e.material.image = this.item.ellipse.material && this.item .ellipse.material.image ? this.item.ellipse.material.image._value : void 0, e.material.repeat = this .item.ellipse.material && this.item.ellipse.material.repeat._value ? this.item.ellipse.material .repeat._value : void 0, e.outline = this.item.ellipse.outline ? this.item.ellipse.outline._value : void 0, e.outlineWidth = this.item.ellipse.outlineWidth && this.item.ellipse.outlineWidth._value ? this.item.ellipse.outlineWidth._value : void 0, e.outlineColor = this.item.ellipse.outlineColor && this.item.ellipse.outlineColor._value ? "rgba" + this.item.ellipse.outlineColor.toString() : void 0, e.numberOfVerticalLines = this.item.ellipse.numberOfVerticalLines && this.item.ellipse .numberOfVerticalLines._value ? this.item.ellipse.numberOfVerticalLines._value : void 0, e .classificationType = this.item.ellipse.classificationType && this.item.ellipse.classificationType ._value ? this.item.ellipse.classificationType._value : void 0, e.near = this.item.ellipse .distanceDisplayCondition ? this.item.ellipse.distanceDisplayCondition._value.near : void 0, e.far = this.item.ellipse.distanceDisplayCondition ? this.item.ellipse.distanceDisplayCondition._value.far : void 0, e.position = this.item.position.getValue().toString(), e }, H.prototype.createCircleOptimization = function(e, t) { this.style = e; var s = this; this.handler.setInputAction(function(e) { e = s.getCatesian3FromPX(e.position, s._viewer, [s.circle]), 0 == s.positions.length && s .positions.push(e.clone()), s.positions.push(e), e = s.createPoint(e, !1); 0 < s.gonCircleArr.length && (s.positions.pop(), s.state = 1, s.handler.destroy()), e.wz = s .gonCircleArr.length, s.gonCircleArr.push(e) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction(function(e) { var t, i, o, r, n, a; s.positions.length < 1 || (e = s.getCatesian3FromPX(e.endPosition, s._viewer, [s.circle]), 2 != s.positions.length || s._cesium.defined(s.circle) || (t = s._cesium .Cartographic.fromCartesian(s.positions[0]), i = s._cesium.Math.toDegrees(t .longitude), o = s._cesium.Math.toDegrees(t.latitude), r = s._cesium .Cartographic.fromCartesian(s.positions[1]), n = s._cesium.Math.toDegrees(r .longitude), a = s._cesium.Math.toDegrees(r.latitude), s.radius = X(o, i, a, n), s.circle = s.createCircle(s.style), s._core.Entityadd(s), s.circle .objId = s.objId), s.circle && (s.positions.pop(), s.positions.push(e), t = s ._cesium.Cartographic.fromCartesian(s.positions[0]), i = s._cesium.Math .toDegrees(t.longitude), o = s._cesium.Math.toDegrees(t.latitude), r = s._cesium .Cartographic.fromCartesian(s.positions[1]), n = s._cesium.Math.toDegrees(r .longitude), a = s._cesium.Math.toDegrees(r.latitude), s.radius = X(o, i, a, n))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE) }, H.prototype.startModify = function() { var n = "拖动修改位置"; if (2 == this.state || 1 == this.state) { this.modifyHandler || (this.modifyHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene .canvas)); for (var a = this, e = 0; e < a.gonCircleArr.length; e++) { var t = a.gonCircleArr[e]; t && (t.show = !0) } this.modifyHandler.setInputAction(function(e) { e = a._viewer.scene.pick(e.position); if (Cesium.defined(e) && e.id) e.id.objId || (a.modifyPoint = e.id, n = "释放后完成修改"), a .forbidDrawWorld(!0); else { for (var t = 0; t < a.gonCircleArr.length; t++) { var i = a.gonCircleArr[t]; i && (i.show = !1) } a.modifyHandler && (a.modifyHandler.destroy(), a.modifyHandler = null) } a.state = 2 }, Cesium.ScreenSpaceEventType.LEFT_DOWN), this.modifyHandler.setInputAction(function(e) { var t, i, o, r = a._viewer.scene.pick(e.endPosition); a._core.CreateTooltip(n, e.endPosition, !1), Cesium.defined(r) && r.id && (r.id.objId || a._core.CreateTooltip(n, e.endPosition, !0)), a.positions.length < 1 || !a .modifyPoint || ((r = a.getCatesian3FromPX(e.endPosition, a._viewer, [a.circle, a .modifyPoint ])) && (a.modifyPoint.position.setValue(r), a.positions[a.modifyPoint.wz] = r, 0 == a.modifyPoint.wz ? a.gonCircleArr[1].position = { x: a.positions[0].x + a.radius, y: a.positions[0].y, z: a.positions[0].z } : (r = a._cesium.Cartographic.fromCartesian(a.positions[0]), t = a._cesium .Math.toDegrees(r.longitude), r = a._cesium.Math.toDegrees(r.latitude), o = a._cesium.Cartographic.fromCartesian(a.positions[a.modifyPoint.wz]), i = a._cesium.Math.toDegrees(o.longitude), o = a._cesium.Math.toDegrees( o.latitude), a.radius = X(r, t, o, i))), a._core.CreateTooltip(n, e .endPosition, !0)) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.modifyHandler.setInputAction(function(e) { var t, i, o; a.modifyPoint && (e = a.getCatesian3FromPX(e.position, a._viewer, [a.circle, a .modifyPoint ]), a.modifyPoint.position.setValue(e), a.positions[a.modifyPoint.wz] = e, 0 == a.modifyPoint.wz ? a.gonCircleArr[1].position = { x: a.positions[0].x + a.radius, y: a.positions[0].y, z: a.positions[0].z } : (e = a._cesium.Cartographic.fromCartesian(a.positions[0]), t = a._cesium .Math.toDegrees(e.longitude), e = a._cesium.Math.toDegrees(e.latitude), o = a._cesium.Cartographic.fromCartesian(a.positions[a.modifyPoint.wz]), i = a ._cesium.Math.toDegrees(o.longitude), o = a._cesium.Math.toDegrees(o .latitude), a.radius = X(e, t, o, i)), a.modifyPoint = null, a .forbidDrawWorld(!1), n = "拖动修改位置") }, Cesium.ScreenSpaceEventType.LEFT_UP) } }, H.prototype.forbidDrawWorld = function(e) { this._viewer.scene.screenSpaceCameraController.enableRotate = !e, this._viewer.scene .screenSpaceCameraController.enableTilt = !e, this._viewer.scene.screenSpaceCameraController .enableTranslate = !e, this._viewer.scene.screenSpaceCameraController.enableInputs = !e }, H.prototype.getCatesian3FromPX = function(e, t, i) { var o, r = t.scene.pick(e), n = t.scene.drillPick(e), a = null; if (i) { for (var s = 0; s < n.length; s++) if (n[s].id._id != i[0].id && n[s].id._id != i[1].id) { a = n[s].id; break } } else a = r; if (t.scene.pickPositionSupported && Cesium.defined(a)) o = t.scene.pickPosition(e); else { r = t.camera.getPickRay(e); if (!r) return; o = t.scene.globe.pick(r, t.scene) } return o }, H.prototype.createCircle = function(e) { var t = this; return this._viewer.entities.add({ position: new t._cesium.CallbackProperty(function() { return t.positions[0] }, !1), ellipse: { semiMinorAxis: new t._cesium.CallbackProperty(function() { return t.radius }, !1), semiMajorAxis: new t._cesium.CallbackProperty(function() { return t.radius }, !1), material: t._cesium.Color.BLUE.withAlpha(.5), outline: e.outline || !0 } }) }, H.prototype.createPoint = function(e, t) { if (e) return this._viewer.entities.add({ position: e, point: { pixelSize: 10, color: this._cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.CLAMP_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY }, show: t }) }, H.prototype.executeClircle = function(e) { var i = [], o = this, r = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), new this ._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas)); function n() { return X(i[0].lat, i[0].lon, i[1].lat, i[1].lon) } return r.setInputAction(function(e) { var t, e = o._getPosition.getMousePosition(e, [o.item]); e && (e = o._cesium.Cartographic.fromCartesian(e), t = o._cesium.Math.toDegrees(e .longitude), e = o._cesium.Math.toDegrees(e.latitude), i.push({ lon: t, lat: e }), 1 == i.length ? (i.push({ lon: t, lat: e }), (t = o._viewer.entities.add({ position: o._cesium.Cartesian3.fromDegrees(i[0].lon, i[0].lat), ellipse: { semiMinorAxis: 0, semiMajorAxis: 0, material: o._cesium.Color.fromRandom({ alpha: .8 }) } })).ellipse.semiMinorAxis = new o._cesium.CallbackProperty(n, !1), t.ellipse .semiMajorAxis = new o._cesium.CallbackProperty(n, !1), o.item = t) : (e = n(), o._core.mouse(o._viewer.container, 0, "0"), o.item.ellipse.semiMinorAxis = e, o .item.ellipse.semiMajorAxis = e, r.destroy(), r = void 0, i = [])) }, o._cesium.ScreenSpaceEventType.LEFT_CLICK), r.setInputAction(function(e) { var t; !i.length || (e = o._getPosition.getMousePosition(e, [o.item])) && (e = o._cesium .Cartographic.fromCartesian(e), t = o._cesium.Math.toDegrees(e.longitude), e = o ._cesium.Math.toDegrees(e.latitude), i[1] = { lon: t, lat: e }) }, o._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, H.prototype.executeClirclews = function(e) { var r = this, t = (this._cesium.Material.fromType(this._cesium.Material.ColorType).uniforms.color = new this ._cesium.Color(1, 1, 0, .5), this._cesium.Ellipsoid.WGS84), i = this, o = this._viewer.scene, n = this._viewer.scene.primitives, a = null, s = new this._cesium.ScreenSpaceEventHandler(o.canvas), l = (s.setInputAction(function(e) { null != e.position && (e = o.camera.pickEllipsoid(e.position, t)) && (null == a ? (a = new l({ center: e, radius: 0, asynchronous: !1, material: r._cesium.Color.RED }), n.add(a)) : i.stopDrawing()) }, r._cesium.ScreenSpaceEventType.LEFT_DOWN), s.setInputAction(function(e) { var e = e.endPosition; null != e && null != a && (e = o.camera.pickEllipsoid(e, t)) && a.setRadius(r._cesium .Cartesian3.distance(a.getCenter(), e)) }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE), function() { function e(e) { if (!r._cesium.defined(e.center) || !r._cesium.defined(e.radius)) throw new r._cesium .DeveloperError("Center and radius are required"); e = copyOptions(e, defaultSurfaceOptions), this.initialiseOptions(e), this.setRadius(e .radius) } return (e.prototype = new u).setCenter = function(e) { this.setAttribute("center", e) }, e.prototype.setRadius = function(e) { this.setAttribute("radius", Math.max(.1, e)) }, e.prototype.getCenter = function() { return this.getAttribute("center") }, e.prototype.getRadius = function() { return this.getAttribute("radius") }, e.prototype.getGeometry = function() { if (r._cesium.defined(this.center) && r._cesium.defined(this.radius)) return new r ._cesium.CircleGeometry({ center: this.center, radius: this.radius, height: this.height, vertexFormat: r._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, stRotation: this.textureRotationAngle, ellipsoid: this.ellipsoid, granularity: this.granularity }) }, e.prototype.getOutlineGeometry = function() { return new r._cesium.CircleOutlineGeometry({ center: this.getCenter(), radius: this.getRadius() }) }, e }), u = (c.prototype.initialiseOptions = function(e) { fillOptions(this, e), this._ellipsoid = void 0, this._granularity = void 0, this._height = void 0, this._textureRotationAngle = void 0, this._id = void 0, this ._createPrimitive = !0, this._primitive = void 0, this._outlinePolygon = void 0 }, c.prototype.setAttribute = function(e, t) { this[e] = t, this._createPrimitive = !0 }, c.prototype.getAttribute = function(e) { return this[e] }, c.prototype.update = function(e, t, i) { if (!r._cesium.defined(this.ellipsoid)) throw new r._cesium.DeveloperError( "this.ellipsoid must be defined."); if (!r._cesium.defined(this.appearance)) throw new r._cesium.DeveloperError( "this.material must be defined."); if (this.granularity < 0) throw new r._cesium.DeveloperError( "this.granularity and scene2D/scene3D overrides must be greater than zero."); if (this.show && (this._createPrimitive || r._cesium.defined(this._primitive))) { if (this._createPrimitive || this._ellipsoid !== this.ellipsoid || this._granularity !== this.granularity || this._height !== this.height || this._textureRotationAngle !== this.textureRotationAngle || this._id !== this.id) { var o = this.getGeometry(); if (!o) return; this._createPrimitive = !1, this._ellipsoid = this.ellipsoid, this._granularity = this.granularity, this._height = this.height, this._textureRotationAngle = this .textureRotationAngle, this._id = this.id, this._primitive = this._primitive && this._primitive.destroy(), this._primitive = new r._cesium.Primitive({ geometryInstances: new r._cesium.GeometryInstance({ geometry: o, id: this.id, pickPrimitive: this }), appearance: this.appearance, asynchronous: this.asynchronous }), this._outlinePolygon = this._outlinePolygon && this._outlinePolygon .destroy(), this.strokeColor && this.getOutlineGeometry && (this ._outlinePolygon = new r._cesium.Primitive({ geometryInstances: new r._cesium.GeometryInstance({ geometry: this.getOutlineGeometry(), attributes: { color: r._cesium.ColorGeometryInstanceAttribute .fromColor(this.strokeColor) } }), appearance: new r._cesium.PerInstanceColorAppearance({ flat: !0, renderState: { depthTest: { enabled: !0 }, lineWidth: Math.min(this.strokeWidth) } }) })) } o = this._primitive; o.appearance.material = this.material, o.debugShowBoundingVolume = this .debugShowBoundingVolume, o.update(e, t, i), this._outlinePolygon && this ._outlinePolygon.update(e, t, i) } }, c.prototype.isDestroyed = function() { return !1 }, c.prototype.destroy = function() { return this._primitive = this._primitive && this._primitive.destroy(), r._cesium .destroyObject(this) }, c.prototype.setStrokeStyle = function(e, t) { this.strokeColor && this.strokeColor.equals(e) && this.strokeWidth == t || (this ._createPrimitive = !0, this.strokeColor = e, this.strokeWidth = t) }, c); function c() {} }, H.prototype.setSemiMajorAxis = function(e) { try { this.item._ellipse.semiMajorAxis = e } catch (e) { console.log(e) } return this }, H.prototype.setSemiMinorAxis = function(e) { try { this.item._ellipse.semiMinorAxis = e } catch (e) { console.log(e) } return this }, H.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show._value, t = null == this.item.ellipse.semiMajorAxis ? void 0 : this.item.ellipse.semiMajorAxis._value, i = null == this.item.ellipse.semiMinorAxis ? void 0 : this.item.ellipse.semiMinorAxis._value, o = (null == this.item.ellipse.height || this.item.ellipse.height._value, null == this.item.ellipse .extrudedHeight ? void 0 : this.item.ellipse.extrudedHeight._value), r = null == this.item.ellipse.rotation ? void 0 : this.item.ellipse.rotation._value, n = null == this.item.ellipse.stRotation ? void 0 : this.item.ellipse.stRotation._value, a = null == this.item.ellipse.fill ? void 0 : this.item.ellipse.fill._value, s = this.item.ellipse.material, l = (null != s && (s = { color: null == s.color ? void 0 : "rgba(" + s.color._value.red + "," + s.color._value .green + "," + s.color._value.blue + "," + s.color._value.alpha + ")", image: null == s.image ? void 0 : s.image._value, diffusemap: null == s.diffusemap ? void 0 : s.diffusemap._value, alphamap: null == s.alphamap ? void 0 : s.alphamap._value }), null == this.item.ellipse.outline ? void 0 : this.item.ellipse.outline._value), u = null == this.item.ellipse.outlineColor ? void 0 : "rgba(" + this.item.ellipse.outlineColor ._value.red + "," + this.item.ellipse.outlineColor._value.green + "," + this.item.ellipse .outlineColor._value.blue + "," + this.item.ellipse.outlineColor._value.alpha + ")", c = null == this.item.ellipse.outlineWidth ? void 0 : this.item.ellipse.outlineWidth._value, h = null == this.item.ellipse.numberOfVerticalLines ? void 0 : this.item.ellipse .numberOfVerticalLines._value, m = this.item.ellipse.distanceDisplayCondition, d = null == m ? void 0 : m._value.near, m = null == m ? void 0 : m._value.far, p = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "circle", position: { x: this._cesium.Math.toDegrees(p.longitude), y: this._cesium.Math.toDegrees(p.latitude), z: p = this._cesium.Math.toDegrees(p.height) }, treeobj: { name: this.treeobj.name }, style: { show: e, semiMajorAxis: t, semiMinorAxis: i, height: p, extrudedHeight: o, rotation: r, stRotation: n, fill: a, material: s, outline: l, outlineColor: u, outlineWidth: c, numberOfVerticalLines: h, near: d, far: m } } }, H.prototype.setTreeobj = function(e) { this.treeobj = e }, H.prototype.setHeight = function(e) { try { this.item._ellipse.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND, this.item ._ellipse.height = e } catch (e) { console.log(e) } return this }, H.prototype.setHeightType = function(e) { try { 1 == e ? this.item._ellipse.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._ellipse.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this .item._ellipse.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, H.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._ellipse.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, H.prototype.setEllipseImage = function(e) { try { this.item._ellipse.material.uniforms.image = e } catch (e) { console.log(e) } return this }, H.prototype.setOutlineColor = function(e) { try { this.item._ellipse.outlineWidth = 5, this.item._ellipse.outlineColor = new m(this._viewer, this ._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, H.prototype.setMaterial = function(e) { try { this.item._ellipse.material.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, H.prototype.setMaterialAlpha = function(e) { try { this.item._ellipse.material.color._value.alpha = e, this.item._ellipse.show = !0 } catch (e) { console.log(e) } return this }, H.prototype.setItem = function(e) { this.item = e }, H.prototype.setExtrudedHeight = function(e) { try { this.item._ellipse.extrudedHeight = e } catch (e) { console.log(e) } return this }, H.prototype.deleteObject = function() { this._viewer.entities.remove(this.item) }, H.prototype.CreateCircle = function(e, t, i, o, r, n) { this._postion = e; var a, t = { semiMinorAxis: this._cesium.defaultValue(t, 3e5), semiMajorAxis: this._cesium.defaultValue(t, 3e5), material: this._cesium.Color.YELLOW, outline: !0, outlineColor: this._cesium.Color.WHITE }, i = (i && "" !== i && (t.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(i)), o && "" !== o && (t.material = new m(this._viewer, this._cesium).colorFromHtmlColor(o)), (e .Yaw || e.Pitch || e.Roll) && (a = this._cesium.Transforms.headingPitchRollQuaternion(this ._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw), this._cesium.Math.toRadians(e .Pitch), this._cesium.Math.toRadians(e.Roll)))), this.item = this._viewer.entities.add({ name: n, position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), ellipse: t, orientation: a }), { id: this.item.id, name: n, pId: this._core.isnull(r) ? 0 : r, type: "circle", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(r) ? 0 : r), this }, H.prototype.CreateEllipse = function(e, t, i, o, r, n, a, s) { this._postion = e; var l, t = { semiMinorAxis: this._cesium.defaultValue(t, 3e5), semiMajorAxis: this._cesium.defaultValue(i, 1e5), numberOfVerticalLines: this._cesium.defaultValue(n, 16), material: this._cesium.Color.YELLOW, outline: !0, outlineColor: this._cesium.Color.WHITE }, i = (o && "" !== o && (t.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(o)), r && "" !== r && (t.material = new m(this._viewer, this._cesium).colorFromHtmlColor(r)), (e .Yaw || e.Pitch || e.Roll) && (l = this._cesium.Transforms.headingPitchRollQuaternion(this ._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw), this._cesium.Math.toRadians(e .Pitch), this._cesium.Math.toRadians(e.Roll)))), this.item = this._viewer.entities.add({ name: s, position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), ellipse: t, orientation: l }), { id: this.item.id, name: s, pId: this._core.isnull(a) ? 0 : a, type: "ellipse", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(a) ? 0 : a), this }, Object.defineProperties(H.prototype, { Position: { Altitude: { get: function() { return this._postion.Altitude }, set: function(e) { try { this._postion.Altitude = e, this.item.position = this._cesium.Cartesian3 .fromDegrees(this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, AltitudeType: { get: function() { return this._postion.AltitudeType }, set: function(e) { try { this._postion.AltitudeType = e } catch (e) { console.log(e) } } }, Cartesian: { get: function() { return this._postion.Cartesian }, set: function(e) { try { this._postion.Cartesian = e } catch (e) { console.log(e) } } }, Distance: { get: function() { return this._postion.Distance }, set: function(e) { try { this._postion.Distance = e } catch (e) { console.log(e) } } }, Pitch: { get: function() { return this._postion.Pitch }, set: function(e) { try { this._postion.Pitch = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, Roll: { get: function() { return this._postion.Roll }, set: function(e) { try { this._postion.Roll = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, X: { get: function() { return this._postion.X }, set: function(e) { try { this._postion.X = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Y: { get: function() { return this._postion.Y }, set: function(e) { try { this._postion.Y = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Yaw: { get: function() { return this._postion.Yaw }, set: function(e) { try { this._postion.Yaw = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } } } }), k.prototype.createPoint = function(e, t, i, o, r, n) { var a = { id: this._core.getuid(), show: !0, pixelSize: 10, color: this._cesium.Color.RED, clampToGround: !0 }, o = (a = this._core.extend(a, o = o || {}, !0), i && (this._core.isHtmlColor(i) ? i = this._color .colorFromHtmlColor(i) : (1 < (i = /^rgb/.test(i) ? this._Color.rgbaStringToRgbaObj(i) : i) .r && (i.r = i.r / 255), 1 < i.g && (i.g = i.g / 255), 1 < i.b && (i.b = i.b / 255), 1 < i.a && (i.a = i.a / 255), i.r && (i = this._color.createColor(i.r, i.g, i.b, i.a))), a .color = i), this._position = t, this.item = this._viewer.entities.add({ name: e, position: this._cesium.Cartesian3.fromDegrees(t[0], t[1], t[2] || 0), point: a }), { id: this.item.id, name: e, pId: this._core.isnull(r) ? 0 : r, type: "Point", item: this }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(r) ? 0 : r), this }, k.prototype.getstyles = function() { var e = {}; return e.show = !this.item.point.show || this.item.point.show._value, e.pixelSize = this.item.point .pixelSize ? this.item.point.pixelSize.toString() : null, e.heightReference = this.item.point .heightReference && this.item.point.heightReference._value ? this.item.point.heightReference .toString() : null, e.color = this.item.point.color && this.item.point.color._value ? "rgba" + this .item.point.color.toString() : null, e.outlineColor = this.item.point.outlineColor && this.item .point.outlineColor._value ? "rgba" + this.item.point.outlineColor.toString() : null, e .outlineWidth = this.item.point.outlineWidth && this.item.point.outlineWidth._value ? this.item .point.outlineWidth.toString() : null, e.near = this.item.point.distanceDisplayCondition ? this.item .point.distanceDisplayCondition._value.near : null, e.far = this.item.point .distanceDisplayCondition ? this.item.point.distanceDisplayCondition._value.far : null, e.position = this.item.position.getValue().toString(), e }, k.prototype.createLonlat = function(o) { var r = this, t = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); t.setInputAction(function(e) { var e = r._viewer.camera.pickEllipsoid(e.position, r._viewer.scene.globe.ellipsoid), e = r._cesium.Cartographic.fromCartesian(e, r._viewer.scene.globe.ellipsoid, new r ._cesium.Cartographic), t = r._cesium.Math.toDegrees(e.latitude), i = r._cesium.Math.toDegrees(e.longitude), e = e.height; "function" == typeof o && o({ lng: i, lat: t, height: e }) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), t.setInputAction(function(e) { t.destroy() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK) }, k.prototype.createRichTextPoint = function(t, i, o = {}) { var m, d, p, g, _, r = this, n = this._core.getuid(), e = o.GroupID, a = (void 0 !== i.length ? 2 === i.length ? a = this._cesium.Cartesian3.fromDegrees(i[0], i[1]) : 3 === i.length && (a = this._cesium.Cartesian3.fromDegrees(i[0], i[1], i[2])) : a = i.z ? this ._cesium.Cartesian3.fromDegrees(i.x, i.y, i.z) : this._cesium.Cartesian3.fromDegrees(i.x, i.y), this._position = a, { horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.BOTTOM, show: !0, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(r._core.defaultValue(o .near, 0), r._core.defaultValue(o.far, Number.MAX_VALUE)) }), s = this._core.extend(a, o, !0), a = "", l = 15, l = (o && o.fontColor && (a = o.fontColor), o && o.fontSize && (l = o.fontSize), m = t, d = l, p = a, g = function(e) { s.image = e, r.item = r._viewer.entities.add({ id: n, name: t, position: r._position, billboard: s }), r.item.degrees = i, r.item.type = "RichPoint", r.item.data = o.data }, (_ = document.createElement("img")).src = r._core.defaultValue(s.url, window .SmartEarthRootUrl + D.richtextpoint), d = parseFloat(d), _.crossOrigin = "Anonymous", _ .onload = function() { var e, t, i, o, r, n, a, s, l = document.createElement("canvas"), u = l.getContext("2d"), c = _.width, h = _.height; l.width = c, l.height = h, u.drawImage(_, 0, 0, c, h), u.shadowOffsetX = 1, u .shadowOffsetY = 0, u.shadowColor = "#fff", u.shadowBlur = 1, /^\$/ .test(m) ? (a = '' + m + "", e = window.URL || window.webkitURL || window, t = document .createElement("img"), a = new Blob([a], { type: "image/svg+xml;charset=utf-8" }), i = e.createObjectURL(a), t.crossOrigin = "Anonymous", t.src = i, t.onload = function() { u.drawImage(t, 0, 0, t.width, t.height), e.revokeObjectURL(i) }) : (u.fillStyle = p || "#fff", u.font = d + "px Calibri,sans-serif", m.length * d > c ? (a = m.substring(0, Math.ceil(m.length / 2)), o = m.substring(Math.floor(m .length / 2), m.length), r = (s = (h - 100 - 2 * d) / 2) + d, n = (c - a .length * d) / 2, u.fillText(a, n, s), u.fillText(o, n, r)) : (a = (h - 100 - d) / 2, s = (c - m.length * d) / 2, u.fillText(m, s, a))), g(l) }, { id: n, name: "新建富文本点" + n, pId: r._core.isnull(e) ? 0 : e, type: "Imagelabel", item: r }); return r.setTreeobj(l), r._tree.insertGroupId(l, r._core.isnull(e) ? 0 : e), this }, k.prototype.createPoints = function(e, t) { var i = { id: this._core.getuid(), show: !0, pixelSize: 10, color: this._cesium.Color.RED, heightReference: this._cesium.HeightReference.CLAMP_TO_GROUND }, i = this._core.extend(i, e, !0), e = (this._core.isnull(text) || (i.text = text), this._position = position, this.item = this._viewer .entities.add({ name: name, position: this._cesium.Cartesian3.fromDegrees(position[0], position[1]), point: i }), { id: this.item.id, name: i.text, pId: this._core.isnull(t) ? 0 : t, type: "Point", item: this }); return this.setTreeobj(e), this._tree.insertGroupId(e, this._core.isnull(t) ? 0 : t), this }, k.prototype.createLocations = function(e, t, i) { var o = { id: this._core.getuid(), show: !0, pixelSize: 10, color: this._cesium.Color.TRANSPARENT, heightReference: this._cesium.HeightReference.CLAMP_TO_GROUND }, t = (this._position = t, this._core.isnull(e) && (e = "新建兴趣点"), this.item = this._viewer.entities .add({ name: e, position: this._cesium.Cartesian3.fromDegrees(t[0], t[1], t[2]), point: o }), { id: o.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "Location", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), this }, k.prototype.createLocation = function(t, e, i) { var o = { id: this._core.getuid(), show: !0, pixelSize: 10, color: this._cesium.Color.TRANSPARENT, heightReference: this._cesium.HeightReference.CLAMP_TO_GROUND }, r = { destination: e.position, orientation: { heading: e.orientation.heading, pitch: e.orientation.pitch, roll: e.orientation.roll } }, n = (this._position = e, this._core.isnull(t) && (t = "新建兴趣点"), this._core.getuid()), a = (this.item = this._viewer.entities.add({ name: t, position: e.position, point: o }), this.item.originalCameraLocation = r, this); return setTimeout(function() { var e = { id: n, name: t + n, pId: a._core.isnull(i) ? 0 : i, type: "Location", item: a }; a.setTreeobj(e), a._tree.insertGroupId(e, a._core.isnull(i) ? 0 : i) }), this }, k.prototype.createPointOptimization = function(e, t) { var i = this, o = [], r = this._core.StyleContrastGeoJson(e, this._cesium); return this.handler.setInputAction(function(e) { var t, e = i._viewer.scene.camera.getPickRay(e.position); (t = e ? i._viewer.scene.globe.pick(e, i._viewer.scene) : t) && (e = i._cesium.Ellipsoid .WGS84.cartesianToCartographic(t), t = i._viewer.scene.globe.getHeight(e), i._point = i ._cesium.Cartesian3.fromDegrees(e.longitude / Math.PI * 180, e.latitude / Math.PI * 180, t), r.position = new i._cesium.CallbackProperty(function() { return i._point }, !1), i.objId = Number((new Date).getTime() + "" + Number(1e3 * Math.random()) .toFixed(0)), (e = i._viewer.entities.add(r)).objId = i.objId, (e.obj = i)._core .Entityadd(i), o.push({ point: e }), i.state = 1, i.handler.destroy(), "function" == typeof method && method(o), i.item = e) }, i._cesium.ScreenSpaceEventType.LEFT_CLICK), this }, k.prototype.startModify = function() { var o, r = "拖动修改位置"; 2 != this.state && 1 != this.state || (this._tree.starttemporaryItem(this._viewer), this .modifyHandler || (this.modifyHandler = new this._cesium.ScreenSpaceEventHandler(this.viewer .scene.canvas)), (o = this).modifyHandler.setInputAction(function(e) { e = o._viewer.scene.pick(e.position); o._cesium.defined(e) && e.id && o._cesium.defined(e) && e.id && e.id.objId && e.id .objId == o.objId && (o.modifyPoint = e.id, r = "释放后完成修改", o.forbidDrawWorld(!0)), o .state = 2 }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.modifyHandler.setInputAction(function(e) { var t, i = o._viewer.scene.pick(e.endPosition); o._core.CreateTooltip(r, e.endPosition, !1), o.modifyPoint ? o.modifyPoint && ((t = o .getCatesian3FromPX(e.endPosition, o._viewer, [o.modifyPoint])) && (o ._point = t, o.modifyPoint.position = t), o._core.CreateTooltip(r, e .endPosition, !0)) : o._cesium.defined(i) && i.id && i.id.objId && o._core .CreateTooltip("拖动修改位置", e.endPosition, !0) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.modifyHandler.setInputAction(function( e) { e = o.getCatesian3FromPX(e.position, o._viewer, [o.modifyPoint]); o.modifyPoint && (e && (o._point = e), o.modifyPoint.position = e, o.modifyPoint = null, o.forbidDrawWorld(!1), r = "拖动修改位置") }, this._cesium.ScreenSpaceEventType.LEFT_UP)) }, k.prototype.getCatesian3FromPX = function(e, t, i) { var o, r = t.scene.pick(e), n = t.scene.drillPick(e), a = null; if (0 < i.length) { for (var s = 0; s < n.length; s++) if (n[s].id._id != i[0].id && n[s].id._id != i[1].id) { a = n[s].id; break } } else a = r; if (t.scene.pickPositionSupported && this._cesium.defined(a)) o = t.scene.pickPosition(e); else { r = t.camera.getPickRay(e); if (!r) return; o = t.scene.globe.pick(r, t.scene) } return o }, k.prototype.forbidDrawWorld = function(e) { this._viewer.scene.screenSpaceCameraController.enableRotate = !e, this._viewer.scene .screenSpaceCameraController.enableTilt = !e, this._viewer.scene.screenSpaceCameraController .enableTranslate = !e, this._viewer.scene.screenSpaceCameraController.enableInputs = !e }, k.prototype.executePoint = function(i, e) { this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw); var o = this, r = (this._tree.starttemporaryItem(this._viewer), { point: o._cesium.Color.RED }); 0 < Object.keys(e).length && "" != e.point && null != e.point && (r.point = e.point), this._tree .removeHandler(); let n = this._core.CreateTooltip(); return this._tree.handler = new o._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas), this._tree .handler.setInputAction(function(e) { var t, e = o._viewer.scene.camera.getPickRay(e.position); (t = e ? o._viewer.scene.globe.pick(e, o._viewer.scene) : t) && (e = o._cesium.Ellipsoid .WGS84.cartesianToCartographic(t), t = o._viewer.scene.globe.getHeight(e), e = o._cesium .Cartesian3.fromDegrees(e.longitude / Math.PI * 180, e.latitude / Math.PI * 180, t), t = 1e3 <= t ? (t / 1e3).toFixed(2) + "千米" : t.toFixed(2) + "米", e = o._viewer.entities .add({ name: "高度", position: e, point: { color: r.point, pixelSize: 5, outlineColor: o._cesium.Color.WHITE, outlineWidth: 2, heightReference: o._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY }, label: { text: "海拔高度:" + t, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), o._tree.temporaryItem.obj.push(e), t = { point: e, height: t }, o._tree.endtemporaryItem(), o._core.mouse(o._viewer.container, 0, "0"), o._tree .handler.destroy(), n.show(!1), "function" == typeof i && i(t), o.item = e) }, o._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function(e) { n.showAt(e.endPosition, "点击拾取高度!") }, o._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, k.prototype.executePointp = function(t, e) { this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw); var i = this, o = (this._tree.starttemporaryItem(this._viewer), { point: i._cesium.Color.RED }); return 0 < Object.keys(e).length && "" != e.point && null != e.point && (o.point = e.point), this._tree .removeHandler(), this._tree.handler = new i._cesium.ScreenSpaceEventHandler(i._viewer.scene .canvas), this._tree.handler.setInputAction(function(e) { var e = i._getPosition.getMousePosition(e); e && (e = i._viewer.entities.add({ name: "高度", position: e, point: { color: o.point, pixelSize: 5, outlineColor: i._cesium.Color.WHITE, outlineWidth: 2, heightReference: i._cesium.HeightReference.none } }), i._tree.temporaryItem.obj.push(e), i._tree.endtemporaryItem(), i._core.mouse(i ._viewer.container, 0, "0"), i._tree.handler.destroy(), "function" == typeof t && t(e), i.item = e) }, i._cesium.ScreenSpaceEventType.LEFT_CLICK), this }, k.prototype.deleteObject = function() { try { if (this._viewer.entities.remove(this.item), 0 < this._points.length) for (var e = 0; e < this._points.length; e++) this._viewer.entities.remove(this._points[e]) } catch (e) {} }, k.prototype.setVisibility = function(e) { if (0 < this._points.length) for (var t = 0; t < this._points.length; t++) this._points[t].show = e; this.item.show = e }, k.prototype.getVisibility = function() { return this.item.show }, k.prototype.setPointAlpha = function(e) { try { this.item._point.material._value.alpha = e } catch (e) { console.log(e) } return this }, k.prototype.export = function() { var e = null == this.item.point.show ? void 0 : this.item.point.show._value, t = null == this.item.point.pixelSize ? void 0 : this.item.point.pixelSize._value, i = null == this.item.point.color ? void 0 : "rgba(" + this.item.point.color._value.red + "," + this .item.point.color._value.green + "," + this.item.point.color._value.blue + "," + this.item.point .color._value.alpha + ")", o = null == this.item.point.outlineColor ? void 0 : "rgba(" + this.item.point.outlineColor._value .red + "," + this.item.point.outlineColor._value.green + "," + this.item.point.outlineColor._value .blue + "," + this.item.point.outlineColor._value.alpha + ")", r = null == this.item.point.outlineWidth ? void 0 : this.item.point.outlineWidth._value, n = this.item.point.distanceDisplayCondition, a = null == n ? void 0 : n._value.near, n = null == n ? void 0 : n._value.far, s = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "point", position: { x: this._cesium.Math.toDegrees(s.longitude), y: this._cesium.Math.toDegrees(s.latitude), z: this._cesium.Math.toDegrees(s.height) }, treeobj: { name: this.treeobj.name }, style: { show: e, pixelSize: t, color: i, outlineColor: o, outlineWidth: r, near: a, far: n } } }, k.prototype.setTreeobj = function(e) { this.treeobj = e }, k.prototype.setPointColor = function(e) { try { this.item._point.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e), this.item .fillColor = this.item._point.color } catch (e) { console.log(e) } return this }, k.prototype.setRadius = function(e) { try { this.item.ellipse = new this._cesium.EllipseGraphics({ semiMinorAxis: e, semiMajorAxis: e, material: this._cesium.Color.RED.withAlpha(.4) }) } catch (e) { console.log(e) } return this }, k.prototype.setOutlineColor = function(e) { try { this.item._point.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, Object.defineProperties(k.prototype, { HighLight: { set: function(e) { e && (this.item.fillColor = this.item.point._color), e ? this.item._point.color = new m( this._viewer, this._cesium).colorFromHtmlColor(this._core.selectedColor) : this .item.point._color = this.item.fillColor } } }), Object.defineProperties(k.prototype, { pointColor: { get: function() { if (this.item.point._color._value) return this._color.toHtmlColor("rgb(" + 255 * this .item.point._color._value.red + "," + 255 * this.item.point._color._value .green + "," + 255 * this.item.point._color._value.blue + "," + 255 * this .item.point._color._value.alpha + ")") }, set: function(e) { try { /^rgb/.test(e) ? (1 < (e = this._color.rgbaStringToRgbaObj(e)).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e .a && (e.a = e.a / 255), e = this._color.createColor(e.r, e.g, e.b, e.a), this.item._point.color = e) : this.item._point.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e), this.item.fillColor = this.item._point .color } catch (e) {} } }, pointOutlineColor: { get: function() { if (null != this.item._point._outlineColor) return this._color.toHtmlColor("rgb(" + 255 * this.item._point.outlineColor._value.red + "," + 255 * this.item ._point.outlineColor._value.green + "," + 255 * this.item._point .outlineColor._value.blue + "," + 255 * this.item._point.outlineColor._value .alpha + ")") }, set: function(e) { try { /^rgb/.test(e) ? (1 < (e = this._color.rgbaStringToRgbaObj(e)).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e .a && (e.a = e.a / 255), e = this._color.createColor(e.r, e.g, e.b, e.a), this.item._point.outlineColor = e) : this.item._point.outlineColor = this ._color.colorFromHtmlColor(e) } catch (e) { console.log(e) } } }, pointOutlineWidth: { get: function() { if (null != this.item.point.outlineWidth) return this.item.point.outlineWidth._value }, set: function(e) { this.item.point.outlineWidth = e } }, pointAlpha: { get: function() { if (null != this.item._point._color) return this.item._point._color._value.alpha }, set: function(e) { this.item._point._color._value.alpha = e } }, pointOutlineAlpha: { get: function() { if (null != this.item._point.outlineColor) return this.item._point.outlineColor._value .alpha }, set: function(e) { try { this.item._point.outlineColor._value.alpha = e } catch (e) {} } }, pointHeight: { set: function(e) { e = parseFloat(e); var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), t = this._cesium.Math.toDegrees(t.latitude), i = this._cesium.Cartesian3.fromDegrees(i, t, e); this.item.position._value = i }, get: function() { var e = this._cesium.Cartographic.fromCartesian(this.item.position._value); return this._cesium.Math.toDegrees(e.height) } }, pointX: { set: function(e) { var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = (this._cesium.Math.toDegrees(t.longitude), this._cesium.Math.toDegrees(t .latitude)), t = this._cesium.Math.toDegrees(t.height), e = this._cesium.Cartesian3.fromDegrees(e, i, t); this.item.position.position = e }, get: function() { var e = this._cesium.Cartographic.fromCartesian(this.item.position._value); return this._cesium.Math.toDegrees(e.longitude) } }, pointY: { set: function(e) { var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), t = (this._cesium.Math.toDegrees(t.latitude), this._cesium.Math.toDegrees(t .height)), i = this._cesium.Cartesian3.fromDegrees(i, e, t); this.item.position.position = i }, get: function() { var e = this._cesium.Cartographic.fromCartesian(this.item.position._value); return this._cesium.Math.toDegrees(e.latitude) } } }), Object.defineProperties(k.prototype, { pixelSize: { get: function() { return this.item.point.pixelSize._value }, set: function(e) { this.item.point.pixelSize = e } } }), Object.defineProperties(k.prototype, { rectangle: { get: function() { return this.item.rectangle }, set: function(e) { this.item.rectangle = e } } }), k.prototype.setItem = function(e) { this.item = e }, Object.defineProperties(k.prototype, { polyline: { get: function() { return this.item.polyline }, set: function(e) { this.item.polyline = e } } }), Object.defineProperties(k.prototype, { polygon: { get: function() { return this.item.polygon }, set: function(e) { this.item.polygon = e } } }), Object.defineProperties(k.prototype, { point: { get: function() { return this.item.point }, set: function(e) { this.item.point = e } } }), Object.defineProperties(k.prototype, { label: { get: function() { return this.item.label }, set: function(e) { this.item.label = e } } }), Object.defineProperties(k.prototype, { position: { get: function() { return this._position || this.item.position } } }), Object.defineProperties(k.prototype, { model: { get: function() { return this.item.model }, set: function(e) { this.item.model = e } } }), Object.defineProperties(k.prototype, { wall: { get: function() { return this.item.wall }, set: function(e) { this.item.wall = e } } }), Object.defineProperties(k.prototype, { pointTempOptions: { get: function() { return { color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: m.BLACK, outlineWidth: 0, show: !0, scaleByDistance: null, translucencyByDistance: null, heightReference: null, distanceDisplayCondition: null, disableDepthTestDistance: null } } } }), F.prototype.createLabel = function(e, t, i, o, r) { var n = { id: this._core.getuid(), text: "default text", backgroundColor: new m(this._viewer, this._cesium).createColor(.165, .165, .165, 1), fillColor: new m(this._viewer, this._cesium).createColor(.9411764705882353, .9725490196078431, 1, 1), font: "30px sans-serif", horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, show: !0, scale: 1, showBackground: !1, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(0, Number.MAX_VALUE) }, n = this._core.extend(n, i, !0), i = (this._core.isnull(t) || (n.text = t), !n.fillColor || this._core.isnull(n) || this._core .isnull(n.fillColor) || "[" == n.fillColor.toString().charAt(0) && "]" == n.fillColor.toString() .charAt(n.fillColor.length - 1) || (this._core.isHtmlColor(n.fillColor) && /^#/.test(n.fillColor .toString()) ? n.fillColor = this._Color.colorFromHtmlColor(n.fillColor) : (/^rgb/.test( n.fillColor) && (n.fillColor = this._Color.rgbaStringToRgbaObj(n.fillColor)), 1 < n .fillColor.r && (n.fillColor.r = n.fillColor.r / 255), 1 < n.fillColor.g && (n.fillColor .g = n.fillColor.g / 255), 1 < n.fillColor.b && (n.fillColor.b = n.fillColor.b / 255), 1 < n.fillColor.a && (n.fillColor.a = n.fillColor.a / 255), n.fillColor.r && ( n.fillColor = this._Color.createColor(n.fillColor.r, n.fillColor.g, n.fillColor.b, n .fillColor.a)))), !n.backgroundColor || this._core.isnull(n) || this._core.isnull(n .backgroundColor) || "[" == n.backgroundColor.toString().charAt(0) && "]" == n .backgroundColor.toString().charAt(n.backgroundColor.length - 1) || (this._core.isHtmlColor(n .backgroundColor) && /^#/.test(n.backgroundColor.toString()) ? n.backgroundColor = this ._Color.colorFromHtmlColor(n.backgroundColor) : (/^rgb/.test(n.backgroundColor) && (n .backgroundColor = this._Color.rgbaStringToRgbaObj(n.backgroundColor)), 1 < n .backgroundColor.r && (n.backgroundColor.r = n.backgroundColor.r / 255), 1 < n .backgroundColor.g && (n.backgroundColor.g = n.backgroundColor.g / 255), 1 < n .backgroundColor.b && (n.backgroundColor.b = n.backgroundColor.b / 255), 1 < n .backgroundColor.a && (n.backgroundColor.a = n.backgroundColor.a / 255), n .backgroundColor.r && (n.backgroundColor = this._Color.createColor(n.backgroundColor.r, n.backgroundColor.g, n.backgroundColor.b, n.backgroundColor.a)))), !n .outlineColor || this._core.isnull(n) || this._core.isnull(n.outlineColor) || "[" == n .outlineColor.toString().charAt(0) && "]" == n.outlineColor.toString().charAt(n.outlineColor .length - 1) || (this._core.isHtmlColor(n.outlineColor) && /^#/.test(n.outlineColor .toString()) ? n.outlineColor = this._Color.colorFromHtmlColor(n.outlineColor) : (/^rgb/ .test(n.outlineColor) && (n.outlineColor = this._Color.rgbaStringToRgbaObj(n .outlineColor)), 1 < n.outlineColor.r && (n.outlineColor.r = n.outlineColor.r / 255), 1 < n.outlineColor.g && (n.outlineColor.g = n.outlineColor.g / 255), 1 < n .outlineColor.b && (n.outlineColor.b = n.outlineColor.b / 255), 1 < n.outlineColor.a && (n.outlineColor.a = n.outlineColor.a / 255), n.outlineColor.r && (n.outlineColor = this ._Color.createColor(n.outlineColor.r, n.outlineColor.g, n.outlineColor.b, n .outlineColor.a)))), n.near && n.far && (n.distanceDisplayCondition = new this ._cesium.DistanceDisplayCondition(n.near, n.far)), this.item = this._viewer.entities.add({ position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), label: n }), { id: this.item.id, name: n.text, pId: this._core.isnull(o) ? 0 : o, type: "label", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), this }, F.prototype.getstyles = function() { var e = {}; return e.backgroundColor = "rgba" + this.item.label._backgroundColor.toString(), e.fillColor = "rgba" + this.item.label._fillColor.toString(), e.text = this.item.label.text.toString(), e.show = !this.item .label.show || this.item.label.show._value, e.font = this.item.label.font ? this.item.label.font .toString() : null, e.style = !this.item.label.style || "null" == this.item.label.style.toString() ? null : this.item.label.style.toString(), e.scale = this.item.label.scale ? this.item.label.scale .toString() : null, e.showBackground = this.item.label.showBackground ? this.item.label .showBackground._value : null, e.horizontalOrigin = this.item.label.horizontalOrigin ? this.item .label.horizontalOrigin.toString() : null, e.verticalOrigin = this.item.label.verticalOrigin ? this .item.label.verticalOrigin.toString() : null, e.heightReference = this.item.label.heightReference ? this.item.label.heightReference.toString() : null, e.outlineColor = this.item.label.outlineColor ? "rgba" + this.item.label.outlineColor.toString() : null, e.outlineWidth = this.item.label .outlineWidth ? this.item.label.outlineWidth._value : null, e.near = this.item.label .distanceDisplayCondition ? this.item.label.distanceDisplayCondition._value.near : null, e.far = this.item.label.distanceDisplayCondition ? this.item.label.distanceDisplayCondition._value.far : null, e.position = this.item.position.getValue().toString(), e }, F.prototype.executeLabel = function(e) { var i = this, t = new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas); return t.setInputAction(function(e) { e = i._viewer.scene.camera.pickEllipsoid(e.position, i._viewer.scene.globe.ellipsoid), e = i ._viewer.entities.add({ position: e, label: { id: i._core.getuid(), text: "", font: "30px sans-serif", horizontalOrigin: i._cesium.HorizontalOrigin.CENTER, verticalOrigin: i._cesium.VerticalOrigin.CENTER, show: !0, showBackground: !0 } }), i.item = e, e = 0; i._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (e = V.selectedItem.id); var t = { id: i._core.getuid(), name: "", pId: i._core.isnull(e) ? 0 : e, type: "Point", item: i }; i.setTreeobj(t), i._tree.insertGroupId(t, i._core.isnull(e) ? 0 : e) }, i._cesium.ScreenSpaceEventType.LEFT_CLICK), t.setInputAction(function(e) { t.destroy() }, i._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, F.prototype.deleteObject = function() { try { var e; if ("DivPoint" === this.item.type) return this.pointPrimitive.remove(this.item), void((e = document .getElementById(this.item.id)) && e.remove()); this._viewer.entities.remove(this.item) } catch (e) {} }, F.prototype.setVisibility = function(e) { this.item.show = e }, F.prototype.setRichtext = function(e) { var o, r, n, t = this._core.getuid(), i = (null != this.item.position._value ? this._position = this.item.position._value : this ._position = this.item.position, this.treeobj.pId), t = (this.deleteObject(), this.pointPrimitive || (this.pointPrimitive = this._viewer.scene .primitives.add(new this._cesium.PointPrimitiveCollection), (n = this).pointPrimitive .update = function() { for (var e, t, i = 0; i < n.pointPrimitive.length; i++) { if (e = n.pointPrimitive.get(i), r = e.position, !(r = n._viewer.scene .cartesianToCanvasCoordinates(r))) return; o = document.getElementById(e.id), e.name || (e.name = "泰瑞"), o = o || (t = e .description ? '
\n
\n
' + e.description + "
\n
" : '
\n
' + e.name + "
\n
", $(".cesium-viewer").append(t), document.getElementById(e.id)), e.description ? o.style.transform = "matrix(1, 0, 0, 1, " + r.x + ", " + (r.y - 157) + ")" : o.style.transform = "matrix(1, 0, 0, 1, " + r.x + ", " + (r.y - 134) + ")" } }), this.item = this.pointPrimitive.add({ id: "DivPoint" + t, position: this._position, color: this._cesium.Color.YELLOW }), this.item.type = "DivPoint", this.item.name = name, this.item.description = e, { id: this.item.id, name: name, pId: this._core.isnull(i) ? 0 : i, type: "Point", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), this.item }, F.prototype.getVisibility = function() { return this.item.show }, F.prototype.setRadius = function(e) { try { this.item._label.outlineWidth = e, this.item._label.outlineColor = this._cesium.Color.RED.withAlpha( .4) } catch (e) { console.log(e) } return this }, F.prototype.setText = function(e) { try { this.item._label.text = e } catch (e) { console.log(e) } return this }, F.prototype.setHeightType = function(e) { try { 1 == e ? this.item._label.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._label.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this.item ._label.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, F.prototype.setUrl = function(e) { try { this.item.billboard = new this._cesium.BillboardGraphics({ id: this._core.getuid(), image: e, show: !0 }) } catch (e) { console.log(e) } return this }, F.prototype.setFillColorRgba = function(e, t, i, o) { try { this.item._label.fillColor = new m(this._viewer, this._cesium).createColor(e, t, i, o) } catch (e) { console.log(e) } }, F.prototype.setFillColorHtml = function(e) { try { this.item._label.fillColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e), this.item .fillColor = this.item._label.fillColor } catch (e) { console.log(e) } }, F.prototype.setFillColorAlpha = function(e) { try { this.item._label.fillColor._value.alpha = e } catch (e) { console.log(e) } }, F.prototype.setBackgroundColorRgba = function(e, t, i, o) { try { this.item._label.backgroundColor = new m(this._viewer, this._cesium).createColor(e, t, i, o) } catch (e) { console.log(e) } }, F.prototype.setBackgroundColorHtml = function(e) { try { this.item._label.backgroundColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } }, F.prototype.setBackgroundColorAlpha = function(e) { try { this.item._label.backgroundColor._value.alpha = e } catch (e) { console.log(e) } }, F.prototype.setFontSize = function(e) { try { this.item._label.font = parseFloat(e) + "px sans-serif" } catch (e) { console.log(e) } }, F.prototype.setFillColorAlpha = function(e) { try { this.item._label.fillColor._value.alpha = e } catch (e) { console.log(e) } }, F.prototype.showBackground = function(e) { try { this.item._label.showBackground = e } catch (e) { console.log(e) } }, F.prototype.setOutlineWidth = function(e) { try { this.item._label.outlineWidth = e } catch (e) { console.log(e) } }, F.prototype.setOutlineColorRgba = function(e, t, i, o) { try { this.item._label.outlineColor = new this._cesium.Color(e, t, i, o) } catch (e) { console.log(e) } }, F.prototype.setOutlineColorHtml = function(e) { try { this.item._label.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } }, F.prototype.setOutlineColorAlpha = function(e) { try { this.item._label.outlineColor._value.alpha = e } catch (e) { console.log(e) } }, F.prototype.setStyle_LabelStyle_FILL = function(e) { try { this.item._label.style = this.LabelStyle_FILL } catch (e) { console.log(e) } }, F.prototype.setStyle_LabelStyle_FILL_AND_OUTLINE = function() { try { this.item._label.style = this.LabelStyle_FILL_AND_OUTLINE } catch (e) { console.log(e) } }, F.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._label.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, F.prototype.setStyle_LabelStyle_OUTLINE = function() { try { this.item._label.style = this.LabelStyle_OUTLINE } catch (e) { console.log(e) } }, F.prototype.setItem = function(e) { this.item = e }, F.prototype.CreateLabel = function(e, t, i, o, r, n) { this._postion = e; var a = { id: this._core.getuid(), text: t, backgroundColor: o.BackgroundColor, font: o.FontName, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.BOTTOM, show: !0, scale: o.Scale, showBackground: !1, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(o.MinViewingHeight, o .MaxViewingHeight) }, e = (o.Italic && (a.font = "italic " + a.font), o.Bold && (a.font = "Bold " + a.font), this._core .isnull(o) || this._core.isnull(o.IconColor) || "[" == o.IconColor.toString().charAt(0) && "]" == o.IconColor.toString().charAt(o.IconColor.length - 1) || (this._core.isHtmlColor(o .IconColor) ? a.fillColor = this._Color.colorFromHtmlColor(o.IconColor) : (/^rgb/.test(o .IconColor) && (a.fillColor = this._Color.rgbaStringToRgbaObj(o.IconColor)), 1 < a .fillColor.r && (a.fillColor.r = a.fillColor.r / 255), 1 < a.fillColor.g && (a.fillColor .g = a.fillColor.g / 255), 1 < a.fillColor.b && (a.fillColor.b = a.fillColor.b / 255), 1 < a.fillColor.a && (a.fillColor.a = a.fillColor.a / 255), a.fillColor = this ._Color.createColor(a.fillColor.r, a.fillColor.g, a.fillColor.b, a.fillColor.a))), this ._core.isnull(o) || this._core.isnull(o.LineColor) || "[" == o.LineColor.toString().charAt(0) && "]" == o.LineColor.toString().charAt(o.LineColor.length - 1) || (this._core.isHtmlColor(o .LineColor) ? a.outlineColor = this._Color.colorFromHtmlColor(o.LineColor) : (/^rgb/ .test(o.LineColor) && (a.outlineColor = this._Color.rgbaStringToRgbaObj(o.LineColor)), 1 < a.outlineColor.r && (a.outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor .g && (a.outlineColor.g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a .outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor .a = a.outlineColor.a / 255), a.outlineColor = this._Color.createColor(a .outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), a = this._core .extend(a, o, !0), { position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), label: a }), i = (i && "" !== i && (e.label.pixelOffset = this._cesium.defaultValue(o.pixelOffset, { x: 30 * (t.length / 2 + 1), y: -30 }), t = { image: i, horizontalOrigin: this._cesium.defaultValue(o.ImageHorizontal, this._cesium .HorizontalOrigin.CENTER), verticalOrigin: this._cesium.defaultValue(o.ImageVertical, this._cesium.VerticalOrigin .BOTTOM), show: !0, scale: o.ImageScale || 1, showBackground: !1, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(o .ImageMinViewingHeight || 0, o.ImageMaxViewingHeight || 99999999999999) }, o.pixelOffset = { x: 0, y: 0 }, t = this._core.extend(t, o, !1), e.billboard = t), this.item = this._viewer.entities.add( e), { id: this.item.id, name: a.text, pId: this._core.isnull(r) ? 0 : r, type: "label", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(r) ? 0 : r), this }, F.prototype.export = function() { var e = null == this.item.label.show ? void 0 : this.item.label.show._value, t = null == this.item.label.text ? void 0 : this.item.label.text._value, i = null == this.item.label.font ? void 0 : this.item.label.font._value, o = null == this.item.label.style ? void 0 : this.item.label.style._value, r = null == this.item.label.scale ? void 0 : this.item.label.scale._value, n = null == this.item.label.showBackground ? void 0 : this.item.label.showBackground._value, a = null == this.item.label.backgroundColor ? void 0 : "rgba(" + this.item.label.backgroundColor ._value.red + "," + this.item.label.backgroundColor._value.green + "," + this.item.label .backgroundColor._value.blue + "," + this.item.label.backgroundColor._value.alpha + ")", s = null == this.item.label.horizontalOrigin ? void 0 : this.item.label.horizontalOrigin._value, l = null == this.item.label.verticalOrigin ? void 0 : this.item.label.verticalOrigin._value, u = null == this.item.label.heightReference ? void 0 : this.item.label.heightReference._value, c = null == this.item.label.fillColor ? void 0 : "rgba(" + this.item.label.fillColor._value.red + "," + this.item.label.fillColor._value.green + "," + this.item.label.fillColor._value.blue + "," + this.item.label.fillColor._value.alpha + ")", h = null == this.item.label.outlineColor ? void 0 : "rgba(" + this.item.label.outlineColor._value .red + "," + this.item.label.outlineColor._value.green + "," + this.item.label.outlineColor._value .blue + "," + this.item.label.outlineColor._value.alpha + ")", m = null == this.item.label.outlineWidth ? void 0 : this.item.label.outlineWidth._value, d = this.item.label.distanceDisplayCondition, p = null == d ? void 0 : d._value.near, d = null == d ? void 0 : d._value.far, g = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "label", position: { x: this._cesium.Math.toDegrees(g.longitude), y: this._cesium.Math.toDegrees(g.latitude), z: this._cesium.Math.toDegrees(g.height) }, treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, text: t, font: i, style: o, scale: r, showBackground: n, backgroundColor: a, horizontalOrigin: s, verticalOrigin: l, heightReference: u, fillColor: c, outlineColor: h, outlineWidth: m, near: p, far: d } } }, F.prototype.setTreeobj = function(e) { this.treeobj = e }, Object.defineProperties(F.prototype, { position: { Altitude: { get: function() { return this._postion.Altitude }, set: function(e) { try { var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), o = this._cesium.Math.toDegrees(t.latitude), r = (this._cesium.Math.toDegrees(t.height), this._cesium.Cartesian3 .fromDegrees(i, o, e)); this.item.position.position = r, this._postion.Altitude = e } catch (e) { console.log(e) } } }, AltitudeType: { get: function() { return this._postion.AltitudeType }, set: function(e) { try { this._postion.AltitudeType = e } catch (e) { console.log(e) } } }, Cartesian: { get: function() { return this._postion.Cartesian }, set: function(e) { try { this._postion.Cartesian = e } catch (e) { console.log(e) } } }, Distance: { get: function() { return this._postion.Distance }, set: function(e) { try { this._postion.Distance = e } catch (e) { console.log(e) } } }, Pitch: { get: function() { return this._postion.Pitch }, set: function(e) { try { this._postion.Pitch = e } catch (e) { console.log(e) } } }, Roll: { get: function() { return this._postion.Roll }, set: function(e) { try { this._postion.Roll = e } catch (e) { console.log(e) } } }, X: { get: function() { return this._postion.X }, set: function(e) { try { this._postion.X = e; var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = (this._cesium.Math.toDegrees(t.longitude), this._cesium.Math.toDegrees(t .latitude)), o = this._cesium.Math.toDegrees(t.height), r = this._cesium.Cartesian3.fromDegrees(e, i, o); this.item.position.position = r } catch (e) { console.log(e) } } }, Y: { get: function() { return this._postion.Y }, set: function(e) { try { this._postion.Y = e; var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), o = (this._cesium.Math.toDegrees(t.latitude), this._cesium.Math.toDegrees(t .height)), r = this._cesium.Cartesian3.fromDegrees(i, e, o); this.item.position.position = r } catch (e) { console.log(e) } } }, Yaw: { get: function() { return this._postion.Yaw }, set: function(e) { try { this._postion.Yaw = e } catch (e) { console.log(e) } } } }, LabelStyle: { BackgroundColor: { set: y.debounce(function(e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor( e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor( e.r, e.g, e.b, e.a))), this.item.label.backgroundColor = e, this .item.backgroundColor = e) }, 500), get: function() { var e = this.item.label.backgroundColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value .green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, Bold: { get: function() { return -1 != this.item._label.font.getValue().indexOf("bold") }, set: function() { var e = "bold " + this.item._label.font.getValue(); this.item._label.font.setValue(e) } }, FontName: { get: function() { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++) if ("bold" != e[t] && -1 == e[t].indexOf("px") && -1 == e[t].indexOf("PX")) return e[t] }, set: function(e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t .length; o++) "bold" != t[o] && -1 == t[o].indexOf("px") && -1 == t[o].indexOf( "PX") || (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, FontSize: { get: function() { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++) if (-1 != e[t].indexOf("px")) return e[t] }, set: function(e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t .length; o++) - 1 != t[o].indexOf("px") && (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, FrameFileName: { get: function() { return "" }, set: function(e) {} }, IconColor: { set: y.debounce(function(e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor( e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor( e.r, e.g, e.b, e.a))), this.item.label.fillColor = e) }, 500), get: function() { var e = this.item.label.fillColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value .green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, Italic: { get: function() { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++) if (-1 != e[t].indexOf("italic")) return e[t] }, set: function(e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t .length; o++) - 1 != t[o].indexOf("italic") && (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, LimitScreenSize: { get: function() { return "" }, set: function(e) {} }, LineColor: { set: y.debounce(function(e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor( e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor( e.r, e.g, e.b, e.a))), this.item.label.outlineColor = e) }, 500), get: function() { var e = this.item.label.outlineColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value .green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, LineToGround: { get: function() { return "" }, set: function(e) {} }, LockMode: { get: function() { return "" }, set: function(e) {} }, MaxImageSize: { get: function() { return "" }, set: function(e) {} }, MaxViewingHeight: { get: function() { if (null != this.item._label.distanceDisplayCondition) return this.item._label .distanceDisplayCondition._value.far }, set: function(e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label .distanceDisplayCondition._value.near), this.item._label .distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(t, e) } }, MinViewingHeight: { get: function() { if (null != this.item._label.distanceDisplayCondition) return this.item._label .distanceDisplayCondition._value.near }, set: function(e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label .distanceDisplayCondition._value.far), this.item._label .distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, t) } }, MultilineJustification: { get: function() { return "" }, set: function(e) {} }, PivotAlignment: { get: function() { return "" }, set: function(e) {} }, Scale: { get: function() { if (null != this.item._label.scale) return this.item.label.scale.getValue() }, set: function(e) { this.item.label.scale.setValue(e) } }, TextAlignment: { get: function() { return "" }, set: function(e) {} }, TextColor: { get: function() { return "" }, set: function(e) {} }, TextOnImage: { get: function() { return "" }, set: function(e) {} }, Underline: { get: function() { return "" }, set: function(e) {} } } }), G.prototype.executeFlycesium = function(t) { var i = this, o = (e.prototype._init = function() { var e = this; this.options.polyline.positions = new i._cesium.CallbackProperty(function() { return e.positions }, !1), this.flycesium = i._viewer.entities.add(this.options), i.item = this.flycesium }, e); function e(e) { this.options = { polyline: { show: !0, positions: [], material: new i._cesium.PolylineGlowMaterialProperty({ glowPower: .1, color: i._cesium.Color.YELLOW }), width: 10, clampToGround: !0 } }, this.positions = e, this._init() } var r = this.handler = new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas), n = [], a = 0, s = void 0, l = { polyline: {}, cameraRoll: null, cameraPitch: null, cameraPosition: null, cameraHeading: null, positions: [], distance: [], Totaltime: "" }, u = this._core.CreateTooltip(); return this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), r.setInputAction( function(e) { e = i._getPosition.getMousePosition(e); "pc" === i._core.getBrowser().pc && 0 == n.length && n.push(e.clone()), n.push(e), 2 <= n .length && (i._cesium.defined(s) || (s = new o(n)), a = i._core.getSpaceDistancem(n, i ._cesium)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), r.setInputAction(function(e) { u.showAt(e.endPosition, "左键开始,右键结束!"); e = i._getPosition.getMousePosition(e); 2 <= n.length && (i._cesium.defined(s) ? e && (n.pop(), n.push(e)) : s = new o(n), a = i ._core.getSpaceDistancem(n, i._cesium)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), r.setInputAction(function(e) { i.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = function(e) { r.destroy(), u.show(!1), i._core.mouse(i._viewer.container, 0), i.end = void 0, i._viewer .entities.remove(i.item), "cancel" === e || n.length < 2 || (a = i._core.getSpaceDistancem( n, i._cesium), l.polyline = s, l.positions = n, l.distance = parseFloat(a), i .setFlycesium(l, function(e) { i.flyceium = e, i.ploylinejl = l, "function" == typeof t && t(e) })) }, this }, G.prototype.setFlycesium = function(t, i) { for (var o, r = this, n = [], e = 0; e < t.positions.length; e++) { var a = r._cesium.Cartographic.fromCartesian(t.positions[e]), a = [a.longitude / Math.PI * 180, a.latitude / Math.PI * 180, a.height]; n.push(a) } this._core.getPmfxPro(t.positions, 25, 0, r._cesium, r._viewer, e => { o = e.max, e = (t.distance / 50).toFixed(1); e = { id: r._core.getuid(), name: "新建路线", distance: t.distance, showPoint: !1, showLine: !0, showModel: !0, isLoop: !1, Totaltime: Math.round(e), speed: 50, height: (o + 100).toFixed(2), pitch: -20, range: 100, mode: 0, url: window.SmartEarthRootUrl + D.testModel, geojson: { geometry: { type: "LineString", coordinates: n } } }; i && i(e) }) }, G.prototype.Start = function(e, t, i) { var o = this; return e.geojson, e.Totaltime || (e.Totaltime = 3e3), o._entityFly && o.exit(), uo = i, setTimeout( function() { o.executeFly3D(e, t) }, 200), this }; var eo, to, io, oo, ro, no, ao, so = null, lo = null, uo = null, N = { start: null, time: null, longitude: 0, latitude: 0, cameraHeight: 100, speed: 50, multiplier: 1, position: 0 }, co = 0, ho = (G.prototype.executeFly3D = function(e, t) { var l = this, i = e.geojson; if (eo = new l._cesium.Cartesian3, oo = new l._cesium.SampledProperty(Number), ro = new l._cesium .SampledPositionProperty, i && i.geometry) { var o = i.geometry.coordinates, r = [], n = []; if (0 < o.length) { for (var a = 0; a < o.length; a++) { var s = o[a][0], u = o[a][1], c = o[a][2]; void 0 !== e.lineHeight && (c = e.lineHeight), n.push(s, u, c), r.push({ x: s, y: u, z: c }) } l._viewer.clock.clockRange = e.isLoop ? l._cesium.ClockRange.LOOP_STOP : l._cesium .ClockRange.CLAMPED, l._viewer.clock.multiplier = e.multiplier || 1, l._viewer.clock .canAnimate = !1, l._viewer.clock.shouldAnimate = !0, N.distance = e.distance, N .cameraHeight = e.height, N.lineHeight = e.lineHeight, N.pitch = e.pitch, N.range = e .range, N.speed = e.speed || 50, N.Totaltime = e.distance / N.speed, N.start = l._cesium .JulianDate.fromDate(new Date), N.stop = l._cesium.JulianDate.addSeconds(N.start, N .Totaltime, new l._cesium.JulianDate), l._viewer.clock.startTime = N.start.clone(), l._viewer.clock.stopTime = N.stop.clone(), l._viewer.clock.currentTime = N.start .clone(); var i = l.computeCirclularFlight(r), h = (N.position = i, N.degrees = r, io = new l._cesium.VelocityOrientationProperty( i), {}), h = "" !== t ? { show: l._cesium.defaultValue(e.showModel, !0), scale: l._cesium.defaultValue(e.modelScale, 1), uri: t } : { show: l._cesium.defaultValue(e.showModel, !0), scale: l._cesium.defaultValue(e.modelScale, 1) }; e.modelData && (h = l._core.extend(h, e.modelData)), ao = function() {}, so = l._viewer .entities.add({ availability: new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({ start: N.start, stop: N.stop })]), position: i, polyline: { clampToGround: void 0 === N.lineHeight, positions: Cesium.Cartesian3.fromDegreesArrayHeights(n), show: l._cesium.defaultValue(e.showLine, !0), material: new l._cesium.PolylineGlowMaterialProperty({ glowPower: .1, color: l._cesium.Color.YELLOW }), width: 10 }, label: { text: new l._cesium.CallbackProperty(function(e, t) { if (l._viewer.camera, 2 === l._viewer.clock.clockRange || ! Cesium.JulianDate.equals(l._viewer.clock.currentTime, l ._viewer.clock.stopTime)) { try { var i, o, r = ho.position.getValue(l._viewer.clock .currentTime), n = l._cesium.Cartographic.fromCartesian(r); N.longitude = l._cesium.Math.toDegrees(n.longitude), N .latitude = l._cesium.Math.toDegrees(n.latitude), void 0 === N.lineHeight && (i = l._viewer.scene .sampleHeight(n, [lo, ho]), o = l._viewer.scene .globe.getHeight(n), lo.position = l._cesium .Cartesian3.fromRadians(n.longitude, n.latitude, i < o ? o : i)) } catch (e) {} try { to.getValue(e, eo), ao(e); var a = l._cesium.Cartesian3.magnitude(eo), s = Math.round(3.6 * a); s += " km/h", N.time = l._cesium.JulianDate .secondsDifference(e, N.start), N.ratio = N.time / N .Totaltime, N.distanceTraveled = N.ratio * N .distance, N.speed = s, N.height = n.height, N .globeHeight = l._viewer.scene.globe.getHeight(n), null != uo && "function" == typeof uo && uo(N) } catch (e) {} return "" } so.label.text = "", l.exit(), null != uo && "function" == typeof uo && uo("end"), ao = function() {} }, !1), font: "20px sans-serif", showBackground: !1, distanceDisplayCondition: new l._cesium.DistanceDisplayCondition(0, 100), eyeOffset: new l._cesium.Cartesian3(0, 3.5, 0) } }), lo = l._viewer.entities.add({ availability: new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({ start: N.start, stop: N.stop })]), position: i, orientation: io, point: { show: l._cesium.defaultValue(e.showPoint, !1), color: l._cesium.Color.RED, outlineColor: l._cesium.Color.WHITE, outlineWidth: 2, pixelSize: 10 }, model: h, billboard: e.image, viewFrom: e.viewFrom || new l._cesium.Cartesian3(500, 500, 500) }), ho = so, l._viewer.trackedEntity = lo, l._entityFly = so, e.mode && l.changeFlyMode( e.mode) } } }, null); function mo(e) { co = oo.getValue(e), N.heading = co } function po(e) { var e = Cesium.Cartographic.fromCartesian(e), t = Cesium.Math.toDegrees(e.longitude), e = Cesium.Math.toDegrees(e.latitude); return Cesium.Cartesian3.fromDegrees(t, e, N.cameraHeight || 100) } function B(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this.positions = [], this.objId = Number((new Date).getTime() + "" + Number(1e3 * Math.random()).toFixed(0)), this.handler = new this ._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.modifyHandler = new this._cesium .ScreenSpaceEventHandler(this._viewer.scene.canvas), this.style = null, this.state = 0, this .gonCircleArr = [], this.gonPointStretchingArr = [], this.topRadius = 0, this.bottomRadius = 0, this .length = 50 } function go(e, t) { this._viewer = e, this._cesium = t, this._Cdcl = new X, this._core = new f, this._polyline = void 0, this ._polygon = void 0, this._box = new R(e, t), this._ellipsoid = new Zi(e, t), this._rectangle = new O(e, t), this._circle = new H(e, t), this._point = void 0, this._label = new F(e, t), this ._dynamicObject = new G(e, t), this._elevationContour = new ye(e, t), this._scopefieldvision = new $i(e, t), this._cone = new B(e, t) } function _o(e, t) { this._viewer = e, this._cesium = t, this._execute = new go(this._viewer, this._cesium) } G.prototype.showPoint = function(e) { lo && lo.point && (lo.point.show = e) }, G.prototype.showLine = function(e) { so && so.polyline && (so.polyline.show = e) }, G.prototype.showModel = function(e) { lo && lo.model && (lo.model.show = e) }, G.prototype.setFlyHeight = function(e) { N.cameraHeight = e }, G.prototype.setFlyDistance = function(e) { N.range = e }, G.prototype.setFlyPitch = function(e) { N.pitch = e }, G.prototype.changeFlyMode = function(e) { var t = this; switch (e) { case 0: ao = function() {}, t.BindingModel(!0); break; case 1: this.BindingModel(!1), ao = function(e) { mo(e), t.exeuteVisualAngle(t._cesium.Math.toRadians(N.heading), t._cesium.Math .toRadians(N.pitch), N.range) }; break; case 2: this.BindingModel(!1), ao = function(e) { mo(e), (no = t._entityFly.position.getValue(t._viewer.clock.currentTime)) && (no = po( no), t._viewer.camera.setView({ destination: no, orientation: { heading: t._cesium.Math.toRadians(N.heading), pitch: t._cesium.Math.toRadians(-90), roll: 0 } })) } } }, G.prototype.faster = function() { this._viewer.animation.viewModel.faster() }, G.prototype.slower = function() { this._viewer.animation.viewModel.slower() }, G.prototype.setMultiplier = function(e) { this._viewer.clock.multiplier = parseFloat(e) }, G.prototype.isPause = function(e) { this._viewer.clockViewModel.shouldAnimate = !e }, G.prototype.exit = function() { this.isPause(!0), this._viewer.clock.multiplier = 1, this.executeSignout(), this.BindingModel(!1), this ._viewer.entities.remove(so), this._viewer.entities.remove(lo), lo = so = null, this._entityFly = null }, G.prototype.updateSpeedLabel = function(e, t) {}, G.prototype.computeCirclularFlight = function(e) { var t = this; to = new t._cesium.VelocityVectorProperty(ro, !1); for (var i, o, r, n, a, s, l = 0; l < e.length; l++) { 0 === l && (a = t._cesium.JulianDate.addSeconds(N.start, 0, new t._cesium.JulianDate), i = t._cesium .Cartesian3.fromDegrees(e[0].x, e[0].y, N.lineHeight), ro.addSample(a, i), co = t._core .TwoPointAzimuth(e[0].x, e[0].y, e[1].x, e[1].y), oo.addSample(a, co)); try { 0 < l && l != e.length - 1 && (i = new t._cesium.Cartesian3(ro._property._values[3 * l - 3], ro ._property._values[3 * l - 2], ro._property._values[3 * l - 1]), o = t._cesium .Cartesian3.fromDegrees(e[l].x, e[l].y, t._cesium.defaultValue(N.lineHeight, e[l].z)), r = [t._cesium.Cartographic.fromCartesian(i), t._cesium.Cartographic.fromCartesian(o)], n = new t._cesium.EllipsoidGeodesic(r[0], r[1]).surfaceDistance, a = t._cesium .JulianDate.addSeconds(ro._property._times[l - 1], .5, new t._cesium.JulianDate), s = t ._cesium.JulianDate.addSeconds(ro._property._times[l - 1], n / N.speed, new t._cesium .JulianDate), ro.addSample(s, o), co = t._core.TwoPointAzimuth(e[l - 1].x, e[l - 1] .y, e[l].x, e[l].y), oo.addSample(a, co), oo.addSample(s, co)) } catch (e) { console.log(e) } } return ro }, G.prototype.executePauseFly3DPaths = function() { var e = this._viewer.clockViewModel; e.shouldAnimate ? e.shouldAnimate = !1 : this._viewer.clockViewModel.canAnimate && (e.shouldAnimate = ! 0) }, G.prototype.changeModel = function(e) { lo.model.uri = e }, G.prototype.PointView = function() { return { position: Viewer.camera.position.clone(), orientation: { heading: Viewer.camera.heading, pitch: Viewer.camera.pitch, roll: Viewer.camera.roll } } }, G.prototype.PlayPaths = function(e) { var t = this; setInterval(function() { viewer.camera.setView({ destination: t._cesium.Cartesian3.fromDegrees(117.48, 30.67, 15e3), orientation: { heading: t._cesium.Math.toRadians(90, 0), pitch: t._cesium.Math.toRadians(-90), roll: 0 } }) }, 2e3) }, G.prototype.BindingModel = function(e) { e ? this._viewer.trackedEntity = lo : (this._viewer.trackedEntity = void 0, this._viewer.camera .lookAtTransform(Cesium.Matrix4.IDENTITY)) }, G.prototype.exeuteVisualAngle = function(e, t, i) { var o = { heading: null, pitch: null, range: null }, e = (o.heading = e || this._cesium.Math.toRadians(90), o.pitch = t || this._cesium.Math.toRadians( 0), o.range = i || 1e3, this._entityFly.position.getValue(this._viewer.clock.currentTime)); e && (e = po(e), t = new this._cesium.HeadingPitchRange(o.heading, o.pitch, o.range), this._viewer .camera.lookAt(e, t)) }, G.prototype.Pathshow = function(e) { this._entityFly.polyline.show = e }, G.prototype.Pointshow = function(e) { lo._point.show = e }, G.prototype.Modelshow = function(e) { lo._model.show = e }, G.prototype.executePlayForwardFly3DPaths = function() { var e = this._viewer.clockViewModel, t = e.multiplier; t < 0 && (e.multiplier = -t), e.shouldAnimate = !0 }, G.prototype.executePlayReverseFly3DPaths = function() { var e = this._viewer.clockViewModel, t = e.multiplier; 0 < t && (e.multiplier = -t), e.shouldAnimate = !0 }, G.prototype.executeSignout = function() { var e = this._cesium.JulianDate.fromDate(new Date), e = (this._viewer.clock.startTime = e.clone(), this._cesium.JulianDate.addSeconds(e, 86400, new this ._cesium.JulianDate)); this._viewer.clock.stopTime = e.clone() }, G.prototype.forceEndHanlder = function() { this.handler && (this.handler.destroy(), this.handler = void 0) }, B.prototype.createCone = function(e, t, i, o) { var r = { length: 4e5, topRadius: 0, bottomRadius: 2e5, material: this._cesium.Color.GREEN }, r = this._core.extend(r, t, !0), t = (this.item = this._viewer.entities.add({ name: i, position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[1]), cylinder: r }), { id: this.item.id, name: i, pId: this._core.isnull(o) ? 0 : o, type: "cylinder", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, B.prototype.getstyles = function() { var e = {}; return e.show = !this.item.cylinder.show || this.item.cylinder.show._value, e.length = this.item .cylinder.length ? this.item.cylinder.length.getValue() : void 0, e.topRadius = this.item.cylinder .topRadius ? this.item.cylinder.topRadius.getValue() : void 0, e.bottomRadius = this.item.cylinder .bottomRadius ? this.item.cylinder.bottomRadius.getValue() : void 0, e.heightReference = this.item .cylinder.heightReference && this.item.cylinder.heightReference._value ? this.item.cylinder .heightReference._value : void 0, e.fill = this.item.cylinder.fill && this.item.cylinder.fill ._value ? this.item.cylinder.fill._value : void 0, e.material = {}, e.material.color = this.item .cylinder.material && this.item.cylinder.material.color && this.item.cylinder.material.color ._value ? "rgba" + this.item.cylinder.material.color.toString() : void 0, e.material.image = this .item.cylinder.material && this.item.cylinder.material.image && this.item.cylinder.material.image ._value ? this.item.cylinder.material.image._value : void 0, e.material.repeat = this.item.cylinder .material && this.item.cylinder.material.repeat && this.item.cylinder.material.repeat._value ? this .item.cylinder.material.repeat._value : void 0, e.outline = this.item.cylinder.outline ? this.item .cylinder.outline._value : void 0, e.outlineWidth = this.item.cylinder.outlineWidth && this.item .cylinder.outlineWidth._value ? this.item.cylinder.outlineWidth._value : void 0, e.outlineColor = this.item.cylinder.outlineColor && this.item.cylinder.outlineColor && this.item.cylinder .outlineColor._value ? "rgba" + this.item.cylinder.outlineColor.toString() : void 0, e.near = this .item.cylinder.distanceDisplayCondition ? this.item.cylinder.distanceDisplayCondition._value.near : void 0, e.far = this.item.cylinder.distanceDisplayCondition ? this.item.cylinder .distanceDisplayCondition._value.far : void 0, e.position = this.item.position.getValue() .toString(), e }, B.prototype.createRectangularSensor = function(e, t, i, o) { var r, n = this, a = this._core.defaultValue((t = t || {}).radius, 100), s = { radii: new this._cesium.Cartesian3(a, a, a), maximumCone: this._cesium.Math.toRadians(90), material: this._cesium.Color.AQUAMARINE.withAlpha(.3), outline: !0, outlineColor: this._cesium.Color.AQUAMARINE.withAlpha(.5), outlineWidth: 1 }, l = this._core.extend(s, t, !0), u = ("string" == typeof t.color && (l.material = this._cesium.Color.fromCssColorString(t.color)), "string" == typeof t.outlineColor && (l.outlineColor = this._cesium.Color.fromCssColorString(t .outlineColor)), 0), c = this.calcPoints(e[0], e[1], e[2], a, u), s = (this.wall = [], this._viewer.entities.add({ polygon: { hierarchy: new this._cesium.CallbackProperty(function() { return new n._cesium.PolygonHierarchy(n._cesium.Cartesian3 .fromDegreesArrayHeights(c)) }, !1), perPositionHeight: !0, material: this._core.defaultValue(t.wallColor && this._cesium.Color .fromCssColorString(t.wallColor), this._cesium.Color.AQUAMARINE.withAlpha( .5)), outline: !0, outlineColor: this._core.defaultValue(t.wallOutlineColor && this._cesium.Color .fromCssColorString(t.wallOutlineColor), this._cesium.Color.RED.withAlpha( .5)) } })), h = (this.wall.push(s), l.angle && (r = this.calcPoints(e[0], e[1], e[2], a, u + l.angle), s = this ._viewer.entities.add({ polygon: { hierarchy: new this._cesium.CallbackProperty(function() { return new n._cesium.PolygonHierarchy(n._cesium.Cartesian3 .fromDegreesArrayHeights(r)) }, !1), perPositionHeight: !0, material: this._core.defaultValue(t.wallColor && this._cesium.Color .fromCssColorString(t.wallColor), this._cesium.Color.AQUAMARINE .withAlpha(.5)), outline: !0, outlineColor: this._core.defaultValue(t.wallOutlineColor && this._cesium.Color .fromCssColorString(t.wallOutlineColor), this._cesium.Color.RED .withAlpha(.5)) } }), this.wall.push(s), s = this._viewer.entities.add({ position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), ellipsoid: { radii: l.radii, minimumClock: this._cesium.Math.toRadians(0), maximumClock: this._cesium.Math.toRadians(l.angle), maximumCone: this._cesium.Math.toRadians(90), material: this._core.defaultValue(t.surfaceColor && this._cesium.Color .fromCssColorString(t.surfaceColor), this._cesium.Color.RED.withAlpha( .5)) }, orientation: new n._cesium.CallbackProperty(function() { return n._cesium.Transforms.headingPitchRollQuaternion(n._cesium .Cartesian3.fromDegrees(e[0], e[1], e[2]), new n._cesium .HeadingPitchRoll(n._cesium.Math.toRadians(-u), 0, 0)) }, !1) }), this.wall.push(s)), this.item = this._viewer.entities.add({ position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), ellipsoid: l }), this._core.defaultValue(l.speed, 1)), t = (this._viewer.clock.onTick.addEventListener(function() { u += .1 * h, c = n.calcPoints(e[0], e[1], e[2], a, u), r = r && n.calcPoints(e[0], e[1], e[2], a, u + l.angle) }), { id: this.item.id, name: i, pId: this._core.isnull(o) ? 0 : o, type: "cylinder", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, B.prototype.computeCirclularFlight = function(e, t, i, o, r, n, a) { for (var s = [], l = (s.push(e), s.push(t), s.push(r), this._cesium.Cartesian3.distance(this._cesium .Cartesian3.fromDegrees(e, t, r), this._cesium.Cartesian3.fromDegrees(i, o, r))), u = n; u <= n + a; u++) { var c = l * Math.sin(u * Math.PI / 180), h = Math.cos(u * Math.PI / 180), m = (o - t) * h + t; s.push((i - e) * h + e), s.push(m), s.push(c + r) } return s }, B.prototype.calcPoints = function(e, t, i, o, r) { var n = this._cesium.Transforms.eastNorthUpToFixedFrame(this._cesium.Cartesian3.fromDegrees(e, t, i)), a = o * Math.cos(r * Math.PI / 180), o = o * Math.sin(r * Math.PI / 180), r = this._cesium.Cartesian3.fromElements(a, o, 0), a = this._cesium.Matrix4.multiplyByPoint(n, r, new this._cesium.Cartesian3), o = this._cesium.Cartographic.fromCartesian(a), n = this._cesium.Math.toDegrees(o.longitude), r = this._cesium.Math.toDegrees(o.latitude); return this.computeCirclularFlight(e, t, n, r, i, 0, 90) }, B.prototype.createRadarMaskScan = function(e, t, i, o) { var r = this._core.defaultValue((i = i || {}).radius, 100), n = this._core.defaultValue(i.yaw, 0), a = this._core.defaultValue(i.angle, 60), s = i.innerOutline, l = { innerRadii: new this._cesium.Cartesian3(2, 2, 2), radii: new Cesium.CallbackProperty(function() { return new Cesium.Cartesian3(r, r, r) }, !1), maximumCone: this._cesium.Math.toRadians(this._core.defaultValue(i.maxLat, 105)), minimumCone: this._cesium.Math.toRadians(this._core.defaultValue(i.minLat, 75)), minimumClock: new Cesium.CallbackProperty(function() { return Cesium.Math.toRadians(n) }, !1), maximumClock: new Cesium.CallbackProperty(function() { return Cesium.Math.toRadians(n + a) }, !1), material: this._cesium.Color.AQUAMARINE.withAlpha(.3), outline: !s, outlineColor: this._cesium.Color.AQUAMARINE.withAlpha(.5), outlineWidth: 1 }, l = this._core.extend(l, i, !0); "string" == typeof i.color && (l.material = this._cesium.Color.fromCssColorString(i.color)), "string" == typeof i.outlineColor && (l.outlineColor = this._cesium.Color.fromCssColorString(i.outlineColor)); let u, c, h = t instanceof Cesium.Entity ? t : void 0; h ? (u = new Cesium.CallbackProperty(() => h.position.getValue(this._viewer.clock.currentTime.clone()), !1), c = new Cesium.CallbackProperty(() => h.orientation.getValue(this._viewer.clock .currentTime.clone()), !1)) : u = Cesium.Cartesian3.fromDegrees(t[0], t[1], t[2]); var m = 0, d = this._core.defaultValue(i.scanAngle, 15), p = (this._scan = this._viewer.entities.add({ position: u, orientation: c, ellipsoid: { ...l, minimumClock: new Cesium.CallbackProperty(function() { return Cesium.Math.toRadians(n + m) }, !1), maximumClock: new Cesium.CallbackProperty(function() { return Cesium.Math.toRadians(n + m + d) }, !1), outline: s, material: this._core.defaultValue(i.scanColor && this._cesium.Color .fromCssColorString(i.scanColor), this._cesium.Color.RED.withAlpha(.5)) } }), this.item = this._viewer.entities.add({ position: u, orientation: c, ellipsoid: l }), this._core.defaultValue(l.speed, 1)); function g() { (m += .1 * p) <= 0 && p < 0 ? (m = 0, p = -p) : a - d <= m && 0 < p && (m = a - d, p = -p) } this._viewer.clock.onTick.addEventListener(g), this.setRadarMaskValue = (e, t) => { "yaw" === e ? n = t : "angle" === e ? a = 360 < t ? 360 : t : "radius" === e ? r = t : "scanAngle" === e ? d = a < t ? a : t : "speed" === e && (p = t) }, this.deleteObject = () => { let e = this._viewer; e.entities.remove(this.item), e.entities.remove(this._scan), this._viewer.clock.onTick .removeEventListener(g) }; t = { id: this.item.id, name: e, pId: this._core.isnull(o) ? 0 : o, type: "ellipsoid", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, B.prototype.ConicSensor = function(t, i, e = {}) { var o = Cesium.Cartesian3.distance(t, i), r = (e.angle || 10) / 2, n = { innerRadii: new this._cesium.Cartesian3(2, 2, 2), radii: new Cesium.CallbackProperty(function() { return new Cesium.Cartesian3(o, o, o) }, !1), outline: e.outline, material: Cesium.Color.RED.withAlpha(.2), outlineColor: Cesium.Color.WHITE.withAlpha(.2), maximumCone: Cesium.Math.toRadians(-r), minimumCone: Cesium.Math.toRadians(r) }; e.color && (n.material = Cesium.Color.fromCssColorString(e.color)), e.outlineColor && (n.outlineColor = Cesium.Color.fromCssColorString(e.outlineColor)); let a = this._core.toDegrees(t), s = this._core.toDegrees(i), l, u, c = 0, h = (this.item = this._viewer.entities.add({ position: t, ellipsoid: n }), () => { l = this._core.TwoPointAzimuth(a.lon, a.lat, s.lon, s.lat) + 90, u = Math.acos((s.height - a .height) / o), u = Cesium.Math.toDegrees(u), this.item.orientation = Cesium .Transforms.headingPitchRollQuaternion(t, new Cesium.HeadingPitchRoll(Cesium.Math .toRadians(this._core.defaultValue(l, 0)), Cesium.Math.toRadians(this._core .defaultValue(u, 0)), Cesium.Math.toRadians(this._core.defaultValue(c, 0)))) }); h(); e = { id: this.item.id, name: "锥形传感器", pId: 0, type: "ellipsoid", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this.changeStart = e => { t = e, a = this._core.toDegrees(t), this.item.position = t, o = Cesium.Cartesian3.distance(t, i), h() }, this.changeEnd = e => { i = e, s = this._core.toDegrees(i), o = Cesium.Cartesian3.distance(t, i), h() }, this.changeAngle = e => { r = e / 2, this.item.ellipsoid.maximumCone = Cesium.Math.toRadians(-r), this.item.ellipsoid .minimumCone = Cesium.Math.toRadians(r) }, this }, B.prototype.createRadarMask = function(e, t, i, o) { var r = this._core.defaultValue((i = i || {}).radius, 100), n = this._core.defaultValue(i.yaw, 0), a = this._core.defaultValue(i.angle, 60), r = { innerRadii: new this._cesium.Cartesian3(2, 2, 2), radii: new this._cesium.Cartesian3(r, r, r), maximumCone: this._cesium.Math.toRadians(this._core.defaultValue(i.maxLat, 105)), minimumCone: this._cesium.Math.toRadians(this._core.defaultValue(i.minLat, 75)), minimumClock: this._cesium.Math.toRadians(n), maximumClock: this._cesium.Math.toRadians(n + a), material: this._cesium.Color.AQUAMARINE.withAlpha(.3), outline: !1, outlineColor: this._cesium.Color.AQUAMARINE.withAlpha(.5), outlineWidth: 1 }, n = this._core.extend(r, i, !0), a = ("string" == typeof i.color && (n.material = this._cesium.Color.fromCssColorString(i.color)), "string" == typeof i.outlineColor && (n.outlineColor = this._cesium.Color.fromCssColorString(i .outlineColor)), this.item = this._viewer.entities.add({ position: t, ellipsoid: n }), { id: this.item.id, name: e, pId: this._core.isnull(o) ? 0 : o, type: "ellipsoid", item: this }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), this }, B.prototype.createConeRadar = function(o, e) { e = e || {}; var r = this, t = (r.lon = o[0], r.lat = o[1], r.height = this._core.defaultValue(o[2], 3e3), this.planePosition = null, this.halfLen = r.height / 2, this.lengthl = r.height, this.geoD = new this._cesium .EllipsoidGeodesic, this.startPt = this._cesium.Cartographic.fromDegrees(r.lon, r.lat, 0), this .changenum = 0, this.curCanvas = "a", this._viewer.scene.globe.getHeight(this.startPt) || 0); this._cesium.Color.fromCssColorString(r._core.defaultValue(e.color, "#0000ff")), this.item = this ._viewer.entities.add({ name: "Red cone", position: e.rotate ? new this._cesium.CallbackProperty(function() { return r.lon > o[0] + .01 && r.lat < o[1] + .005 ? r.lat += 1e-5 : r.lat > o[ 1] + .005 && r.lon > o[0] ? r.lon -= 1e-5 : r.lon <= o[0] && r.lat > o[1] ? r.lat -= 1e-5 : r.lon += 1e-5, r.planePosition = r._cesium.Cartesian3 .fromDegrees(r.lon, r.lat, r.height / 2), r.planePosition }, !1) : r._cesium.Cartesian3.fromDegrees(r.lon, r.lat, (r.height + t) / 2), orientation: e.rotate ? new this._cesium.CallbackProperty(function() { var e = Cesium.Cartographic.fromDegrees(r.lon, o[1], 0), e = (r.geoD.setEndPoints(r.startPt, e), r.geoD.surfaceDistance), t = Math.atan(e / r.halfLen), i = Cesium.Cartographic.fromDegrees(r.lon, r.lat, 0), i = (r.geoD.setEndPoints(r.startPt, i), e = r.geoD.surfaceDistance, r .lengthl = Math.sqrt(e * e + r.halfLen * r.halfLen), Cesium.Cartographic .fromDegrees(o[0], r.lat, 0)), i = (r.geoD.setEndPoints(r.startPt, i), e = r.geoD.surfaceDistance, Math .asin(e / r.lengthl)), e = new Cesium.HeadingPitchRoll(0, t, i); return Cesium.Transforms.headingPitchRollQuaternion(r.planePosition, e) }, !1) : void 0, cylinder: { length: e.rotate ? new r._cesium.CallbackProperty(function() { return 2 * r.lengthl }, !1) : r.height - t, topRadius: 0, bottomRadius: r._core.defaultValue(e.radius, 300), bottomSurface: !1, material: r._core.getConeRadarMaterial(e.color) } }); t = { id: this._core.getuid(), name: "新建卫星雷达", pId: 0, type: "ConeRadar", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, 0), this }, B.prototype.setLength = function(e) { try { this.item._cylinder.length = e } catch (e) { console.log(e) } return this }, B.prototype.createCylinderOptimization = function(e, t) { this.style = e; var s = this; this.handler.setInputAction(function(e) { var e = s.getCatesian3FromPX(e.position, s._viewer, [s.circle]), t = (0 == s.positions.length && s.positions.push(e.clone()), s.positions.push(e), s .createPoint(e, !1)), e = (0 < s.gonCircleArr.length && (s.positions.pop(), s.state = 1, s.handler.destroy()), s.createPointStretching(e, !1)); e.wq = s.gonCircleArr.length, s.gonPointStretchingArr.push(e), t.wz = s.gonCircleArr.length, s.gonCircleArr.push(t) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction(function(e) { var t, i, o, r, n, a; s.positions.length < 1 || (e = s.getCatesian3FromPX(e.endPosition, s._viewer, [s.circle]), 2 != s.positions.length || s._cesium.defined(s.circle) || (t = s._cesium .Cartographic.fromCartesian(s.positions[0]), i = s._cesium.Math.toDegrees(t .longitude), o = s._cesium.Math.toDegrees(t.latitude), r = s._cesium .Cartographic.fromCartesian(s.positions[1]), n = s._cesium.Math.toDegrees(r .longitude), a = s._cesium.Math.toDegrees(r.latitude), s.topRadius = X(o, i, a, n), s.bottomRadius = X(o, i, a, n), s.circle = s.createCylinder(s.style), s._core.Entityadd(s), s.circle.objId = s.objId), s.circle && (s.positions.pop(), s.positions.push(e), t = s._cesium.Cartographic.fromCartesian(s.positions[0]), i = s._cesium.Math.toDegrees(t.longitude), o = s._cesium.Math.toDegrees(t .latitude), r = s._cesium.Cartographic.fromCartesian(s.positions[1]), n = s ._cesium.Math.toDegrees(r.longitude), a = s._cesium.Math.toDegrees(r.latitude), s.topRadius = X(o, i, a, n), s.bottomRadius = X(o, i, a, n))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE) }, B.prototype.startModify = function() { var m = "拖动修改位置"; if (2 == this.state || 1 == this.state) { this.modifyHandler || (this.modifyHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene .canvas)); for (var d = this, e = 0; e < d.gonCircleArr.length; e++)(t = d.gonCircleArr[e]) && (t.show = !0); if (0 < d.gonPointStretchingArr.length) for (var t, e = 0; e < d.gonPointStretchingArr.length; e++)(t = d.gonPointStretchingArr[e]) && ( t.show = !0); this.modifyHandler.setInputAction(function(e) { e = d._viewer.scene.pick(e.position); if (Cesium.defined(e) && e.id) e.id.objId || (d.modifyPoint = e.id, m = "释放后完成修改"), d .forbidDrawWorld(!0); else { for (var t = 0; t < d.gonCircleArr.length; t++)(i = d.gonCircleArr[t]) && (i .show = !1); if (0 < d.gonPointStretchingArr.length) for (var i, t = 0; t < d.gonPointStretchingArr.length; t++)(i = d .gonPointStretchingArr[t]) && (i.show = !1); d.modifyHandler && (d.modifyHandler.destroy(), d.modifyHandler = null) } d.state = 2 }, Cesium.ScreenSpaceEventType.LEFT_DOWN), this.modifyHandler.setInputAction(function(e) { var t, i, o, r, n, a, s, l, u, c, h = d._viewer.scene.pick(e.endPosition); d._core.CreateTooltip(m, e.endPosition, !1), Cesium.defined(h) && h.id && (h.id.objId || d._core.CreateTooltip(m, e.endPosition, !0)), d.positions.length < 1 || !d .modifyPoint || ((h = d.getCatesian3FromPX(e.endPosition, d._viewer, [d.circle, d .modifyPoint ])) && (null != d.modifyPoint.wq ? (r = { x: h.x, y: h.y, z: h.z + +d.length }, d.positions[d.modifyPoint.wq] = h, 0 == d.modifyPoint.wq ? (d .modifyPoint.position.setValue(r), d.gonCircleArr[d.modifyPoint.wq] .position = h) : (r = d._viewer.scene.pickPosition(e.endPosition), n = d._cesium.Cartographic.fromCartesian(r), a = d._cesium.Math .toDegrees(n.longitude), s = d._cesium.Math.toDegrees(n.latitude), l = d._cesium.Cartographic.fromCartesian(d.positions[1]), u = d ._cesium.Math.toDegrees(l.longitude), c = d._cesium.Math.toDegrees(l .latitude), d.length = X(s, a, c, u), r = d._cesium.Cartographic .fromCartesian(d.gonCircleArr[0].position.getValue()), t = d._cesium .Math.toDegrees(r.longitude), o = d._cesium.Math.toDegrees(r .latitude), r = r.height + d.length, t = d._cesium.Cartesian3 .fromDegrees(t, o, r), o = d._cesium.Cartographic.fromCartesian(d .gonCircleArr[1].position.getValue()), r = d._cesium.Math .toDegrees(o.longitude), i = d._cesium.Math.toDegrees(o.latitude), o = o.height + d.length, r = d._cesium.Cartesian3.fromDegrees(r, i, o), d.gonPointStretchingArr[0].position.setValue(t), d .gonPointStretchingArr[1].position.setValue(r))) : (d.modifyPoint .position.setValue(h), d.positions[d.modifyPoint.wz] = h, d .gonPointStretchingArr[d.modifyPoint.wz].position = { x: h.x, y: h.y, z: h.z + d.length }, d.modifyPoint.wz && 0 == d.modifyPoint.wz ? (d.gonCircleArr[1] .position = { x: d.positions[0].x + d.topRadius, y: d.positions[0].y, z: d.positions[0].z }, d.gonPointStretchingArr[1].position = { x: d.positions[0].x + d.topRadius, y: d.positions[0].y, z: d.positions[0].z + d.length }) : (n = d._cesium.Cartographic.fromCartesian(d.positions[0]), a = d._cesium.Math.toDegrees(n.longitude), s = d._cesium.Math.toDegrees( n.latitude), l = d._cesium.Cartographic.fromCartesian(d .positions[d.modifyPoint.wz]), u = d._cesium.Math.toDegrees(l .longitude), c = d._cesium.Math.toDegrees(l.latitude), d .topRadius = X(s, a, c, u), d.bottomRadius = X(s, a, c, u)))), d._core .CreateTooltip(m, e.endPosition, !0)) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.modifyHandler.setInputAction(function(e) { d.modifyPoint && (d.modifyPoint = null, d.forbidDrawWorld(!1), m = "拖动修改位置") }, Cesium.ScreenSpaceEventType.LEFT_UP) } }, B.prototype.forbidDrawWorld = function(e) { this._viewer.scene.screenSpaceCameraController.enableRotate = !e, this._viewer.scene .screenSpaceCameraController.enableTilt = !e, this._viewer.scene.screenSpaceCameraController .enableTranslate = !e, this._viewer.scene.screenSpaceCameraController.enableInputs = !e }, B.prototype.getCatesian3FromPX = function(e, t, i) { var o, r = t.scene.pick(e), n = t.scene.drillPick(e), a = null; if (i) { for (var s = 0; s < n.length; s++) if (n[s].id._id != i[0].id && n[s].id._id != i[1].id) { a = n[s].id; break } } else a = r; if (t.scene.pickPositionSupported && Cesium.defined(a)) o = t.scene.pickPosition(e); else { r = t.camera.getPickRay(e); if (!r) return; o = t.scene.globe.pick(r, t.scene) } return o }, B.prototype.createCylinder = function(e) { var t = this; return e.length && (t.length = e.length), this._viewer.entities.add({ position: new t._cesium.CallbackProperty(function() { return t.positions[0] }, !1), cylinder: { topRadius: new t._cesium.CallbackProperty(function() { return t.topRadius }, !1), bottomRadius: new t._cesium.CallbackProperty(function() { return t.bottomRadius }, !1), length: new t._cesium.CallbackProperty(function() { return t.length }, !1), material: e.material || Cesium.Color.WHITE } }) }, B.prototype.createPoint = function(e, t) { if (e) return this._viewer.entities.add({ position: e, point: { pixelSize: 10, color: this._cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.CLAMP_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY }, show: t }) }, B.prototype.createPointStretching = function(e, t) { var i, o, r; if (e) return r = Cesium.Cartographic.fromCartesian(e), i = Cesium.Math.toDegrees(r.longitude), o = Cesium.Math.toDegrees(r.latitude), r = r.height + this.length, e = Cesium.Cartesian3 .fromDegrees(i, o, r), this._viewer.entities.add({ position: e, point: { pixelSize: 10, color: Cesium.Color.fromAlpha(Cesium.Color.FUCHSIA, .5), outlineWidth: 2, outlineColor: Cesium.Color.fromAlpha(Cesium.Color.WHITE, .5), heightReference: Cesium.HeightReference.NONE, disableDepthTestDistance: Number.POSITIVE_INFINITY }, show: t }) }, B.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = null == this.item.cylinder.length ? void 0 : this.item.cylinder.length.getValue(), i = null == this.item.cylinder.topRadius ? void 0 : this.item.cylinder.topRadius.getValue(), o = null == this.item.cylinder.bottomRadius ? void 0 : this.item.cylinder.bottomRadius.getValue(), r = null == this.item.cylinder.fill ? void 0 : this.item.cylinder.fill.getValue(), n = this.item.cylinder.material, a = (null != n && (n = { color: null == n.color ? void 0 : "rgba(" + n.color._value.red + "," + n.color._value .green + "," + n.color._value.blue + "," + n.color._value.alpha + ")", image: null == n.image ? void 0 : n.image._value, diffusemap: null == n.diffusemap ? void 0 : n.diffusemap._value, alphamap: null == n.alphamap ? void 0 : n.alphamap._value }), null == this.item.cylinder.outline ? void 0 : this.item.cylinder.outline._value), s = null == this.item.cylinder.outlineColor ? void 0 : "rgba(" + this.item.cylinder.outlineColor ._value.red + "," + this.item.cylinder.outlineColor._value.green + "," + this.item.cylinder .outlineColor._value.blue + "," + this.item.cylinder.outlineColor._value.alpha + ")", l = null == this.item.cylinder.outlineWidth ? void 0 : this.item.cylinder.outlineWidth._value, u = null == this.item.cylinder.numberOfVerticalLines ? void 0 : this.item.cylinder .numberOfVerticalLines._value, c = null == this.item.cylinder.slices ? void 0 : this.item.cylinder.slices._value, h = this.item.cylinder.distanceDisplayCondition, m = null == h ? void 0 : h._value.near, h = null == h ? void 0 : h._value.far, d = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "cylinder", position: { x: this._cesium.Math.toDegrees(d.longitude), y: this._cesium.Math.toDegrees(d.latitude), z: this._cesium.Math.toDegrees(d.height) }, treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, length: t, topRadius: i, bottomRadius: o, fill: r, material: n, outline: a, outlineColor: s, outlineWidth: l, numberOfVerticalLines: u, slices: c, near: m, far: h } } }, B.prototype.setTreeobj = function(e) { this.treeobj = e }, B.prototype.setVisibility = function(t) { this.item.show = t, this._scan && (this._scan.show = t), this.wall && this.wall.forEach(e => { e.show = t }) }, B.prototype.getVolume = function() { try { var e = 0, t = this.item._cylinder.bottomRadius, i = (this.item._cylinder.topRadius, this.item._cylinder.length), e = 0 == t ? 3.14159 * t * t * i / 3 : 3.14159 * t * t * i } catch (e) { console.log(e) } return e }, B.prototype.executeCone = function(o) { var r = this, n = (r.shape = { tempPoints: [], button: 0, position: {} }, new this._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas)), a = [], s = []; return n.setInputAction(function(e) { var e = r._viewer.scene.camera.pickEllipsoid(e.position, r._viewer.scene.globe.ellipsoid), t = r._cesium.Cartographic.fromCartesian(e), i = r._cesium.Math.toDegrees(t.longitude), t = r._cesium.Math.toDegrees(t.latitude); s.push({ lon: i, lat: t }); 0 == r.shape.button ? (a.push(e.clone()), a.push(e), r.shape.position = e, r.cylinder = r ._viewer.entities.add({ name: "", position: r._cesium.Cartesian3.fromDegrees(s[0].lon, s[0].lat), cylinder: { length: 100, show: !0, fill: !0, topRadius: 0, bottomRadius: 100, material: r._cesium.Color.RED } }), r.item = r.cylinder) : 1 == r.shape.button ? (i = X(s[0].lat, s[0].lon, s[1] .lat, s[1].lon), r.item.cylinder.bottomRadius = i) : 2 == r.shape.button && (n .destroy(), t = 0, r._core.isnull(V.selectedItem) || "group" != V.selectedItem .type || (t = V.selectedItem.id), i = { id: e = r._core.getuid(), name: "新建圆锥" + e, pId: r._core.isnull(t) ? 0 : t, type: "cylinder", item: r }, this.setTreeobj(i), V.insertGroupId(i, r._core.isnull(t) ? 0 : t), "function" == typeof o && o({ polyline: {}, positions: [], distance: [] })), r.shape.button = r.shape.button + 1 }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), n.setInputAction(function(e) { 2 == r.shape.button && (e = r._viewer.camera.getPickRay(e.endPosition), e = r._viewer.scene .globe.pick(e, r._viewer.scene), r.item.cylinder.length = e.z) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, B.prototype.executeCylinder = function(o) { var r = this, n = (r.shape = { tempPoints: [], button: 0, position: {} }, new this._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas)), a = [], s = []; return n.setInputAction(function(e) { var e = r._viewer.scene.camera.pickEllipsoid(e.position, r._viewer.scene.globe.ellipsoid), t = r._cesium.Cartographic.fromCartesian(e), i = r._cesium.Math.toDegrees(t.longitude), t = r._cesium.Math.toDegrees(t.latitude); s.push({ lon: i, lat: t }); 0 == r.shape.button ? (a.push(e.clone()), a.push(e), r.shape.position = e, r.cylinder = r ._viewer.entities.add({ name: "", position: r._cesium.Cartesian3.fromDegrees(s[0].lon, s[0].lat), cylinder: { length: 100, topRadius: 0, bottomRadius: 100, material: r._cesium.Color.RED } }), r.item = r.cylinder) : 1 == r.shape.button ? (i = X(s[0].lat, s[0].lon, s[1] .lat, s[1].lon), r.item.cylinder.bottomRadius = i, r.item.cylinder.topRadius = i) : 2 == r.shape.button && (n.destroy(), t = 0, r._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (t = V.selectedItem.id), i = { id: e = r._core.getuid(), name: "新建圆柱" + e, pId: r._core.isnull(t) ? 0 : t, type: "cylinder", item: r }, r.setTreeobj(i), V.insertGroupId(i, r._core.isnull(t) ? 0 : t), "function" == typeof o && o({ polyline: {}, positions: [], distance: [] })), r.shape.button = r.shape.button + 1 }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), n.setInputAction(function(e) { 2 == r.shape.button && (e = r._viewer.camera.getPickRay(e.endPosition), e = r._viewer.scene .globe.pick(e, r._viewer.scene), r.item.cylinder.length = e.z) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, B.prototype.setTopRadius = function(e) { try { this.item._cylinder.topRadius = e } catch (e) { console.log(e) } return this }, B.prototype.setHeight = function(e) { try { var t = this._cesium.Cartesian3.fromDegrees(-94.74211811500844, 37.34584317651723, e); this.item._position._value.z = t.z } catch (e) { console.log(e) } return this }, B.prototype.deleteObject = function() { let t = this._viewer; t.entities.remove(this.item), this.wall && (this.wall.forEach(e => { t.entities.remove(e) }), this.wall = []) }, B.prototype.setHeightType = function(e) { try { 1 == e ? this.item._cylinder.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._cylinder.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this .item._cylinder.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, B.prototype.setCylinderImage = function(e) { try { this.item._cylinder.material = new this._cesium.ImageMaterialProperty({ image: e }) } catch (e) { console.log(e) } return this }, B.prototype.setCylinderRepeat = function(e, t) { try { this.item._cylinder.material.repeat = new this._cesium.Cartesian2(e, t) } catch (e) { console.log(e) } return this }, B.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._cylinder.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, B.prototype.setBottomRadius = function(e) { try { this.item._cylinder.bottomRadius = e } catch (e) { console.log(e) } return this }, B.prototype.setShow = function(e) { try { this.item._cylinder.show = e } catch (e) { console.log(e) } return this }, B.prototype.setMaterial = function(e) { try { this.item._cylinder.material = e } catch (e) { console.log(e) } return this }, B.prototype.setMaterial = function(e) { try { this.item._cylinder.material.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, B.prototype.setMaterialAlpha = function(e) { try { this.item._cylinder.material.color._value.alpha = e, this.item._cylinder.show = !0 } catch (e) { console.log(e) } return this }, B.prototype.setItem = function(e) { this.item = e }, B.prototype.CreateCone = function(e, t, i, o, r, n, a, s) { this._postion = e; var l, t = { topRadius: 0, bottomRadius: this._cesium.defaultValue(t, 2e4), length: this._cesium.defaultValue(i, 4e4), slices: this._cesium.defaultValue(n, 128), material: this._cesium.Color.RED, outline: !1, outlineColor: void 0 }, i = (o && "" !== o && (t.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(o), t .outline = !0), r && "" !== r && (t.material = new m(this._viewer, this._cesium) .colorFromHtmlColor(r)), (e.Yaw || e.Pitch || e.Roll) && (l = this._cesium.Transforms .headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw), this._cesium.Math .toRadians(e.Pitch), this._cesium.Math.toRadians(e.Roll)))), this.item = this ._viewer.entities.add({ name: s, position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), cylinder: t, orientation: l }), { id: this.item.id, name: s, pId: this._core.isnull(a) ? 0 : a, type: "cylinder", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(a) ? 0 : a), this }, B.prototype.CreateCylinder = function(e, t, i, o, r, n, a, s) { this._postion = e; var l, t = { topRadius: this._cesium.defaultValue(t, 2e4), bottomRadius: this._cesium.defaultValue(t, 2e4), length: this._cesium.defaultValue(i, 4e4), slices: this._cesium.defaultValue(n, 128), material: this._cesium.Color.RED, outline: !1, outlineColor: void 0 }, i = (o && "" !== o && (t.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(o), t .outline = !0), r && "" !== r && (t.material = new m(this._viewer, this._cesium) .colorFromHtmlColor(r)), (e.Yaw || e.Pitch || e.Roll) && (l = this._cesium.Transforms .headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw), this._cesium.Math .toRadians(e.Pitch), this._cesium.Math.toRadians(e.Roll)))), this.item = this ._viewer.entities.add({ name: s, position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), cylinder: t, orientation: l }), { id: this.item.id, name: s, pId: this._core.isnull(a) ? 0 : a, type: "cylinder", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(a) ? 0 : a), this }, Object.defineProperties(B.prototype, { Position: { Altitude: { get: function() { return this._postion.Altitude }, set: function(e) { try { this._postion.Altitude = e, this.item.position = this._cesium.Cartesian3 .fromDegrees(this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, AltitudeType: { get: function() { return this._postion.AltitudeType }, set: function(e) { try { this._postion.AltitudeType = e } catch (e) { console.log(e) } } }, Cartesian: { get: function() { return this._postion.Cartesian }, set: function(e) { try { this._postion.Cartesian = e } catch (e) { console.log(e) } } }, Distance: { get: function() { return this._postion.Distance }, set: function(e) { try { this._postion.Distance = e } catch (e) { console.log(e) } } }, Pitch: { get: function() { return this._postion.Pitch }, set: function(e) { try { this._postion.Pitch = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, Roll: { get: function() { return this._postion.Roll }, set: function(e) { try { this._postion.Roll = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, X: { get: function() { return this._postion.X }, set: function(e) { try { this._postion.X = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Y: { get: function() { return this._postion.Y }, set: function(e) { try { this._postion.Y = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Yaw: { get: function() { return this._postion.Yaw }, set: function(e) { try { this._postion.Yaw = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } } } }), go.prototype.execute = function(e, t, i = {}, o) { var r = this._viewer, n = this._cesium; if (this._point = new k(r, n), this._polyline = new M(r, n), this._polygon = new A(r, n), this._core, 0 == e && 0 == t) return this._polyline.executePolyline(i, o); if (4 == e && 1 == t) return this._elevationContour.executeContourMaterial(o); if (0 == e && 1 == t) return this._polygon.executePolygon(i, o); if (0 == e && 11 == t) return this._polygon.executePolygonvideo(o, i); if (1 == e && 1 == t) return this._box.executeBox(o); if (1 == e && 2 == t) return this._cone.executeCone(o); if (1 == e && 3 == t) return this._cone.executeCylinder(o); if (1 == e && 4 == t) return this._ellipsoid.executeEllipsoid(o); if (1 == e && 5 == t) return this._rectangle.createRectangle(i, o); if (1 == e && 6 == t) return this._circle.executeClircle(o); if (1 == e && 7 == t) return this._polygon.executeSector(o, i); if (1 == e && 8 == t) return this._box.executeExcavation(i, o); if (1 == e && 9 == t) return this._box.executeExcavation(i, o); if (1 == e && 10 == t) return this._circle.executeClirclews(o); if (1 == e && 11 == t) return this._point.executePoint(o, i); if (1 == e && 12 == t) return this._rectangle.createRectangledxkz(o); if (0 == e && 2 == t) return this._polyline.executeHorizontals(o, i); if (0 == e && 3 == t) return this._polygon.executePolygoncl(o, i); if (0 == e && 4 == t) return this._polyline.executeHorizontal(o, i); if (0 == e && 10 == t) return this._polyline.executePolyline1(o, i); if (0 == e && 5 == t) return this._polyline.executeHeightTe(o, i); if (0 == e && 6 == t) return this._polyline.executeAnge(o, i); if (0 == e && 9 == t) return this._polyline.executeAngeSd(o, i); if (0 != e || 7 != t) { if (0 == e && 8 == t) return this._polygon.spaceArea(i, o); if (0 == e && 12 == t) return this._polyline.executeAngle(o, i); if (0 == e && 13 == t) this._point.executePointp(o, i); else { if (2 == e && 0 == t) return this._polyline.executeProfile(i, o); if (2 == e && 1 == t) return this._polygon.executePolygonym(o); if (2 == e && 2 == t) { let e = new A(r, n); return e.executePolygonymsd(i, o) } if (2 == e && 3 == t) return this._dynamicObject.executeFlycesium(o); if (2 == e && 4 == t) return this._polygon.executePolygonymsdtt(i, o); if (2 == e && 5 == t) return this._rectangle.createRectanglelbj(i, o); if (2 == e && 6 == t) return this._polyline.executeProfilePro(i, o); if (3 == e && 0 == t) "" != i && null != i && (o = new Date(i), o = n.JulianDate.fromDate(o), r .clock.currentTime = o.clone()); else if (3 == e && 1 == t) this._viewer.animation.viewModel.faster(); else if (3 == e && 2 == t) this._viewer.animation.viewModel.slower(); else if (3 == e && 3 == t) this._viewer.animation.viewModel.playForwardViewModel.command(); else if (3 == e && 4 == t) this._viewer.animation.viewModel.playReverseViewModel.command(); else if (3 == e && 5 == t) this._viewer.animation.viewModel.pauseViewModel.command(); else { if (3 == e && 6 == t) return r = n.Cartographic.fromCartesian(i), { lon: n.Math.toDegrees(r.longitude), lat: n.Math.toDegrees(r.latitude), hei: r.height }; 3 == e && 7 == t && this._scopefieldvision.executeScopefieldvision() } } } }, _o.prototype.execute = function(e, t, i, o) { return this._execute.execute(e, t, i, o) }; var fo = Object.freeze({ L_Click: "OnLButtonClk", L_DBL_Click: "OnLButtonDblClk", L_Down: "OnLButtonDown", L_Up: "OnLButtonUp", M_Click: "OnMButtonClk", M_Down: "OnMButtonDown", M_Up: "OnMButtonUp", R_Click: "OnRButtonClk", R_Down: "OnRButtonDown", R_Up: "OnRButtonUp", Move: "OnFrame", Wheel: "OnMouseWheel" }); function yo(e, t = {}) { this._viewer = e, this.radius = this.defaultValue(t.radius, 50), this.alpha = this.defaultValue(t.alpha, 1), this.rectangleHeight = t.height, this.minRadius = this.defaultValue(t.minRadius, 1), this.maxRadius = this.defaultValue(t.maxRadius, 50), this.flyTo = this.defaultValue(t.flyTo, !0), this.datas = [], t .dynamic && this.dynamicAdjust(!0) } function vo(e, t = {}) { this._viewer = e, this.radius = this.defaultValue(t.radius, 50), this.minRadius = this.defaultValue(t .minRadius, 1), this.maxRadius = this.defaultValue(t.maxRadius, 50), this.blur = this.defaultValue(t .blur, .85), this.alpha = this.defaultValue(t.alpha, 1), this.rectangleHeight = t.height, this .is3D = t.type && -1 < t.type.indexOf("3D"), this.is3D && (this._3DOption = { width: t.TIN_X || 200, height: t.TIN_Y || 200, grid: this.defaultValue(t.showTIN, !1), scale: this.defaultValue(t.colorScale, 1), z: this.defaultValue(t.minHeight, 100) }), this.minOpacity = this.defaultValue(t.minOpacity, .1), this.maxOpacity = this.defaultValue(t .maxOpacity, .8), this.gradient = this.defaultValue(t.gradient, { ".3": "blue", ".5": "green", ".7": "yellow", ".95": "red" }), this.flyTo = this.defaultValue(t.flyTo, !0), t.dynamic && !this.is3D && this.dynamicAdjust(!0), this ._core = new f, this.tooltip = this._core.CreateTooltip(), t.tooltip && this.showTooltip(!0) } yo.prototype.defaultValue = function(e, t) { return Cesium.defaultValue(e, t) }, yo.prototype.create = function(e) { this.setData(e), this.flyTo && this.flyToBounding() }, yo.prototype.setData = function(e) { let o = 1e3, r = -1e3, n = 1e3, a = -1e3, s = -1 / 0, l = 1 / 0; e.forEach(e => { var t = e.x, i = e.y; o = Math.min(t, o), n = Math.min(i, n), r = Math.max(t, r), a = Math.max(i, a), s = Math .max(e.value, s), l = Math.min(e.value, l) }); var t = r - o, i = a - n; let u = { xMin: o - t / 10, yMin: n - i / 10, xMax: r + t / 10, yMax: a + i / 10 }, c; if (this._heatmap) c = this._heatmap.canvas, this._heatmap.clear(); else { c = document.createElement("canvas"), document.body.appendChild(c), c.width = 1e3, c.height = parseInt(1e3 / (u.xMax - u.xMin) * (u.yMax - u.yMin)); try { this._heatmap = createWebGLHeatmap({ canvas: c, intensityToAlpha: !0 }) } catch (e) { console.error(e) } } this.datas = []; let h = s - l; e.forEach(e => { var t = (e.x - u.xMin) / (u.xMax - u.xMin) * c.clientWidth, i = (-(e.y - u.yMin) / (u.yMax - u.yMin) + 1) * c.clientHeight; this.datas.push({ x: t, y: i, size: this.radius, intensity: (e.value - l) / h }) }), this._heatmap.addPoints(this.datas), this._heatmap.adjustSize(), this._heatmap.update(), this ._heatmap.display(), this.drawHeatmapRect(c, u), this.rectangle = Cesium.Rectangle.fromDegrees(u .xMin, u.yMin, u.xMax, u.yMax); t = Cesium.BoundingSphere.fromRectangle3D(this.rectangle); this.boundingRadius = t.radius }, yo.prototype.flyToBounding = function() { this._viewer.camera.flyTo({ destination: this.rectangle }) }, yo.prototype.drawHeatmapRect = function(e, t) { this._worldRectangle && this._viewer.scene.primitives.remove(this._worldRectangle); e = this.convertCanvasToImage(e); let i = void 0 === this.rectangleHeight ? Cesium.GroundPrimitive : Cesium.Primitive; this._worldRectangle = this._viewer.scene.primitives.add(new i({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ rectangle: Cesium.Rectangle.fromDegrees(t.xMin, t.yMin, t.xMax, t.yMax), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, height: this.rectangleHeight }) }), appearance: new Cesium.EllipsoidSurfaceAppearance({ aboveGround: !1, material: new Cesium.Material({ fabric: { type: "Image", uniforms: { image: e.src } } }) }) })), this.setAlpha(0), setTimeout(() => { this.setAlpha(this.alpha) }, 100) }, yo.prototype.destroy = function() { this.dynamicAdjust(!1), this._viewer.scene.primitives.remove(this._worldRectangle), this._heatmap .clear(), this._heatmap.canvas.remove() }, yo.prototype.dynamicAdjust = function(e) { e ? this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent, this) : this._viewer.clock .onTick.removeEventListener(this.dynamicAdjustEvent, this) }, yo.prototype.dynamicAdjustEvent = function() { if (this._heatmap && this._viewer) { var t = this._viewer.camera.positionCartographic; let e = (t.height - this._viewer.scene.globe.getHeight(t)) / this.boundingRadius * this.maxRadius; (e = (e = (e = e.toFixed(1)) > this.maxRadius ? this.maxRadius : e) < this.minRadius ? this .minRadius : e) !== this.radius && e <= this.maxRadius && e >= this.minRadius && this .changeRadius(e) } }, yo.prototype.updateHeatmap = function() { this._heatmap.adjustSize(), this._heatmap.update(), this._heatmap.display(); var e = this.convertCanvasToImage(this._heatmap.canvas); this._worldRectangle.appearance.material.uniforms.image = e.src }, yo.prototype.multiply = function(e) { this._heatmap.multiply(e), this.updateHeatmap() }, yo.prototype.changeRadius = function(t) { this.radius = t, this.datas.forEach(e => { e.size = t }), this._heatmap.clear(), this._heatmap.addPoints(this.datas), this.updateHeatmap() }, yo.prototype.clamp = function(e, t) { this._heatmap.clamp(e, t), this.updateHeatmap() }, yo.prototype.blur = function() { this._heatmap.blur(), this.updateHeatmap() }, yo.prototype.show = function(e) { this._worldRectangle && (this._worldRectangle.show = e) }, yo.prototype.setAlpha = function(e) { this._worldRectangle && (this._worldRectangle.appearance.material.uniforms.color.alpha = e) }, yo.prototype.convertCanvasToImage = function(e) { var t = new Image; return t.src = e.toDataURL("image/png"), t }, vo.prototype.defaultValue = function(e, t) { return Cesium.defaultValue(e, t) }, vo.prototype.create = function(e) { this.setData(e), this.flyTo && this.flyToBounding() }, vo.prototype.setData = function(e) { let o = 1e3, r = -1e3, n = 1e3, a = -1e3, s = -1 / 0, l = 1 / 0; e.forEach(function(e) { var t = e.x, i = e.y; o = Math.min(t, o), n = Math.min(i, n), r = Math.max(t, r), a = Math.max(i, a), s = Math .max(e.value, s), l = Math.min(e.value, l) }); var t = r - o, i = a - n; let u = { xMin: o - t / 10, yMin: n - i / 10, xMax: r + t / 10, yMax: a + i / 10 }, c = parseInt(1e3 / (u.xMax - u.xMin) * (u.yMax - u.yMin)); if (this.heatmapInstance) this.heatmapInstance._renderer.canvas.setAttribute("style", "width:1000px;height:" + c + "px;"); else { let e = document.createElement("div"); e.setAttribute("style", "width:1000px;height:" + c + "px;display:none;"), document.body.appendChild( e), this.heatmapInstance = h337.create({ container: e, maxOpacity: this.maxOpacity, minOpacity: this.minOpacity, blur: this.blur, radius: this.radius, gradient: this.gradient }) } var h = [], t = (e.forEach(function(e) { var t = (e.x - u.xMin) / (u.xMax - u.xMin) * 1e3, i = (-(e.y - u.yMin) / (u.yMax - u.yMin) + 1) * c, t = { x: Math.round(t), y: Math.round(i), value: e.value }; h.push(t) }), this.datas = { max: s, min: l, data: h }, this.heatmapInstance.setData(this.datas), this.heatmapcanvas = this.heatmapInstance._renderer .canvas, this.drawHeatmapRect(this.heatmapcanvas, u), this.rectangle = Cesium.Rectangle .fromDegrees(u.xMin, u.yMin, u.xMax, u.yMax), Cesium.BoundingSphere.fromRectangle3D(this .rectangle)); this.boundingRadius = t.radius, this.extent = u }, vo.prototype.flyToBounding = function() { this._viewer.camera.flyTo({ destination: this.rectangle }) }, vo.prototype.destroy = function() { this.dynamicAdjust(!1), this._viewer.scene.primitives.remove(this._worldRectangle), this.heatmapcanvas .remove(), this.showTooltip(!1) }, vo.prototype.dynamicAdjust = function(e) { e ? this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent, this) : this._viewer.clock .onTick.removeEventListener(this.dynamicAdjustEvent, this) }, vo.prototype.dynamicAdjustEvent = function() { if (this.heatmapInstance && this._viewer) { var t = this._viewer.camera.positionCartographic; let e = (t.height - this._viewer.scene.globe.getHeight(t)) / this.boundingRadius * this.maxRadius; (e = (e = (e = e.toFixed(1)) > this.maxRadius ? this.maxRadius : e) < this.minRadius ? this .minRadius : e) !== this.radius && e <= this.maxRadius && e >= this.minRadius && this .changeRadius(e) } }, vo.prototype.changeRadius = async function(e) { for (var t in this.radius = e, this.heatmapInstance._store._radi) for (var i in this.heatmapInstance._store._radi[t]) this.heatmapInstance._store._radi[t][i] = e; this.heatmapInstance._coordinator.emit("renderall", this.heatmapInstance._store._getInternalData()), this.updateHeatmap() }, vo.prototype.drawHeatmapRect = function(t, i) { this._worldRectangle && this._viewer.scene.primitives.remove(this._worldRectangle); t = this.convertCanvasToImage(t); if (this.is3D) Object.assign(this._3DOption, i), this.create3DHeatmap(t); else { let e = void 0 === this.rectangleHeight ? Cesium.GroundPrimitive : Cesium.Primitive; this._worldRectangle = this._viewer.scene.primitives.add(new e({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ rectangle: Cesium.Rectangle.fromDegrees(i.xMin, i.yMin, i.xMax, i.yMax), vertexFormat: Cesium.EllipsoidSurfaceAppearance .VERTEX_FORMAT, height: this.rectangleHeight }) }), appearance: new Cesium.EllipsoidSurfaceAppearance({ aboveGround: !0, material: new Cesium.Material({ fabric: { type: "Image", uniforms: { image: t.src } } }) }) })), this.setAlpha(0), setTimeout(() => { this.setAlpha(this.alpha) }, 100) } }, vo.prototype.create3DHeatmap = function(t) { let e = document.createElement("canvas"), r = this._3DOption, n = r.width + 1, a = r.height + 1, s = (e.width = n, e.height = a, e.getContext("2d")), l = [], u = 0; t.onload = () => { s.drawImage(t, 0, 0, n, a); var i = s.getImageData(0, 0, n, a); for (let t = 0; t < i.height; t++) for (let e = 0; e < i.width; e++) { var o = 4 * t * i.width + 4 * e; l[u++] = i.data[3 + o] } s.putImageData(i, 0, 0, 0, 0, i.width, i.height), r.imgData = l; var e = new Cesium.GeometryInstance({ geometry: this.create3DGeometry(r) }), e = new Cesium.Primitive({ geometryInstances: e, appearance: new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { type: "Image", uniforms: { image: t.src } } }) }), asynchronous: !1 }); this._worldRectangle = this._viewer.scene.primitives.add(e), this.setAlpha(0), setTimeout( () => { this.setAlpha(this.alpha) }, 100) } }, vo.prototype.create3DGeometry = function(e) { var t = this.construct3DRectangle(e); return new Cesium.Geometry({ attributes: { position: new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: t.positions }), st: new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: t.st }) }, indices: t.indexs, primitiveType: e.grid ? Cesium.PrimitiveType.LINES : Cesium.PrimitiveType.TRIANGLES, boundingSphere: Cesium.BoundingSphere.fromVertices(t.positions) }) }, vo.prototype.construct3DRectangle = function(e) { for (var t = e.imgData, i = e.xMax - e.xMin, o = e.yMax - e.yMin, r = e.width, n = e.height, a = i / r, s = o / n, l = r + 1, u = n + 1, c = new Float64Array(l * u * 3), h = 0, m = new Float32Array(l * u * 2), d = 0, p = new Uint16Array(r * n * 2 * 3), g = 0, _ = 0; _ < u; _++) for (var f = 0; f < l; f++) { var y = e.xMin + a * f, v = e.yMin + s * _, y = Cesium.Cartesian3.fromDegrees(y, v, t[(n - _) * l + f] * e.scale + e.z); c[h++] = y.x, c[h++] = y.y, c[h++] = y.z, m[d++] = a * f / i, m[d++] = s * _ / o, 0 != _ && 0 != f && (p[g++] = (_ - 1) * l + (f - 1), p[g++] = (_ - 1) * l + f, p[g++] = _ * l + f - 1, p[g++] = (_ - 1) * l + f, p[g++] = _ * l + f, p[g++] = _ * l + f - 1) } return { positions: c, st: m, indexs: p } }, vo.prototype.get3DShader = function() { return "uniform sampler2D image;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n vec2 repeat = vec2(1.0,1.0);\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec4 j_color = texture2D(image, fract(repeat * materialInput.st)).rgba; \n material.diffuse = j_color.rgb; \n material.alpha = j_color.a;\n return material;\n }\n " }, vo.prototype.showTooltip = function(e) { e ? (this.tooltipHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this .tooltipHandler.setInputAction(e => { var t, i = this._viewer.scene.pickPosition(e.endPosition); this.heatmapInstance && this.extent && i ? (t = ((i = this._core.toDegrees(i)).lon - this.extent.xMin) / (this.extent.xMax - this.extent.xMin) * this .heatmapcanvas.width, i = (-(i.lat - this.extent.yMin) / (this.extent.yMax - this.extent.yMin) + 1) * this.heatmapcanvas.height, t <= this .heatmapcanvas.width && 0 <= t & i <= this.heatmapcanvas.height && 0 <= i ? (t = this.heatmapInstance.getValueAt({ x: Math.round(t), y: Math.round(i) }), this.tooltip.showAt(e.endPosition, t)) : this.tooltip.show(!1)) : this .tooltip.show(!1) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE)) : (this.tooltip.show(!1), this.tooltipHandler && this.tooltipHandler.destroy(), this.tooltipHandler = void 0) }, vo.prototype.updateHeatmap = function() { this.heatmapcanvas = this.heatmapInstance._renderer.canvas; var e = this.convertCanvasToImage(this.heatmapcanvas); this._worldRectangle.appearance.material.uniforms.image = e.src }, vo.prototype.show = function(e) { this._worldRectangle && (this._worldRectangle.show = e) }, vo.prototype.setAlpha = function(e) { this._worldRectangle && (this._worldRectangle.appearance.material.uniforms.color.alpha = e) }, vo.prototype.config = function(e) { this.heatmapInstance.configure(e), this.updateHeatmap() }, vo.prototype.convertCanvasToImage = function(e) { var t = new Image; return t.src = e.toDataURL("image/png"), t }; const Co = new Map([ ["centerX", Float64Array.BYTES_PER_ELEMENT], ["centerY", Float64Array.BYTES_PER_ELEMENT], ["centerZ", Float64Array.BYTES_PER_ELEMENT], ["minHeight", Float32Array.BYTES_PER_ELEMENT], ["maxHeight", Float32Array.BYTES_PER_ELEMENT], ["boundingSphereCenterX", Float64Array.BYTES_PER_ELEMENT], ["boundingSphereCenterY", Float64Array.BYTES_PER_ELEMENT], ["boundingSphereCenterZ", Float64Array.BYTES_PER_ELEMENT], ["boundingSphereRadius", Float64Array.BYTES_PER_ELEMENT], ["horizonOcclusionPointX", Float64Array.BYTES_PER_ELEMENT], ["horizonOcclusionPointY", Float64Array.BYTES_PER_ELEMENT], ["horizonOcclusionPointZ", Float64Array.BYTES_PER_ELEMENT] ]); function wo(e) { return e >> 1 ^ -(1 & e) } function bo(e, t, i, o, r = !0) { let n; if (n = new(2 === o ? Uint16Array : Uint32Array)(e, t, i), !r) return n; let a = 0; for (let e = 0; e < n.length; ++e) { var s = n[e]; n[e] = a - s, 0 === s && ++a } return n } function To(e, t) { const i = {}; if (e.byteLength <= t) return { extensions: i, extensionsEndPosition: t }; let o = t; for (; o < e.byteLength;) { var r = e.getUint8(o, !0), n = (o += Uint8Array.BYTES_PER_ELEMENT, e.getUint32(o, !0)), a = (o += Uint32Array.BYTES_PER_ELEMENT, new DataView(e.buffer, o, n)); switch (r) { case 1: i.vertexNormals = new Uint8Array(a.buffer, a.byteOffset, a.byteLength); break; case 2: i.waterMask = a.buffer.slice(a.byteOffset, a.byteOffset + a.byteLength); break; default: console.warn("Unknown extension with id " + r) } o += n } return { extensions: i, extensionsEndPosition: o } } const So = { header: 0, vertices: 1, triangleIndices: 2, edgeIndices: 3, extensions: 4 }, Po = { maxDecodingStep: So.extensions }; function Eo(e, t) { var t = Object.assign({}, Po, t), e = new DataView(e), { header: i, headerEndPosition: o } = function(e) { let t = 0; const i = {}; for (var [o, r] of Co) { const n = 8 === r ? e.getFloat64 : e.getFloat32; i[o] = n.call(e, t, !0), t += r } return { header: i, headerEndPosition: t } }(e); if (t.maxDecodingStep < So.vertices) return { header: i }; var { vertexData: o, vertexDataEndPosition: r } = function(t, e) { var i = t.getUint32(e, !0); const o = new Uint16Array(3 * i); e += Uint32Array.BYTES_PER_ELEMENT; var r = Uint16Array.BYTES_PER_ELEMENT, n = i * r, a = e, s = a + n, l = s + n; let u = 0, c = 0, h = 0; for (let e = 0; e < i; e++) u += wo(t.getUint16(a + r * e, !0)), c += wo(t.getUint16(s + r * e, !0)), h += wo(t.getUint16(l + r * e, !0)), o[e] = u, o[e + i] = c, o[e + 2 * i] = h; return e += 3 * n, { vertexData: o, vertexDataEndPosition: e } }(e, o); if (t.maxDecodingStep < So.triangleIndices) return { header: i, vertexData: o }; var { triangleIndices: r, triangleIndicesEndPosition: n } = function(e, t, i) { let o = i; return i = (65536 < t.length / 3 ? Uint32Array : Uint16Array).BYTES_PER_ELEMENT, o % i != 0 && (o += i - o % i), t = e.getUint32(o, !0), o += Uint32Array.BYTES_PER_ELEMENT, t *= 3, e = bo(e.buffer, o, t, i), { triangleIndicesEndPosition: o += t * i, triangleIndices: e } }(e, o, r); if (t.maxDecodingStep < So.edgeIndices) return { header: i, vertexData: o, triangleIndices: r }; a = e, n = n, l = (65536 < (l = o).length / 3 ? Uint32Array : Uint16Array).BYTES_PER_ELEMENT, s = a .getUint32(n, !0), n += Uint32Array.BYTES_PER_ELEMENT, u = bo(a.buffer, n, s, l, !1), s = a.getUint32( n += s * l, !0), n += Uint32Array.BYTES_PER_ELEMENT, c = bo(a.buffer, n, s, l, !1), s = a.getUint32( n += s * l, !0), n += Uint32Array.BYTES_PER_ELEMENT, h = bo(a.buffer, n, s, l, !1), s = a.getUint32( n += s * l, !0), n += Uint32Array.BYTES_PER_ELEMENT, a = bo(a.buffer, n, s, l, !1); var a, { westIndices: s, southIndices: l, eastIndices: n, northIndices: u, edgeIndicesEndPosition: c } = { edgeIndicesEndPosition: n += s * l, westIndices: u, southIndices: c, eastIndices: h, northIndices: a }; if (t.maxDecodingStep < So.extensions) return { header: i, vertexData: o, triangleIndices: r, westIndices: s, northIndices: u, eastIndices: n, southIndices: l }; var h = To(e, c)["extensions"]; return { header: i, vertexData: o, triangleIndices: r, westIndices: s, northIndices: u, eastIndices: n, southIndices: l, extensions: h } } function xo(e, t = {}) { this.sgworld = e, this.contourUniforms = void 0, this.shadingUniforms = void 0, this.min = { elevation: 10, slope: 0 }, this.max = { elevation: 2e3, slope: 70 }, this.width = t.width || 2, this.spacing = t.spacing || 150, this.tf = !1, this.contourColor = t .contourColor || "#ff0000", this.type = "none", this.Contour = void 0, this.startColor = t.startColor || "#0055ff", this.endColor = t.endColor || "#ff0000", this.colorArr = this.sgworld.Core.gradientColor(this .startColor, this.endColor, 7), this.changeSlopeColor = void 0 !== t.changeSlopeColor && t .changeSlopeColor } xo.prototype.render = function() { "slope" === this.type ? (Cesium.ExpandBySmartEarth.displaySlopeMap = !0, this.changeSlopeColor && this .setShopeColor()) : Cesium.ExpandBySmartEarth.displaySlopeMap = !1, this.Contour = this.sgworld .Analysis.createElevationContour(this.tf, "slope" === this.type ? "none" : this.type, { colorArr: this.colorArr, min: this.min[this.type], max: this.max[this.type], width: this.width, spacing: this.spacing, lineColor: this.contourColor }), this.shadingUniforms = this.Contour.item.shadingUniforms, this.contourUniforms = this.Contour .item.contourUniforms }, xo.prototype.setContourColor = function(e) { this.contourColor = e, this.Contour && this.Contour.setMaterialColor(this.contourColor) }, xo.prototype.setShopeColor = function() { let i = [], o = [0, 6, 17, 31, 45, 70, 90]; this.colorArr.forEach((e, t) => { i.unshift({ val: 100 * Math.cos(Cesium.Math.toRadians(o[t])), color: e }) }), Cesium.ExpandBySmartEarth.SlopeMapPallete = i, Cesium.ExpandBySmartEarth.isSlopeDirty = !0 }, xo.prototype.setWidth = function(e) { this.width = e, this.Contour && this.Contour.setWidth(this.width) }, xo.prototype.setSpacing = function(e) { this.spacing = e, this.Contour && this.Contour.setSpacing(this.spacing) }, xo.prototype.setStartColor = function(e) { this.startColor = e, this.colorArr = this.sgworld.Core.gradientColor(this.startColor, this.endColor, 7), this.render() }, xo.prototype.setEndColor = function(e) { this.endColor = e, this.colorArr = this.sgworld.Core.gradientColor(this.startColor, this.endColor, 7), this.render() }, xo.prototype.setMin = function(e) { this.min[this.type] = e, "elevation" === this.type ? this.shadingUniforms.minimumHeight = this.min[this .type] : this.render() }, xo.prototype.setMax = function(e) { this.max[this.type] = e, "elevation" === this.type ? this.shadingUniforms.maximumHeight = this.max[this .type] : this.render() }, xo.prototype.reset = function() { this.contourColor = "#ff0000", this.startColor = "#0055ff", this.endColor = "#ff0000", this.colorArr = this.sgworld.Core.gradientColor(this.startColor, this.endColor, 7), this.render() }; var j = { version: "1.0.0" }, Io = "doublearrow", Do = .25, Lo = .3, Mo = .85, Ao = .15, Ro = { headHeightFactor: .18, headWidthFactor: .3, neckHeightFactor: .85, neckWidthFactor: .15, tailWidthFactor: .1, headTailFactor: .8, swallowTailFactor: 1 }, Oo = { tailWidthFactor: .15, neckWidthFactor: .2, headWidthFactor: .25, headAngle: Math.PI / 8.5, neckAngle: Math.PI / 13 }, z = (j.algorithm = {}, j.algorithm.doubleArrow = function(e) { this.connPoint = null; var t = { controlPoint: this.tempPoint4 = null, polygonalPoint: null }; if (!((n = (this.points = e).length) < 2)) { if (2 == n) return e; var i = this.points[0], o = this.points[1], r = this.points[2], n = e.length, n = (this.tempPoint4 = 3 == n ? j.algorithm.getTempPoint4(i, o, r) : this.points[3], this .connPoint = 3 == n || 4 == n ? z.PlotUtils.mid(i, o) : this.points[4], e = z.PlotUtils .isClockWise(i, o, r) ? (u = j.algorithm.getArrowPoints(i, this.connPoint, this .tempPoint4, !1), j.algorithm.getArrowPoints(this.connPoint, o, r, !0)) : (u = j .algorithm.getArrowPoints(o, this.connPoint, r, !1), j.algorithm.getArrowPoints(this .connPoint, i, this.tempPoint4, !0)), u.length), a = (n - 5) / 2, s = u.slice(0, a), l = u.slice(a, 5 + a), u = u.slice(5 + a, n), c = e.slice(0, a), h = e.slice(a, 5 + a), e = e.slice(5 + a, n), c = z.PlotUtils.getBezierPoints(c), a = z.PlotUtils.getBezierPoints(e.concat(s.slice(1))), u = z.PlotUtils.getBezierPoints(u), n = c.concat(h, a, l, u), e = j.algorithm.array2Dto1D(n); t.controlPoint = [i, o, r, this.tempPoint4, this.connPoint], t.polygonalPoint = Cesium .Cartesian3.fromDegreesArray(e) } return t }, j.algorithm.threeArrow = function(e) { this.connPoint = null, this.tempPoint4 = null; var t = { controlPoint: this.tempPoint5 = null, polygonalPoint: null }; if (2 <= (n = (this.points = e).length)) { if (2 == n) return e; var i = this.points[0], o = this.points[1], r = this.points[2], n = (3 == (n = e.length) ? (this.tempPoint4 = j.algorithm.getTempPoint4(i, o, r), this .tempPoint5 = z.PlotUtils.mid(r, this.tempPoint4)) : (this.tempPoint4 = this.points[ 3], this.tempPoint5 = this.points[4]), this.connPoint = n < 6 ? z.PlotUtils.mid(i, o) : this.points[5], e = z.PlotUtils.isClockWise(i, o, r) ? (u = j.algorithm .getArrowPoints(i, this.connPoint, this.tempPoint4, !1), j.algorithm.getArrowPoints( this.connPoint, o, r, !0)) : (u = j.algorithm.getArrowPoints(o, this.connPoint, r, !1), j.algorithm.getArrowPoints(this.connPoint, i, this.tempPoint4, !0)), u .length), a = (n - 5) / 2, s = u.slice(0, a), l = u.slice(a, 5 + a), u = u.slice(5 + a, n), c = e.slice(0, a), h = e.slice(a, 5 + a), e = e.slice(5 + a, n), c = z.PlotUtils.getBezierPoints(c), a = z.PlotUtils.getBezierPoints(e.concat(s.slice(1))), u = z.PlotUtils.getBezierPoints(u), n = c.concat(h, a, l, u), e = j.algorithm.array2Dto1D(n); t.controlPoint = [i, o, r, this.tempPoint4, this.tempPoint5, this.connPoint], t.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(e) } return t }, j.algorithm.array2Dto1D = function(e) { var t = []; return e.forEach(function(e) { t.push(e[0]), t.push(e[1]) }), t }, j.algorithm.getArrowPoints = function(e, t, i, o) { this.type = Io, this.headHeightFactor = Do, this.headWidthFactor = Lo, this.neckHeightFactor = Mo, this.neckWidthFactor = Ao; var r = z.PlotUtils.mid(e, t), n = z.PlotUtils.distance(r, i), a = z.PlotUtils.getThirdPoint(i, r, 0, .3 * n, !0), s = z.PlotUtils.getThirdPoint(i, r, 0, .5 * n, !0), a = [r, z.PlotUtils.getThirdPoint(r, a, z.Constants.HALF_PI, n / 5, o), z.PlotUtils .getThirdPoint(r, s, z.Constants.HALF_PI, n / 4, o), i ], r = j.algorithm.getArrowHeadPoints(a, this.headHeightFactor, this.headWidthFactor, this .neckHeightFactor, this.neckWidthFactor), s = r[0], n = r[4], o = z.PlotUtils.distance(e, t) / z.PlotUtils.getBaseLength(a) / 2, i = j.algorithm.getArrowBodyPoints(a, s, n, o), a = i.length, o = i.slice(0, a / 2), i = i.slice(a / 2, a); return o.push(s), i.push(n), (o = o.reverse()).push(t), (i = i.reverse()).push(e), o.reverse() .concat(r, i) }, j.algorithm.getArrowHeadPoints = function(e, t, i) { this.type = Io, this.headHeightFactor = Do, this.headWidthFactor = Lo, this.neckHeightFactor = Mo, this.neckWidthFactor = Ao; var o = z.PlotUtils.getBaseLength(e) * this.headHeightFactor, r = e[e.length - 1], t = (z.PlotUtils.distance(t, i), o * this.headWidthFactor), i = o * this.neckWidthFactor, n = o * this.neckHeightFactor, o = z.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, o, !0), e = z.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, n, !0), n = z.PlotUtils.getThirdPoint(r, o, z.Constants.HALF_PI, t, !1), o = z.PlotUtils.getThirdPoint(r, o, z.Constants.HALF_PI, t, !0); return [z.PlotUtils.getThirdPoint(r, e, z.Constants.HALF_PI, i, !1), n, r, o, z.PlotUtils .getThirdPoint(r, e, z.Constants.HALF_PI, i, !0) ] }, j.algorithm.getArrowBodyPoints = function(e, t, i, o) { for (var r = z.PlotUtils.wholeDistance(e), n = z.PlotUtils.getBaseLength(e) * o, a = (n - z .PlotUtils.distance(t, i)) / 2, s = 0, l = [], u = [], c = 1; c < e.length - 1; c++) { var h = z.PlotUtils.getAngleOfThreePoints(e[c - 1], e[c], e[c + 1]) / 2, m = (n / 2 - (s += z.PlotUtils.distance(e[c - 1], e[c])) / r * a) / Math.sin(h), d = z.PlotUtils.getThirdPoint(e[c - 1], e[c], Math.PI - h, m, !0), h = z.PlotUtils.getThirdPoint(e[c - 1], e[c], h, m, !1); l.push(d), u.push(h) } return l.concat(u) }, j.algorithm.getTempPoint4 = function(e, t, i) { var o, r, n, t = z.PlotUtils.mid(e, t), a = z.PlotUtils.distance(t, i), i = z.PlotUtils.getAngleOfThreePoints(e, t, i), a = i < z.Constants.HALF_PI ? (o = a * Math.sin(i), r = a * Math.cos(i), n = z.PlotUtils .getThirdPoint(e, t, z.Constants.HALF_PI, o, !1), z.PlotUtils.getThirdPoint(t, n, z .Constants.HALF_PI, r, !0)) : i >= z.Constants.HALF_PI && i < Math.PI ? (o = a * Math .sin(Math.PI - i), r = a * Math.cos(Math.PI - i), n = z.PlotUtils.getThirdPoint(e, t, z .Constants.HALF_PI, o, !1), z.PlotUtils.getThirdPoint(t, n, z.Constants.HALF_PI, r, !1) ) : i >= Math.PI && i < 1.5 * Math.PI ? (o = a * Math.sin(i - Math.PI), r = a * Math.cos(i - Math.PI), n = z.PlotUtils.getThirdPoint(e, t, z.Constants.HALF_PI, o, !0), z.PlotUtils .getThirdPoint(t, n, z.Constants.HALF_PI, r, !0)) : (o = a * Math.sin(2 * Math.PI - i), r = a * Math.cos(2 * Math.PI - i), n = z.PlotUtils.getThirdPoint(e, t, z.Constants.HALF_PI, o, ! 0), z.PlotUtils.getThirdPoint(t, n, z.Constants.HALF_PI, r, !1)); return a }, j.algorithm.tailedAttackArrow = function(e) { e = j.algorithm.dereplication(e), this.tailWidthFactor = Ro.tailWidthFactor, this .swallowTailFactor = Ro.swallowTailFactor, this.swallowTailPnt = Ro.swallowTailPnt; var t = { controlPoint: null, polygonalPoint: null }; if (!((t.controlPoint = e).length < 2)) { if (2 == e.length) return t.polygonalPoint = e, t; var i = e[0], o = e[1]; z.PlotUtils.isClockWise(e[0], e[1], e[2]) && (i = e[1], o = e[0]); var e = [z.PlotUtils.mid(i, o)].concat(e.slice(2)), r = j.algorithm.getAttackArrowHeadPoints(e, i, o, Ro), n = r[0], a = r[4], s = z.PlotUtils.distance(i, o), l = z.PlotUtils.getBaseLength(e), u = l * this.tailWidthFactor * this.swallowTailFactor; this.swallowTailPnt = z.PlotUtils.getThirdPoint(e[1], e[0], 0, u, !0); u = j.algorithm.getAttackArrowBodyPoints(e, n, a, s / l), e = u.length, s = [i].concat(u.slice( 0, e / 2)), l = (s.push(n), [o].concat(u.slice(e / 2, e))); l.push(a), s = z.PlotUtils.getQBSplinePoints(s), l = z.PlotUtils.getQBSplinePoints(l), i = j .algorithm.array2Dto1D(s.concat(r, l.reverse(), [this.swallowTailPnt, s[0]])), t .polygonalPoint = Cesium.Cartesian3.fromDegreesArray(i) } return t }, j.algorithm.getAttackArrowHeadPoints = function(e, t, i, o) { this.headHeightFactor = o.headHeightFactor, this.headTailFactor = o.headTailFactor, this .headWidthFactor = o.headWidthFactor, this.neckWidthFactor = o.neckWidthFactor, this .neckHeightFactor = o.neckHeightFactor; var o = z.PlotUtils.getBaseLength(e) * this.headHeightFactor, r = e[e.length - 1], n = z.PlotUtils.distance(r, e[e.length - 2]), t = z.PlotUtils.distance(t, i), i = (o = o > t * this.headTailFactor ? t * this.headTailFactor : o) * this.headWidthFactor, t = o * this.neckWidthFactor, n = (o = n < o ? n : o) * this.neckHeightFactor, o = z.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, o, !0), e = z.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, n, !0), n = z.PlotUtils.getThirdPoint(r, o, z.Constants.HALF_PI, i, !1), o = z.PlotUtils.getThirdPoint(r, o, z.Constants.HALF_PI, i, !0); return [z.PlotUtils.getThirdPoint(r, e, z.Constants.HALF_PI, t, !1), n, r, o, z.PlotUtils .getThirdPoint(r, e, z.Constants.HALF_PI, t, !0) ] }, j.algorithm.getAttackArrowBodyPoints = function(e, t, i, o) { for (var r = z.PlotUtils.wholeDistance(e), n = z.PlotUtils.getBaseLength(e) * o, a = (n - z .PlotUtils.distance(t, i)) / 2, s = 0, l = [], u = [], c = 1; c < e.length - 1; c++) { var h = z.PlotUtils.getAngleOfThreePoints(e[c - 1], e[c], e[c + 1]) / 2, m = (n / 2 - (s += z.PlotUtils.distance(e[c - 1], e[c])) / r * a) / Math.sin(h), d = z.PlotUtils.getThirdPoint(e[c - 1], e[c], Math.PI - h, m, !0), h = z.PlotUtils.getThirdPoint(e[c - 1], e[c], h, m, !1); l.push(d), u.push(h) } return l.concat(u) }, j.algorithm.dereplication = function(e) { var t = e[e.length - 1], i = !1, o = [], o = e.filter(function(e) { if (e[0] != t[0] && e[1] != t[1]) return e; i = !0 }); return i && o.push(t), o }, j.algorithm.fineArrow = function(t, o) { var m, _, f, y, v, C; if (!(t.length < 2 || o.length < 2)) return m = Oo.tailWidthFactor, _ = Oo.neckWidthFactor, f = Oo .headWidthFactor, y = Oo.headAngle, v = Oo.neckAngle, C = [], C[0] = t, C[1] = o, e = C[0], r = C[1], n = z.PlotUtils.getBaseLength(C), g = n * m, i = n * _, s = n * f, a = z.PlotUtils .getThirdPoint(r, e, z.Constants.HALF_PI, g, !0), l = z.PlotUtils.getThirdPoint(r, e, z .Constants.HALF_PI, g, !1), u = z.PlotUtils.getThirdPoint(e, r, y, s, !1), c = z .PlotUtils.getThirdPoint(e, r, y, s, !0), p = z.PlotUtils.getThirdPoint(e, r, v, i, !1), h = z.PlotUtils.getThirdPoint(e, r, v, i, !0), (d = []).push(a[0], a[1], p[0], p[1], u[0], u[1], r[0], r[1], c[0], c[1], h[0], h[1], l[0], l[1], e[0], e[1]), Cesium.Cartesian3 .fromDegreesArray(d) }, { version: "1.0.0" }); function Ho(e, t, i, o, r, n, a) { var s = new Cesium.Credit("WMTS"), i = (r = Cesium.defaultValue(r, {}), this._7 = new Cesium.GeographicTilingScheme({ numberOfLevelZeroTilesX: 2, numberOfLevelZeroTilesY: 1 }), this._3 = 256, this._4 = 256, this._10 = Cesium.defaultValue(r.fileExtension, "jpg"), this._9 = r.proxy, this._12 = r.tileDiscardPolicy, this._2 = i, this._1 = o, this._8 = new Cesium.Rectangle( 0 - Math.PI, 0 - Math.PI / 2, Math.PI, Math.PI / 2), this._5 = new Cesium.Rectangle(0 - Math.PI, 0 - Math.PI / 2, Math.PI, Math.PI / 2), this._6 = !0, this.baseurl = e, this.needaddone = t, n && (this._0 = n, this.baseurl2 = a), Cesium.defaultValue(r.credit, s)); "string" == typeof i && (i = new Cesium.Credit(i)), this._11 = i } function Vo(e, t, i, o) { this._extractAttributes = e, this._featureName = t || "featureMember", this._xy = o, this._gmlns = i || "http://www.opengis.net/gml", this._regExes = { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g } } function ko() { this._quadtree = void 0, this._loadTileEvent = new Cesium.Event, this._tilingScheme = new Cesium .GeographicTilingScheme, this._errorEvent = new Cesium.Event, this._levelZeroMaximumError = Cesium .QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme), this .cartographicLimitRectangle = Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE), this._tileCache = [], this._primitivesWaitingToBeAddedToTheScene = [], this._pauseStreaming = !1, this._numTilesInLevel = [], this.STREAM_SPEED_IMIDIATE = 0, this.STREAM_SPEED_FAST = 1, this.STREAM_SPEED_NORMAL = 2, this .STREAM_SPEED_SLOW = 3, this._streamSpeed = this.STREAM_SPEED_NORMAL, ko.prototype.ready || Object .defineProperties(ko.prototype, { quadtree: { get: function() { return this._quadtree }, set: function(e) { this._quadtree = e } }, ready: { get: function() { return !0 } }, tilingScheme: { get: function() { return this._tilingScheme } }, errorEvent: { get: function() { return this._errorEvent } }, loadTileEvent: { get: function() { return this._loadTileEvent } }, pauseStreaming: { get: function() { return this._pauseStreaming }, set: function(e) { this._pauseStreaming = e } }, streamSpeed: { get: function() { return this._streamSpeed }, set: function(e) { this._streamSpeed = e } }, bestLevelAvailable: { get: function() { for (var e = 0, t = 0; t < 22; t++) null != this._numTilesInLevel[t] && 0 < this ._numTilesInLevel[t] && e < t && (e = t); return e } } }) } function Fo(i, e, o) { $.each(e._primitives, function(e, t) { if (t instanceof Cesium.BillboardCollection) return e = Wo.indexOf(t = t), t._parentCollection ._primitiveOld = o, -1 !== e ? (i.scene.primitives.remove(Wo[e]._parentCollection), Wo[ e] = t) : Wo.push(t), !1 }) } function Go(e, t, i) { e.scene.primitives.remove(i), t._onDestroyTilePrimitive = function() { e.scene.primitives.remove(i), this._onDestroyTilePrimitive = void 0 } } function No(e, t, i, o) { Cesium.when.all(t, function() { e.scene.primitives.remove(o) }), i._onDestroyTilePrimitive = function() { e.scene.primitives.remove(o), this._onDestroyTilePrimitive = void 0 } } function Bo(e, t, i) { No(e, $.map(t._primitives, function(e) { return e.readyPromise }), t, i) } function jo(e, t, i) { No(e, $.map(t._primitives[0]._primitives, function(e) { return e.readyPromise }), t, i) } function zo(e, t, i) { e.scene.primitives.remove(i) } function Uo(e, t, i) { No(e, [t.readyPromise], t, i) } z.PlotUtils = {}, z.PlotUtils.distance = function(e, t) { return Math.sqrt(Math.pow(e[0] - t[0], 2) + Math.pow(e[1] - t[1], 2)) }, z.PlotUtils.wholeDistance = function(e) { for (var t = 0, i = 0; i < e.length - 1; i++) t += z.PlotUtils.distance(e[i], e[i + 1]); return t }, z.PlotUtils.getBaseLength = function(e) { return Math.pow(z.PlotUtils.wholeDistance(e), .99) }, z.PlotUtils.mid = function(e, t) { return [(e[0] + t[0]) / 2, (e[1] + t[1]) / 2] }, z.PlotUtils.getCircleCenterOfThreePoints = function(e, t, i) { var o = [(e[0] + t[0]) / 2, (e[1] + t[1]) / 2], t = [o[0] - e[1] + t[1], o[1] + e[0] - t[0]], r = [(e[0] + i[0]) / 2, (e[1] + i[1]) / 2], e = [r[0] - e[1] + i[1], r[1] + e[0] - i[0]]; return z.PlotUtils.getIntersectPoint(o, t, r, e) }, z.PlotUtils.getIntersectPoint = function(e, t, i, o) { var r, n, a; return e[1] == t[1] ? [(r = (o[0] - i[0]) / (o[1] - i[1])) * (e[1] - i[1]) + i[0], a = e[1]] : i[1] == o[1] ? [(n = (t[0] - e[0]) / (t[1] - e[1])) * (i[1] - e[1]) + e[0], a = i[1]] : (n = (t[0] - e[0]) / (t[1] - e[1]), r = (o[0] - i[0]) / (o[1] - i[1]), [n * (a = (n * e[1] - e[0] - r * i[1] + i[ 0]) / (n - r)) - n * e[1] + e[0], a]) }, z.PlotUtils.getAzimuth = function(e, t) { var i, o = Math.asin(Math.abs(t[1] - e[1]) / z.PlotUtils.distance(e, t)); return t[1] >= e[1] && t[0] >= e[0] ? i = o + Math.PI : t[1] >= e[1] && t[0] < e[0] ? i = z.Constants .TWO_PI - o : t[1] < e[1] && t[0] < e[0] ? i = o : t[1] < e[1] && t[0] >= e[0] && (i = Math.PI - o), i }, z.PlotUtils.getAngleOfThreePoints = function(e, t, i) { e = z.PlotUtils.getAzimuth(t, e) - z.PlotUtils.getAzimuth(t, i); return e < 0 ? e + z.Constants.TWO_PI : e }, z.PlotUtils.isClockWise = function(e, t, i) { return (i[1] - e[1]) * (t[0] - e[0]) > (t[1] - e[1]) * (i[0] - e[0]) }, z.PlotUtils.getPointOnLine = function(e, t, i) { return [t[0] + e * (i[0] - t[0]), t[1] + e * (i[1] - t[1])] }, z.PlotUtils.getCubicValue = function(e, t, i, o, r) { var n = 1 - (e = Math.max(Math.min(e, 1), 0)), a = e * e, s = a * e, l = n * n, u = l * n; return [u * t[0] + 3 * l * e * i[0] + 3 * n * a * o[0] + s * r[0], u * t[1] + 3 * l * e * i[1] + 3 * n * a * o[1] + s * r[1] ] }, z.PlotUtils.getThirdPoint = function(e, t, i, o, r) { e = z.PlotUtils.getAzimuth(e, t), r = r ? e + i : e - i, e = o * Math.cos(r), i = o * Math.sin(r); return [t[0] + e, t[1] + i] }, z.PlotUtils.getArcPoints = function(e, t, i, o) { for (var r = [], n = (n = o - i) < 0 ? n + z.Constants.TWO_PI : n, a = 0; a <= z.Constants .FITTING_COUNT; a++) { var s = i + n * a / z.Constants.FITTING_COUNT, l = e[0] + t * Math.cos(s), s = e[1] + t * Math.sin(s); r.push([l, s]) } return r }, z.PlotUtils.getBisectorNormals = function(e, t, i, o) { var r, n, a = z.PlotUtils.getNormal(t, i, o), s = Math.sqrt(a[0] * a[0] + a[1] * a[1]), l = a[0] / s, a = a[1] / s, u = z.PlotUtils.distance(t, i), c = z.PlotUtils.distance(i, o), s = s > z.Constants.ZERO_TOLERANCE ? z.PlotUtils.isClockWise(t, i, o) ? (r = [i[0] - (n = e * u) * a, i[1] + n * l ], [i[0] + (n = e * c) * a, i[1] - n * l]) : (r = [i[0] + (n = e * u) * a, i[1] - n * l], [i[0] - ( n = e * c) * a, i[1] + n * l]) : (r = [i[0] + e * (t[0] - i[0]), i[1] + e * (t[1] - i[1])], [i[ 0] + e * (o[0] - i[0]), i[1] + e * (o[1] - i[1])]); return [r, s] }, z.PlotUtils.getNormal = function(e, t, i) { var o = e[0] - t[0], e = e[1] - t[1], r = Math.sqrt(o * o + e * e), r = (o /= r, e /= r, i[0] - t[0]), i = i[1] - t[1], t = Math.sqrt(r * r + i * i); return [o + (r /= t), e + (i /= t)] }, z.PlotUtils.getCurvePoints = function(e, t) { for (var i = [z.PlotUtils.getLeftMostControlPoint(t)], o = 0; o < t.length - 2; o++) var r = t[o], n = t[o + 1], a = t[o + 2], a = z.PlotUtils.getBisectorNormals(e, r, n, a), i = i.concat(a); for (var s = z.PlotUtils.getRightMostControlPoint(t), l = (i.push(s), []), o = 0; o < t.length - 1; o++) { r = t[o], n = t[o + 1], l.push(r); for (e = 0; e < z.Constants.FITTING_COUNT; e++) { var u = z.PlotUtils.getCubicValue(e / z.Constants.FITTING_COUNT, r, i[2 * o], i[2 * o + 1], n); l.push(u) } l.push(n) } return l }, z.PlotUtils.getLeftMostControlPoint = function(e) { var i, o, r, n, a, s = e[0], l = e[1], e = e[2], u = z.PlotUtils.getBisectorNormals(0, s, l, e)[0], e = z.PlotUtils.getNormal(s, l, e), e = Math.sqrt(e[0] * e[0] + e[1] * e[1]) > z.Constants.ZERO_TOLERANCE ? (e = z.PlotUtils.mid(s, l), r = s[0] - e[0], i = s[1] - e[1], o = z.PlotUtils.distance(s, l), n = u[0] - e[0], u = u[1] - e[ 1], a = e[0] + ((i = -(o = 2 / o) * i) * i - (o = o * r) * o) * n + (r = 2 * i * o) * u, e[ 1] + r * n + (o * o - i * i) * u) : (a = s[0] + t * (l[0] - s[0]), s[1] + t * (l[1] - s[ 1])); return [a, e] }, z.PlotUtils.getRightMostControlPoint = function(e) { var i, o, r, n, a, s = e.length, l = e[s - 3], u = e[s - 2], e = e[s - 1], s = z.PlotUtils.getBisectorNormals(0, l, u, e)[1], l = z.PlotUtils.getNormal(l, u, e), l = Math.sqrt(l[0] * l[0] + l[1] * l[1]) > z.Constants.ZERO_TOLERANCE ? (l = z.PlotUtils.mid(u, e), r = e[0] - l[0], i = e[1] - l[1], o = z.PlotUtils.distance(u, e), n = s[0] - l[0], s = s[1] - l[ 1], a = l[0] + ((i = -(o = 2 / o) * i) * i - (o = o * r) * o) * n + (r = 2 * i * o) * s, l[ 1] + r * n + (o * o - i * i) * s) : (a = e[0] + t * (u[0] - e[0]), e[1] + t * (u[1] - e[ 1])); return [a, l] }, z.PlotUtils.getBezierPoints = function(e) { if (e.length <= 2) return e; for (var t = [], i = e.length - 1, o = 0; o <= 1; o += .01) { for (var r = 0, n = 0, a = 0; a <= i; a++) { var s = z.PlotUtils.getBinomialFactor(i, a), l = Math.pow(o, a), u = Math.pow(1 - o, i - a); r += s * l * u * e[a][0], n += s * l * u * e[a][1] } t.push([r, n]) } return t.push(e[i]), t }, z.PlotUtils.getBinomialFactor = function(e, t) { return z.PlotUtils.getFactorial(e) / (z.PlotUtils.getFactorial(t) * z.PlotUtils.getFactorial(e - t)) }, z.PlotUtils.getFactorial = function(e) { if (e <= 1) return 1; if (2 == e) return 2; if (3 == e) return 6; if (4 == e) return 24; if (5 == e) return 120; for (var t = 1, i = 1; i <= e; i++) t *= i; return t }, z.PlotUtils.getQBSplinePoints = function(e) { if (e.length <= 2) return e; var t = [], i = e.length - 2 - 1; t.push(e[0]); for (var o = 0; o <= i; o++) for (var r = 0; r <= 1; r += .05) { for (var n = 0, a = 0, s = 0; s <= 2; s++) { var l = z.PlotUtils.getQuadricBSplineFactor(s, r); n += l * e[o + s][0], a += l * e[o + s][1] } t.push([n, a]) } return t.push(e[e.length - 1]), t }, z.PlotUtils.getQuadricBSplineFactor = function(e, t) { return 0 == e ? Math.pow(t - 1, 2) / 2 : 1 == e ? (-2 * Math.pow(t, 2) + 2 * t + 1) / 2 : 2 == e ? Math .pow(t, 2) / 2 : 0 }, z.Constants = { TWO_PI: 2 * Math.PI, HALF_PI: Math.PI / 2, FITTING_COUNT: 100, ZERO_TOLERANCE: 1e-4 }, Object.defineProperties(Ho.prototype, { tileWidth: { get: function() { return this._3 } }, tileHeight: { get: function() { return this._4 } }, defaultAlpha: { get: function() { return 1 } }, hasAlphaChannel: { get: function() { return !0 } }, maximumLevel: { get: function() { return this._1 } }, minimumLevel: { get: function() { return this._2 } }, tilingScheme: { get: function() { return this._7 } }, extent: { get: function() { return this._8 } }, rectangle: { get: function() { return this._5 } }, ready: { get: function() { return this._6 } }, minimumTerrainLevel: { get: function() { return 0 } }, maximumTerrainLevel: { get: function() { return 17 } } }), Ho.prototype.requestImage = function(e, t, i) { this.needaddone && (e += 1, t += 1, i += 1); var o = this.baseurl, o = (o = this._0 && i > this._0 ? this.baseurl2 : o).replace("{x}", e); return o = (o = (o = o.replace("{l}", t % 8)).replace("{y}", t)).replace("{z}", i + 1), Cesium .ImageryProvider.loadImage(this, o) }, Object.defineProperties(Vo.prototype, { featureName: { get: function() { return this._featureName }, set: function(e) { this._featureName = e } }, extractAttributes: { get: function() { return this._extractAttributes }, set: function(e) { this._extractAttributes = e } }, xy: { get: function() { return this._xy } } }), Vo.prototype.getElementsByTagNameNS = function(e, t, i) { var o = []; if (e.getElementsByTagNameNS) o = e.getElementsByTagNameNS(t, i); else for (var r, n, a = e.getElementsByTagName("*"), s = 0, l = a.length; s < l; ++s) n = (r = a[s]) .prefix ? r.prefix + ":" + i : i, "*" != i && n != r.nodeName || "*" != t && t != r .namespaceURI || o.push(r); return o }, Vo.prototype.read = function(e) { for (var t = this.getElementsByTagNameNS(e.documentElement, this._gmlns, this.featureName), i = [], o = 0; o < t.length; o++) { var r = this.parseFeature(t[o]); r && i.push(r) } return i }, Vo.prototype.parseFeature = function(e) { for (var t, i, o, r, n = ["MultiPolygon", "Polygon", "MultiLineString", "LineString", "MultiPoint", "Point", "Envelope" ], a = 0; a < n.length; ++a) if (0 < (i = this.getElementsByTagNameNS(e, this._gmlns, t = n[a])).length) { (r = this.parseGeometry[t.toLowerCase()]) ? o = r.apply(this, [i[0]]): console.log( "unsupportedGeometryType:" + t); break } for (var s, l = this.getElementsByTagNameNS(e, this._gmlns, "Box"), a = 0; a < l.length; ++a) { var u = l[a], c = this.parseGeometry.box.apply(this, [u]), u = u.parentNode; "boundedBy" === (u.localName || u.nodeName.split(":").pop()) ? s = c: o = c.toGeometry() } this.extractAttributes && (m = this.parseAttributes(e)); for (var h, m = { geometryType: t.toLowerCase(), positions: o, attributes: m }, d = (m.bounds = s, e.firstChild); d && (1 != d.nodeType || !(h = d.getAttribute("fid") || d .getAttribute("id")));) d = d.nextSibling; return m.fid = h, m }, Vo.prototype.parseGeometry = { point: function(e) { var t = [], i = this.getElementsByTagNameNS(e, this._gmlns, "pos"); return 0 == (t = 0 < i.length ? i[0].firstChild.nodeValue.replace(this._regExes.trimSpace, "") .split(this._regExes.splitSpace) : t).length && (0 < (i = this.getElementsByTagNameNS(e, this._gmlns, "coordinates")).length && (t = i[0].firstChild.nodeValue.replace(this ._regExes.removeSpace, "").split(","))), 0 == t.length && 0 < (i = this .getElementsByTagNameNS(e, this._gmlns, "coord")).length && (e = this .getElementsByTagNameNS(i[0], this._gmlns, "X"), i = this.getElementsByTagNameNS(i[0], this._gmlns, "Y"), 0 < e.length && 0 < i.length && (t = [e[0].firstChild.nodeValue, i[0].firstChild.nodeValue ])), 2 == t.length && (t[2] = null), this.xy ? [parseFloat(t[0]), parseFloat(t[1]), parseFloat(t[2]) ] : [parseFloat(t[1]), parseFloat(t[0]), parseFloat(t[2])] }, multipoint: function(e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "Point"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.point.apply(this, [t[r]])) && i .push(o); return i }, linestring: function(e, t) { var i = [], o = [], r = this.getElementsByTagNameNS(e, this._gmlns, "posList"); if (0 < r.length) for (var n, a, s, i = this.getChildValue(r[0]).replace(this._regExes.trimSpace, "").split( this._regExes.splitSpace), l = parseInt(r[0].getAttribute("dimension")), u = 0; u < i.length / l; ++u) s = u * l, n = parseFloat(i[s]), a = parseFloat(i[1 + s]), s = 2 == l ? null : parseFloat(i[2 + s]), this.xy ? o.push(n, a, s) : o.push(a, n, s); if (0 == i.length && 0 < (r = this.getElementsByTagNameNS(e, this._gmlns, "coordinates")) .length) for (var c = this.getChildValue(r[0]).replace(this._regExes.trimSpace, "").replace(this ._regExes.trimComma, ",").split(this._regExes.splitSpace), u = 0; u < c.length; ++u) 2 == (i = c[u].split(",")).length && (i[2] = null), this.xy ? o.push(parseFloat(i[0]), parseFloat(i[1]), parseFloat(i[2])) : o.push(parseFloat(i[1]), parseFloat(i[0]), parseFloat(i[2])); return o }, multilinestring: function(e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "LineString"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.linestring.apply(this, [t[ r]])) && i.push(o); return i }, polygon: function(e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "LinearRing"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.linestring.apply(this, [t[r], ! 0 ])) && i.push(o); return i }, multipolygon: function(e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "Polygon"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.polygon.apply(this, [t[r]])) && i.push(o); return i }, envelope: function(e) { var t, i, o, r, n = [], a = this.getElementsByTagNameNS(e, this._gmlns, "lowerCorner"), a = (0 < a.length && (o = [], 2 == (o = 0 < a.length ? a[0].firstChild.nodeValue.replace( this._regExes.trimSpace, "").split(this._regExes.splitSpace) : o).length && (o[ 2] = null), i = this.xy ? new OpenLayers_Geometry_Point(o[0], o[1], o[2]) : new OpenLayers_Geometry_Point(o[1], o[0], o[2])), this.getElementsByTagNameNS(e, this._gmlns, "upperCorner")); return 0 < a.length && (o = [], 2 == (o = 0 < a.length ? a[0].firstChild.nodeValue.replace(this ._regExes.trimSpace, "").split(this._regExes.splitSpace) : o).length && (o[2] = null), r = this.xy ? new OpenLayers_Geometry_Point(o[0], o[1], o[2]) : new OpenLayers_Geometry_Point(o[1], o[0], o[2])), i && r && (n.push([i.x, i.y, null]), n .push([r.x, i.y, null]), n.push([r.x, r.y, null]), n.push([i.x, r.y, null]), n.push([i .x, i.y, null ]), t = new OpenLayers_Geometry_Polygon([ [n] ])), t }, box: function(e) { var e = this.getElementsByTagNameNS(e, this._gmlns, "coordinates"), t = null, i = null; if (0 < e.length && (2 == (e = e[0].firstChild.nodeValue.split(" ")).length && (t = e[0].split( ","), i = e[1].split(","))), null !== t && null !== i) return [parseFloat(t[0]), parseFloat(t[1]), null, parseFloat(i[0]), parseFloat(i[1]), null ] } }, Vo.prototype.parseAttributes = function(e) { for (var t, i, o, r, n, a = {}, s = e.firstChild; s;) { if (1 == s.nodeType) { for (t = s.childNodes, i = 0; i < t.length; ++i) 1 == (o = t[i]).nodeType && (1 == (n = o .childNodes).length ? 3 != (n = n[0]).nodeType && 4 != n.nodeType || (r = o.prefix ? o.nodeName.split(":")[1] : o.nodeName, n = n.nodeValue.replace(this._regExes .trimSpace, ""), a[r] = n) : a[o.nodeName.split(":").pop()] = null); break } s = s.nextSibling } return a }, Vo.prototype.getChildValue = function(e, t) { var i = t || ""; if (e) for (var o = e.firstChild; o; o = o.nextSibling) switch (o.nodeType) { case 3: case 4: i += o.nodeValue } return i }, ko.prototype.streamSpeedFactor = function() { switch (this._streamSpeed) { case this.STREAM_SPEED_FAST: return 1; case this.STREAM_SPEED_NORMAL: return 3; case this.STREAM_SPEED_SLOW: return 20; default: return 3 } }; var Wo = [], Yo = 0, Qo = (ko.prototype.onPreFrame = function(e, t) { if (Yo++, !this._pauseStreaming) { if (this._streamSpeed == this.STREAM_SPEED_IMIDIATE) for (; 0 < this._primitivesWaitingToBeAddedToTheScene.length;) { var i = this._primitivesWaitingToBeAddedToTheScene.pop(); e.primitives.add(i) } else 0 < this._primitivesWaitingToBeAddedToTheScene.length && Yo % this .streamSpeedFactor() == 0 && ((i = this._primitivesWaitingToBeAddedToTheScene.pop()) ._instanceIds && 100 < i._instanceIds.length && this.streamSpeed === this .STREAM_SPEED_FAST && (this.streamSpeed = this.STREAM_SPEED_NORMAL), e.primitives .add(i)); $.each(Wo, function(e, t) { t.ready && this.viewer.scene.primitives.remove(t._parentCollection._primitiveOld) }) } }, ko.prototype.updateForPick = function(e) {}, Math.PI, ko.prototype.placeHolder = function(e, t) { t = t || Cesium.Color.fromBytes(0, 255, 0, 255); t = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleOutlineGeometry({ rectangle: e.rectangle, height: this.viewer.camera.positionCartographic.height - .99 * TerraExplorer.internal.Navigate.HeightAboveGround }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(t) } }), appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }) }); e.data.primitive.add(t) }, ko.prototype.getTile = function(e) { return this._tileCache[e] }, ko.prototype.getAllTiles = function() { var e, t = []; for (e in this._tileCache) t.push(this._tileCache[e]); return t }, ko.prototype.addToScene = function(e) { this._primitivesWaitingToBeAddedToTheScene.push(e) }, ko.prototype.removeFromScene = function(e) { var t = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); - 1 != t ? (this ._primitivesWaitingToBeAddedToTheScene[t].destroy(), this ._primitivesWaitingToBeAddedToTheScene.splice(t, 1)) : this.viewer.scene.primitives.remove( e) }, ko.prototype.replaceInScene = function(e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); if (-1 != i) this._primitivesWaitingToBeAddedToTheScene[i] = t; else switch (e.ID != t.ID && console.log( "TileManager.replaceInScene Warning: new primitive has a different ID than old primitive" ), null != e._replacmentPrimitive && this.viewer.scene.primitives.remove(e ._replacmentPrimitive), e._replacmentPrimitive = t, this.viewer.scene.primitives.add(t), t.ID.split(":")[0]) { case "billboards": Fo(this.viewer, t, e); break; case "labels": Go(this.viewer, t, e); break; case "polygons": Bo(this.viewer, t, e); break; case "models": jo(this.viewer, t, e); break; case "polylines": Uo(this.viewer, t, e); break; case "points": zo(this.viewer, 0, e); break; default: console.log("Error updating layer"), this.viewer.scene.primitives.remove(e) } }, { billboards: Fo, labels: Go, polygons: Bo, models: jo, polylines: Uo, points: zo }), qo = (ko.prototype.replaceInSceneNew = function(e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); - 1 != i ? this ._primitivesWaitingToBeAddedToTheScene[i] = t : (e.ID !== t.ID && console.log( "TileManager.replaceInScene Warning: new primitive has a different ID than old primitive" ), this.addToScene(t), i = t.ID.split(":")[0], (i = Qo[i]) ? i(t, e) : (console.log( "Error updating layer"), this.viewer.scene.primitives.remove(e))) }, !(ko.prototype.update = function(e) { this._quadtree.beginFrame(e), this._quadtree.render(e), this._quadtree.endFrame(e) })); function Jo(e) { if (e = e || [], !Cesium.defined(e.workerPath)) throw new Cesium.DeveloperError("workerPath is required."); this._workerPath = e.workerPath, this._poolSize = Cesium.defaultValue(e.poolSize, 16), this._workers = [], this._defered = [] } function Xo() {} function Ko(e) { return "string" == typeof e ? e.replace(/^\s+/g, "").replace(/\s+$/g, "") : e } function $o(t, e) { for (var i = !1, o = 0, r = "", n = 0; n < e.length; n++) !i && /['"`]/.test(e[n]) ? i = e[n] : i && e[n] == i ? i = !1 : i || "(" != e[n] ? i || ")" != e[n] || o-- : o++, e[n] == t && (0 < o || i) ? r += "######" : r += e[n]; return e = (e = (e = r).split(t)).map(function(e) { return Ko(e.replace(new RegExp("######", "g"), t)) }) } function Zo(e) { for (var t = "#", i = e.length, o = 0; o < i; o++) t += e[o] + "#"; return t } function er(e) { for (var t = "", i = e.length, o = 1; o < i; o += 2) t += e[o]; return t } function tr(e) { this.source = e, this.cursor = 0, this.currentChar = "", this.readNextChar() } function ir(e) { this.lexer = new tr(e), this.currentToken = "", this.readNextToken() } function or(e, t) { var i = ""; return void 0 !== e.logic ? (i = (i = e.terms.map(function(e) { return or(e, !0) })).join(" " + e.logic + " "), void 0 !== t && (i = "(" + i + ")")) : void 0 !== e.left ? (i = e.left, void 0 !== e.operator && (i += " " + e.operator, void 0 !== e.right && ("IN" === e.operator ? i += " (" + e.right + ")" : i += " " + e.right))) : i = e, i } function rr(e) { var t, i = 0; if (0 === e.length) return i; for (t = 0; t < e.length; t++) i = (i << 5) - i + e.charCodeAt(t), i |= 0; return i } function nr(e) { for (var t = [], i = 0; i < e.length; i++) for (var o = 0; o < e[i].positions.length; o += 3) t.push(Cesium.Cartographic.fromDegrees(e[i] .positions[o + 0], e[i].positions[o + 1], 0)); return t } function ar(e, t, i, o) { for (var r = 0, n = 0; n < e.length; n++) for (var a = o ? vr : i(e[n]), s = 2; s < e[n].positions.length; s += 3) { null == t[r].height && (t[r].height = 0), null == e[n].absoluteHeightPositions && (e[n] .absoluteHeightPositions = []), e[n].absoluteHeightPositions[s - 2] = e[n].positions[s - 2], e[n].absoluteHeightPositions[s - 1] = e[n].positions[s - 1], e[n].absoluteHeightPositions[+s] = e[n].positions[+s]; var l = o ? 0 : e[n].positions[s]; e[n].absoluteHeightPositions[s] = l + t[r].height + a, r++ } } function sr(e, t) { this._style = e || {}, t.scene.onHoverShowTextArray = {}, t.scene._lastObjectShowOnText = null, this .setEyeOffset = function(e, t) { void 0 === t && (t = 0), e.eyeOffset = Cesium.DynamicEyeOffset(t) }, this.viewer = t } function lr(e, t) { for (var i = e.length, o = 0; o < i; o++) { var r = t(e[o]); if ("polygon" == e[o].geometryType || "multipolygon" == e[o].geometryType) { for (var n = e[o], a = n.positions.length, s = 0; s < a; s++) { for (var l = n.positions[s], u = 2; u < l.length; u += 3) l[u] += r; n.positions[s] = l } e[o] = n } else { for (var c = e[o], h = c.positions.length, s = 2; s < h; s += 3) c.positions[s] += r; e[o] = c } } return e } function ur(e, t) { if (null == e.isQuery) if (null == e.originalInstanceIds) { if (e.parentLayer.isExistRenderedFeatureId(t)) return } else if (-1 == e.originalInstanceIds.indexOf(t)) return; return 1 } function cr(t) { return function(e) { e = Number(t.applyConditionalClassification(t._style.altitudeOffset, e.attributes)); return e = isNaN(e) ? 0 : e } } function hr(e) { if ("string" != typeof e) return e; var t = Number(e); if (isNaN(t)) return e; var i = t.toString(16); if (i.length < 6 && null != i) for (var o = i.length; o < 6;) i = "0" + i, o++; e = Cesium.Color.fromCssColorString("#" + i); return null != e && (t = e.red, e.red = e.blue, e.blue = t), e } function mr(e) { if (null != e) { var t = parseInt(e); if (null != e.alpha || isNaN(t)) return e; t < 0 && (t &= 16777215); var i = t.toString(16); if (i.length < 6 && null != i) for (var o = i.length; o < 6;) i = "0" + i, o++; var e = (e = "#" + i).substring(0, 7), t = Cesium.Color.fromCssColorString(e); return null != t && (e = t.red, t.red = t.blue, t.blue = e), t } } function dr(e) { return isNaN(e) ? e : parseFloat(e) } function pr(e, i) { var t, o = []; return $.each(e.attributeNames, function(e, t) { o.push(dr(i[t])) }), 1 === o.length ? t = e.func(o[0]) : 2 === e.attributeNames.length ? t = e.func(o[0], o[1]) : 3 === e .attributeNames.length ? t = e.func(o[0], o[1], o[2]) : 4 === e.attributeNames.length && (t = e.func(o[ 0], o[1], o[2], o[3])), t } function gr(e, t, i) { return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"), "g"), i) } ko.prototype.initialize = function(e) { qo || (this.viewer.scene.preRender.addEventListener(this.onPreFrame, this), qo = !0) }, ko.prototype.beginUpdate = function(e) { this.quadtree.beginFrame(e) }, ko.prototype.endUpdate = function(e) { var t = this; e.afterRender.push(function() { t.quadtree.endFrame(e) }) }, ko.prototype.getLevelMaximumGeometricError = function(e) { return this._levelZeroMaximumError / (1 << e) }, ko.prototype.loadTile = function(e, t) { var i = this; null == this._numTilesInLevel[t._level] && (this._numTilesInLevel[t._level] = 0), this._numTilesInLevel[ t._level]++, t.state === Cesium.QuadtreeTileLoadState.START && (t.data = { primitive: new Cesium.PrimitiveCollection, wfsLayerData: [], id: Cesium.createGuid(), freeResources: function() { if (i._tileCache[t.data.id] && i._numTilesInLevel[t._level]--, i._numTilesInLevel[t ._level] < 0 && (i._numTilesInLevel[t._level] = 0), Cesium.defined(this .wfsLayerData)) { for (var e in this.wfsLayerData) Cesium.defined(this.wfsLayerData[e]) && this .wfsLayerData[e].freeResources(); this.wfsLayerData = void 0 } Cesium.defined(this.primitive) && (this.primitive.destroy(), this.primitive = void 0), delete i._tileCache[t.data.id] } }, this._tileCache[t.data.id] = t, Math.abs(6371e3 * (t.rectangle.south - t.rectangle.north)), t .data.boundingSphere3D = Cesium.BoundingSphere.fromRectangle3D(t.rectangle), t.data .boundingSphere2D = Cesium.BoundingSphere.fromRectangle2D(t.rectangle, e.mapProjection), t .rectangle.west, t.rectangle.south, t.rectangle.east, t.rectangle.north, this.loadTileEvent .raiseEvent(t), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0) }, ko.prototype.computeTileVisibility = function(e, t, i) { var o = this.computeDistanceToTile(e, t); if (e._distance = o, t.fog.enabled && 1 <= Cesium.Math.fog(o, t.fog.density)) return Cesium.Visibility .NONE; o = e.data; if (o.tileBoundingRegion, void 0 === o.boundingVolumeSourceTile) return Cesium.Visibility.PARTIAL; var r = t.cullingVolume, n = o.orientedBoundingBox; !n && o.renderedMesh && (n = o.renderedMesh.boundingSphere3D), o.clippedByBoundaries = !1; a = e.rectangle, (s = this.cartographicLimitRectangle).west < s.east || (s = Rectangle.clone(s, splitCartographicLimitRectangleScratch), 0 < Rectangle.center(a, rectangleCenterScratch) .longitude ? s.east = CesiumMath.PI : s.west = -CesiumMath.PI); var a = s, s = new Cesium.Rectangle, a = Cesium.Rectangle.simpleIntersection(a, e.rectangle, s); if (!a) return Visibility.NONE; if (Cesium.Rectangle.equals(a, e.rectangle) || (o.clippedByBoundaries = !0), t.mode, Cesium.SceneMode .SCENE3D, !n) return Cesium.Intersect.INTERSECTING; s = this._clippingPlanes; if (s && s.enabled) { a = s.computeIntersectionWithBoundingVolume(n); if (e.isClipped = a !== Intersect.INSIDE, a === Cesium.Intersect.OUTSIDE) return Cesium.Visibility .NONE } s = r.computeVisibility(n); if (s === Cesium.Intersect.OUTSIDE) return Cesium.Visibility.NONE; e = t.mode === Cesium.SceneMode.SCENE3D && t.camera.frustum instanceof Cesium.OrthographicFrustum; return t.mode !== Cesium.SceneMode.SCENE3D || e || !i || !(a = o.occludeePointInScaledSpace) || i .ellipsoid.isScaledSpacePointVisible(a) ? s : Cesium.Visibility.NONE }, ko.prototype.canRefine = function(e, t, i) { return e.level < 16 }, ko.prototype.showTileThisFrame = function(e, t, i, o) { e.data.geometryPrimitive && e.data.geometryPrimitive.update(t, i, o) }, ko.prototype.computeDistanceToTile = function(e, t) { s = e, this.terrainProvider, void 0 === (r = void 0 === (r = s.data) ? s.data = new Cesium .GlobeSurfaceTile : r).tileBoundingRegion && (r.tileBoundingRegion = new Cesium .TileBoundingRegion({ computeBoundingVolumes: !1, rectangle: s.rectangle, ellipsoid: s.tilingScheme.ellipsoid, minimumHeight: 0, maximumHeight: 0 })); var i, o, r = e.data, n = r.tileBoundingRegion; if (void 0 === s) return 9999999999; r.boundingVolumeSourceTile !== s && (r.boundingVolumeSourceTile = s, (s = e.rectangle) && s.width < Cesium.Math.PI_OVER_TWO + Cesium.Math.EPSILON5 && (r.orientedBoundingBox = Cesium .OrientedBoundingBox.fromRectangle(e.rectangle, n.minimumHeight, n.maximumHeight, e .tilingScheme.ellipsoid, r.orientedBoundingBox), r.occludeePointInScaledSpace = (s = this, c = r.orientedBoundingBox.center, l = e.rectangle, u = n.maximumHeight, i = r .occludeePointInScaledSpace, a = (s = s.quadtree._occluders.ellipsoid).ellipsoid, o = [ new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium .Cartesian3 ], Cesium.Cartesian3.fromRadians(l.west, l.south, u, a, o[0]), Cesium.Cartesian3 .fromRadians(l.east, l.south, u, a, o[1]), Cesium.Cartesian3.fromRadians(l.west, l .north, u, a, o[2]), Cesium.Cartesian3.fromRadians(l.east, l.north, u, a, o[3]), s .computeHorizonCullingPoint(c, o, i)))); var a, s, l = n.minimumHeight, u = n.maximumHeight, c = (r.boundingVolumeSourceTile !== e && (a = t.camera.positionCartographic.height, s = Math.abs(a - l), Math.abs(a - u) < s ? (n.minimumHeight = l, n.maximumHeight = l) : (n .minimumHeight = u, n.maximumHeight = u)), n.distanceToCamera(t)); return n.minimumHeight = l, n.maximumHeight = u, c }, ko.prototype.isDestroyed = function() { return !1 }, ko.prototype.destroy = function() { return Cesium.destroyObject(this) }, ko.prototype.remove = function() { this.destroy() }, ko.prototype.getInstance = function(e) { var t; return 0 == Cesium.defined(e.TileManager) && (t = new ko, (e.TileManager = t).viewer = e, t = new Cesium .QuadtreePrimitive({ tileProvider: e.TileManager, maximumScreenSpaceError: 2 }), e.scene.primitives.add(t)), e.TileManager }, Object.defineProperties(Jo.prototype, { errorEvent: { get: function() { return this.errorEvent } }, poolSize: { get: function() { return this._poolSize } } }), Jo.prototype.queueWorkItem = function(e, t) { for (var i, o = Cesium.when.defer(), r = null, n = 999999, a = 0; a < this._workers.length; a++) { r = this._workers[a]; this._workers[a].jobQueueSize < n && (r = this._workers[a], n = this._workers[a].jobQueueSize) } 0 < n && this._workers.length < this.poolSize && (r = new Worker(this._workerPath), i = this, r .addEventListener("message", function(e) { i.onWorkerMessage(e) }, !1), r.addEventListener("error", function(e) { i.onWorkerError(e) }, !1), r.jobQueueSize = 0, this._workers.push(r), r.id = Cesium.createGuid()), e.workerId = r .id; var s = Cesium.createGuid(); return e.deferedId = s, this._defered[s] = o, r.jobQueueSize++, r.postMessage(e, t), o }, Jo.prototype.trimPool = function(e) { var t = this; if (null == e) return null != this.timerId && clearTimeout(this.timerId), void(this.timerId = setTimeout(function() { t.trimPool(!0) }, 5e3)); for (var i = 0; i < this._workers.length; i++) 0 == this._workers[i].jobQueueSize && (this._workers[i] .terminate(), this._workers.splice(i, 1), i--); this._workers.length ? this.timerId = setTimeout(function() { t.trimPool(!0) }, 5e3) : this.timerId = null }, Jo.prototype.onWorkerMessage = function(e) { var t = e.data, e = function(e, t) { for (var i = 0; i < e.length; i++) if (t(e[i])) return i }(this._workers, function(e) { return e.id === t.workerId }), e = (null != e && (this._workers[e].jobQueueSize--, this.trimPool()), this._defered[t.deferedId]); delete this._defered[t.deferedId], e.resolve(t) }, Jo.prototype.onWorkerError = function(e) { console.log(e) }, Xo.sql2ast = function(r, e) { function n(e, t) { return t } null == e && (e = !0); var t = "###semi-colon###", i = (r = (r = (r = (r = r.replace(/[("'`].*;.*[)"'`]/g, function(e) { return e.replace(/;/g, t) })).replace(/;/g, "###EOR###")).split("###EOR###")[0]).replace(new RegExp(t, "g"), ";"), [ "SELECT", "FROM", "DELETE FROM", "INSERT INTO", "UPDATE", "JOIN", "LEFT JOIN", "RIGHT JOIN", "INNER JOIN", "ORDER BY", "GROUP BY", "HAVING", "WHERE", "LIMIT", "VALUES", "SET" ]), o = i.map(function(e) { return e + " " }), a = (o = (o = o.concat(i.map(function(e) { return e + "(" }))).concat(o.map(function(e) { return e.toLowerCase() }))).map(function(e) { return e.replace("(", "[\\(]") }), s = (r = r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function(e) { return e.replace(new RegExp(a.join("|"), "gi"), Zo) }), []), l = (o.forEach(function(e) { var t, i, o = 0; do {} while (-1 != (i = r.indexOf(e, o)) && (t = e.replace(/^((\w|\s)+?)\s?\(?$/i, n), o = i + (s[i] = t).length), -1 != i) }), 0), u = (s.forEach(function(e, t) { t < l ? delete s[t] : (l = parseInt(t, 10) + e.length, "JOIN" == e && (s[t] = "INNER JOIN")) }), a.slice(0)), c = (u = (u = u.map(Zo)).join("|"), r.split(new RegExp(a.join("|"), "i"))), h = (r = r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function(e) { return e.replace(new RegExp(u, "gi"), er) }), c = c.map(function(e) { return e.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function(e) { return e.replace(new RegExp(u, "gi"), er) }) }), []), m = (h.SELECT = function(e) { return $o(",", e).filter(function(e) { return "" !== e }).map(function(e) { return { name: e } }) }, h.SET = function(e) { return $o(",", e).filter(function(e) { return "" !== e }).map(function(e) { return { expression: e } }) }, h.FROM = h["DELETE FROM"] = h.UPDATE = function(e) { var i = e.split(","); return (i = i.map(Ko)).forEach(function(e, t) { "" === e && i.splice(t) }), i = i.map(function(e) { var e = e.split(" AS "), t = e[1] || ""; return 0 === t.indexOf('"') && t.lastIndexOf('"') == t.length - 1 && (t = t .substring(1, t.length - 1)), { table: e[0], as: t } }) }, h["LEFT JOIN"] = h.JOIN = h["INNER JOIN"] = h["RIGHT JOIN"] = function(e) { var t = (e = e.split(" ON "))[0].split(" AS "), i = {}; return i.table = Ko(t[0]), i.as = Ko(t[1]) || "", i.cond = Ko(e[1]), i }, h.WHERE = Ko, h["ORDER BY"] = function(e) { e = e.split(","); var o = []; return e.forEach(function(e, t) { var i = /([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi; null !== (i = i.exec(e)) && ((e = {}).column = Ko(i[1]), e.order = Ko(i[2]), void 0 === i[2] && (e.order = "ASC"), o.push(e)) }), o }, h["GROUP BY"] = function(e) { e = e.split(","); var o = []; return e.forEach(function(e, t) { var i = /([A-Za-z0-9_\.]+)/gi; null !== (i = i.exec(e)) && ((e = {}).column = Ko(i[1]), o.push(e)) }), o }, h.LIMIT = function(e) { var t = /((\d+)\s*,\s*)?(\d+)/gi, e = (void 0 === (t = t.exec(e))[2] && (t[2] = 0), {}); return e.nb = parseInt(Ko(t[3]), 10), e.from = parseInt(Ko(t[2]), 10), e }, h["INSERT INTO"] = function(e) { var t = (t = /([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi).exec(e), e = {}; return e.table = Ko(t[1]), void 0 !== t[3] && (e.columns = t[3].split(","), e.columns = e .columns.map(Ko)), e }, h.VALUES = function(e) { var e = $o(",", e = "(" != (e = Ko(e))[0] ? "(" + e : e), t = []; return e.forEach(function(e) { e = $o(",", e = e.replace(/^\(/g, "").replace(/\)$/g, "")), t.push(e) }), t }, {}), d = 0; return s.forEach(function(e, t) { var i, o; e = e.toUpperCase(), d++, void 0 !== h[e] ? (i = h[e](c[d]), void 0 !== m[e] ? ("string" != typeof m[e] && void 0 !== m[e][0] || (o = m[e], m[e] = [], m[e].push(o)), m[e] .push(i)) : m[e] = i) : console.log("Can't analyze statement \"" + e + '"') }), void 0 !== m["LEFT JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["LEFT JOIN"][0] ? m["LEFT JOIN"].forEach(function(e) { e.type = "left", m.JOIN.push(e) }) : (m["LEFT JOIN"].type = "left", m.JOIN.push(m["LEFT JOIN"])), delete m["LEFT JOIN"]), void 0 !== m["INNER JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["INNER JOIN"][0] ? m["INNER JOIN"].forEach(function(e) { e.type = "inner", m.JOIN.push(e) }) : (m["INNER JOIN"].type = "inner", m.JOIN.push(m["INNER JOIN"])), delete m["INNER JOIN"]), void 0 !== m["RIGHT JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["RIGHT JOIN"][0] ? m["RIGHT JOIN"].forEach(function(e) { e.type = "right", m.JOIN.push(e) }) : (m["RIGHT JOIN"].type = "right", m.JOIN.push(m["RIGHT JOIN"])), delete m["RIGHT JOIN"]), e && ("string" == typeof m.WHERE && (m.WHERE = ir.parse(m.WHERE)), void 0 !== m.JOIN && m.JOIN .forEach(function(e, t) { m.JOIN[t].cond = ir.parse(e.cond) })), m }, tr.prototype = { constructor: tr, readNextChar: function() { "string" != typeof this.source ? this.currentChar = "" : this.currentChar = this.source[this .cursor++] || "" }, readNextToken: function() { return /\w|[-]/.test(this.currentChar) ? this.readWord() : /["'`]/.test(this.currentChar) ? this .readString() : /[()]/.test(this.currentChar) ? this.readGroupSymbol() : /[!=<>]/.test(this .currentChar) ? this.readOperator() : "" === this.currentChar ? { type: "eot", value: "" } : (this.readNextChar(), { type: "empty", value: "" }) }, readWord: function() { for (var e = "", t = 0, i = !1; /./.test(this.currentChar);) { if (!i && /['"`]/.test(this.currentChar)) i = this.currentChar; else if (i && this.currentChar == i) i = !1; else { if (!i) { if (")" == this.currentChar && t <= 0) break; if ("(" == this.currentChar ? t++ : ")" == this.currentChar && t--, /[!=<>]/.test( this.currentChar)) break } if (" " == this.currentChar && t <= 0) break } e += this.currentChar, this.readNextChar() } return /^(AND|OR)$/i.test(e) ? { type: "logic", value: e } : /^(IN|IS|NOT|LIKE)$/i.test(e) ? { type: "operator", value: e } : { type: "word", value: e } }, readString: function() { var e = "", t = this.currentChar; for (e += this.currentChar, this.readNextChar(); this.currentChar != t && "" !== this .currentChar;) e += this.currentChar, this.readNextChar(); return e += this.currentChar, this.readNextChar(), "." == this.currentChar ? (e += this .currentChar, this.readNextChar(), { type: "word", value: e += this.readString().value }) : { type: "string", value: e } }, readGroupSymbol: function() { var e = this.currentChar; return this.readNextChar(), { type: "group", value: e } }, readOperator: function() { var e = this.currentChar; return this.readNextChar(), /[=<>]/.test(this.currentChar) && (e += this.currentChar, this .readNextChar()), { type: "operator", value: e } } }, tr.tokenize = function(e) { var t = new tr(e), i = []; do { var o = t.readNextToken() } while ("empty" != o.type && i.push(o), t.currentChar); return i }, ir.prototype = { constructor: ir, readNextToken: function() { for (this.currentToken = this.lexer.readNextToken(); "empty" == this.currentToken.type;) this.currentToken = this.lexer.readNextToken(); return this.currentToken }, parseExpressionsRecursively: function() { return this.parseLogicalExpression() }, parseLogicalExpression: function() { for (var e = this.parseConditionExpression(); "logic" == this.currentToken.type;) { var t = this.currentToken.value, i = (this.readNextToken(), this.parseConditionExpression()); void 0 !== e.logic && e.logic == t && void 0 !== e.terms ? e.terms.push(i) : e = { logic: t, terms: [e, i].slice(0) } } return e }, parseConditionExpression: function() { var e, t = this.parseBaseExpression(); return "operator" == this.currentToken.type && (e = this.currentToken.value, this .readNextToken(), "operator" == this.currentToken.type && (e += " " + this.currentToken .value, this.readNextToken()), t = { operator: e, left: t, right: this.parseBaseExpression() }), t }, parseBaseExpression: function() { var e = ""; return "word" == this.currentToken.type || "string" == this.currentToken.type ? (e = this .currentToken.value, this.readNextToken()) : "group" == this.currentToken.type && (this .readNextToken(), e = this.parseExpressionsRecursively(), this.readNextToken()), e } }, ir.parse = function(e) { return new ir(e).parseExpressionsRecursively() }, Xo.ast2sql = function(e) { function t(e) { return void 0 !== e.WHERE ? " WHERE " + or(e.WHERE) : "" } var i, o, r, n, a; return void 0 !== e.SELECT && void 0 !== e.FROM ? (void 0 !== (a = e).SELECT ? "SELECT " + a.SELECT.map( function(e) { return e.name }).join(", ") : "") + (void 0 !== (a = e).FROM ? " FROM " + a.FROM.map(function(e) { var t = e.table; return "" !== e.as && (t += " AS " + e.as), t }).join(", ") : "") + (void 0 !== (a = e).JOIN ? (n = "", a.JOIN.forEach(function(e) { n += " " + e.type.toUpperCase() + " JOIN " + e.table, "" !== e.as && (n += " AS " + e.as), n += " ON " + or(e.cond) }), n) : "") + t(e) + (void 0 !== (a = e)["GROUP BY"] ? " GROUP BY " + a["GROUP BY"].map(function( e) { return e.column }).join(", ") : "") + (void 0 !== (a = e)["ORDER BY"] ? " ORDER BY " + a["ORDER BY"].map(function( e) { return e.column + " " + e.order }).join(", ") : "") + (void 0 !== (a = e).LIMIT && void 0 !== a.LIMIT.nb && 0 < parseInt(a.LIMIT.nb, 10) ? (r = " LIMIT ", void 0 !== a.LIMIT.from && 1 < parseInt(a.LIMIT.from, 10) && (r += a .LIMIT.from + ","), r + a.LIMIT.nb) : "") : void 0 !== e["INSERT INTO"] ? (void 0 !== (r = e)[ "INSERT INTO"] ? (a = "INSERT INTO " + r["INSERT INTO"].table, void 0 !== r["INSERT INTO"] .columns ? (a += " (") + r["INSERT INTO"].columns.join(", ") + ")" : a) : "") + (void 0 !== (o = e).VALUES ? " VALUES " + o.VALUES.map(function(e) { return "(" + e.join(", ") + ")" }).join(", ") : "") : void 0 !== e.UPDATE ? (void 0 !== (o = e).UPDATE ? "UPDATE " + o.UPDATE.map( function(e) { var t = e.table; return "" !== e.as && (t += " AS " + e.as), t }).join(", ") : "") + (void 0 !== (i = e).SET ? " SET " + i.SET.map(function(e) { return e.expression }).join(", ") : "") + t(e) : void 0 !== e["DELETE FROM"] ? (void 0 !== (i = e)["DELETE FROM"] ? "DELETE FROM " + i["DELETE FROM"].map(function(e) { var t = e.table; return "" !== e.as && (t += " AS " + e.as), t }).join(", ") : "") + t(e) : null }, Xo.trim = Ko, Xo.protect = Zo, Xo.unprotect = er, Xo.protect_split = $o, Xo.CondLexer = tr, Xo .CondParser = ir; var _r, fr = nr, yr = ar, vr = 1, Cr = (Object.defineProperties(sr.prototype, { style: { get: function() { return this._style }, set: function(e) { this._style = e } } }), sr.prototype.clonePartOfMultiFeature = function(e, t) { return { positions: e.positions[t], attributes: e.attributes, fid: e.fid, geometryType: e.geometryType } }, sr.prototype.createPrimitiveFromWFSFeatures = function(e) { new Cesium.PrimitiveCollection; for (var t = [], i = [], o = [], r = e.features.numPositions = 0; r < e.features.length; r++) { var n = e.features[r]; switch (this.sanitizePositions(n.positions), e.features.numPositions += n.positions.length, n .geometryType) { case "polygon": t.push(n); break; case "multipolygon": for (var a = n.positions.length, s = 0; s < a; s++) t.push(this.clonePartOfMultiFeature( n, s)); break; case "linestring": i.push(n); break; case "multilinestring": for (a = n.positions.length, s = 0; s < a; s++) i.push(this.clonePartOfMultiFeature(n, s)); break; case "point": o.push(n); break; case "multipoint": for (a = n.positions.length, s = 0; s < a; s++) o.push(this.clonePartOfMultiFeature(n, s)) } } 0 < t.length ? (e.features = t, this.createPolygonPrimitive(e)) : 0 < i.length ? (e.features = i, this.createLinestringPrimitive(e)) : 0 < o.length && (e.features = o, this .createPointPrimitive(e)) }, sr.prototype.createPolygonPrimitive = function(g) { function _(e) { if (e.isQuery) e.onFinishedQuery(a); else { for (var t, i, o, r, n = "", a = [], s = [], l = [], u = [], c = [], h = 0; h < e.features .length; h++) { var m, d, p, g = e.features[h]; ur(e, g.fid) && (d = g.absoluteHeightPositions || g.positions, m = f .createPolygonOptions(d, g.attributes), d = f.createCommonOptions(g.attributes), g.absoluteHeightPositions && delete g.absoluteHeightPositions, a.push(Cesium .BoundingSphere.fromPoints(m.hierarchy.positions)), e.isQuery || (m .outline && (p = f.createPolygonGeometryHelper(Cesium .PolygonOutlineGeometry, g, m.hierarchy, m.outlineColor, m .perPositionHeight, m.extrudedHeight, m.height), l.push(p)), m.fill && ( p = f.createPolygonGeometryHelper(Cesium.PolygonGeometry, g, m .hierarchy, m.material, m.perPositionHeight, m.extrudedHeight, m .height, m.water), s.push(p)), e.parentLayer.addRenderedFeatureId(g .fid), n += g.fid + ";", u.push(g.fid), c.push(d.tooltip))) } "" != n && (t = new Cesium.PrimitiveCollection, o = new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: m.material.alpha < 1 }), 0 < s.length && (m.water && (i = { color: m.water.color || "rgba(135,206,235,0.6)", image: m.water.image || window.SmartEarthRootUrl + D.water, frequency: m.water.frequency || 1e3, speed: m.water.speed || 10, amplitude: m.water.amplitude || 10 }, r = Cesium.Color.fromCssColorString(i.color), o = new Cesium .EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { type: "Water", uniforms: { baseWaterColor: r, blendColor: r, normalMap: i.image, frequency: i.frequency, animationSpeed: i.speed / 1e3, amplitude: i.amplitude } } }) })), ((r = m.clampToGround || !m.perPositionHeight && !m.extrudedHeight && ! m.height ? new Cesium.GroundPrimitive({ geometryInstances: s, appearance: o, classificationType: m.classificationType }) : new Cesium.Primitive({ geometryInstances: s, appearance: o }))._parentCollection = t).add(r)), 0 < l.length && (m.clampToGround || ((r = new Cesium.Primitive({ geometryInstances: l, appearance: o }))._parentCollection = t).add(r)), t.ID = "polygons:" + rr(n), t._instanceIds = u, t._tooltips = c, e.onFinishedCreatePrimitive(t, a)) } } var e, f = this; 3 == this.style.altitudeMethod ? (g.features = lr(g.features, cr(f)), _(g)) : (e = function(e) { for (var t = [], i = e.length, o = 0; o < i; o++) for (var r = e[o], n = r.positions.length, a = 0; a < n; a++) for (var s = r.positions[a], l = 0; l < s.length; l += 3) t.push(Cesium .Cartographic.fromDegrees(s[l + 0], s[l + 1], 0)); return t }(g.features), e = Cesium.sampleRenderedData(e, Cesium.SampleRenderedDataFlags.TERRAIN | Cesium.SampleRenderedDataFlags.FLOOR), Cesium.when(e, function(e) { for (var t = 2 == f._style.altitudeMethod, i = g.features, o = e, r = cr(f), n = t, a = 0, s = 0; s < i.length; s++) { var l = i[s], u = n ? vr : r(l); null == l.absoluteHeightPositions && (l.absoluteHeightPositions = []); for (var c = 0; c < l.positions.length; c++) for (var h = l.positions[c], m = l.absoluteHeightPositions[c] = [], d = 2; d < h.length; d += 3) { var p = n ? 0 : h[d]; null == o[a].height && (o[a].height = 0), m[d - 2] = h[d - 2], m[d - 1] = h[d - 1], m[+d] = h[+d], m[d] = p + o[a].height + u, a++ } } _(g) })) }, sr.prototype.createPolygonGeometryHelper = function(e, t, i, o, r, n, a, s) { var l = null != n ? Cesium.PerInstanceColorAppearance.VERTEX_FORMAT : Cesium .PerInstanceColorAppearance.FLAT_VERTEX_FORMAT, e = new e({ polygonHierarchy: i, vertexFormat: l = void 0 === s && void 0 === a ? l : Cesium.EllipsoidSurfaceAppearance .VERTEX_FORMAT, perPositionHeight: void 0 !== a ? void 0 : r, extrudedHeight: n, height: a }); return new Cesium.GeometryInstance({ geometry: e, id: t, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(o) } }) }, sr.prototype.createLinestringPrimitive = function(i) { function o(o) { if (o.isQuery) o.onFinishedQuery(t); else { var e, r = "", t = [], n = [], a = []; let i = new Cesium.PrimitiveCollection; for (var s, l = 0; l < o.features.length; l++) { var u = o.features[l]; if (ur(o, u.fid)) { var c = u.absoluteHeightPositions || u.positions, c = d.createLinestringOptions(c, u.attributes), h = d.createCommonOptions(u.attributes); if (c.vertexFormat = (e ? Cesium.PerInstanceColorAppearance : Cesium .PolylineColorAppearance).VERTEX_FORMAT, u.absoluteHeightPositions && delete u.absoluteHeightPositions, t.push(Cesium.BoundingSphere.fromPoints(c .positions)), !o.isQuery) { m = c.clampToGround ? new Cesium.GroundPolylineGeometry({ positions: c.positions, width: c.width }) : new Cesium.PolylineGeometry(c); var m = new Cesium.GeometryInstance({ id: u, geometry: m, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(c .material) } }); o.parentLayer.addRenderedFeatureId(u.fid), r += u.fid + ";", n.push(u.fid), a .push(h.tooltip); let e = null, t; t = c.dash ? new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material .PolylineDashType, { color: c.material, gapColor: c.gapColor || Cesium.Color.TRANSPARENT, dashLength: c.dashLength || 20 }) }) : new Cesium.PolylineMaterialAppearance({ material: new Cesium.Material({ fabric: { type: "PolylineOutline", uniforms: { color: c.material, outlineColor: c.outlineColor || c.material, outlineWidth: c.outlineWidth || 0 } } }) }), e = c.clampToGround ? new Cesium.GroundPolylinePrimitive({ geometryInstances: m, appearance: t, classificationType: c.classificationType }) : new Cesium.Primitive({ geometryInstances: m, appearance: t }), i.add(e) } } } "" != r && ((s = i).ID = "polylines:" + rr(r), s._instanceIds && 0 === s._instanceIds .length && (s._instanceIds = n), s._tooltips = a, o.onFinishedCreatePrimitive(s, t)) } } var e, d = this; 3 == this.style.altitudeMethod ? (i.features = lr(i.features, cr(d)), o(i)) : (e = nr(i.features), e = Cesium.sampleRenderedData(e, Cesium.SampleRenderedDataFlags.TERRAIN | Cesium .SampleRenderedDataFlags.FLOOR), Cesium.when(e, function(e) { var t = 2 == d._style.altitudeMethod; ar(i.features, e, cr(d), t), o(i) })) }, sr.prototype.createPointPrimitive = function(i) { function o(e) { if (e.isQuery) e.onFinishedQuery(n); else { for (var t, i, o = "", r = [], n = [], a = [], s = new Cesium.LabelCollection({ scene: C.viewer.scene }), l = new Cesium.PointPrimitiveCollection({ scene: C.viewer.scene }), u = new Cesium.BillboardCollection({ scene: C.viewer.scene }), c = new Cesium.PrimitiveCollection, h = new Cesium.PolylineCollection, m = 0; m < e .features.length; m++) { var d, p, _, f, y, v = e.features[m]; ur(e, v.fid) && (d = v.absoluteHeightPositions || v.positions, d = C.createPointOptions( d, v.attributes), p = C.createCommonOptions(v.attributes), v.clampToGround = d.clampToGround, d.sgsPointPosition && (v.sgsPointPosition = d.sgsPointPosition, delete d.sgsPointPosition), v.absoluteHeightPositions && delete v .absoluteHeightPositions, n.push(Cesium.BoundingSphere.fromPoints([d .position])), e.isQuery || (d.label && (d.label.position = d.position, d.label .id = v, C.setEyeOffset(d.label), null != d.label.imageFile && (d.label .image = C.applyConditionalClassification(d.label.imageFile, v .attributes), d.label.label = d.label, u.add(d.label), C .setEyeOffset(d.label, -5)), null != d.label.imageFile && null != d .label.showText && d.label.showText && (C.viewer.scene .onHoverShowTextArray[d.label.id] = !0), null != d.label.isBold && d .label.isBold ? s.add(g) : null != d.label.isUnderline && d.label .isUnderline ? (f = null != d.label.text.match(/[iljf1]/g) ? d.label .text.match(/[iljf1]/g) : [], _ = d.label.text.length, _ = Array( Math.ceil(_ - .5 * f.length)).join("_"), f = $.extend({}, d .label), null != d.label.image && delete d.label.image, f .position = d.label.position, f.id = d.label.id, f.text = _, f .alignment = null != d.label.alignment ? d.label.alignment : void 0, f.underline = !0, f.textRelativeToImage = null != d.label .textRelativeToImage ? d.label.textRelativeToImage : void 0, -1 < d .label.font.indexOf("pt") ? Number(d.label.font.split("pt")[0]) : - 1 < d.label.font.indexOf("px") && Number(d.label.font.split("px")[ 0]), f.pixelOffset = new Cesium.Cartesian2(0, -45), s.add(f)) : s.add(d.label)), d.billboard && (d.billboard.position = d.position, d .billboard.id = v, C.setEyeOffset(d.billboard), u.add(d.billboard)), d .model && (d.model.url = d.model.uri, d.model.id = v, c.add(Cesium.Model .fromGltf(d.model))), d.point && (d.point.position = d.position, d.point .id = v, C.setEyeOffset(d.point), l.add(d.point)), 0 != d .lineToGround && (_ = Cesium.Cartographic.fromCartesian(d.position), f = Cesium.Cartesian3.fromRadians(_.longitude, _.latitude, 0), 2 == d .lineToGround && (y = d.lineToGroundLength / Cesium.Cartesian3.distance( d.position, f), Cesium.Cartesian3.lerp(d.position, f, y, f)), h .add({ show: !0, width: 1, positions: [d.position, f], material: Cesium.Material.fromType("Color", { color: d.lineToGroundColor }) })), e.parentLayer.addRenderedFeatureId(v.fid), o += v.fid + ";", r .push(v.fid), a.push(p.tooltip))) } "" != o && (i = new Cesium.PrimitiveCollection, 0 < s.length && ($.each(s._labels, function( e, t) { t._type = "Label" }), (s._billboardCollection._parentCollection = i).add(s), t = "labels"), 0 < u .length && ($.each(u._billboards, function(e, t) { t._type = "Billboard" }), (u._parentCollection = i).add(u), t = "billboards"), 0 < c.length && ($.each(c ._primitives, function(e, t) { t._type = "Model", t._parentCollection = i }), i.add(c), t = "models"), 0 < l.length && ($.each(l._pointPrimitives, function(e, t) { t._type = "Point" }), (l._parentCollection = i).add(l), t = "points"), 0 < h.length && ($.each(h ._polylines, function(e, t) { t._type = "L2G" }), (h._parentCollection = i).add(h), t = "L2G"), i.ID = t + ":" + rr(o), i ._instanceIds = r, i._tooltips = a, e.onFinishedCreatePrimitive(i, n)) } } var e, C = this; 3 == this.style.altitudeMethod ? (i.features = lr(i.features, cr(C)), o(i)) : (e = fr(i.features), e = Cesium.sampleRenderedData(e), Cesium.when(e, function(e) { var t = 2 == C._style.altitudeMethod; yr(i.features, e, cr(C), t), o(i) }).otherwise(function(e) {})) }, sr.prototype.createCommonOptions = function(e) { var t = {}; return t.tooltip = this.applyConditionalClassification(this.style.tooltip, e), t }, sr.prototype.createPolygonOptions = function(e, t) { var i = this.getPolygonStyle(this.style); i.polygon.hierarchy = { positions: Cesium.Cartesian3.fromDegreesArrayHeights(e[0]), holes: [] }; for (var o = 1; o < e.length; o++) i.polygon.hierarchy.holes.push({ positions: Cesium.Cartesian3.fromDegreesArrayHeights(e[o]) }); var r, n = this.applyConditionalClassification(i.polygon.material, t); return i.polygon.material = hr(n), null != i.polygon.fill && null != i.polygon.fromKml && (1 < (r = this.applyConditionalClassification(i.polygon.fill, t)) && (r /= 100), i.polygon .material = new Cesium.Color(i.polygon.material.red, i.polygon.material.green, i.polygon .material.blue, r)), i.polygon.extrudedHeight && i.polygon.extrudedHeight && i.polygon .extrudedHeight.indexOf && -1 < i.polygon.extrudedHeight.indexOf("[") && -1 < i.polygon .extrudedHeight.defaultValue.indexOf("]") && (n = t[i.polygon.extrudedHeight.defaultValue .substring(1, i.polygon.extrudedHeight.defaultValue.length - 1)], void 0 !== (n = parseInt(n)) && (i.polygon.extrudedHeight = 3 * n)), t.FSCALE && (r = this.getLevelDistance( t.FSCALE), i.polygon.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, r)), n = this.applyConditionalClassification(i.polygon.outlineColor, t), i.polygon .outlineColor = hr(n), i.polygon }, sr.prototype.translateLineWidth = function(e, t) { t = this.applyConditionalClassification(e.polyline.width, t); return 0 < t ? TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS ? 1 < t && (e.polyline .widthInMeters = !0, t *= .8, 0 < e.polyline.backgroundOpacity && (t *= .8)) : t = 1 < t ? 2 : 1 : t < 0 ? t = Math.min(5, Math.abs(t)) : 0 == t && (t = 1), t }, sr.prototype.createLinestringOptions = function(e, t) { var i = this.getLinestringStyle(this.style), e = (i.id = t, i.polyline.positions = Cesium.Cartesian3.fromDegreesArrayHeights(e), this .applyConditionalClassification(i.polyline.material, t)); return i.polyline.material = hr(e), null != i.polyline.lineOpacity && (1 < (e = this .applyConditionalClassification(i.polyline.lineOpacity, t)) && (e /= 100), i.polyline .material = new Cesium.Color(i.polyline.material.red, i.polyline.material.green, i.polyline .material.blue, e)), i.polyline.far && (i.polyline.distanceDisplayCondition = new Cesium .DistanceDisplayCondition(void 0 !== i.polyline.near ? i.polyline.near : 0, i.polyline.far) ), t.FSCALE && (e = this.getLevelDistance(t.FSCALE), i.polyline.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, e)), i.polyline.width = this .applyConditionalClassification(i.polyline.width, t), i.polyline }, sr.prototype.applyConditionalClassification = function(e, i) { if (null != e) { if (null == e.defaultValue) return e; var o = dr(e.defaultValue); if (void 0 === e.classificationArray) { if (!isNaN(o)) return o; if (o instanceof Cesium.Color) return o } if (void 0 !== e.attributeName) { var t = "[" + e.attributeName + "]"; if (o === t) o = i[e.attributeName]; else if (e.multipleAttributeReplacementNeeded) for (name in i) o = gr(o, "[" + name + "]", i[name]); else o = gr(o, t, i[e.attributeName]); return o } if (void 0 !== e.classification) return o = pr(e.classification, i); var r = e.classificationArray; return void 0 !== r && $(Object.keys(r)).each(function(e, t) { t = function(e, t) { if (void 0 !== e && 0 !== e.condition.length) { if (void 0 === e.func) return dr(e.value); var i = void 0; return i = !0 === pr(e, t) ? dr(e.value) : i } }(r[t], i); t && (o = t) }), o } }, sr.prototype.createLineToGroundOptions = function(e, t) { var i = this.applyConditionalClassification(e.lineToGround, t); null != i && 0 != Number(i) ? (e.lineToGround = i, i = mr(i = this.applyConditionalClassification(e .lineToGroundColor, t)), e.lineToGroundColor = i, i = this .applyConditionalClassification(e.lineToGroundLength, t), e.lineToGroundLength = Number(i) ) : (e.lineToGround = 0, e.lineToGroundColor = 0, e.lineToGroundLength = 0) }, sr.prototype.createPointOptions = function(e, t) { var i, o, r, n, a, s = this.getPointStyle(this.style); return s.pointHeight ? (s.position = Cesium.Cartesian3.fromDegrees(e[0], e[1], s.pointHeight), e[ 2] = s.pointHeight) : s.position = Cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), s .sgsPointPosition = e, s.id = t, s.label && (void 0 !== (e = s.label.text) && -1 < e .defaultValue.indexOf("[") && -1 < e.defaultValue.indexOf("]") && (void 0 !== (e = t[e .defaultValue.substring(1, e.defaultValue.length - 1)]) && (s.label.text = e)), this .applyConditionalClassification(s.label.text, t) ? s.label.text = this .applyConditionalClassification(s.label.text, t).toString() : s.label.text = this .applyConditionalClassification(s.label.text, t), s.label.text = this.o(s.label.text) ? this .s(s.label.text) : s.label.text, -1 < s.label.text.indexOf("[") && -1 < s.label.text .indexOf("]") && (s.label.text = ""), null != s.label.family && (e = this .applyConditionalClassification(s.label.family, t), o = this .applyConditionalClassification(s.label.font, t), s.label.font = 0 <= o ? (3 * o / 4) .toString() + "pt " + e : (3 * (-1 * (72 * o / 96)) / 4).toString() + "pt " + e), s .label.fillColor = mr(this.applyConditionalClassification(s.label.fillColor, t)), s.label .backgroundColor = mr(this.applyConditionalClassification(s.label.backgroundColor, t)), null == s.label.backgroundColor && (s.label.backgroundColor = new Cesium.Color(.165, .165, .165, 0)), s.label.showBackground = !0, null != s.label.showText && ((a = this .applyConditionalClassification(s.label.showText, t)) && 1 === Number(a) && (s.label .onHoverShowText = !0), a && null == viewer.scene.canvas.onHoverShowText && (i = viewer.scene, new Cesium.ScreenSpaceEventHandler(i.canvas).setInputAction(function( e) { var t = {}; i.screenToWorld(e.endPosition, t), Cesium.defined(t.pickPrimitive) && "Billboard" == t.pickPrimitive.constructor.name && null != t .pickPrimitive.label ? null != i.onHoverShowTextArray[t.pickPrimitive .label.id] && (null != i._lastObjectShowOnText && i ._lastObjectShowOnText.id != t.pickPrimitive.label.id && null != i ._lastObjectShowOnText.show && (i._lastObjectShowOnText.show = !1), viewer.scene._lastObjectShowOnText = i.onHoverShowTextArray[t .pickPrimitive.label.id], null != i._lastObjectShowOnText .show && (viewer.scene._lastObjectShowOnText.show = !0)) : null != i ._lastObjectShowOnText && null != i._lastObjectShowOnText.show && (i ._lastObjectShowOnText.show = !1) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), viewer.scene.canvas.onHoverShowText = !0 )), null != s.label.textRelativeToImage && null != s.label.textAlignment && (s.label .textRelativeToImage = this.applyConditionalClassification(s.label.textRelativeToImage, t), s.label.alignment = this.applyConditionalClassification(s.label.textAlignment, t)), null != s.label.underline && (s.label.isUnderline = this .applyConditionalClassification(s.label.underline, t)), null != s.label.bold && 1 == this.applyConditionalClassification(s.label.bold, t) && (s.label.font = "bold " + s.label .font), null != s.label.italic && 1 == this.applyConditionalClassification(s.label .italic, t) && (s.label.font = "italic " + s.label.font), null != s.label .backgroundOpacity && (s.label.backgroundColor.alpha = this.applyConditionalClassification(s .label.backgroundOpacity, t)), null != s.label.minViewingHeight && (r = this .applyConditionalClassification(s.label.minViewingHeight, t), n = 650 * this .applyConditionalClassification(s.label.scaleMPP, t), s.label.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(r, n)), t.FSCALE && (a = this.getLevelDistance(t .FSCALE), s.label.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, a)), s.label.disableDepthTestDistance || (s.label.disableDepthTestDistance = 1e3), s .clampToGround && (s.label.heightReference = 1)), s.billboard && (s.billboard .sizeInMeters = !1, null != s.billboard.imageColor && (o = mr(o = this .applyConditionalClassification(s.billboard.imageColor, t)), s.billboard.color = o), null != s.billboard.imageOpacity && null != s.billboard.color.alpha && (s.billboard.color .alpha = Number(this.applyConditionalClassification(s.billboard.imageOpacity, t))), s .billboard.image = this.applyConditionalClassification(s.billboard.image, t), null != s .billboard.minViewingHeight && (r = this.applyConditionalClassification(s.billboard .minViewingHeight, t), n = 650 * this.applyConditionalClassification(s.billboard .scaleMPP, t), s.billboard.distanceDisplayCondition = new Cesium .DistanceDisplayCondition(r, n)), t.FSCALE && (a = this.getLevelDistance(t.FSCALE), s .billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, a)), s .billboard.link && s.id && "object" == typeof s.id && (s.id.link = this .applyConditionalClassification(s.billboard.link, t)), s.billboard .disableDepthTestDistance || (s.billboard.disableDepthTestDistance = 1e3), s .clampToGround && (s.billboard.heightReference = 1)), s.model && (e = function(e) { e = Number(e); return e = Cesium.defined(e) && !isNaN(e) ? e : 0 }, s.model.uri = this.applyClassification(s.model.uri, t), s.model.scale = e(this .applyClassification(s.model.scale, t)), r = e(this.applyClassification(s.model.heading, t)), n = e(this.applyClassification(s.model.pitch, t)), a = e(this.applyClassification(s .model.roll, t)), e = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(r), Cesium.Math .toRadians(n), Cesium.Math.toRadians(a)), s.model.modelMatrix = Cesium.Transforms .headingPitchRollToFixedFrame(s.position, e)), this.createLineToGroundOptions(s, t), s }, sr.prototype.s = function(e) { return e.split("").reverse().join("") }, sr.prototype.getLevelDistance = function(e) { var t = 2e7; switch (parseInt(e)) { case 2: t = 10123e3; break; case 3: t = 7123e3; break; case 4: t = 6321e3; break; case 5: t = 5522e3; break; case 6: t = 3436e3; break; case 7: t = 539e3; break; case 8: t = 305e3; break; case 9: t = 18e4; break; case 10: t = 133e3; break; case 11: t = 1e5; break; case 12: t = 76500; break; case 13: t = 58200; break; case 14: t = 23500; break; case 15: t = 9600; break; case 16: t = 4e3; break; case 17: t = 2e3; break; case 18: t = 1700; break; case 19: t = 1500; break; case 20: t = 1e3; break; case 21: t = 500; break; case 22: t = 200; break; case 23: t = 100 } return t }, sr.prototype.o = function(e) { if (!e) return e; return new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e[0]) }, sr.prototype.applyClassification = function(e, t) { if ("string" !== $.type(e)) return e; if (null != /(\[([^\]]+)\])/g.exec(e)) for (var i in t) e = gr(e, "[" + i + "]", t[i]); for (var o = /(\<([^\>]+)\>)/g, r = o.exec(e = "undefined" == e ? "" : e); null != r;) { try { var n = r[r.length - 1], a = (0, eval)(n); e = e.replace(r[0], a) } catch (e) {} r = o.exec(e) } return e }, sr.prototype.getPolygonStyle = function(e) { return $.extend(!0, {}, Cr.DEFAULT_POLYGON_STYLE, e) }, sr.prototype.getLinestringStyle = function(e) { return $.extend(!0, {}, Cr.DEFAULT_POLYLINE_STYLE, e) }, sr.prototype.getPointStyle = function(e) { return null != e.label ? $.extend(!0, {}, Cr.DEFAULT_LABEL_STYLE, e) : null != e.billboard ? $ .extend(!0, {}, Cr.DEFAULT_BILLBOARD_STYLE, e) : null != e.model ? $.extend(!0, {}, Cr .DEFAULT_MODEL_STYLE, e) : null != e.point ? $.extend(!0, {}, Cr.DEFAULT_POINT_STYLE, e) : Cr.DEFAULT_POINT_STYLE }, sr.prototype.sanitizePositions = function(e) { for (var t = 0; t < e.length; t++) e[t] instanceof Array ? this.sanitizePositions(e[t]) : isNaN(e[ t]) && (e[t] = 0) }, {}); function U(e, t, i, o, r, n, a, s, l) { var u, c = this; function h(t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(p(t, i), function(e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise } function m(e, t) { for (var i = e.tilingScheme, o = i.positionToTileXY(t, 0), e = c._Viewer.scene.globe._surface .tileProvider.quadtree._levelZeroTiles, r = e[0].x == o.x && e[0].y == o.y ? e[0] : e[1], n = 1; n < 22; n++) { var a = function(e, t) { for (var i = 0; i < e.children.length; i++) if (e.children[i].state >= Cesium.QuadtreeTileLoadState.DONE && (null != e.children[i] .data.terrainData._mesh || null != e.children[i].data.terrainData._buffer) && e .children[i].x == t.x && e.children[i].y == t.y) return e.children[i] }(r, o = i.positionToTileXY(t, n)); if (null == a) break; r = a } return r } function d(e) { var t; for ($.grep(c._Viewer.scene.primitives._primitives, function(e) { return e instanceof Cesium.Cesium3DTileset }), t = 0; t < e.length; ++t) { var i = e[t], o = i instanceof Cesium.Cartographic, r = o ? i : Cesium.Cartographic.fromCartesian(i); r.height = c.G, o || (o = Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude, r.latitude, r .height ])[0], i.z = o.z) } return e } function p(e, t) { for (var i = 0; i < t.length; ++i) { var o = t[i], r = m(e, o); o.height = r.data.terrainData.interpolateHeight(r.rectangle, o.longitude, o.latitude) } return t } function g(e) { this.value = new Float32Array([e]) } this._viewer = e, this._Viewer = e, c.G = 65535, _r = new ko, Er = new Jo({ workerPath: function() { for (var e = document.scripts, t = "./wfs/featurefetcherworker.js", i = 0; i < e .length; i++) { var o = e[i].src.split("/"), o = o[o.length - 1]; "SmartEarth.js" == o ? t = e[i].outerHTML.split('"')[1].replace("SmartEarth.js", "Workers/featurefetcherworker.js") : "SmartEarth.min.js" == o && (t = e[i] .outerHTML.split('"')[1].replace("SmartEarth.min.js", "Workers/featurefetcherworker.js")) } return t }() }), Cesium.sampleRenderedData || (Cesium.Resource && (Cesium.loadText = Cesium.Resource.fetchText, Cesium.loadJson = Cesium.Resource.fetchJson, Cesium.loadBlob = Cesium.Resource.fetchBlob, Cesium .loadArrayBuffer = Cesium.Resource.fetchArrayBuffer, Cesium.loadImage = Cesium.Resource .fetchImage), g.fromZBias = function(e) { if (Cesium.defined(e)) return new g(e); throw new DeveloperError("zbias is required.") }, g.toValue = function(e, t) { if (Cesium.defined(e)) return Cesium.defined(t) ? color.toBytes(t) : new Float32Array(e); throw new DeveloperError("zbias is required.") }, g.equals = function(e, t) { return e === t || Cesium.defined(e) && Cesium.defined(t) && e.value[0] === t.value[0] }, g.defaultBias = function() { return g.fromZBias(15e-6) }, Cesium.ZBiasGeometryInstanceAttribute = g, Cesium.ZBiasGeometryInstanceAttribute = g, Cesium .SampleRenderedDataFlags = { TERRAIN: 2, MESH: 4, FLOOR: 8 }, Cesium.DynamicEyeOffset = function(e) { return void 0 === e && (e = 0), new Cesium.Cartesian3(.001234321, 0, e) }, Cesium.sampleRenderedData = function(r, e) { var t, i = 2, o = 4, n = 8, a = (null == e && (e = i | o), Cesium.when.defer()), s = [], l = (i < e ? r.forEach(function(e) { s.push(Cesium.Cartographic.fromRadians(e.longitude, e.latitude, e.height)) }) : s = r, []), u = (e & i && l.push(h(c._Viewer.terrainProvider, r)), 0 < (e & n)); return e & (o | n) && l.push((i = s, Cesium.Check.defined("positions", i), t = Cesium.when .defer(), Cesium.when(d(i), function(e) { t.resolve(e) }), t.promise)), Cesium.when.all(l).then(function(e) { if (1 < l.length) for (var t = 0; t < r.length; t++) { var i = e[0][t], o = e[1][t]; o.height != c.G && (i.height < o.height || u) && (i.height = o.height) } a.resolve(e[0]) }), a.promise }, Cesium.sampleRenderedMesh = function(e, t) { Cesium.Check.defined("positions", e); var i = Cesium.when.defer(); return Cesium.when(d(e), function(e) { i.resolve(e) }), i.promise }, Cesium.sampleRenderedTerrain = function(t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(p(t, i), function(e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise }, Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo = function() { var e, t = this.getRenderedLevelInfo(), i = 0; for (e in t) i < Number(e) && (i = Number(e)); return { bestLevel: i, count: t[i] } }, Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo = function() { var t = []; return this._tilesToRender.forEach(function(e) { null == t[e.level] && (t[e.level] = 0), t[e.level]++ }), t }), r = r || {}, this._level = o || { min: 0, max: 22 }, "number" == typeof this._level && (this._level = { min: o, max: 22 }), this._url = t, this._layerName = i, this._guid = Cesium.createGuid(), this._gmlParser = new Vo(!0, null, null, !0), this._tileManager = _r.getInstance(e), this._tileManager._loadTileEvent .addEventListener(U.prototype.loadTile, this), this._useWorkers = !0, this._layerDisplayName = n, this ._showAttributesAsMessage = r.showAttributesAsMessage, delete r.showAttributesAsMessage, this ._entityCreator = new sr(r, e), this._visible = !0, this._featuresMap = {}, this._boundingBox = void 0, this._geometryFieldName = void 0, this._operations = {}, this._subdomains = a, this.latLon = s, this ._addedFeatures = [], this.simpleSqlParser = Xo, this.myLayer = l, this._statistics = { numberOfAddedFeatures: 0, numberOfDeletedFeatures: 0, numberOfAddePositions: 0, numberOfDeletedPositions: 0, getNumberOfCurrentlyRenderedFeatures: function() { return this.numberOfAddedFeatures - this.numberOfDeletedFeatures }, getNumberOfCurrentlyRenderedPositions: function() { return this.numberOfAddePositions - this.numberOfDeletedPositions } }, o = (u = this).cleanUrl(u._url).replace("{s}", u.sTag(u._layerName.length, u._layerName.length, u ._level)), o = (o += Tr(o)) + ( "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName=" + u._layerName), t = Cesium.TrustedServers.contains(wr(u._url, u._subdomains)), $.ajax({ dataType: "xml", xhrFields: { withCredentials: t }, url: encodeURI(o), success: function(e) { var i, o; o = u, br(e, "FeatureType", "wfs").each(function(e, t) { return br(t, "Name", "wfs").text() != o._layerName || (1 === (t = br(t, "LatLongBoundingBox", "wfs")).length && (o._boundingBox = Cesium .Rectangle.fromDegrees(parseFloat(t[0].attributes.minx.value), parseFloat(t[0].attributes.miny.value), parseFloat(t[0] .attributes.maxx.value), parseFloat(t[0].attributes.maxy .value))), !1) }), i = u, $(e).find("FeatureType").each(function(e, t) { return $(t).children("Name").text() != i._layerName || (0 != (t = $(t) .children("Operations")).length && t.children().each( function() { i._operations[this.tagName.toLowerCase()] = {} }), !1) }) } }), Sr(this) } function wr(e, t) { t = -1 != e.indexOf("{s}") ? null != t && 0 < t.length ? e.replace("{s}", t[0]) : console.error( "Error - sTag with no subdomains.") : e; return t } function br(e, t, i) { var o = $(e).find(t); return 0 < (o = 0 == o.length && "wfs" === i.toLowerCase() ? $(e).find("wfs\\:" + t + "," + t) : o).length ? o : $([]) } function Tr(e) { return -1 < e.indexOf("?") ? "&" : "?" } function Sr(i) { i.featureColumnNames = null; var e = i.cleanUrl(i._url).replace("{s}", i.sTag(i._layerName.length, i._layerName.length, i._level)), t = (e = (e += Tr(e)) + ("SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName=" + i ._layerName), Cesium.TrustedServers.contains(wr(i._url, i._subdomains))); $.ajax({ dataType: "xml", xhrFields: { withCredentials: t }, url: encodeURI(e), success: function(e) { var o, t; o = i, e = e, t = $(e).find("[type^='gml:']"), o._geometryFieldName = $(t).attr("name"), o.geometryResponseData = e, o.wfsNamespace = function(e, t) { let i = eval; if (null == e) return null; try { var o = (new XMLSerializer).serializeToString(e).match(i("/[<]([a-z]+):" + t + "[>]/i")); return null != o ? o[1] : null } catch (e) { return !1 } }(o.geometryResponseData, "sequence"), null == o.wfsNamespace && (o.wfsNamespace = "xsd"), o.sgSchemaExists = $(o.geometryResponseData).find(o.wfsNamespace + "\\:schema").attr("xmlns:sfs"), o.sgSchemaExists || (o.sgSchemaExists = $(o .geometryResponseData).find("schema").attr("xmlns:sfs")), 0 == (t = $(o .geometryResponseData).find(o.wfsNamespace + "\\:sequence " + o .wfsNamespace + "\\:element")).length && (t = $(o.geometryResponseData).find( "sequence").find("element")), o.geomFields = [], t.each(function() { var e, t = $(this), i = t.attr("name"), t = t.attr("type"); null == t ? t = "string" : (e = t.match(/.*[:](\w+)/)) && (t = e[1]), o .geomFields.push({ name: i, type: t }) }) } }) } function Pr(e) { return null == e ? void 0 : e.parentLayer ? e : e._parentCollection || (e.primitive && e.primitive ._parentCollection ? e.primitive._parentCollection : void 0) } Object.defineProperties(Cr, { DEFAULT_POLYGON_STYLE: { get: function() { return { polygon: { perPositionHeight: !0, fill: 0, material: Cesium.Color.GREEN, outline: !0, outlineColor: Cesium.Color.WHITE, outlineWidth: 1 } } } }, DEFAULT_POLYLINE_STYLE: { get: function() { return { polyline: { material: Cesium.Color.WHITE, width: 1 } } } }, DEFAULT_POINT_STYLE: { get: function() { return { point: { color: Cesium.Color.RED, pixelSize: 5, outlineColor: Cesium.Color.WHITE, outlineWidth: 2 } } } }, DEFAULT_LABEL_STYLE: { get: function() { return { label: { text: "Text", font: "18px arial", style: Cesium.LabelStyle.FILL, fillColor: Cesium.Color.WHITE, outlineColor: Cesium.Color.BLACK, outlineWidth: 5, scale: 1, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, eyeOffset: Cesium.Cartesian3.ZERO, pixelOffset: new Cesium.Cartesian2(0, -50) } } } }, DEFAULT_BILLBOARD_STYLE: { get: function() { return { billboard: { image: "./img/query.png", scale: 1, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM } } } }, DEFAULT_MODEL_STYLE: { get: function() { return { model: { uri: "./img/CesiumTexturedBoxTest.bgltf", scale: 1e3 } } } } }), Object.defineProperties(U.prototype, { LayerDisplayName: { get: function() { return this._layerDisplayName } }, displayName: { get: function() { return this.LayerDisplayName } }, guid: { get: function() { return this._guid } }, Style: { get: function() { return this._entityCreator.style } }, show: { get: function() { return this._visible }, set: function(e) { this.setVisibility(e) } }, BoundingBox: { get: function() { return this._boundingBox } }, boundingSphere: { get: function() { return Cesium.BoundingSphere.fromRectangle3D(this._boundingBox) } }, Statistics: { get: function() { return this._statistics } } }); var Er, xr = 180 / Math.PI; function Ir(e) { this.Viewer = e, this._core = new f, this.colorTool = this._core.gradientColor() } function Dr(e, t) { this._viewer = e, this._cesium = t } U.prototype.getRequestMaxFeatures = function() { return 1e3 }, U.prototype.isAttributeField = function(e, t) { return !(!t || !e || "" == e.toLowerCase() || "fid" == e.toLowerCase()) && ("string" == t .toLowerCase() || "integer" == t.toLowerCase() || "double" == t.toLowerCase()) }, U.prototype.updateFeatures = function(e, o) { var t, i, r, n, a, s; e.length <= 0 ? o() : (t = this, i = [], $(this.geomFields).each(function() { t.isAttributeField(this.name, this.type) && i.push(this.name) }), r = " {wfs_updates}", n = "", $(e).each(function() { var e = this, t = ''.replace("{lyaer_id}", this.layerId); $(i).each(function() { t += "" + this + "" + e[ this] + "" }), t += '', n += t += "" }), r = " {wfs_updates}" .replace("{wfs_updates}", n), a = "Failed to save changes to server", e = wr(this.cleanUrl(this ._url), this._subdomains), s = Cesium.TrustedServers.contains(e), $.ajax({ dataType: "xml", type: "POST", data: r, xhrFields: { withCredentials: s }, url: encodeURI(e), success: function(e) { null == (new XMLSerializer).serializeToString(e.documentElement).toLowerCase() .match(/success\s*\//) ? o(a) : o() }, error: function(e, t, i) { o(a) }, timeout: 1e4 })) }, U.prototype.getFeatures = function(e, t, r) { var i = this, o = [], n = ($(this.geomFields).each(function() { i.isAttributeField(this.name, this.type) && o.push(this.name) }), " {wfs_filter} " ), a = (n = (n = n.replace("{layer_name}", this._layerName)).replace("{REQUEST_MAX_FEATURES}", 1e3), ""), e = ("" != e.replace(/[ ]/g, "") && (a = (a = "" ) + function e(t, i) { if (t.operator) { var o = ""; switch (t.operator.toLowerCase()) { case "=": o = "PropertyIsEqualTo"; break; case "<>": o = "PropertyIsNotEqualTo"; break; case ">": o = "PropertyIsGreaterThan"; break; case ">=": o = "PropertyIsGreaterThanOrEqualTo"; break; case "<": o = "PropertyIsLessThan"; break; case "<=": o = "PropertyIsLessThanOrEqualTo"; break; case "like": o = "PropertyIsLike" } var r = -1 != i.indexOf(t.right) ? t.right : t.left, n = ""; n += "" + r + ""; var a = null == (r = (r = -1 != i.indexOf(t.right) ? t.left : t.right).replace( /^'|'$$/g, "")).match(/^[%]|[%]$$/); return n = n + ("" + (r = "like" == t.operator.toLowerCase() && a ? "%" + r + "%" : r)) + "" } a = "and" == t.logic.toLowerCase() ? "And" : "Or", n = ""; return 2 == t.terms.length ? n += e(t.terms[0], i) : n += e({ logic: a, terms: t.terms.slice(0, t.terms.length - 1) }, i), n = n + e(t.terms[t.terms.length - 1], i) + "" }(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE " + e).WHERE, o) + ""), n = n .replace("{wfs_filter}", a), wr(this.cleanUrl(this._url), this._subdomains)), a = Cesium.TrustedServers.contains(e); t.xhr = $.ajax({ url: encodeURI(e), type: "POST", data: n, dataType: "xml", xhrFields: { withCredentials: a }, success: function(e) { var o, t; ! function(t, i) { if (null == t) return !1; try { let e = eval; return null != (new XMLSerializer).serializeToString(null != t.context ? t .context : t).match(e("/[<](([a-z]+):)?" + i + "[^>]*[>]/i")) } catch (e) { return !1 } }($(e), "FeatureCollection") ? r(null, TELang.i18n("layer_error_reading_features")): (e = e, o = [], (t = 0 == (t = $(e).find("gml\\:featureMember")).length ? $(e) .find("featureMember") : t).each(function() { var e = {}, t = $(this).children().first(), i = (e.layerId = t[0].nodeName, e.originFid = t.attr("fid"), e .fid = t.attr("fid"), null == e.fid && (e.fid = -1), e.fid .match(/[.]?(\d+)$$/)); i && (e.fid = i[1]), e.node = t[0], t.children().each(function() { e[this.nodeName] = this.innerHTML, null == e[this .nodeName] && (e[this.nodeName] = $(this) .text()) }), o.push(e) }), r(o)) }, error: function(e, t, i) { r(null, e.statusText) }, timeout: 1e4 }) }, U.prototype.getFeatureColumnNames = function() { if (this.featureColumnNames) return this.featureColumnNames; var e = $(this.geometryResponseData).find(this.wfsNamespace + "\\:sequence " + this.wfsNamespace + "\\:element"), t = (0 == e.length && (e = $(this.geometryResponseData).find("sequence").find("element")), []); return e.each(function() { var e = $(this); "geom" != e.attr("name").toLowerCase() && t.push(e.attr("name").toLowerCase()) }), this.featureColumnNames = t, this.featureColumnNames }, U.prototype.refresh = function(e) { for (var t = this._tileManager.getAllTiles(), i = t.length, o = 0; o < i; o++) t[o].data.wfsLayerData[ this._guid] && t[o].data.wfsLayerData[this._guid].freeResources(), this.loadTile(t[o]); e && Sr(this) }, U.prototype.setVisibility = function(e) { if (this._visible != e) if (0 == (this._visible = e)) for (var t = (o = this._tileManager.getAllTiles()).length, i = 0; i < t; i++) o[i].data .wfsLayerData[this._guid] && o[i].data.wfsLayerData[this._guid].primitive && (o[i].data .wfsLayerData[this._guid].primitive.show = !1); else for (var o, t = (o = this._tileManager.getAllTiles()).length, i = 0; i < t; i++) o[i].data .wfsLayerData[this._guid] && (o[i].data.wfsLayerData[this._guid].primitive ? o[i].data .wfsLayerData[this._guid].primitive.show = !0 : this.loadTile(o[i])) }, U.prototype.loadTile = function(e) { var t = this; e.data.wfsLayerData[this._guid] = { id: e.data.id, primitive: void 0, freeResources: function() { Cesium.defined(this.xhr) && (this.xhr.abort(), this.xhr = void 0), Cesium.defined(this .features) && (t.removeFeaturesFromLayer(this.features), this.features = void 0), Cesium.defined(this.primitive) && (t._tileManager.removeFromScene(this .primitive), this.primitive = void 0) } }, this.show && e.level >= this._level.min && e.level <= this._level.max && (this.statc = 0, this ._guide = this._guid, this.beginLoadWFSData(e)) }, U.prototype.isDestroyed = function() { return !1 }, U.prototype.destroy = function() { var e = this._tileManager.getAllTiles(), t = e.length; if (0 < t) for (var i = 0; i < t; i++) e[i].data.wfsLayerData[this._guid] && e[i].data.wfsLayerData[this._guid] .freeResources(); return this._tileManager._loadTileEvent.removeEventListener(U.prototype.loadTile, this), Cesium .destroyObject(this) }, U.prototype.sTag = function(e, t, i) { if (null == this._subdomains) return ""; e = (e + t + i) % this._subdomains.length; return this._subdomains[e] }, U.prototype.cleanUrl = function(e) { return -1 != e.indexOf("?") ? e.split("?")[0] : e }, U.prototype.beginLoadWFSData = function(t) { var i, o, e; null != this.latLon && !this.latLon || (null == this.BoundingBox || 0 != this.BoundingBox.width && 0 != this.BoundingBox.height || (this.BoundingBox.east += 1, this.BoundingBox.north += 1, this .BoundingBox.beenModified = !0), void 0 !== this.BoundingBox && void 0 === Cesium.Rectangle .intersection(this.BoundingBox, t.rectangle) || (e = [xr * t.rectangle.west, xr * t.rectangle .south, xr * t.rectangle.east, xr * t.rectangle.north ], o = (i = this).cleanUrl(this._url).replace("{s}", this.sTag(t.x, t.y, t.level)), o = ( o += Tr(o)) + ( "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName=" + this ._layerName + "&srsName=EPSG:4326&BBOX=" + e.join(",")), e = Cesium.TrustedServers .contains(wr(this._url, this._subdomains)), t.data.wfsLayerData[this._guid].xhr = $.ajax({ dataType: this._useWorkers ? "text" : "xml", url: encodeURI(o), cache: !0, xhrFields: { withCredentials: e }, success: function(e) { i.processWFSData(t, e) }, error: function(e, t, i) { "abort" !== i && console.log("Failed to retrieve data from " + o + " :" + i) }, complete: function() { t.data.wfsLayerData[i._guid].xhr = void 0 } }))) }, U.prototype.processWFSData = function(e, t) { var i; e.data.wfsLayerData[this._guid].xhr = void 0, this._useWorkers ? Er.queueWorkItem({ id: e.data.id, text: t, geometryFieldName: (i = this)._geometryFieldName }).then(function(e) { i.addFeaturesToTile(e) }) : (t = this._gmlParser.read(t), this.addFeaturesToTile({ id: e.data.id, features: t })) }, U.prototype.boundingSphereFromGML = function(e, i) { var t = viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel, o = this; Er.queueWorkItem({ id: "0", text: e, geometryFieldName: this._geometryFieldName }).then(function(e) { e = { parentLayer: o, features: e.features, sampleTerrainLevel: t + 1, isQuery: !0, onFinishedQuery: function(e) { var t; 0 < e.length && (t = Cesium.BoundingSphere.fromBoundingSpheres(e)), i(t) } }; o._entityCreator.createPrimitiveFromWFSFeatures(e) }) }, U.prototype.boundingSphereFromFeature = function(e) { var t, i = viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel; return this._entityCreator.createPrimitiveFromWFSFeatures({ parentLayer: this, features: [e], sampleTerrainLevel: i + 1, isQuery: !0, onFinishedQuery: function(e) { 0 < e.length && (t = Cesium.BoundingSphere.fromBoundingSpheres(e)) } }), t }, U.prototype.addRenderedFeatureId = function(e) { null == this._addedFeatures[e] && (this._addedFeatures[e] = 0), this._addedFeatures[e]++ }, U.prototype.removeRenderedFeatureId = function(e) { null != this._addedFeatures[e] && this._addedFeatures[e]--, 0 == this._addedFeatures[e] && (this ._addedFeatures[e] = void 0) }, U.prototype.isExistRenderedFeatureId = function(e) { return null != this._addedFeatures[e] }, U.prototype.addFeaturesToTile = function(i, o) { var r, e, n = this._tileManager.getTile(i.id); void 0 !== n && (e = o ? n.data.wfsLayerData[this._guid].primitive._instanceIds : void 0, e = { parentLayer: r = this, originalInstanceIds: e, features: i.features, onFinishedCreatePrimitive: function(e) { var t; null != i.features && null != n.data.wfsLayerData && (n.data.wfsLayerData[r._guid] .features = i.features, o || r.addFeaturesToLayer(n.data.wfsLayerData[r ._guid].features), (void 0 === e.length || 0 < e.length) && (t = n.data .wfsLayerData[r._guid].primitive, e.show = r.show, (n.data.wfsLayerData[ r._guid].primitive = e).parentLayer = r, e.parentTileId = i.id, e ._guid = Cesium.createGuid(), o ? r._tileManager.replaceInScene(t, e) : r._tileManager.addToScene(e))) } }, this._entityCreator.createPrimitiveFromWFSFeatures(e)) }, U.prototype.addFeaturesToLayer = function(e) { this._statistics.numberOfAddedFeatures += e.length, this._statistics.numberOfAddePositions += Cesium .defaultValue(e.numPositions, 0); for (var t = e.length, i = 0; i < t; i++) !1 === Object.prototype.hasOwnProperty.call(this._featuresMap, e[i].fid) ? this._featuresMap[e[i].fid] = { refCount: 1, feature: e[i] } : this._featuresMap[e[i].fid].refCount++ }, U.prototype.removeFeaturesFromLayer = function(e) { this._statistics.numberOfDeletedFeatures += e.length, this._statistics.numberOfDeletedPositions += Cesium.defaultValue(e.numPositions, 0); for (var t = e.length, i = 0; i < t; i++) !1 !== Object.prototype.hasOwnProperty.call(this._featuresMap, e[i].fid) && (this._featuresMap[e[i].fid].refCount--, 0 === this._featuresMap[e[i].fid] .refCount && delete this._featuresMap[e[i].fid], this.removeRenderedFeatureId(e[i].fid)) }, U.prototype.getFeature = function(e) { return !1 === Object.prototype.hasOwnProperty.call(this._featuresMap, e) ? null : this._featuresMap[e] }, U.prototype.updateTile = function(e) { e = this._tileManager.getTile(e); void 0 !== e && (null == e.data.wfsLayerData[this._guid].features ? this.loadTile(e) : this .addFeaturesToTile(e.data.wfsLayerData[this._guid], !0)) }, U.blockRequestPrimitiveFromPrimitive = function(e) { var t; if (null != e) return t = Pr(e), null == t && (e._labelCollection && e._labelCollection ._billboardCollection ? t = Pr(e._labelCollection._billboardCollection) : e ._billboardCollection && (t = Pr(e._billboardCollection))), t }, U.prototype.resetAttributesTable = function() { this.lastEditedCell = null, this.attrTblDialogMemo = null }, Ir.prototype.CreateWfs = function(e, t) { let i = {}, o, r; var n; if ("point" === e ? t.sgStyleJSON ? i = this.getSGStyle("point", t.sgStyleJSON, t.name) : (o = this .colorTool.colorRgb(this._core.defaultValue(t.color, "#ffffff")), n = this.colorTool.colorRgb( this._core.defaultValue(t.bgColor, "#010101")), i = { lineToGround: { defaultValue: "0" }, lineToGroundLength: { defaultValue: "0" }, lineToGroundColor: { defaultValue: { red: 1, green: 1, blue: 1, alpha: 1 } }, altitudeMethod: 0, altitudeOffset: { defaultValue: "0" }, clampToGround: this._core.defaultValue(t.clampToGround, !1) }, t.text && (t.offsetX && (t.offsetX = parseInt(t.offsetX)), t.offsetY && (t.offsetY = parseInt(t.offsetY)), i.label = { text: { defaultValue: t.text }, scaleMPP: { defaultValue: "15000" }, fillColor: { defaultValue: { red: o[0] / 255, green: o[1] / 255, blue: o[2] / 255, alpha: this._core.defaultValue(t.alpha, 1) } }, scaleByDistance: { near: 150, nearValue: 1, far: 8e5, farValue: .5 }, minViewingHeight: { defaultValue: "0" }, font: { defaultValue: "12" }, family: { defaultValue: this._core.defaultValue(t.font, "Arial") }, backgroundColor: { defaultValue: { red: n[0] / 255, green: n[1] / 255, blue: n[2] / 255, alpha: this._core.defaultValue(t.alpha, 1) } }, scale: this._core.defaultValue(t.scale, 2), backgroundOpacity: { defaultValue: t.bgColor ? "0.5" : "0" }, italic: { defaultValue: t.italic ? "1" : "0" }, bold: { defaultValue: t.bold ? "1" : "0" }, limitGrowth: { defaultValue: "1" }, textRelativeToImage: { defaultValue: "0" }, showText: { defaultValue: "0" }, textAlignment: { defaultValue: "17" }, pixelOffset: new Cesium.Cartesian2(this._core.defaultValue(t.offsetX, 0), this._core .defaultValue(t.offsetY, t.image ? -10 : 0)), outlineColor: Cesium.Color.fromCssColorString(this._core.defaultValue(t.outlineColor, "#ffffff")), outlineWidth: this._core.defaultValue(t.outlineWidth, 2), horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, disableDepthTestDistance: "Infinity" === t.disableDepthTestDistance ? Number .POSITIVE_INFINITY : t.disableDepthTestDistance }), t.outlineColor && i.label && (i.label.style = Cesium.LabelStyle.FILL_AND_OUTLINE), t .image && (i.billboard = { image: t.image, scale: this._core.defaultValue(t.imageScale, 1), disableDepthTestDistance: t.disableDepthTestDistance, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, link: t.link })) : "polyline" === e ? i = t.sgStyleJSON ? this.getSGStyle("polyline", t.sgStyleJSON, t .name) : { polyline: { material: { red: (o = this.colorTool.colorRgb(this._core.defaultValue(t.color, "#ffff00")))[0] / 255, green: o[1] / 255, blue: o[2] / 255, alpha: this._core.defaultValue(t.alpha, 1) }, outlineColor: Cesium.Color.fromCssColorString(this._core.defaultValue(t.outlineColor, "#ffffff")), lineOpacity: this._core.defaultValue(t.alpha, 1), outlineWidth: this._core.defaultValue(t.outlineWidth, 0), width: this._core.defaultValue(t.width, 4), clampToGround: this._core.defaultValue(t.clampToGround, !0), dash: t.dash, gapColor: t.gapColor && Cesium.Color.fromCssColorString(t.gapColor), dashLength: t.dashLength }, altitudeOffset: t.height } : "polygon" === e && (i = t.sgStyleJSON ? this.getSGStyle("polygon", t.sgStyleJSON, t.name) : (o = this.colorTool.colorRgb(this._core.defaultValue(t.color, "#6bbeef")), { polygon: { outlineColor: { defaultValue: { red: (r = this.colorTool.colorRgb(this._core.defaultValue(t.outlineColor, "#ffffff")))[0] / 255, green: r[1] / 255, blue: r[2] / 255, alpha: this._core.defaultValue(t.alpha, 1) } }, outlineWidth: 1, fill: { defaultValue: this._core.defaultValue(t.alpha, 1) }, height: t.height, extrudedHeight: t.extrudedHeight, clampToGround: this._core.defaultValue(t.clampToGround, void 0 === t .extrudedHeight && void 0 === t.height), water: t.water, outline: this._core.defaultValue(t.outline, !0), material: { defaultValue: { red: o[0] / 255, green: o[1] / 255, blue: o[2] / 255, alpha: this._core.defaultValue(t.alpha, 1) } }, fromKml: !0 } })), i || !t.sgStyleJSON) return i.position_x && (t.lon = i.position_x, t.lat = i.position_y, t .height = i.position_z), new U(this.Viewer, this._core.defaultValue(t.urls, i.urls), this ._core.defaultValue(t.layer, i.layer), { min: this._core.defaultValue(t.minimumLevel, i.minimumLevel || 0), max: this._core.defaultValue(t.maximumLevel, i.maximumLevel || 22) }, i, this._core.defaultValue(t.layer, i.layer), t.pID || "0", t.checked, void 0); console.log(t.name + "获取样式失败!") }, Ir.prototype.getSGColor = function(e) { let t = parseInt(e).toString(16); return 2 === t.length ? t = "0000" + t : 4 === t.length && (t = "00" + t), t = "#" + t.slice(4) + t .slice(2, 4) + t.slice(0, 2) }, Ir.prototype.getSGStyle = function(r, e, n) { let a; return $.ajax({ url: e, async: !1, contentType: "application/json", success: e => { let t = (e = e && "string" == typeof e ? JSON.parse(e) : e).filter(e => e .LayerName === n); var i, o; "point" === r ? (e = t[0], (t = e.Point).Line_Color = this.getSGColor(t.Line_Color), t.Image_Color = this.getSGColor(t.Image_Color), t.Text_Color = this .getSGColor(t.Text_Color), t.Background_Color = this.getSGColor(t .Background_Color), i = this.colorTool.colorRgb(this._core.defaultValue( t.Text_Color, "#ffffff")), o = this.colorTool.colorRgb(this._core .defaultValue(t.Background_Color, "#010101")), a = { label: { text: { defaultValue: this._core.defaultValue(t.Text.match( /(\S*)<\/Value>/)[1], t.Text.match( /(\S*)<\/DefaultValue>/)[1]) }, scaleMPP: { defaultValue: t.Scale }, fillColor: { defaultValue: { red: i[0] / 255, green: i[1] / 255, blue: i[2] / 255, alpha: 1 } }, scaleByDistance: { near: 0, nearValue: 1, far: 8e8, farValue: 1 }, minViewingHeight: { defaultValue: "0" }, font: { defaultValue: t.Text_Size }, family: { defaultValue: this._core.defaultValue(t.Font, "Arial") }, backgroundColor: { defaultValue: { red: o[0] / 255, green: o[1] / 255, blue: o[2] / 255, alpha: 1 } }, scale: this._core.defaultValue(t.TextScale, 1.5), backgroundOpacity: { defaultValue: t.Background_Opacity }, italic: { defaultValue: t.Italic }, bold: { defaultValue: t.Bold }, limitGrowth: { defaultValue: "1" }, textRelativeToImage: { defaultValue: "0" }, showText: { defaultValue: "0" }, textAlignment: { defaultValue: "17" }, pixelOffset: new Cesium.Cartesian2(this._core.defaultValue(t .offsetX, 0), this._core.defaultValue(t.offsetY, t .Image_file ? -10 : 0)), outlineColor: Cesium.Color.fromCssColorString(this._core .defaultValue(t.Line_Color, "#ffffff")), outlineWidth: this._core.defaultValue(t.outlineWidth, 2), horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM }, lineToGround: { defaultValue: t.Line_to_Ground }, lineToGroundLength: { defaultValue: t.Line_Length }, lineToGroundColor: { defaultValue: { red: 1, green: 1, blue: 1, alpha: 1 } }, altitudeMethod: 0, altitudeOffset: { defaultValue: "0" }, clampToGround: this._core.defaultValue(t.clampToGround, !0), pointHeight: this._core.defaultValue(t.pointHeight, void 0), minimumLevel: this._core.defaultValue(t.level_min, 0), maximumLevel: this._core.defaultValue(t.level_max, 22), position_x: e.position_x, position_y: e.position_y, position_z: 0 == e.position_z ? 1e4 : e.position_z, urls: e.Server, layer: e.ServerName }, t.Line_Color && a.label && (a.label.style = Cesium.LabelStyle .FILL_AND_OUTLINE), t.Image_file && (a.billboard = { image: t.Image_file, scale: this._core.defaultValue(t.ImageScale, 1), scaleMPP: { defaultValue: t.Scale }, scaleByDistance: { near: 0, nearValue: 1, far: 8e8, farValue: 1 }, minViewingHeight: { defaultValue: "0" }, verticalOrigin: Cesium.VerticalOrigin.BOTTOM })) : "polyline" === r ? (i = t[0], (t = i.Line).Line_Color = this .getSGColor(t.Line_Color), t.Line_Width && (2 === t.Line_Width.length ? t .Line_Width /= 10 : 3 === t.Line_Width.length && (t.Line_Width /= 100)), o = this.colorTool.colorRgb(this._core.defaultValue(t.Line_Color, "#ff0000")), a = { polyline: { material: { red: o[0] / 255, green: o[1] / 255, blue: o[2] / 255, alpha: 1 }, lineOpacity: parseInt(this._core.defaultValue(t.Line_Opacity, 1)), width: parseInt(this._core.defaultValue(t.Line_Width, 4)), near: t.Near, far: t.Far, clampToGround: this._core.defaultValue(t.clampToGround, !0) }, minimumLevel: this._core.defaultValue(t.level_min, 0), maximumLevel: this._core.defaultValue(t.level_max, 22), position_x: i.position_x, position_y: i.position_y, position_z: 0 == i.position_z ? 1e4 : i.position_z, urls: i.Server, layer: i.ServerName }) : "polygon" === r && (e = t[0], (t = e.data).fill = Cesium.Color .fromCssColorString(t.fill), t.outlineColor = Cesium.Color .fromCssColorString(t.outlineColor), a = { polygon: { outlineColor: { defaultValue: t.outlineColor }, outlineWidth: t.outlineWidth, fill: { defaultValue: t.fill.alpha }, extrudedHeight: t.extrudedHeight || 0, height: t.height, outline: t.outline, material: { defaultValue: t.fill }, clampToGround: !t.extrudedHeight, fromKml: !0 }, altitudeMethod: 2, altitudeOffset: { defaultValue: "0" }, minimumLevel: this._core.defaultValue(t.level_min, 0), maximumLevel: this._core.defaultValue(t.level_max, 22), position_x: e.position_x, position_y: e.position_y, position_z: 0 == e.position_z ? 1e4 : e.position_z, urls: e.Server, layer: e.ServerName }) }, error: () => { console.log("获取样式配置失败!") } }), a }; Ie = function(e, t, i) { return t && Lr(e.prototype, t), i && Lr(e, i), e }; function Lr(e, t) { for (var i = 0; i < t.length; i++) { var o = t[i]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object .defineProperty(e, o.key, o) } } function Mr() { var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0], t = this, i = Mr; if (!(t instanceof i)) throw new TypeError("Cannot call a class as a function"); this._url = "http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}", this ._tileWidth = 256, this._tileHeight = 256, this._maximumLevel = 18, this._tilingScheme = new Cesium .WebMercatorTilingScheme({ rectangleSouthwestInMeters: new Cesium.Cartesian2(-33554054, -33746824), rectangleNortheastInMeters: new Cesium.Cartesian2(33554054, 33746824) }), this._rectangle = this._tilingScheme.rectangle, this._credit = void 0, this._style = e.style || "normal" } function Ar(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function Rr(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V } Dr.prototype.BaiduImageryProvider = (Ie(Mr, [{ key: "getTileCredits", value: function(e, t, i) {} }, { key: "requestImage", value: function(e, t, i) { if (!this.ready) throw new Cesium.DeveloperError( "requestImage must not be called before the imagery provider is ready."); var o = this._tilingScheme.getNumberOfXTilesAtLevel(i), r = this._tilingScheme.getNumberOfYTilesAtLevel(i), e = this._url.replace("{x}", e - o / 2).replace("{y}", r / 2 - t - 1).replace( "{z}", i).replace("{s}", 1).replace("{style}", this._style); return Cesium.ImageryProvider.loadImage(this, e) } }, { key: "url", get: function() { return this._url } }, { key: "token", get: function() { return this._token } }, { key: "tileWidth", get: function() { if (this.ready) return this._tileWidth; throw new Cesium.DeveloperError( "tileWidth must not be called before the imagery provider is ready.") } }, { key: "tileHeight", get: function() { if (this.ready) return this._tileHeight; throw new Cesium.DeveloperError( "tileHeight must not be called before the imagery provider is ready.") } }, { key: "maximumLevel", get: function() { if (this.ready) return this._maximumLevel; throw new Cesium.DeveloperError( "maximumLevel must not be called before the imagery provider is ready.") } }, { key: "minimumLevel", get: function() { if (this.ready) return 0; throw new Cesium.DeveloperError( "minimumLevel must not be called before the imagery provider is ready.") } }, { key: "tilingScheme", get: function() { if (this.ready) return this._tilingScheme; throw new Cesium.DeveloperError( "tilingScheme must not be called before the imagery provider is ready.") } }, { key: "rectangle", get: function() { if (this.ready) return this._rectangle; throw new Cesium.DeveloperError( "rectangle must not be called before the imagery provider is ready.") } }, { key: "ready", get: function() { return !!this._url } }, { key: "credit", get: function() { return this._credit } }]), Mr), Ar.prototype.createBillboardbatch = function(e) { for (var t = { show: !0, position: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, eyeOffset: this._cesium.Cartesian3.ZERO, heightReference: this._cesium.HeightReference.NONE, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, scale: 1, image: "", imageSubRegion: void 0, color: this._cesium.Color.WHITE, id: void 0, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, scaleByDistance: void 0, translucencyByDistance: void 0, pixelOffsetScaleByDistance: void 0, sizeInMeters: !1, distanceDisplayCondition: void 0 }, i = 0; i < e.length; i++) { var o = e[i]; t.image = o.image, this._viewer.entities.add({ name: "", position: this._cesium.Cartesian3.fromDegrees(o.log, o.lat, o.height), billboard: t }) } return this }, Ar.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show._value, t = null == this.item.box.dimensions ? void 0 : this.item.box.dimensions.getValue(), i = null == this.item.box.fill ? void 0 : this.item.box.fill._value, o = this.item.box.material, r = (null != o && (o = { color: null == o.color._value ? void 0 : "rgba(" + o.color._value.red + "," + o.color ._value.green + "," + o.color._value.blue + "," + o.color._value.alpha + ")", image: null == o.image ? void 0 : o.image._value, diffusemap: null == o.diffusemap ? void 0 : o.diffusemap._value, alphamap: null == o.alphamap ? void 0 : o.alphamap._value }), null == this.item.box.outline ? void 0 : this.item.box.outline._value), n = null == this.item.box.outlineColor ? void 0 : "rgba(" + this.item.box.outlineColor._value.red + "," + this.item.box.outlineColor._value.green + "," + this.item.box.outlineColor._value.blue + "," + this.item.box.outlineColor._value.alpha + ")", a = null == this.item.box.outlineWidth ? void 0 : this.item.box.outlineWidth._value, s = this.item.box.distanceDisplayCondition, l = null == s ? void 0 : s._value.near, s = null == s ? void 0 : s._value.far, u = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "box", position: { x: this._cesium.Math.toDegrees(u.longitude), y: this._cesium.Math.toDegrees(u.latitude), z: this._cesium.Math.toDegrees(u.height) }, treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, dimensions: t, fill: i, material: o, outline: r, outlineColor: n, outlineWidth: a, near: l, far: s } } }, Ar.prototype.setTreeobj = function(e) { this.treeobj = e }, Ar.prototype.setVisibility = function(e) { this.item.show = e }, Ar.prototype.setShow = function(e) { try { this.item._box.show = e } catch (e) { console.log(e) } return this }, Ar.prototype.deleteObject = function() { this._viewer.entities.remove(this.item) }, Object.defineProperties(Ar.prototype, { ColorAlpha: { get: function() { return this.item._box.color._value.alpha } }, Scale: { get: function() { return this.item._box.scale } }, Rotation: { get: function() { return this.item._box.rotation } }, Width: { get: function() { return this.item._box.width } }, Height: { get: function() { return this.item._box.heightReference } }, Color: { get: function() { return this._color.toHtmlColor("rgb(" + 255 * this.item._box.backgroundColor._value .red + "," + 255 * this.item._box.backgroundColor._value.green + "," + 255 * this.item._box.backgroundColor._value.blue + "," + 255 * this.item._box .backgroundColor._value.alpha + ")") } } }), Ar.prototype.CreateBox = function(e, t, i, o, r, n, a, s) { this._postion = e; var l, o = { dimensions: new this._cesium.Cartesian3(o, t, i), material: this._cesium.Color.YELLOW, outline: !0, outlineColor: this._cesium.Color.RED }, t = (r && "" !== r && (o.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(r)), n && "" !== n && (o.material = new m(this._viewer, this._cesium).colorFromHtmlColor(n)), (e .Yaw || e.Pitch || e.Roll) && (l = this._cesium.Transforms.headingPitchRollQuaternion(this ._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw), this._cesium.Math.toRadians(e .Pitch), this._cesium.Math.toRadians(e.Roll)))), this.item = this._viewer.entities.add({ name: s, position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), box: o, orientation: l }), { id: this.item.id, name: s, pId: this._core.isnull(a) ? 0 : a, type: "box", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(a) ? 0 : a), this }, Object.defineProperties(Ar.prototype, { Position: { Altitude: { get: function() { return this._postion.Altitude }, set: function(e) { try { this._postion.Altitude = e, this.item.position = this._cesium.Cartesian3 .fromDegrees(this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, AltitudeType: { get: function() { return this._postion.AltitudeType }, set: function(e) { try { this._postion.AltitudeType = e } catch (e) { console.log(e) } } }, Cartesian: { get: function() { return this._postion.Cartesian }, set: function(e) { try { this._postion.Cartesian = e } catch (e) { console.log(e) } } }, Distance: { get: function() { return this._postion.Distance }, set: function(e) { try { this._postion.Distance = e } catch (e) { console.log(e) } } }, Pitch: { get: function() { return this._postion.Pitch }, set: function(e) { try { this._postion.Pitch = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, Roll: { get: function() { return this._postion.Roll }, set: function(e) { try { this._postion.Roll = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, X: { get: function() { return this._postion.X }, set: function(e) { try { this._postion.X = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Y: { get: function() { return this._postion.Y }, set: function(e) { try { this._postion.Y = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Yaw: { get: function() { return this._postion.Yaw }, set: function(e) { try { this._postion.Yaw = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } } } }), Rr.prototype.createBoxGeojsonFeatureLayer = function(e, t, i, o, n) { var r = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, granularity: CesiumMath.RADIANS_PER_DEGREE, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC }, a = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.charAt(0) && "]" == i.material.charAt(i.material.length - 1) || (this._core.isHtmlColor(i.material) ? i.material = this._color.colorFromHtmlColor(i.material) : (/^rgb/.test(i.material) && (i.material = this ._color.rgbaStringToRgbaObj(i.material)), 1 < i.material.r && (i.material.r = i .material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i .material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material .g, i.material.b, i.material.a))), this._core.extend(r, i, !0)), r = (null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t), s = this; return r.then(function(e) { for (var t = e.entities.values, i = [], o = 0; o < t.length; o++) { var r = t[o], r = (a.polygonHierarchy = new s._cesium.PolygonHierarchy(r.polyline.positions ._value, []), new s._cesium.GeometryInstance({ id: r, geometry: new s._cesium.PolygonGeometry(a), attributes: { color: new s._cesium.ColorGeometryInstanceAttribute.fromColor(a .material) } })); i.push(r) } e = s._viewer.scene.primitives.add(new s._cesium.Primitive({ geometryInstances: i, appearance: new s._cesium.PerInstanceColorAppearance({ translucent: !1 }), shadows: s._cesium.ShadowMode.ENABLED })); e.show = a.show, s.item = e, "function" == typeof n && n(e) }), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a .id), this._tree.insertGroupId({ id: a.id, name: e, checked: a.show, pId: this._core.isnull(o) ? 0 : o, type: "polylineLayer", item: this }, this._core.isnull(o) ? 0 : o), this }; let W = { opacity: 1, poolSize: 16, canvas: null, layers: new Array, showid: null, width: 0, height: 0, cesium: null, viewer: null, workers: new Array, oceanCanvas: null, oceanCtx: null, oceanWorker: null }; var Or, Hr = !1, Vr = !1, kr = Math.floor(204), Fr = [NaN, NaN, null], Gr = null, Nr = null, Br = [], jr = [ [30, [10, 25, 68]], [33, [10, 25, 250]], [33.5, [24, 255, 255]], [34, [105, 233, 252]], [34.5, [255, 233, 65]], [34.5, [255, 233, 15]], [34.5, [255, 233, 15]], [34.5, [255, 233, 15]], [34.5, [255, 233, 15]], [35, [255, 225, 15]], [35, [255, 225, 15]], [35, [255, 225, 15]], [35, [255, 225, 15]], [35, [255, 255, 15]], [35, [255, 235, 15]], [35, [255, 215, 15]], [35, [255, 195, 15]], [35, [255, 175, 15]], [35, [255, 155, 15]], [35, [255, 135, 15]], [35, [255, 115, 15]], [35, [255, 95, 15]], [35, [255, 75, 15]], [35, [255, 55, 15]], [35, [255, 35, 15]], [35, [255, 15, 15]] ]; function zr() { for (var a = {}, e = Math.round(7 * Or.width), s = [], t = 0; t < e; t++) s.push($r({ age: Kr(0, 100) })); var i = Or.valMax - Or.valMin; i /= Gr.length - 1; for (t = 0; t < Gr.length; t++) Gr[t][0] = Or.valMin + t * i; var l = function(e) { for (var n = [], a = [], s = [], t = 0; t < e.length - 1; t++) n.push(e[t + 1][0]), a.push(function( e, t) { var i = e[0], o = e[1], r = e[2], n = t[0] - i, a = t[1] - o, s = t[2] - r; return function(e, t) { return [Math.floor(i + e * n), Math.floor(o + e * a), Math.floor(r + e * s), t] } }(e[t][1], e[t + 1][1])), s.push([e[t][0], e[t + 1][0]]); return function(e, t) { for (var i = 0; i < n.length - 1 && !(e <= n[i]); i++); var o, r = s[i]; return a[i]((o = r[0], r = r[1], (function(e, t, i) { return Math.max(t, Math.min(e, i)) }(e, o, r) - o) / (r - o)), t) } }(Gr); Hr = !1, W.oceanCtx.clearRect(0, 0, W.oceanCanvas.width, W.oceanCanvas.height), function e() { try { if (!Hr && !Vr) { if (a = [], s.forEach(function(e) { 100 < e.age && (e.xt = void 0, e.yt = void 0, $r(e).age = 0), e.xt && e.yt && (e .x = e.xt, e.y = e.yt); var t = e.x, i = e.y, o = Jr(t, i), r = o[2]; null === r ? e.age = 100 : Xr(t = t + o[0], i = i + o[1]) ? (e.xt = t, e.yt = i, r = "rgba(" + (o = l(r, kr))[0] + ", " + o[1] + ", " + o[2] + ", " + kr + ")", null == a[r] && (a[r] = []), a[r].push(e)) : (e.x = t, e.y = i), e.age += 1 }), !Vr) { var t, i = W.oceanCtx, o = (i.lineWidth = 1, i.fillStyle = "rgba(0, 0, 0, 0.97)", i .globalCompositeOperation); for (t in i.globalCompositeOperation = "destination-in", i.fillRect(0, 0, W.oceanCanvas .width, W.oceanCanvas.height), i.globalCompositeOperation = o, a) { var r = a[t]; if (0 < r.length) { for (var n in i.beginPath(), i.strokeStyle = t, r) { n = r[n]; i.moveTo(n.x, n.y), i.lineTo(n.xt, n.yt), n.x = n.xt, n.y = n.yt } i.stroke(), i.strokeStyle = "#fff" } } } Nr = setTimeout(e, 30) } } catch (e) {} }() } function Ur(e) { Gr = e.color || jr, W.oceanWorker = new Worker(SmartEarthRootUrl + "Workers/field/oceanWorker.js"), W .oceanWorker.onmessage = function(e) { var t = e.data; switch (t.type) { case "success": break; case "draw": Or = t.data, Br = Or.drawData, zr() } }, W.oceanWorker.postMessage(e.message) } function Wr(l, u) { var t, i; t = { message: { id: l.id, ncpath: l.ncpath, variable: l.variable, depth: l.depth }, callback: function(e) { n = e.width, t = e.height, null != W.canvas && (W.canvas.remove(), W.canvas = null), W .canvas = document.createElement("canvas"), W.canvas.width = n, W.canvas.height = t; for (var t, i, o, r, n = W.canvas.getContext("2d"), a = n.getImageData(0, 0, e.width, e .height), s = 0; s < e.arrayBufferView.length; s++) a.data[s] = e.arrayBufferView[ s]; n.putImageData(a, 0, 0), t = e, n = l.id, i = e.minx, o = e.miny, r = e.maxx, t = e.maxy, i = W.cesium.Rectangle.fromDegrees(i, o, r, t), o = new W.cesium.ImageMaterialProperty({ image: W.canvas, transparent: !0 }), mlayer = W.viewer.entities.add({ show: !0, rectangle: { coordinates: i, material: o } }), W.layers[n] = mlayer, "function" == typeof u && u(l.id) } }, (i = new Worker(SmartEarthRootUrl + "Workers/field/rendermapWorker.js")).onmessage = function(e) { t.callback(e.data), i.terminate() }, i.postMessage(t.message) } function Yr(e) { var t = { x: 0, y: 0, z: 0 }; return t.x = e.x, t.y = e.y, t.z = e.z, t } function Qr() { for (var e = W.viewer.scene, t = e.camera, i = [], o = [], r = Yr(t.positionWC), n = Yr(t.directionWC), a = Yr(t.rightWC), s = Yr(t.upWC), l = 0; l < 16; l++) i[l] = t.viewMatrix[l], o[l] = t.frustum .projectionMatrix[l]; return { width: e.canvas.clientWidth, height: e.canvas.clientHeight, viewMatrix: i, projectionMatrix: o, frustum: { fovy: t.frustum.fovy, aspectRatio: t.frustum.aspectRatio, near: t.frustum.near }, positionWC: r, directionWC: n, rightWC: a, upWC: s } } function qr(t, i) { switch (t.type) { case "single": Wr({ id: 0, ncpath: t.ncpath, variable: t.variable, depth: t.depth }, i); break; case "mfile": Wr({ id: 0, ncpath: t.ncpath.format(t.params[0]), variable: t.variable, depth: t.depth }, function() { "function" == typeof i && i(0); for (var e = 1; e < t.params.length; e++) Wr({ id: e, ncpath: t.ncpath.format(t.params[e]), variable: t.variable, depth: t.depth }) }); break; case "mdepth": break; case "ocean": e = { id: 0, upath: t.upath, vpath: t.vpath }, o = Qr(), null == W.oceanCanvas ? (W.oceanCanvas = document.createElement("canvas"), W .oceanCanvas.width = o.width, W.oceanCanvas.height = o.height, W.oceanCanvas.id = "animation", W.oceanCanvas.style = "position: absolute;left: 0px;top: 0px;pointer-events: none;", document .getElementsByClassName("cesium-widget")[0].appendChild(W.oceanCanvas), W.oceanCtx = W .oceanCanvas.getContext("2d"), Ur({ message: { id: e.id, type: "init", upath: e.upath, vpath: e.vpath, scene: o }, callback: function(e) {} }), W.viewer.scene.camera.moveStart.addEventListener(function() { Nr && clearTimeout(Nr), (Nr = null) != W.oceanWorker && (W.oceanWorker.postMessage({ type: "stop" }), Vr = !0, Br = [], W.oceanCtx.clearRect(0, 0, W.oceanCanvas.width, W .oceanCanvas.height)) }), W.viewer.scene.camera.moveEnd.addEventListener(function() { null != W.oceanWorker && (Vr = !1, W.oceanWorker.postMessage({ type: "update", scene: Qr() })) })) : Ur({ message: { id: e.id, type: "init", upath: e.upath, vpath: e.vpath, scene: o }, callback: function(e) {} }); break; default: Wr({ id: 0, ncpath: t.ncpath, variable: t.variable, depth: t.depth }) } var e, o } function Jr(e, t) { e = Br[Math.round(e)]; return e && e[Math.round(t)] || Fr } function Xr(e, t) { return null !== Jr(e, t)[2] } function Kr(e, t) { return null == t && (t = e, e = 0), e + Math.floor(Math.random() * (t - e + 1)) } function $r(e) { for (var t, i, o = 0; !Xr(t = Math.round(Kr(0, W.viewer.scene.canvas.clientWidth)), i = Math.round(Kr(0, W .viewer.scene.canvas.clientHeight))) && o++ < 30;); return e.x = t, e.y = i, e } function Zr(e, t) { W.viewer = e, W.cesium = t } function en(e) { this._viewer = e, this._core = new f, this._tree = V } function tn(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function on(e, t, i, o) { this._extractAttributes = e, this._featureName = t || "featureMember", this._xy = o, this._gmlns = i || "http://www.opengis.net/gml", this._regExes = { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g } } function rn() { this._quadtree = void 0, this._loadTileEvent = new Cesium.Event, this._tilingScheme = new Cesium .GeographicTilingScheme, this._errorEvent = new Cesium.Event, this._levelZeroMaximumError = Cesium .QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme), this .cartographicLimitRectangle = Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE), this._tileCache = [], this._primitivesWaitingToBeAddedToTheScene = [], this._pauseStreaming = !1, this._numTilesInLevel = [], this.STREAM_SPEED_IMIDIATE = 0, this.STREAM_SPEED_FAST = 1, this.STREAM_SPEED_NORMAL = 2, this .STREAM_SPEED_SLOW = 3, this._streamSpeed = this.STREAM_SPEED_NORMAL, rn.prototype.ready || Object .defineProperties(rn.prototype, { quadtree: { get: function() { return this._quadtree }, set: function(e) { this._quadtree = e } }, ready: { get: function() { return !0 } }, tilingScheme: { get: function() { return this._tilingScheme } }, errorEvent: { get: function() { return this._errorEvent } }, loadTileEvent: { get: function() { return this._loadTileEvent } }, pauseStreaming: { get: function() { return this._pauseStreaming }, set: function(e) { this._pauseStreaming = e } }, streamSpeed: { get: function() { return this._streamSpeed }, set: function(e) { this._streamSpeed = e } }, bestLevelAvailable: { get: function() { for (var e = 0, t = 0; t < 22; t++) null != this._numTilesInLevel[t] && 0 < this ._numTilesInLevel[t] && e < t && (e = t); return e } } }) } function nn(i, e, o) { $.each(e._primitives, function(e, t) { if (t instanceof Cesium.BillboardCollection) return e = mn.indexOf(t = t), t._parentCollection ._primitiveOld = o, -1 !== e ? (i.scene.primitives.remove(mn[e]._parentCollection), mn[ e] = t) : mn.push(t), !1 }) } function an(e, t, i) { e.scene.primitives.remove(i), t._onDestroyTilePrimitive = function() { e.scene.primitives.remove(i), this._onDestroyTilePrimitive = void 0 } } function sn(e, t, i, o) { Cesium.when.all(t, function() { e.scene.primitives.remove(o) }), i._onDestroyTilePrimitive = function() { e.scene.primitives.remove(o), this._onDestroyTilePrimitive = void 0 } } function ln(e, t, i) { sn(e, $.map(t._primitives, function(e) { return e.readyPromise }), t, i) } function un(e, t, i) { sn(e, $.map(t._primitives[0]._primitives, function(e) { return e.readyPromise }), t, i) } function cn(e, t, i) { e.scene.primitives.remove(i) } function hn(e, t, i) { sn(e, [t.readyPromise], t, i) } W.hide = function() { (W.showid || 0 == W.showid) && W.layers[W.showid] && (W.layers[W.showid].show = !1) }, W.show = function(e) { (W.showid || 0 == W.showid) && W.layers[W.showid] && (W.layers[W.showid].show = !1), (e || 0 == e) && W .layers[e] && (W.layers[e].show = !0, W.showid = e) }, W.draw = function(e, t) { qr(e, t) }, W.destroy = function() { try { for (var e = 0; e < W.layers.length; e++) W.viewer.entities.remove(W.layers[e]); W.layers = [] } catch (e) {} try { for (e = 0; e < W.workers.length; e++) try { W.workers[e].terminate() } catch (e) {} W.workers = [] } catch (e) {} try { Nr && clearTimeout(Nr), Nr = null } catch (e) {} try { W.oceanWorker.terminate(), W.oceanWorker = null, W.oceanCtx.clearRect(0, 0, W.oceanCanvas.width, W .oceanCanvas.height) } catch (e) {} }, String.prototype.format = function(e) { var t, i = this; if (0 < arguments.length) if (1 == arguments.length && "object" == typeof e) for (var o in e) void 0 !== e[o] && (t = new RegExp("({" + o + "})", "g"), i = i.replace(t, e[ o])); else for (var r, n = 0; n < arguments.length; n++) void 0 !== arguments[n] && (r = new RegExp("({)" + n + "(})", "g"), i = i.replace(r, arguments[n])); return i }, Zr.prototype.createField = function(e, t) { return W.draw(e, t), this }, Zr.prototype.destroy = function() { W.destroy() }, Zr.prototype.remove = function() { W.destroy() }, en.prototype.create = function(e, t, i = {}) { this.radius = Cesium.Cartesian3.distance(e, t), this.angle = (i.angle || 10) / 2, this.heading = this .pitch = this.roll = 0, this.startPosition = e, this.endPosition = t; let o = { innerRadii: new Cesium.Cartesian3(1, 1, 1), radii: new Cesium.CallbackProperty(() => new Cesium.Cartesian3(this.radius, this.radius, this .radius), !1), outline: i.outline, material: Cesium.Color.RED.withAlpha(.2), outlineColor: Cesium.Color.WHITE.withAlpha(.2), maximumCone: new Cesium.CallbackProperty(() => Cesium.Math.toRadians(-this.angle), !1), minimumCone: new Cesium.CallbackProperty(() => Cesium.Math.toRadians(this.angle), !1) }; i.color && (o.material = Cesium.Color.fromCssColorString(i.color)), i.outlineColor && (o.outlineColor = Cesium.Color.fromCssColorString(i.outlineColor)), this.degrees1 = this._core.toDegrees(this .startPosition), this.degrees2 = this._core.toDegrees(this.endPosition), this.item = this ._viewer.entities.add({ position: new Cesium.CallbackProperty(() => this.startPosition, !1), ellipsoid: o }), this.updateOrientation(); e = { id: this.item.id, name: "锥形传感器", pId: 0, type: "ellipsoid", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, en.prototype.updateOrientation = function() { this.heading = this._core.TwoPointAzimuth(this.degrees1.lon, this.degrees1.lat, this.degrees2.lon, this .degrees2.lat) + 90; var e = Math.acos((this.degrees2.height - this.degrees1.height) / this.radius); this.pitch = Cesium.Math.toDegrees(e), this.item.orientation = Cesium.Transforms .headingPitchRollQuaternion(this.startPosition, new Cesium.HeadingPitchRoll(Cesium.Math.toRadians( this._core.defaultValue(this.heading, 0)), Cesium.Math.toRadians(this._core .defaultValue(this.pitch, 0)), Cesium.Math.toRadians(this._core.defaultValue(this.roll, 0)))) }, en.prototype.changeStart = function(e) { this.startPosition = e, this.degrees1 = this._core.toDegrees(this.startPosition), this.radius = Cesium .Cartesian3.distance(this.startPosition, this.endPosition), this.updateOrientation() }, en.prototype.changeEnd = function(e) { this.endPosition = e, this.degrees2 = this._core.toDegrees(this.endPosition), this.radius = Cesium .Cartesian3.distance(this.startPosition, this.endPosition), this.updateOrientation() }, en.prototype.changeAngle = function(e) { this.angle = e / 2 }, en.prototype.setTreeobj = function(e) { this.treeobj = e }, en.prototype.setVisibility = function(e) { this.item && (this.item.show = e) }, en.prototype.deleteObject = function() { this._viewer.entities.remove(this.item) }, Object.defineProperties(en.prototype, { Position: { Altitude: { get: function() { return this._postion.Altitude }, set: function(e) { try { this._postion.Altitude = e, this.item.position = Cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, AltitudeType: { get: function() { return this._postion.AltitudeType }, set: function(e) { try { this._postion.AltitudeType = e } catch (e) { console.log(e) } } }, Cartesian: { get: function() { return this._postion.Cartesian }, set: function(e) { try { this._postion.Cartesian = e } catch (e) { console.log(e) } } }, Distance: { get: function() { return this._postion.Distance }, set: function(e) { try { this._postion.Distance = e } catch (e) { console.log(e) } } }, Pitch: { get: function() { return this._postion.Pitch }, set: function(e) { try { this._postion.Pitch = e, this.item.orientation = Cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new Cesium .HeadingPitchRoll(Cesium.Math.toRadians(this._postion.Yaw), Cesium.Math .toRadians(this._postion.Pitch), Cesium.Math.toRadians(this._postion .Roll))) } catch (e) { console.log(e) } } }, Roll: { get: function() { return this._postion.Roll }, set: function(e) { try { this._postion.Roll = e, this.item.orientation = Cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new Cesium .HeadingPitchRoll(Cesium.Math.toRadians(this._postion.Yaw), Cesium.Math .toRadians(this._postion.Pitch), Cesium.Math.toRadians(this._postion .Roll))) } catch (e) { console.log(e) } } }, X: { get: function() { return this._postion.X }, set: function(e) { try { this._postion.X = e, this.item.position = Cesium.Cartesian3.fromDegrees(this ._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Y: { get: function() { return this._postion.Y }, set: function(e) { try { this._postion.Y = e, this.item.position = Cesium.Cartesian3.fromDegrees(this ._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Yaw: { get: function() { return this._postion.Yaw }, set: function(e) { try { this._postion.Yaw = e, this.item.orientation = Cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new Cesium .HeadingPitchRoll(Cesium.Math.toRadians(this._postion.Yaw), Cesium.Math .toRadians(this._postion.Pitch), Cesium.Math.toRadians(this._postion .Roll))) } catch (e) { console.log(e) } } } } }), tn.prototype.createCorridor = function(e, t, i, o) { var r = { show: !0, material: this._cesium.Color.RED.withAlpha(.5), width: 1e3 }; if (!this._core.isnull(i)) { i = this._core.extend(r, i, !0); var n = []; if (t[0].x || t[0].y) if (void 0 !== t[0].z) for (a = 0; a < t.length; a++) n.push(this._cesium.Cartesian3.fromDegrees(t[a].x, t[a].y, t[ a].z)); else for (a = 0; a < t.length; a++) n.push(this._cesium.Cartesian3.fromDegrees(t[a].x, t[a].y)); else if (2 === t[0].length) for (var a = 0; a < t.length; a++) n.push(this._cesium.Cartesian3.fromDegrees(t[a][0], t[a][ 1])); else if (3 === t[0].length) for (var a = 0; a < t.length; a++) n.push(this._cesium.Cartesian3.fromDegrees(t[a][0], t[a][1], t[a][2])); i.positions = n; r = this._viewer.entities.add({ name: e, id: this._core.getuid(), corridor: i }); return this.item = r, this._tree.insertGroupId({ id: r.id, name: e, pId: this._core.isnull(o) ? 0 : o, type: "corridor", item: this }, this._core.isnull(o) ? 0 : o), this } console.log("options is required") }, tn.prototype.getstyles = function() { var e = {}; return e.show = !this.item.ellipse.show || this.item.ellipse.show._value, e.positions = this.item .ellipse.positions ? this.item.ellipse.positions.getValue().toString() : void 0, e.width = this.item .ellipse.width && this.item.ellipse.width._value ? this.item.ellipse.width.toString() : void 0, e .height = this.item.ellipse.height && this.item.ellipse.height._value ? this.item.ellipse.height .toString() : void 0, e.heightReference = this.item.ellipse.heightReference && this.item.ellipse .heightReference._value ? this.item.ellipse.heightReference._value : void 0, e.extrudedHeight = this .item.ellipse.extrudedHeight && this.item.ellipse.extrudedHeight.getValue() ? this.item.ellipse .extrudedHeight.getValue() : void 0, e.extrudedHeightReference = this.item.ellipse .extrudedHeightReference && this.item.ellipse.extrudedHeightReference._value ? this.item.ellipse .extrudedHeightReference._value : void 0, e.cornerType = this.item.ellipse.cornerType ? this.item .ellipse.cornerType._value : void 0, e.material = {}, tyles.material.color = this.item.ellipse .material && this.item.ellipse.material.color && this.item.ellipse.material.color._value ? this.item .ellipse.material.color.toString() : void 0, e.material.image = this.item.ellipse.material && this .item.ellipse.material.image && this.item.ellipse.material.image._value ? this.item.ellipse.material .image._value : void 0, e.material.repeat = this.item.ellipse.material && this.item.ellipse.material .repeat && this.item.ellipse.material.repeat._value ? this.item.ellipse.material.repeat._value : void 0, e.fill = this.item.ellipse.fill ? this.item.ellipse.fill._value : void 0, e.outline = this .item.ellipse.outline ? this.item.ellipse.outline._value : void 0, e.outlineWidth = this.item .ellipse.outlineWidth && this.item.ellipse.outlineWidth._value ? this.item.ellipse.outlineWidth ._value : void 0, e.outlineColor = this.item.ellipse.outlineColor && this.item.ellipse.outlineColor ._value ? "rgba" + this.item.ellipse.outlineColor.toString() : void 0, e.near = this.item.ellipse .distanceDisplayCondition ? this.item.ellipse.distanceDisplayCondition._value.near : void 0, e.far = this.item.ellipse.distanceDisplayCondition ? this.item.ellipse.distanceDisplayCondition._value.far : void 0, e.position = this.item.position.getValue().toString(), e }, tn.prototype.setVisibility = function(e) { this.item.show = e }, tn.prototype.getVisibility = function() { return this.item.show }, tn.prototype.deleteObject = function() { this._viewer.entities.remove(this.item) }, tn.prototype.setItem = function(e) { this.item = e }, tn.prototype.setTreeobj = function(e) { this.treeobj = e }, Object.defineProperties(on.prototype, { featureName: { get: function() { return this._featureName }, set: function(e) { this._featureName = e } }, extractAttributes: { get: function() { return this._extractAttributes }, set: function(e) { this._extractAttributes = e } }, xy: { get: function() { return this._xy } } }), on.prototype.getElementsByTagNameNS = function(e, t, i) { var o = []; if (e.getElementsByTagNameNS) o = e.getElementsByTagNameNS(t, i); else for (var r, n, a = e.getElementsByTagName("*"), s = 0, l = a.length; s < l; ++s) n = (r = a[s]) .prefix ? r.prefix + ":" + i : i, "*" != i && n != r.nodeName || "*" != t && t != r .namespaceURI || o.push(r); return o }, on.prototype.read = function(e) { for (var t = this.getElementsByTagNameNS(e.documentElement, this._gmlns, this.featureName), i = [], o = 0; o < t.length; o++) { var r = this.parseFeature(t[o]); r && i.push(r) } return i }, on.prototype.parseFeature = function(e) { for (var t, i, o, r, n = ["MultiPolygon", "Polygon", "MultiLineString", "LineString", "MultiPoint", "Point", "Envelope" ], a = 0; a < n.length; ++a) if (0 < (i = this.getElementsByTagNameNS(e, this._gmlns, t = n[a])).length) { (r = this.parseGeometry[t.toLowerCase()]) ? o = r.apply(this, [i[0]]): console.log( "unsupportedGeometryType:" + t); break } for (var s, l = this.getElementsByTagNameNS(e, this._gmlns, "Box"), a = 0; a < l.length; ++a) { var u = l[a], c = this.parseGeometry.box.apply(this, [u]), u = u.parentNode; "boundedBy" === (u.localName || u.nodeName.split(":").pop()) ? s = c: o = c.toGeometry() } this.extractAttributes && (m = this.parseAttributes(e)); for (var h, m = { geometryType: t.toLowerCase(), positions: o, attributes: m }, d = (m.bounds = s, e.firstChild); d && (1 != d.nodeType || !(h = d.getAttribute("fid") || d .getAttribute("id")));) d = d.nextSibling; return m.fid = h, m }, on.prototype.parseGeometry = { point: function(e) { var t = [], i = this.getElementsByTagNameNS(e, this._gmlns, "pos"); return 0 == (t = 0 < i.length ? i[0].firstChild.nodeValue.replace(this._regExes.trimSpace, "") .split(this._regExes.splitSpace) : t).length && (0 < (i = this.getElementsByTagNameNS(e, this._gmlns, "coordinates")).length && (t = i[0].firstChild.nodeValue.replace(this ._regExes.removeSpace, "").split(","))), 0 == t.length && 0 < (i = this .getElementsByTagNameNS(e, this._gmlns, "coord")).length && (e = this .getElementsByTagNameNS(i[0], this._gmlns, "X"), i = this.getElementsByTagNameNS(i[0], this._gmlns, "Y"), 0 < e.length && 0 < i.length && (t = [e[0].firstChild.nodeValue, i[0].firstChild.nodeValue ])), 2 == t.length && (t[2] = null), this.xy ? [parseFloat(t[0]), parseFloat(t[1]), parseFloat(t[2]) ] : [parseFloat(t[1]), parseFloat(t[0]), parseFloat(t[2])] }, multipoint: function(e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "Point"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.point.apply(this, [t[r]])) && i .push(o); return i }, linestring: function(e, t) { var i = [], o = [], r = this.getElementsByTagNameNS(e, this._gmlns, "posList"); if (0 < r.length) for (var n, a, s, i = this.getChildValue(r[0]).replace(this._regExes.trimSpace, "").split( this._regExes.splitSpace), l = parseInt(r[0].getAttribute("dimension")), u = 0; u < i.length / l; ++u) s = u * l, n = parseFloat(i[s]), a = parseFloat(i[1 + s]), s = 2 == l ? null : parseFloat(i[2 + s]), this.xy ? o.push(n, a, s) : o.push(a, n, s); if (0 == i.length && 0 < (r = this.getElementsByTagNameNS(e, this._gmlns, "coordinates")) .length) for (var c = this.getChildValue(r[0]).replace(this._regExes.trimSpace, "").replace(this ._regExes.trimComma, ",").split(this._regExes.splitSpace), u = 0; u < c.length; ++u) 2 == (i = c[u].split(",")).length && (i[2] = null), this.xy ? o.push(parseFloat(i[0]), parseFloat(i[1]), parseFloat(i[2])) : o.push(parseFloat(i[1]), parseFloat(i[0]), parseFloat(i[2])); return o }, multilinestring: function(e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "LineString"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.linestring.apply(this, [t[ r]])) && i.push(o); return i }, polygon: function(e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "LinearRing"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.linestring.apply(this, [t[r], ! 0 ])) && i.push(o); return i }, multipolygon: function(e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "Polygon"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.polygon.apply(this, [t[r]])) && i.push(o); return i }, envelope: function(e) { var t, i, o, r, n = [], a = this.getElementsByTagNameNS(e, this._gmlns, "lowerCorner"), a = (0 < a.length && (o = [], 2 == (o = 0 < a.length ? a[0].firstChild.nodeValue.replace( this._regExes.trimSpace, "").split(this._regExes.splitSpace) : o).length && (o[ 2] = null), i = this.xy ? new OpenLayers_Geometry_Point(o[0], o[1], o[2]) : new OpenLayers_Geometry_Point(o[1], o[0], o[2])), this.getElementsByTagNameNS(e, this._gmlns, "upperCorner")); return 0 < a.length && (o = [], 2 == (o = 0 < a.length ? a[0].firstChild.nodeValue.replace(this ._regExes.trimSpace, "").split(this._regExes.splitSpace) : o).length && (o[2] = null), r = this.xy ? new OpenLayers_Geometry_Point(o[0], o[1], o[2]) : new OpenLayers_Geometry_Point(o[1], o[0], o[2])), i && r && (n.push([i.x, i.y, null]), n .push([r.x, i.y, null]), n.push([r.x, r.y, null]), n.push([i.x, r.y, null]), n.push([i .x, i.y, null ]), t = new OpenLayers_Geometry_Polygon([ [n] ])), t }, box: function(e) { var e = this.getElementsByTagNameNS(e, this._gmlns, "coordinates"), t = null, i = null; if (0 < e.length && (2 == (e = e[0].firstChild.nodeValue.split(" ")).length && (t = e[0].split( ","), i = e[1].split(","))), null !== t && null !== i) return [parseFloat(t[0]), parseFloat(t[1]), null, parseFloat(i[0]), parseFloat(i[1]), null ] } }, on.prototype.parseAttributes = function(e) { for (var t, i, o, r, n, a = {}, s = e.firstChild; s;) { if (1 == s.nodeType) { for (t = s.childNodes, i = 0; i < t.length; ++i) 1 == (o = t[i]).nodeType && (1 == (n = o .childNodes).length ? 3 != (n = n[0]).nodeType && 4 != n.nodeType || (r = o.prefix ? o.nodeName.split(":")[1] : o.nodeName, n = n.nodeValue.replace(this._regExes .trimSpace, ""), a[r] = n) : a[o.nodeName.split(":").pop()] = null); break } s = s.nextSibling } return a }, on.prototype.getChildValue = function(e, t) { var i = t || ""; if (e) for (var o = e.firstChild; o; o = o.nextSibling) switch (o.nodeType) { case 3: case 4: i += o.nodeValue } return i }, rn.prototype.streamSpeedFactor = function() { switch (this._streamSpeed) { case this.STREAM_SPEED_FAST: return 1; case this.STREAM_SPEED_NORMAL: return 3; case this.STREAM_SPEED_SLOW: return 20; default: return 3 } }; var mn = [], dn = 0, pn = (rn.prototype.onPreFrame = function(e, t) { if (dn++, !this._pauseStreaming) { if (this._streamSpeed == this.STREAM_SPEED_IMIDIATE) for (; 0 < this._primitivesWaitingToBeAddedToTheScene.length;) { var i = this._primitivesWaitingToBeAddedToTheScene.pop(); e.primitives.add(i) } else 0 < this._primitivesWaitingToBeAddedToTheScene.length && dn % this .streamSpeedFactor() == 0 && ((i = this._primitivesWaitingToBeAddedToTheScene.pop()) ._instanceIds && 100 < i._instanceIds.length && this.streamSpeed === this .STREAM_SPEED_FAST && (this.streamSpeed = this.STREAM_SPEED_NORMAL), e.primitives .add(i)); $.each(mn, function(e, t) { t.ready && this.viewer.scene.primitives.remove(t._parentCollection._primitiveOld) }) } }, rn.prototype.updateForPick = function(e) {}, Math.PI, rn.prototype.placeHolder = function(e, t) { t = t || Cesium.Color.fromBytes(0, 255, 0, 255); t = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleOutlineGeometry({ rectangle: e.rectangle, height: this.viewer.camera.positionCartographic.height - .99 * TerraExplorer.internal.Navigate.HeightAboveGround }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(t) } }), appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }) }); e.data.primitive.add(t) }, rn.prototype.getTile = function(e) { return this._tileCache[e] }, rn.prototype.getAllTiles = function() { var e, t = []; for (e in this._tileCache) t.push(this._tileCache[e]); return t }, rn.prototype.addToScene = function(e) { this._primitivesWaitingToBeAddedToTheScene.push(e) }, rn.prototype.removeFromScene = function(e) { var t = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); - 1 != t ? (this ._primitivesWaitingToBeAddedToTheScene[t].destroy(), this ._primitivesWaitingToBeAddedToTheScene.splice(t, 1)) : this.viewer.scene.primitives.remove( e) }, rn.prototype.replaceInScene = function(e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); if (-1 != i) this._primitivesWaitingToBeAddedToTheScene[i] = t; else switch (e.ID != t.ID && console.log( "TileManager.replaceInScene Warning: new primitive has a different ID than old primitive" ), null != e._replacmentPrimitive && this.viewer.scene.primitives.remove(e ._replacmentPrimitive), e._replacmentPrimitive = t, this.viewer.scene.primitives.add(t), t.ID.split(":")[0]) { case "billboards": nn(this.viewer, t, e); break; case "labels": an(this.viewer, t, e); break; case "polygons": ln(this.viewer, t, e); break; case "models": un(this.viewer, t, e); break; case "polylines": hn(this.viewer, t, e); break; case "points": cn(this.viewer, 0, e); break; default: console.log("Error updating layer"), this.viewer.scene.primitives.remove(e) } }, { billboards: nn, labels: an, polygons: ln, models: un, polylines: hn, points: cn }), gn = (rn.prototype.replaceInSceneNew = function(e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); - 1 != i ? this ._primitivesWaitingToBeAddedToTheScene[i] = t : (e.ID !== t.ID && console.log( "TileManager.replaceInScene Warning: new primitive has a different ID than old primitive" ), this.addToScene(t), i = t.ID.split(":")[0], (i = pn[i]) ? i(t, e) : (console.log( "Error updating layer"), this.viewer.scene.primitives.remove(e))) }, !(rn.prototype.update = function(e) { this._quadtree.beginFrame(e), this._quadtree.render(e), this._quadtree.endFrame(e) })); function _n() {} function fn(e) { return "string" == typeof e ? e.replace(/^\s+/g, "").replace(/\s+$/g, "") : e } function yn(t, e) { for (var i = !1, o = 0, r = "", n = 0; n < e.length; n++) !i && /['"`]/.test(e[n]) ? i = e[n] : i && e[n] == i ? i = !1 : i || "(" != e[n] ? i || ")" != e[n] || o-- : o++, e[n] == t && (0 < o || i) ? r += "######" : r += e[n]; return e = (e = (e = r).split(t)).map(function(e) { return fn(e.replace(new RegExp("######", "g"), t)) }) } function vn(e) { for (var t = "#", i = e.length, o = 0; o < i; o++) t += e[o] + "#"; return t } function Cn(e) { for (var t = "", i = e.length, o = 1; o < i; o += 2) t += e[o]; return t } function wn(e) { this.source = e, this.cursor = 0, this.currentChar = "", this.readNextChar() } function bn(e) { this.lexer = new wn(e), this.currentToken = "", this.readNextToken() } function Tn(e, t) { var i = ""; return void 0 !== e.logic ? (i = (i = e.terms.map(function(e) { return Tn(e, !0) })).join(" " + e.logic + " "), void 0 !== t && (i = "(" + i + ")")) : void 0 !== e.left ? (i = e.left, void 0 !== e.operator && (i += " " + e.operator, void 0 !== e.right && ("IN" === e.operator ? i += " (" + e.right + ")" : i += " " + e.right))) : i = e, i } function Sn(e) { var t, i = 0; if (0 === e.length) return i; for (t = 0; t < e.length; t++) i = (i << 5) - i + e.charCodeAt(t), i |= 0; return i } function Pn(e) { for (var t = [], i = 0; i < e.length; i++) for (var o = 0; o < e[i].positions.length; o += 3) t.push(Cesium.Cartographic.fromDegrees(e[i] .positions[o + 0], e[i].positions[o + 1], 0)); return t } function En(e, t, i, o) { for (var r = 0, n = 0; n < e.length; n++) for (var a = o ? Gn : i(e[n]), s = 2; s < e[n].positions.length; s += 3) { null == t[r].height && (t[r].height = 0), null == e[n].absoluteHeightPositions && (e[n] .absoluteHeightPositions = []), e[n].absoluteHeightPositions[s - 2] = e[n].positions[s - 2], e[n].absoluteHeightPositions[s - 1] = e[n].positions[s - 1], e[n].absoluteHeightPositions[+s] = e[n].positions[+s]; var l = o ? 0 : e[n].positions[s]; e[n].absoluteHeightPositions[s] = l + t[r].height + a, r++ } } function xn(e, t) { this._style = e || {}, t.scene.onHoverShowTextArray = {}, t.scene._lastObjectShowOnText = null, this .setEyeOffset = function(e, t) { void 0 === t && (t = 0), e.eyeOffset = Cesium.DynamicEyeOffset(t) }, this.viewer = t } function In(e, t) { for (var i = e.length, o = 0; o < i; o++) { var r = t(e[o]); if ("polygon" == e[o].geometryType || "multipolygon" == e[o].geometryType) { for (var n = e[o], a = n.positions.length, s = 0; s < a; s++) { for (var l = n.positions[s], u = 2; u < l.length; u += 3) l[u] += r; n.positions[s] = l } e[o] = n } else { for (var c = e[o], h = c.positions.length, s = 2; s < h; s += 3) c.positions[s] += r; e[o] = c } } return e } function Dn(e, t) { if (null == e.isQuery) if (null == e.originalInstanceIds) { if (e.parentLayer.isExistRenderedFeatureId(t)) return } else if (-1 == e.originalInstanceIds.indexOf(t)) return; return 1 } function Ln(t) { return function(e) { e = Number(t.applyConditionalClassification(t._style.altitudeOffset, e.attributes)); return e = isNaN(e) ? 0 : e } } function Mn(e) { if ("string" != typeof e) return e; var t = Number(e); if (isNaN(t)) return e; var i = t.toString(16); if (i.length < 6 && null != i) for (var o = i.length; o < 6;) i = "0" + i, o++; e = Cesium.Color.fromCssColorString("#" + i); return null != e && (t = e.red, e.red = e.blue, e.blue = t), e } function An(e) { if (null != e) { var t = parseInt(e); if (null != e.alpha || isNaN(t)) return e; t < 0 && (t &= 16777215); var i = t.toString(16); if (i.length < 6 && null != i) for (var o = i.length; o < 6;) i = "0" + i, o++; var e = (e = "#" + i).substring(0, 7), t = Cesium.Color.fromCssColorString(e); return null != t && (e = t.red, t.red = t.blue, t.blue = e), t } } function Rn(e) { return isNaN(e) ? e : parseFloat(e) } function On(e, i) { var t, o = []; return $.each(e.attributeNames, function(e, t) { o.push(Rn(i[t])) }), 1 === o.length ? t = e.func(o[0]) : 2 === e.attributeNames.length ? t = e.func(o[0], o[1]) : 3 === e .attributeNames.length ? t = e.func(o[0], o[1], o[2]) : 4 === e.attributeNames.length && (t = e.func(o[ 0], o[1], o[2], o[3])), t } function Hn(e, t, i) { return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"), "g"), i) } rn.prototype.initialize = function(e) { gn || (this.viewer.scene.preRender.addEventListener(this.onPreFrame, this), gn = !0) }, rn.prototype.beginUpdate = function(e) { this.quadtree.beginFrame(e) }, rn.prototype.endUpdate = function(e) { var t = this; e.afterRender.push(function() { t.quadtree.endFrame(e) }) }, rn.prototype.getLevelMaximumGeometricError = function(e) { return this._levelZeroMaximumError / (1 << e) }, rn.prototype.loadTile = function(e, t) { var i = this; null == this._numTilesInLevel[t._level] && (this._numTilesInLevel[t._level] = 0), this._numTilesInLevel[ t._level]++, t.state === Cesium.QuadtreeTileLoadState.START && (t.data = { primitive: new Cesium.PrimitiveCollection, wfsLayerData: [], id: Cesium.createGuid(), freeResources: function() { if (i._tileCache[t.data.id] && i._numTilesInLevel[t._level]--, i._numTilesInLevel[t ._level] < 0 && (i._numTilesInLevel[t._level] = 0), Cesium.defined(this .wfsLayerData)) { for (var e in this.wfsLayerData) Cesium.defined(this.wfsLayerData[e]) && this .wfsLayerData[e].freeResources(); this.wfsLayerData = void 0 } Cesium.defined(this.primitive) && (this.primitive.destroy(), this.primitive = void 0), delete i._tileCache[t.data.id] } }, this._tileCache[t.data.id] = t, Math.abs(6371e3 * (t.rectangle.south - t.rectangle.north)), t .data.boundingSphere3D = Cesium.BoundingSphere.fromRectangle3D(t.rectangle), t.data .boundingSphere2D = Cesium.BoundingSphere.fromRectangle2D(t.rectangle, e.mapProjection), t .rectangle.west, t.rectangle.south, t.rectangle.east, t.rectangle.north, this.loadTileEvent .raiseEvent(t), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0) }, rn.prototype.computeTileVisibility = function(e, t, i) { var o = this.computeDistanceToTile(e, t); if (e._distance = o, t.fog.enabled && 1 <= Cesium.Math.fog(o, t.fog.density)) return Cesium.Visibility .NONE; o = e.data; if (o.tileBoundingRegion, void 0 === o.boundingVolumeSourceTile) return Cesium.Visibility.PARTIAL; var r = t.cullingVolume, n = o.orientedBoundingBox; !n && o.renderedMesh && (n = o.renderedMesh.boundingSphere3D), o.clippedByBoundaries = !1; a = e.rectangle, (s = this.cartographicLimitRectangle).west < s.east || (s = Rectangle.clone(s, splitCartographicLimitRectangleScratch), 0 < Rectangle.center(a, rectangleCenterScratch) .longitude ? s.east = CesiumMath.PI : s.west = -CesiumMath.PI); var a = s, s = new Cesium.Rectangle, a = Cesium.Rectangle.simpleIntersection(a, e.rectangle, s); if (!a) return Visibility.NONE; if (Cesium.Rectangle.equals(a, e.rectangle) || (o.clippedByBoundaries = !0), t.mode, Cesium.SceneMode .SCENE3D, !n) return Cesium.Intersect.INTERSECTING; s = this._clippingPlanes; if (s && s.enabled) { a = s.computeIntersectionWithBoundingVolume(n); if (e.isClipped = a !== Intersect.INSIDE, a === Cesium.Intersect.OUTSIDE) return Cesium.Visibility .NONE } s = r.computeVisibility(n); if (s === Cesium.Intersect.OUTSIDE) return Cesium.Visibility.NONE; e = t.mode === Cesium.SceneMode.SCENE3D && t.camera.frustum instanceof Cesium.OrthographicFrustum; return t.mode !== Cesium.SceneMode.SCENE3D || e || !i || !(a = o.occludeePointInScaledSpace) || i .ellipsoid.isScaledSpacePointVisible(a) ? s : Cesium.Visibility.NONE }, rn.prototype.canRefine = function(e, t, i) { return e.level < 16 }, rn.prototype.showTileThisFrame = function(e, t, i, o) { e.data.geometryPrimitive && e.data.geometryPrimitive.update(t, i, o) }, rn.prototype.computeDistanceToTile = function(e, t) { s = e, this.terrainProvider, void 0 === (r = void 0 === (r = s.data) ? s.data = new Cesium .GlobeSurfaceTile : r).tileBoundingRegion && (r.tileBoundingRegion = new Cesium .TileBoundingRegion({ computeBoundingVolumes: !1, rectangle: s.rectangle, ellipsoid: s.tilingScheme.ellipsoid, minimumHeight: 0, maximumHeight: 0 })); var i, o, r = e.data, n = r.tileBoundingRegion; if (void 0 === s) return 9999999999; r.boundingVolumeSourceTile !== s && (r.boundingVolumeSourceTile = s, (s = e.rectangle) && s.width < Cesium.Math.PI_OVER_TWO + Cesium.Math.EPSILON5 && (r.orientedBoundingBox = Cesium .OrientedBoundingBox.fromRectangle(e.rectangle, n.minimumHeight, n.maximumHeight, e .tilingScheme.ellipsoid, r.orientedBoundingBox), r.occludeePointInScaledSpace = (s = this, c = r.orientedBoundingBox.center, l = e.rectangle, u = n.maximumHeight, i = r .occludeePointInScaledSpace, a = (s = s.quadtree._occluders.ellipsoid).ellipsoid, o = [ new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium .Cartesian3 ], Cesium.Cartesian3.fromRadians(l.west, l.south, u, a, o[0]), Cesium.Cartesian3 .fromRadians(l.east, l.south, u, a, o[1]), Cesium.Cartesian3.fromRadians(l.west, l .north, u, a, o[2]), Cesium.Cartesian3.fromRadians(l.east, l.north, u, a, o[3]), s .computeHorizonCullingPoint(c, o, i)))); var a, s, l = n.minimumHeight, u = n.maximumHeight, c = (r.boundingVolumeSourceTile !== e && (a = t.camera.positionCartographic.height, s = Math.abs(a - l), Math.abs(a - u) < s ? (n.minimumHeight = l, n.maximumHeight = l) : (n .minimumHeight = u, n.maximumHeight = u)), n.distanceToCamera(t)); return n.minimumHeight = l, n.maximumHeight = u, c }, rn.prototype.isDestroyed = function() { return !1 }, rn.prototype.destroy = function() { return Cesium.destroyObject(this) }, rn.prototype.remove = function() { this.destroy() }, rn.prototype.getInstance = function(e) { var t; return 0 == Cesium.defined(e.TileManager) && (t = new rn, (e.TileManager = t).viewer = e, t = new Cesium .QuadtreePrimitive({ tileProvider: e.TileManager, maximumScreenSpaceError: 2 }), e.scene.primitives.add(t)), e.TileManager }, _n.sql2ast = function(r, e) { function n(e, t) { return t } null == e && (e = !0); var t = "###semi-colon###", i = (r = (r = (r = (r = r.replace(/[("'`].*;.*[)"'`]/g, function(e) { return e.replace(/;/g, t) })).replace(/;/g, "###EOR###")).split("###EOR###")[0]).replace(new RegExp(t, "g"), ";"), [ "SELECT", "FROM", "DELETE FROM", "INSERT INTO", "UPDATE", "JOIN", "LEFT JOIN", "RIGHT JOIN", "INNER JOIN", "ORDER BY", "GROUP BY", "HAVING", "WHERE", "LIMIT", "VALUES", "SET" ]), o = i.map(function(e) { return e + " " }), a = (o = (o = o.concat(i.map(function(e) { return e + "(" }))).concat(o.map(function(e) { return e.toLowerCase() }))).map(function(e) { return e.replace("(", "[\\(]") }), s = (r = r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function(e) { return e.replace(new RegExp(a.join("|"), "gi"), vn) }), []), l = (o.forEach(function(e) { var t, i, o = 0; do {} while (-1 != (i = r.indexOf(e, o)) && (t = e.replace(/^((\w|\s)+?)\s?\(?$/i, n), o = i + (s[i] = t).length), -1 != i) }), 0), u = (s.forEach(function(e, t) { t < l ? delete s[t] : (l = parseInt(t, 10) + e.length, "JOIN" == e && (s[t] = "INNER JOIN")) }), a.slice(0)), c = (u = (u = u.map(vn)).join("|"), r.split(new RegExp(a.join("|"), "i"))), h = (r = r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function(e) { return e.replace(new RegExp(u, "gi"), Cn) }), c = c.map(function(e) { return e.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function(e) { return e.replace(new RegExp(u, "gi"), Cn) }) }), []), m = (h.SELECT = function(e) { return yn(",", e).filter(function(e) { return "" !== e }).map(function(e) { return { name: e } }) }, h.SET = function(e) { return yn(",", e).filter(function(e) { return "" !== e }).map(function(e) { return { expression: e } }) }, h.FROM = h["DELETE FROM"] = h.UPDATE = function(e) { var i = e.split(","); return (i = i.map(fn)).forEach(function(e, t) { "" === e && i.splice(t) }), i = i.map(function(e) { var e = e.split(" AS "), t = e[1] || ""; return 0 === t.indexOf('"') && t.lastIndexOf('"') == t.length - 1 && (t = t .substring(1, t.length - 1)), { table: e[0], as: t } }) }, h["LEFT JOIN"] = h.JOIN = h["INNER JOIN"] = h["RIGHT JOIN"] = function(e) { var t = (e = e.split(" ON "))[0].split(" AS "), i = {}; return i.table = fn(t[0]), i.as = fn(t[1]) || "", i.cond = fn(e[1]), i }, h.WHERE = fn, h["ORDER BY"] = function(e) { e = e.split(","); var o = []; return e.forEach(function(e, t) { var i = /([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi; null !== (i = i.exec(e)) && ((e = {}).column = fn(i[1]), e.order = fn(i[2]), void 0 === i[2] && (e.order = "ASC"), o.push(e)) }), o }, h["GROUP BY"] = function(e) { e = e.split(","); var o = []; return e.forEach(function(e, t) { var i = /([A-Za-z0-9_\.]+)/gi; null !== (i = i.exec(e)) && ((e = {}).column = fn(i[1]), o.push(e)) }), o }, h.LIMIT = function(e) { var t = /((\d+)\s*,\s*)?(\d+)/gi, e = (void 0 === (t = t.exec(e))[2] && (t[2] = 0), {}); return e.nb = parseInt(fn(t[3]), 10), e.from = parseInt(fn(t[2]), 10), e }, h["INSERT INTO"] = function(e) { var t = (t = /([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi).exec(e), e = {}; return e.table = fn(t[1]), void 0 !== t[3] && (e.columns = t[3].split(","), e.columns = e .columns.map(fn)), e }, h.VALUES = function(e) { var e = yn(",", e = "(" != (e = fn(e))[0] ? "(" + e : e), t = []; return e.forEach(function(e) { e = yn(",", e = e.replace(/^\(/g, "").replace(/\)$/g, "")), t.push(e) }), t }, {}), d = 0; return s.forEach(function(e, t) { var i, o; e = e.toUpperCase(), d++, void 0 !== h[e] ? (i = h[e](c[d]), void 0 !== m[e] ? ("string" != typeof m[e] && void 0 !== m[e][0] || (o = m[e], m[e] = [], m[e].push(o)), m[e] .push(i)) : m[e] = i) : console.log("Can't analyze statement \"" + e + '"') }), void 0 !== m["LEFT JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["LEFT JOIN"][0] ? m["LEFT JOIN"].forEach(function(e) { e.type = "left", m.JOIN.push(e) }) : (m["LEFT JOIN"].type = "left", m.JOIN.push(m["LEFT JOIN"])), delete m["LEFT JOIN"]), void 0 !== m["INNER JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["INNER JOIN"][0] ? m["INNER JOIN"].forEach(function(e) { e.type = "inner", m.JOIN.push(e) }) : (m["INNER JOIN"].type = "inner", m.JOIN.push(m["INNER JOIN"])), delete m["INNER JOIN"]), void 0 !== m["RIGHT JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["RIGHT JOIN"][0] ? m["RIGHT JOIN"].forEach(function(e) { e.type = "right", m.JOIN.push(e) }) : (m["RIGHT JOIN"].type = "right", m.JOIN.push(m["RIGHT JOIN"])), delete m["RIGHT JOIN"]), e && ("string" == typeof m.WHERE && (m.WHERE = bn.parse(m.WHERE)), void 0 !== m.JOIN && m.JOIN .forEach(function(e, t) { m.JOIN[t].cond = bn.parse(e.cond) })), m }, wn.prototype = { constructor: wn, readNextChar: function() { "string" != typeof this.source ? this.currentChar = "" : this.currentChar = this.source[this .cursor++] || "" }, readNextToken: function() { return /\w|[-]/.test(this.currentChar) ? this.readWord() : /["'`]/.test(this.currentChar) ? this .readString() : /[()]/.test(this.currentChar) ? this.readGroupSymbol() : /[!=<>]/.test(this .currentChar) ? this.readOperator() : "" === this.currentChar ? { type: "eot", value: "" } : (this.readNextChar(), { type: "empty", value: "" }) }, readWord: function() { for (var e = "", t = 0, i = !1; /./.test(this.currentChar);) { if (!i && /['"`]/.test(this.currentChar)) i = this.currentChar; else if (i && this.currentChar == i) i = !1; else { if (!i) { if (")" == this.currentChar && t <= 0) break; if ("(" == this.currentChar ? t++ : ")" == this.currentChar && t--, /[!=<>]/.test( this.currentChar)) break } if (" " == this.currentChar && t <= 0) break } e += this.currentChar, this.readNextChar() } return /^(AND|OR)$/i.test(e) ? { type: "logic", value: e } : /^(IN|IS|NOT|LIKE)$/i.test(e) ? { type: "operator", value: e } : { type: "word", value: e } }, readString: function() { var e = "", t = this.currentChar; for (e += this.currentChar, this.readNextChar(); this.currentChar != t && "" !== this .currentChar;) e += this.currentChar, this.readNextChar(); return e += this.currentChar, this.readNextChar(), "." == this.currentChar ? (e += this .currentChar, this.readNextChar(), { type: "word", value: e += this.readString().value }) : { type: "string", value: e } }, readGroupSymbol: function() { var e = this.currentChar; return this.readNextChar(), { type: "group", value: e } }, readOperator: function() { var e = this.currentChar; return this.readNextChar(), /[=<>]/.test(this.currentChar) && (e += this.currentChar, this .readNextChar()), { type: "operator", value: e } } }, wn.tokenize = function(e) { var t = new wn(e), i = []; do { var o = t.readNextToken() } while ("empty" != o.type && i.push(o), t.currentChar); return i }, bn.prototype = { constructor: bn, readNextToken: function() { for (this.currentToken = this.lexer.readNextToken(); "empty" == this.currentToken.type;) this.currentToken = this.lexer.readNextToken(); return this.currentToken }, parseExpressionsRecursively: function() { return this.parseLogicalExpression() }, parseLogicalExpression: function() { for (var e = this.parseConditionExpression(); "logic" == this.currentToken.type;) { var t = this.currentToken.value, i = (this.readNextToken(), this.parseConditionExpression()); void 0 !== e.logic && e.logic == t && void 0 !== e.terms ? e.terms.push(i) : e = { logic: t, terms: [e, i].slice(0) } } return e }, parseConditionExpression: function() { var e, t = this.parseBaseExpression(); return "operator" == this.currentToken.type && (e = this.currentToken.value, this .readNextToken(), "operator" == this.currentToken.type && (e += " " + this.currentToken .value, this.readNextToken()), t = { operator: e, left: t, right: this.parseBaseExpression() }), t }, parseBaseExpression: function() { var e = ""; return "word" == this.currentToken.type || "string" == this.currentToken.type ? (e = this .currentToken.value, this.readNextToken()) : "group" == this.currentToken.type && (this .readNextToken(), e = this.parseExpressionsRecursively(), this.readNextToken()), e } }, bn.parse = function(e) { return new bn(e).parseExpressionsRecursively() }, _n.ast2sql = function(e) { function t(e) { return void 0 !== e.WHERE ? " WHERE " + Tn(e.WHERE) : "" } var i, o, r, n, a; return void 0 !== e.SELECT && void 0 !== e.FROM ? (void 0 !== (a = e).SELECT ? "SELECT " + a.SELECT.map( function(e) { return e.name }).join(", ") : "") + (void 0 !== (a = e).FROM ? " FROM " + a.FROM.map(function(e) { var t = e.table; return "" !== e.as && (t += " AS " + e.as), t }).join(", ") : "") + (void 0 !== (a = e).JOIN ? (n = "", a.JOIN.forEach(function(e) { n += " " + e.type.toUpperCase() + " JOIN " + e.table, "" !== e.as && (n += " AS " + e.as), n += " ON " + Tn(e.cond) }), n) : "") + t(e) + (void 0 !== (a = e)["GROUP BY"] ? " GROUP BY " + a["GROUP BY"].map(function( e) { return e.column }).join(", ") : "") + (void 0 !== (a = e)["ORDER BY"] ? " ORDER BY " + a["ORDER BY"].map(function( e) { return e.column + " " + e.order }).join(", ") : "") + (void 0 !== (a = e).LIMIT && void 0 !== a.LIMIT.nb && 0 < parseInt(a.LIMIT.nb, 10) ? (r = " LIMIT ", void 0 !== a.LIMIT.from && 1 < parseInt(a.LIMIT.from, 10) && (r += a .LIMIT.from + ","), r + a.LIMIT.nb) : "") : void 0 !== e["INSERT INTO"] ? (void 0 !== (r = e)[ "INSERT INTO"] ? (a = "INSERT INTO " + r["INSERT INTO"].table, void 0 !== r["INSERT INTO"] .columns ? (a += " (") + r["INSERT INTO"].columns.join(", ") + ")" : a) : "") + (void 0 !== (o = e).VALUES ? " VALUES " + o.VALUES.map(function(e) { return "(" + e.join(", ") + ")" }).join(", ") : "") : void 0 !== e.UPDATE ? (void 0 !== (o = e).UPDATE ? "UPDATE " + o.UPDATE.map( function(e) { var t = e.table; return "" !== e.as && (t += " AS " + e.as), t }).join(", ") : "") + (void 0 !== (i = e).SET ? " SET " + i.SET.map(function(e) { return e.expression }).join(", ") : "") + t(e) : void 0 !== e["DELETE FROM"] ? (void 0 !== (i = e)["DELETE FROM"] ? "DELETE FROM " + i["DELETE FROM"].map(function(e) { var t = e.table; return "" !== e.as && (t += " AS " + e.as), t }).join(", ") : "") + t(e) : null }, _n.trim = fn, _n.protect = vn, _n.unprotect = Cn, _n.protect_split = yn, _n.CondLexer = wn, _n .CondParser = bn; var Vn, kn = Pn, Fn = En, Gn = 1, Nn = (Object.defineProperties(xn.prototype, { style: { get: function() { return this._style }, set: function(e) { this._style = e } } }), xn.prototype.clonePartOfMultiFeature = function(e, t) { return { positions: e.positions[t], attributes: e.attributes, fid: e.fid, geometryType: e.geometryType } }, xn.prototype.createPrimitiveFromWFSFeatures = function(e) { new Cesium.PrimitiveCollection; for (var t = [], i = [], o = [], r = e.features.numPositions = 0; r < e.features.length; r++) { var n = e.features[r]; switch (this.sanitizePositions(n.positions), e.features.numPositions += n.positions.length, n .geometryType) { case "polygon": t.push(n); break; case "multipolygon": for (var a = n.positions.length, s = 0; s < a; s++) t.push(this.clonePartOfMultiFeature( n, s)); break; case "linestring": i.push(n); break; case "multilinestring": for (a = n.positions.length, s = 0; s < a; s++) i.push(this.clonePartOfMultiFeature(n, s)); break; case "point": o.push(n); break; case "multipoint": for (a = n.positions.length, s = 0; s < a; s++) o.push(this.clonePartOfMultiFeature(n, s)) } } 0 < t.length ? (e.features = t, this.createPolygonPrimitive(e)) : 0 < i.length ? (e.features = i, this.createLinestringPrimitive(e)) : 0 < o.length && (e.features = o, this .createPointPrimitive(e)) }, xn.prototype.createPolygonPrimitive = function(g) { function _(e) { if (e.isQuery) e.onFinishedQuery(a); else { for (var t, i, o, r, n = "", a = [], s = [], l = [], u = [], c = [], h = 0; h < e.features .length; h++) { var m, d, p, g = e.features[h]; Dn(e, g.fid) && (d = g.absoluteHeightPositions || g.positions, m = f .createPolygonOptions(d, g.attributes), d = f.createCommonOptions(g.attributes), g.absoluteHeightPositions && delete g.absoluteHeightPositions, a.push(Cesium .BoundingSphere.fromPoints(m.hierarchy.positions)), e.isQuery || (m .outline && (p = f.createPolygonGeometryHelper(Cesium .PolygonOutlineGeometry, g, m.hierarchy, m.outlineColor, m .perPositionHeight, m.extrudedHeight, m.height), l.push(p)), m.fill && ( p = f.createPolygonGeometryHelper(Cesium.PolygonGeometry, g, m .hierarchy, m.material, m.perPositionHeight, m.extrudedHeight, m .height, m.water), s.push(p)), e.parentLayer.addRenderedFeatureId(g .fid), n += g.fid + ";", u.push(g.fid), c.push(d.tooltip))) } "" != n && (t = new Cesium.PrimitiveCollection, o = new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: m.material.alpha < 1 }), 0 < s.length && (m.water && (i = { color: m.water.color || "rgba(135,206,235,0.6)", image: m.water.image || window.SmartEarthRootUrl + D.water, frequency: m.water.frequency || 1e3, speed: m.water.speed || 10, amplitude: m.water.amplitude || 10 }, r = Cesium.Color.fromCssColorString(i.color), o = new Cesium .EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { type: "Water", uniforms: { baseWaterColor: r, blendColor: r, normalMap: i.image, frequency: i.frequency, animationSpeed: i.speed / 1e3, amplitude: i.amplitude } } }) })), ((r = m.clampToGround || !m.perPositionHeight && !m.extrudedHeight && ! m.height ? new Cesium.GroundPrimitive({ geometryInstances: s, appearance: o, classificationType: m.classificationType }) : new Cesium.Primitive({ geometryInstances: s, appearance: o }))._parentCollection = t).add(r)), 0 < l.length && (m.clampToGround || ((r = new Cesium.Primitive({ geometryInstances: l, appearance: o }))._parentCollection = t).add(r)), t.ID = "polygons:" + Sn(n), t._instanceIds = u, t._tooltips = c, e.onFinishedCreatePrimitive(t, a)) } } var e, f = this; 3 == this.style.altitudeMethod ? (g.features = In(g.features, Ln(f)), _(g)) : (e = function(e) { for (var t = [], i = e.length, o = 0; o < i; o++) for (var r = e[o], n = r.positions.length, a = 0; a < n; a++) for (var s = r.positions[a], l = 0; l < s.length; l += 3) t.push(Cesium .Cartographic.fromDegrees(s[l + 0], s[l + 1], 0)); return t }(g.features), e = Cesium.sampleRenderedData(e, Cesium.SampleRenderedDataFlags.TERRAIN | Cesium.SampleRenderedDataFlags.FLOOR), Cesium.when(e, function(e) { for (var t = 2 == f._style.altitudeMethod, i = g.features, o = e, r = Ln(f), n = t, a = 0, s = 0; s < i.length; s++) { var l = i[s], u = n ? Gn : r(l); null == l.absoluteHeightPositions && (l.absoluteHeightPositions = []); for (var c = 0; c < l.positions.length; c++) for (var h = l.positions[c], m = l.absoluteHeightPositions[c] = [], d = 2; d < h.length; d += 3) { var p = n ? 0 : h[d]; null == o[a].height && (o[a].height = 0), m[d - 2] = h[d - 2], m[d - 1] = h[d - 1], m[+d] = h[+d], m[d] = p + o[a].height + u, a++ } } _(g) })) }, xn.prototype.createPolygonGeometryHelper = function(e, t, i, o, r, n, a, s) { var l = null != n ? Cesium.PerInstanceColorAppearance.VERTEX_FORMAT : Cesium .PerInstanceColorAppearance.FLAT_VERTEX_FORMAT, e = new e({ polygonHierarchy: i, vertexFormat: l = void 0 === s && void 0 === a ? l : Cesium.EllipsoidSurfaceAppearance .VERTEX_FORMAT, perPositionHeight: void 0 !== a ? void 0 : r, extrudedHeight: n, height: a }); return new Cesium.GeometryInstance({ geometry: e, id: t, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(o) } }) }, xn.prototype.createLinestringPrimitive = function(i) { function o(o) { if (o.isQuery) o.onFinishedQuery(t); else { var e, r = "", t = [], n = [], a = []; let i = new Cesium.PrimitiveCollection; for (var s, l = 0; l < o.features.length; l++) { var u = o.features[l]; if (Dn(o, u.fid)) { var c = u.absoluteHeightPositions || u.positions, c = d.createLinestringOptions(c, u.attributes), h = d.createCommonOptions(u.attributes); if (c.vertexFormat = (e ? Cesium.PerInstanceColorAppearance : Cesium .PolylineColorAppearance).VERTEX_FORMAT, u.absoluteHeightPositions && delete u.absoluteHeightPositions, t.push(Cesium.BoundingSphere.fromPoints(c .positions)), !o.isQuery) { m = c.clampToGround ? new Cesium.GroundPolylineGeometry({ positions: c.positions, width: c.width }) : new Cesium.PolylineGeometry(c); var m = new Cesium.GeometryInstance({ id: u, geometry: m, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(c .material) } }); o.parentLayer.addRenderedFeatureId(u.fid), r += u.fid + ";", n.push(u.fid), a .push(h.tooltip); let e = null, t; t = c.dash ? new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material .PolylineDashType, { color: c.material, gapColor: c.gapColor || Cesium.Color.TRANSPARENT, dashLength: c.dashLength || 20 }) }) : new Cesium.PolylineMaterialAppearance({ material: new Cesium.Material({ fabric: { type: "PolylineOutline", uniforms: { color: c.material, outlineColor: c.outlineColor || c.material, outlineWidth: c.outlineWidth || 0 } } }) }), e = c.clampToGround ? new Cesium.GroundPolylinePrimitive({ geometryInstances: m, appearance: t, classificationType: c.classificationType }) : new Cesium.Primitive({ geometryInstances: m, appearance: t }), i.add(e) } } } "" != r && ((s = i).ID = "polylines:" + Sn(r), s._instanceIds && 0 === s._instanceIds .length && (s._instanceIds = n), s._tooltips = a, o.onFinishedCreatePrimitive(s, t)) } } var e, d = this; 3 == this.style.altitudeMethod ? (i.features = In(i.features, Ln(d)), o(i)) : (e = Pn(i.features), e = Cesium.sampleRenderedData(e, Cesium.SampleRenderedDataFlags.TERRAIN | Cesium .SampleRenderedDataFlags.FLOOR), Cesium.when(e, function(e) { var t = 2 == d._style.altitudeMethod; En(i.features, e, Ln(d), t), o(i) })) }, xn.prototype.createPointPrimitive = function(i) { function o(e) { if (e.isQuery) e.onFinishedQuery(n); else { for (var t, i, o = "", r = [], n = [], a = [], s = new Cesium.LabelCollection({ scene: C.viewer.scene }), l = new Cesium.PointPrimitiveCollection({ scene: C.viewer.scene }), u = new Cesium.BillboardCollection({ scene: C.viewer.scene }), c = new Cesium.PrimitiveCollection, h = new Cesium.PolylineCollection, m = 0; m < e .features.length; m++) { var d, p, _, f, y, v = e.features[m]; Dn(e, v.fid) && (d = v.absoluteHeightPositions || v.positions, d = C.createPointOptions( d, v.attributes), p = C.createCommonOptions(v.attributes), v.clampToGround = d.clampToGround, d.sgsPointPosition && (v.sgsPointPosition = d.sgsPointPosition, delete d.sgsPointPosition), v.absoluteHeightPositions && delete v .absoluteHeightPositions, n.push(Cesium.BoundingSphere.fromPoints([d .position])), e.isQuery || (d.label && (d.label.position = d.position, d.label .id = v, C.setEyeOffset(d.label), null != d.label.imageFile && (d.label .image = C.applyConditionalClassification(d.label.imageFile, v .attributes), d.label.label = d.label, u.add(d.label), C .setEyeOffset(d.label, -5)), null != d.label.imageFile && null != d .label.showText && d.label.showText && (C.viewer.scene .onHoverShowTextArray[d.label.id] = !0), null != d.label.isBold && d .label.isBold ? s.add(g) : null != d.label.isUnderline && d.label .isUnderline ? (f = null != d.label.text.match(/[iljf1]/g) ? d.label .text.match(/[iljf1]/g) : [], _ = d.label.text.length, _ = Array( Math.ceil(_ - .5 * f.length)).join("_"), f = $.extend({}, d .label), null != d.label.image && delete d.label.image, f .position = d.label.position, f.id = d.label.id, f.text = _, f .alignment = null != d.label.alignment ? d.label.alignment : void 0, f.underline = !0, f.textRelativeToImage = null != d.label .textRelativeToImage ? d.label.textRelativeToImage : void 0, -1 < d .label.font.indexOf("pt") ? Number(d.label.font.split("pt")[0]) : - 1 < d.label.font.indexOf("px") && Number(d.label.font.split("px")[ 0]), f.pixelOffset = new Cesium.Cartesian2(0, -45), s.add(f)) : s.add(d.label)), d.billboard && (d.billboard.position = d.position, d .billboard.id = v, C.setEyeOffset(d.billboard), u.add(d.billboard)), d .model && (d.model.url = d.model.uri, d.model.id = v, c.add(Cesium.Model .fromGltf(d.model))), d.point && (d.point.position = d.position, d.point .id = v, C.setEyeOffset(d.point), l.add(d.point)), 0 != d .lineToGround && (_ = Cesium.Cartographic.fromCartesian(d.position), f = Cesium.Cartesian3.fromRadians(_.longitude, _.latitude, 0), 2 == d .lineToGround && (y = d.lineToGroundLength / Cesium.Cartesian3.distance( d.position, f), Cesium.Cartesian3.lerp(d.position, f, y, f)), h .add({ show: !0, width: 1, positions: [d.position, f], material: Cesium.Material.fromType("Color", { color: d.lineToGroundColor }) })), e.parentLayer.addRenderedFeatureId(v.fid), o += v.fid + ";", r .push(v.fid), a.push(p.tooltip))) } "" != o && (i = new Cesium.PrimitiveCollection, 0 < s.length && ($.each(s._labels, function( e, t) { t._type = "Label" }), (s._billboardCollection._parentCollection = i).add(s), t = "labels"), 0 < u .length && ($.each(u._billboards, function(e, t) { t._type = "Billboard" }), (u._parentCollection = i).add(u), t = "billboards"), 0 < c.length && ($.each(c ._primitives, function(e, t) { t._type = "Model", t._parentCollection = i }), i.add(c), t = "models"), 0 < l.length && ($.each(l._pointPrimitives, function(e, t) { t._type = "Point" }), (l._parentCollection = i).add(l), t = "points"), 0 < h.length && ($.each(h ._polylines, function(e, t) { t._type = "L2G" }), (h._parentCollection = i).add(h), t = "L2G"), i.ID = t + ":" + Sn(o), i ._instanceIds = r, i._tooltips = a, e.onFinishedCreatePrimitive(i, n)) } } var e, C = this; 3 == this.style.altitudeMethod ? (i.features = In(i.features, Ln(C)), o(i)) : (e = kn(i.features), e = Cesium.sampleRenderedData(e), Cesium.when(e, function(e) { var t = 2 == C._style.altitudeMethod; Fn(i.features, e, Ln(C), t), o(i) }).otherwise(function(e) {})) }, xn.prototype.createCommonOptions = function(e) { var t = {}; return t.tooltip = this.applyConditionalClassification(this.style.tooltip, e), t }, xn.prototype.createPolygonOptions = function(e, t) { var i = this.getPolygonStyle(this.style); i.polygon.hierarchy = { positions: Cesium.Cartesian3.fromDegreesArrayHeights(e[0]), holes: [] }; for (var o = 1; o < e.length; o++) i.polygon.hierarchy.holes.push({ positions: Cesium.Cartesian3.fromDegreesArrayHeights(e[o]) }); var r, n = this.applyConditionalClassification(i.polygon.material, t); return i.polygon.material = Mn(n), null != i.polygon.fill && null != i.polygon.fromKml && (1 < (r = this.applyConditionalClassification(i.polygon.fill, t)) && (r /= 100), i.polygon .material = new Cesium.Color(i.polygon.material.red, i.polygon.material.green, i.polygon .material.blue, r)), i.polygon.extrudedHeight && i.polygon.extrudedHeight && i.polygon .extrudedHeight.indexOf && -1 < i.polygon.extrudedHeight.indexOf("[") && -1 < i.polygon .extrudedHeight.defaultValue.indexOf("]") && (n = t[i.polygon.extrudedHeight.defaultValue .substring(1, i.polygon.extrudedHeight.defaultValue.length - 1)], void 0 !== (n = parseInt(n)) && (i.polygon.extrudedHeight = 3 * n)), t.FSCALE && (r = this.getLevelDistance( t.FSCALE), i.polygon.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, r)), n = this.applyConditionalClassification(i.polygon.outlineColor, t), i.polygon .outlineColor = Mn(n), i.polygon }, xn.prototype.translateLineWidth = function(e, t) { t = this.applyConditionalClassification(e.polyline.width, t); return 0 < t ? TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS ? 1 < t && (e.polyline .widthInMeters = !0, t *= .8, 0 < e.polyline.backgroundOpacity && (t *= .8)) : t = 1 < t ? 2 : 1 : t < 0 ? t = Math.min(5, Math.abs(t)) : 0 == t && (t = 1), t }, xn.prototype.createLinestringOptions = function(e, t) { var i = this.getLinestringStyle(this.style), e = (i.id = t, i.polyline.positions = Cesium.Cartesian3.fromDegreesArrayHeights(e), this .applyConditionalClassification(i.polyline.material, t)); return i.polyline.material = Mn(e), null != i.polyline.lineOpacity && (1 < (e = this .applyConditionalClassification(i.polyline.lineOpacity, t)) && (e /= 100), i.polyline .material = new Cesium.Color(i.polyline.material.red, i.polyline.material.green, i.polyline .material.blue, e)), i.polyline.far && (i.polyline.distanceDisplayCondition = new Cesium .DistanceDisplayCondition(void 0 !== i.polyline.near ? i.polyline.near : 0, i.polyline.far) ), t.FSCALE && (e = this.getLevelDistance(t.FSCALE), i.polyline.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, e)), i.polyline.width = this .applyConditionalClassification(i.polyline.width, t), i.polyline }, xn.prototype.applyConditionalClassification = function(e, i) { if (null != e) { if (null == e.defaultValue) return e; var o = Rn(e.defaultValue); if (void 0 === e.classificationArray) { if (!isNaN(o)) return o; if (o instanceof Cesium.Color) return o } if (void 0 !== e.attributeName) { var t = "[" + e.attributeName + "]"; if (o === t) o = i[e.attributeName]; else if (e.multipleAttributeReplacementNeeded) for (name in i) o = Hn(o, "[" + name + "]", i[name]); else o = Hn(o, t, i[e.attributeName]); return o } if (void 0 !== e.classification) return o = On(e.classification, i); var r = e.classificationArray; return void 0 !== r && $(Object.keys(r)).each(function(e, t) { t = function(e, t) { if (void 0 !== e && 0 !== e.condition.length) { if (void 0 === e.func) return Rn(e.value); var i = void 0; return i = !0 === On(e, t) ? Rn(e.value) : i } }(r[t], i); t && (o = t) }), o } }, xn.prototype.createLineToGroundOptions = function(e, t) { var i = this.applyConditionalClassification(e.lineToGround, t); null != i && 0 != Number(i) ? (e.lineToGround = i, i = An(i = this.applyConditionalClassification(e .lineToGroundColor, t)), e.lineToGroundColor = i, i = this .applyConditionalClassification(e.lineToGroundLength, t), e.lineToGroundLength = Number(i) ) : (e.lineToGround = 0, e.lineToGroundColor = 0, e.lineToGroundLength = 0) }, xn.prototype.createPointOptions = function(e, t) { var i, o, r, n, a, s = this.getPointStyle(this.style); return s.pointHeight ? (s.position = Cesium.Cartesian3.fromDegrees(e[0], e[1], s.pointHeight), e[ 2] = s.pointHeight) : s.position = Cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), s .sgsPointPosition = e, s.id = t, s.label && (void 0 !== (e = s.label.text) && -1 < e .defaultValue.indexOf("[") && -1 < e.defaultValue.indexOf("]") && (void 0 !== (e = t[e .defaultValue.substring(1, e.defaultValue.length - 1)]) && (s.label.text = e)), this .applyConditionalClassification(s.label.text, t) ? s.label.text = this .applyConditionalClassification(s.label.text, t).toString() : s.label.text = this .applyConditionalClassification(s.label.text, t), s.label.text = this.o(s.label.text) ? this .s(s.label.text) : s.label.text, -1 < s.label.text.indexOf("[") && -1 < s.label.text .indexOf("]") && (s.label.text = ""), null != s.label.family && (e = this .applyConditionalClassification(s.label.family, t), o = this .applyConditionalClassification(s.label.font, t), s.label.font = 0 <= o ? (3 * o / 4) .toString() + "pt " + e : (3 * (-1 * (72 * o / 96)) / 4).toString() + "pt " + e), s .label.fillColor = An(this.applyConditionalClassification(s.label.fillColor, t)), s.label .backgroundColor = An(this.applyConditionalClassification(s.label.backgroundColor, t)), null == s.label.backgroundColor && (s.label.backgroundColor = new Cesium.Color(.165, .165, .165, 0)), s.label.showBackground = !0, null != s.label.showText && ((a = this .applyConditionalClassification(s.label.showText, t)) && 1 === Number(a) && (s.label .onHoverShowText = !0), a && null == viewer.scene.canvas.onHoverShowText && (i = viewer.scene, new Cesium.ScreenSpaceEventHandler(i.canvas).setInputAction(function( e) { var t = {}; i.screenToWorld(e.endPosition, t), Cesium.defined(t.pickPrimitive) && "Billboard" == t.pickPrimitive.constructor.name && null != t .pickPrimitive.label ? null != i.onHoverShowTextArray[t.pickPrimitive .label.id] && (null != i._lastObjectShowOnText && i ._lastObjectShowOnText.id != t.pickPrimitive.label.id && null != i ._lastObjectShowOnText.show && (i._lastObjectShowOnText.show = !1), viewer.scene._lastObjectShowOnText = i.onHoverShowTextArray[t .pickPrimitive.label.id], null != i._lastObjectShowOnText .show && (viewer.scene._lastObjectShowOnText.show = !0)) : null != i ._lastObjectShowOnText && null != i._lastObjectShowOnText.show && (i ._lastObjectShowOnText.show = !1) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), viewer.scene.canvas.onHoverShowText = !0 )), null != s.label.textRelativeToImage && null != s.label.textAlignment && (s.label .textRelativeToImage = this.applyConditionalClassification(s.label.textRelativeToImage, t), s.label.alignment = this.applyConditionalClassification(s.label.textAlignment, t)), null != s.label.underline && (s.label.isUnderline = this .applyConditionalClassification(s.label.underline, t)), null != s.label.bold && 1 == this.applyConditionalClassification(s.label.bold, t) && (s.label.font = "bold " + s.label .font), null != s.label.italic && 1 == this.applyConditionalClassification(s.label .italic, t) && (s.label.font = "italic " + s.label.font), null != s.label .backgroundOpacity && (s.label.backgroundColor.alpha = this.applyConditionalClassification(s .label.backgroundOpacity, t)), null != s.label.minViewingHeight && (r = this .applyConditionalClassification(s.label.minViewingHeight, t), n = 650 * this .applyConditionalClassification(s.label.scaleMPP, t), s.label.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(r, n)), t.FSCALE && (a = this.getLevelDistance(t .FSCALE), s.label.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, a)), s.label.disableDepthTestDistance || (s.label.disableDepthTestDistance = 1e3), s .clampToGround && (s.label.heightReference = 1)), s.billboard && (s.billboard .sizeInMeters = !1, null != s.billboard.imageColor && (o = An(o = this .applyConditionalClassification(s.billboard.imageColor, t)), s.billboard.color = o), null != s.billboard.imageOpacity && null != s.billboard.color.alpha && (s.billboard.color .alpha = Number(this.applyConditionalClassification(s.billboard.imageOpacity, t))), s .billboard.image = this.applyConditionalClassification(s.billboard.image, t), null != s .billboard.minViewingHeight && (r = this.applyConditionalClassification(s.billboard .minViewingHeight, t), n = 650 * this.applyConditionalClassification(s.billboard .scaleMPP, t), s.billboard.distanceDisplayCondition = new Cesium .DistanceDisplayCondition(r, n)), t.FSCALE && (a = this.getLevelDistance(t.FSCALE), s .billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, a)), s .billboard.link && s.id && "object" == typeof s.id && (s.id.link = this .applyConditionalClassification(s.billboard.link, t)), s.billboard .disableDepthTestDistance || (s.billboard.disableDepthTestDistance = 1e3), s .clampToGround && (s.billboard.heightReference = 1)), s.model && (e = function(e) { e = Number(e); return e = Cesium.defined(e) && !isNaN(e) ? e : 0 }, s.model.uri = this.applyClassification(s.model.uri, t), s.model.scale = e(this .applyClassification(s.model.scale, t)), r = e(this.applyClassification(s.model.heading, t)), n = e(this.applyClassification(s.model.pitch, t)), a = e(this.applyClassification(s .model.roll, t)), e = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(r), Cesium.Math .toRadians(n), Cesium.Math.toRadians(a)), s.model.modelMatrix = Cesium.Transforms .headingPitchRollToFixedFrame(s.position, e)), this.createLineToGroundOptions(s, t), s }, xn.prototype.s = function(e) { return e.split("").reverse().join("") }, xn.prototype.getLevelDistance = function(e) { var t = 2e7; switch (parseInt(e)) { case 2: t = 10123e3; break; case 3: t = 7123e3; break; case 4: t = 6321e3; break; case 5: t = 5522e3; break; case 6: t = 3436e3; break; case 7: t = 539e3; break; case 8: t = 305e3; break; case 9: t = 18e4; break; case 10: t = 133e3; break; case 11: t = 1e5; break; case 12: t = 76500; break; case 13: t = 58200; break; case 14: t = 23500; break; case 15: t = 9600; break; case 16: t = 4e3; break; case 17: t = 2e3; break; case 18: t = 1700; break; case 19: t = 1500; break; case 20: t = 1e3; break; case 21: t = 500; break; case 22: t = 200; break; case 23: t = 100 } return t }, xn.prototype.o = function(e) { if (!e) return e; return new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e[0]) }, xn.prototype.applyClassification = function(e, t) { if ("string" !== $.type(e)) return e; if (null != /(\[([^\]]+)\])/g.exec(e)) for (var i in t) e = Hn(e, "[" + i + "]", t[i]); for (var o = /(\<([^\>]+)\>)/g, r = o.exec(e = "undefined" == e ? "" : e); null != r;) { try { var n = r[r.length - 1], a = (0, eval)(n); e = e.replace(r[0], a) } catch (e) {} r = o.exec(e) } return e }, xn.prototype.getPolygonStyle = function(e) { return $.extend(!0, {}, Nn.DEFAULT_POLYGON_STYLE, e) }, xn.prototype.getLinestringStyle = function(e) { return $.extend(!0, {}, Nn.DEFAULT_POLYLINE_STYLE, e) }, xn.prototype.getPointStyle = function(e) { return null != e.label ? $.extend(!0, {}, Nn.DEFAULT_LABEL_STYLE, e) : null != e.billboard ? $ .extend(!0, {}, Nn.DEFAULT_BILLBOARD_STYLE, e) : null != e.model ? $.extend(!0, {}, Nn .DEFAULT_MODEL_STYLE, e) : null != e.point ? $.extend(!0, {}, Nn.DEFAULT_POINT_STYLE, e) : Nn.DEFAULT_POINT_STYLE }, xn.prototype.sanitizePositions = function(e) { for (var t = 0; t < e.length; t++) e[t] instanceof Array ? this.sanitizePositions(e[t]) : isNaN(e[ t]) && (e[t] = 0) }, {}); function Y(e, t, i, o, r, n, a, s, l) { var u, c = this; function h(t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(p(t, i), function(e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise } function m(e, t) { for (var i = e.tilingScheme, o = i.positionToTileXY(t, 0), e = c._Viewer.scene.globe._surface .tileProvider.quadtree._levelZeroTiles, r = e[0].x == o.x && e[0].y == o.y ? e[0] : e[1], n = 1; n < 22; n++) { var a = function(e, t) { for (var i = 0; i < e.children.length; i++) if (e.children[i].state >= Cesium.QuadtreeTileLoadState.DONE && (null != e.children[i] .data.terrainData._mesh || null != e.children[i].data.terrainData._buffer) && e .children[i].x == t.x && e.children[i].y == t.y) return e.children[i] }(r, o = i.positionToTileXY(t, n)); if (null == a) break; r = a } return r } function d(e) { var t; for ($.grep(c._Viewer.scene.primitives._primitives, function(e) { return e instanceof Cesium.Cesium3DTileset }), t = 0; t < e.length; ++t) { var i = e[t], o = i instanceof Cesium.Cartographic, r = o ? i : Cesium.Cartographic.fromCartesian(i); r.height = c.G, o || (o = Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude, r.latitude, r .height ])[0], i.z = o.z) } return e } function p(e, t) { for (var i = 0; i < t.length; ++i) { var o = t[i], r = m(e, o); o.height = r.data.terrainData.interpolateHeight(r.rectangle, o.longitude, o.latitude) } return t } function g(e) { this.value = new Float32Array([e]) } this._viewer = e, this._Viewer = e, c.G = 65535, Vn = new rn, ml = new Jo({ workerPath: function() { for (var e = document.scripts, t = "./wfs/featurefetcherworker.js", i = 0; i < e .length; i++) { var o = e[i].src.split("/"), o = o[o.length - 1]; "SmartEarth.js" == o ? t = e[i].outerHTML.split('"')[1].replace("SmartEarth.js", "Workers/featurefetcherworker.js") : "SmartEarth.min.js" == o && (t = e[i] .outerHTML.split('"')[1].replace("SmartEarth.min.js", "Workers/featurefetcherworker.js")) } return t }() }), Cesium.sampleRenderedData || (Cesium.Resource && (Cesium.loadText = Cesium.Resource.fetchText, Cesium.loadJson = Cesium.Resource.fetchJson, Cesium.loadBlob = Cesium.Resource.fetchBlob, Cesium .loadArrayBuffer = Cesium.Resource.fetchArrayBuffer, Cesium.loadImage = Cesium.Resource .fetchImage), g.fromZBias = function(e) { if (Cesium.defined(e)) return new g(e); throw new DeveloperError("zbias is required.") }, g.toValue = function(e, t) { if (Cesium.defined(e)) return Cesium.defined(t) ? color.toBytes(t) : new Float32Array(e); throw new DeveloperError("zbias is required.") }, g.equals = function(e, t) { return e === t || Cesium.defined(e) && Cesium.defined(t) && e.value[0] === t.value[0] }, g.defaultBias = function() { return g.fromZBias(15e-6) }, Cesium.ZBiasGeometryInstanceAttribute = g, Cesium.ZBiasGeometryInstanceAttribute = g, Cesium .SampleRenderedDataFlags = { TERRAIN: 2, MESH: 4, FLOOR: 8 }, Cesium.DynamicEyeOffset = function(e) { return void 0 === e && (e = 0), new Cesium.Cartesian3(.001234321, 0, e) }, Cesium.sampleRenderedData = function(r, e) { var t, i = 2, o = 4, n = 8, a = (null == e && (e = i | o), Cesium.when.defer()), s = [], l = (i < e ? r.forEach(function(e) { s.push(Cesium.Cartographic.fromRadians(e.longitude, e.latitude, e.height)) }) : s = r, []), u = (e & i && l.push(h(c._Viewer.terrainProvider, r)), 0 < (e & n)); return e & (o | n) && l.push((i = s, Cesium.Check.defined("positions", i), t = Cesium.when .defer(), Cesium.when(d(i), function(e) { t.resolve(e) }), t.promise)), Cesium.when.all(l).then(function(e) { if (1 < l.length) for (var t = 0; t < r.length; t++) { var i = e[0][t], o = e[1][t]; o.height != c.G && (i.height < o.height || u) && (i.height = o.height) } a.resolve(e[0]) }), a.promise }, Cesium.sampleRenderedMesh = function(e, t) { Cesium.Check.defined("positions", e); var i = Cesium.when.defer(); return Cesium.when(d(e), function(e) { i.resolve(e) }), i.promise }, Cesium.sampleRenderedTerrain = function(t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(p(t, i), function(e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise }, Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo = function() { var e, t = this.getRenderedLevelInfo(), i = 0; for (e in t) i < Number(e) && (i = Number(e)); return { bestLevel: i, count: t[i] } }, Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo = function() { var t = []; return this._tilesToRender.forEach(function(e) { null == t[e.level] && (t[e.level] = 0), t[e.level]++ }), t }), r = r || {}, this._level = o || { min: 0, max: 22 }, "number" == typeof this._level && (this._level = { min: o, max: 22 }), this._url = t, this._layerName = i, this._guid = Cesium.createGuid(), this._gmlParser = new on(!0, null, null, !0), this._tileManager = Vn.getInstance(e), this._tileManager._loadTileEvent .addEventListener(Y.prototype.loadTile, this), this._useWorkers = !0, this._layerDisplayName = n, this ._showAttributesAsMessage = r.showAttributesAsMessage, delete r.showAttributesAsMessage, this ._entityCreator = new xn(r, e), this._visible = !0, this._featuresMap = {}, this._boundingBox = void 0, this._geometryFieldName = void 0, this._operations = {}, this._subdomains = a, this.latLon = s, this ._addedFeatures = [], this.simpleSqlParser = _n, this.myLayer = l, this._statistics = { numberOfAddedFeatures: 0, numberOfDeletedFeatures: 0, numberOfAddePositions: 0, numberOfDeletedPositions: 0, getNumberOfCurrentlyRenderedFeatures: function() { return this.numberOfAddedFeatures - this.numberOfDeletedFeatures }, getNumberOfCurrentlyRenderedPositions: function() { return this.numberOfAddePositions - this.numberOfDeletedPositions } }, o = (u = this).cleanUrl(u._url).replace("{s}", u.sTag(u._layerName.length, u._layerName.length, u ._level)), o = (o += ul(o)) + ( "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName=" + u._layerName), t = Cesium.TrustedServers.contains(Bn(u._url, u._subdomains)), $.ajax({ dataType: "xml", xhrFields: { withCredentials: t }, url: encodeURI(o), success: function(e) { var i, o; o = u, ll(e, "FeatureType", "wfs").each(function(e, t) { return ll(t, "Name", "wfs").text() != o._layerName || (1 === (t = ll(t, "LatLongBoundingBox", "wfs")).length && (o._boundingBox = Cesium .Rectangle.fromDegrees(parseFloat(t[0].attributes.minx.value), parseFloat(t[0].attributes.miny.value), parseFloat(t[0] .attributes.maxx.value), parseFloat(t[0].attributes.maxy .value))), !1) }), i = u, $(e).find("FeatureType").each(function(e, t) { return $(t).children("Name").text() != i._layerName || (0 != (t = $(t) .children("Operations")).length && t.children().each( function() { i._operations[this.tagName.toLowerCase()] = {} }), !1) }) } }), cl(this) } function Bn(e, t) { t = -1 != e.indexOf("{s}") ? null != t && 0 < t.length ? e.replace("{s}", t[0]) : console.error( "Error - sTag with no subdomains.") : e; return t } function ll(e, t, i) { var o = $(e).find(t); return 0 < (o = 0 == o.length && "wfs" === i.toLowerCase() ? $(e).find("wfs\\:" + t + "," + t) : o).length ? o : $([]) } function ul(e) { return -1 < e.indexOf("?") ? "&" : "?" } function cl(i) { i.featureColumnNames = null; var e = i.cleanUrl(i._url).replace("{s}", i.sTag(i._layerName.length, i._layerName.length, i._level)), t = (e = (e += ul(e)) + ("SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName=" + i ._layerName), Cesium.TrustedServers.contains(Bn(i._url, i._subdomains))); $.ajax({ dataType: "xml", xhrFields: { withCredentials: t }, url: encodeURI(e), success: function(e) { var o, t; o = i, e = e, t = $(e).find("[type^='gml:']"), o._geometryFieldName = $(t).attr("name"), o.geometryResponseData = e, o.wfsNamespace = function(e, t) { let i = eval; if (null == e) return null; try { var o = (new XMLSerializer).serializeToString(e).match(i("/[<]([a-z]+):" + t + "[>]/i")); return null != o ? o[1] : null } catch (e) { return !1 } }(o.geometryResponseData, "sequence"), null == o.wfsNamespace && (o.wfsNamespace = "xsd"), o.sgSchemaExists = $(o.geometryResponseData).find(o.wfsNamespace + "\\:schema").attr("xmlns:sfs"), o.sgSchemaExists || (o.sgSchemaExists = $(o .geometryResponseData).find("schema").attr("xmlns:sfs")), 0 == (t = $(o .geometryResponseData).find(o.wfsNamespace + "\\:sequence " + o .wfsNamespace + "\\:element")).length && (t = $(o.geometryResponseData).find( "sequence").find("element")), o.geomFields = [], t.each(function() { var e, t = $(this), i = t.attr("name"), t = t.attr("type"); null == t ? t = "string" : (e = t.match(/.*[:](\w+)/)) && (t = e[1]), o .geomFields.push({ name: i, type: t }) }) } }) } function hl(e) { return null == e ? void 0 : e.parentLayer ? e : e._parentCollection || (e.primitive && e.primitive ._parentCollection ? e.primitive._parentCollection : void 0) } Object.defineProperties(Nn, { DEFAULT_POLYGON_STYLE: { get: function() { return { polygon: { perPositionHeight: !0, fill: 0, material: Cesium.Color.GREEN, outline: !0, outlineColor: Cesium.Color.WHITE, outlineWidth: 1 } } } }, DEFAULT_POLYLINE_STYLE: { get: function() { return { polyline: { material: Cesium.Color.WHITE, width: 1 } } } }, DEFAULT_POINT_STYLE: { get: function() { return { point: { color: Cesium.Color.RED, pixelSize: 5, outlineColor: Cesium.Color.WHITE, outlineWidth: 2 } } } }, DEFAULT_LABEL_STYLE: { get: function() { return { label: { text: "Text", font: "18px arial", style: Cesium.LabelStyle.FILL, fillColor: Cesium.Color.WHITE, outlineColor: Cesium.Color.BLACK, outlineWidth: 5, scale: 1, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, eyeOffset: Cesium.Cartesian3.ZERO, pixelOffset: new Cesium.Cartesian2(0, -50) } } } }, DEFAULT_BILLBOARD_STYLE: { get: function() { return { billboard: { image: "./img/query.png", scale: 1, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM } } } }, DEFAULT_MODEL_STYLE: { get: function() { return { model: { uri: "./img/CesiumTexturedBoxTest.bgltf", scale: 1e3 } } } } }), Object.defineProperties(Y.prototype, { LayerDisplayName: { get: function() { return this._layerDisplayName } }, displayName: { get: function() { return this.LayerDisplayName } }, guid: { get: function() { return this._guid } }, Style: { get: function() { return this._entityCreator.style } }, show: { get: function() { return this._visible }, set: function(e) { this.setVisibility(e) } }, BoundingBox: { get: function() { return this._boundingBox } }, boundingSphere: { get: function() { return Cesium.BoundingSphere.fromRectangle3D(this._boundingBox) } }, Statistics: { get: function() { return this._statistics } } }); var ml, dl = 180 / Math.PI; function pl() { this._quadtree = void 0, this._tilingScheme = new Cesium.GeographicTilingScheme, this._errorEvent = new Cesium.Event, this._loadTileEvent = new Cesium.Event, this._levelZeroMaximumError = Cesium .TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid, 128, this._tilingScheme.getNumberOfXTilesAtLevel(0)), this._tileCache = [], this ._primitivesWaitingToBeAddedToTheScene = [], this._pauseStreaming = !1, this._numTilesInLevel = [], this .STREAM_SPEED_IMIDIATE = 0, this.STREAM_SPEED_FAST = 1, this.STREAM_SPEED_NORMAL = 2, this .STREAM_SPEED_SLOW = 3, this._streamSpeed = this.STREAM_SPEED_NORMAL } function gl(e, i) { $.each(e._primitives, function(e, t) { if (t instanceof Cesium.BillboardCollection) return e = Tl.indexOf(t = t), t._parentCollection ._primitiveOld = i, -1 !== e ? (viewer.scene.primitives.remove(Tl[e]._parentCollection), Tl[e] = t) : Tl.push(t), !1 }) } function _l(e, t) { viewer.scene.primitives.remove(t), e._onDestroyTilePrimitive = function() { viewer.scene.primitives.remove(t), this._onDestroyTilePrimitive = void 0 } } function fl(e, t, i) { Cesium.when.all(e, function() { viewer.scene.primitives.remove(i) }), t._onDestroyTilePrimitive = function() { viewer.scene.primitives.remove(i), this._onDestroyTilePrimitive = void 0 } } function yl(e, t) { fl($.map(e._primitives, function(e) { return e.readyPromise }), e, t) } function vl(e, t) { fl($.map(e._primitives[0]._primitives, function(e) { return e.readyPromise }), e, t) } function Cl(e, t) { viewer.scene.primitives.remove(t) } function wl(e, t) { fl([e.readyPromise], e, t) } Y.prototype.getRequestMaxFeatures = function() { return 1e3 }, Y.prototype.isAttributeField = function(e, t) { return !(!t || !e || "" == e.toLowerCase() || "fid" == e.toLowerCase()) && ("string" == t .toLowerCase() || "integer" == t.toLowerCase() || "double" == t.toLowerCase()) }, Y.prototype.updateFeatures = function(e, o) { var t, i, r, n, a, s; e.length <= 0 ? o() : (t = this, i = [], $(this.geomFields).each(function() { t.isAttributeField(this.name, this.type) && i.push(this.name) }), r = " {wfs_updates}", n = "", $(e).each(function() { var e = this, t = ''.replace("{lyaer_id}", this.layerId); $(i).each(function() { t += "" + this + "" + e[ this] + "" }), t += '', n += t += "" }), r = " {wfs_updates}" .replace("{wfs_updates}", n), a = "Failed to save changes to server", e = Bn(this.cleanUrl(this ._url), this._subdomains), s = Cesium.TrustedServers.contains(e), $.ajax({ dataType: "xml", type: "POST", data: r, xhrFields: { withCredentials: s }, url: encodeURI(e), success: function(e) { null == (new XMLSerializer).serializeToString(e.documentElement).toLowerCase() .match(/success\s*\//) ? o(a) : o() }, error: function(e, t, i) { o(a) }, timeout: 1e4 })) }, Y.prototype.getFeatures = function(e, t, r) { var i = this, o = [], n = ($(this.geomFields).each(function() { i.isAttributeField(this.name, this.type) && o.push(this.name) }), " {wfs_filter} " ), a = (n = (n = n.replace("{layer_name}", this._layerName)).replace("{REQUEST_MAX_FEATURES}", 1e3), ""), e = ("" != e.replace(/[ ]/g, "") && (a = (a = "" ) + function e(t, i) { if (t.operator) { var o = ""; switch (t.operator.toLowerCase()) { case "=": o = "PropertyIsEqualTo"; break; case "<>": o = "PropertyIsNotEqualTo"; break; case ">": o = "PropertyIsGreaterThan"; break; case ">=": o = "PropertyIsGreaterThanOrEqualTo"; break; case "<": o = "PropertyIsLessThan"; break; case "<=": o = "PropertyIsLessThanOrEqualTo"; break; case "like": o = "PropertyIsLike" } var r = -1 != i.indexOf(t.right) ? t.right : t.left, n = ""; n += "" + r + ""; var a = null == (r = (r = -1 != i.indexOf(t.right) ? t.left : t.right).replace( /^'|'$$/g, "")).match(/^[%]|[%]$$/); return n = n + ("" + (r = "like" == t.operator.toLowerCase() && a ? "%" + r + "%" : r)) + "" } a = "and" == t.logic.toLowerCase() ? "And" : "Or", n = ""; return 2 == t.terms.length ? n += e(t.terms[0], i) : n += e({ logic: a, terms: t.terms.slice(0, t.terms.length - 1) }, i), n = n + e(t.terms[t.terms.length - 1], i) + "" }(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE " + e).WHERE, o) + ""), n = n .replace("{wfs_filter}", a), Bn(this.cleanUrl(this._url), this._subdomains)), a = Cesium.TrustedServers.contains(e); t.xhr = $.ajax({ url: encodeURI(e), type: "POST", data: n, dataType: "xml", xhrFields: { withCredentials: a }, success: function(e) { var o, t; ! function(t, i) { if (null == t) return !1; try { let e = eval; return null != (new XMLSerializer).serializeToString(null != t.context ? t .context : t).match(e("/[<](([a-z]+):)?" + i + "[^>]*[>]/i")) } catch (e) { return !1 } }($(e), "FeatureCollection") ? r(null, TELang.i18n("layer_error_reading_features")): (e = e, o = [], (t = 0 == (t = $(e).find("gml\\:featureMember")).length ? $(e) .find("featureMember") : t).each(function() { var e = {}, t = $(this).children().first(), i = (e.layerId = t[0].nodeName, e.originFid = t.attr("fid"), e .fid = t.attr("fid"), null == e.fid && (e.fid = -1), e.fid .match(/[.]?(\d+)$$/)); i && (e.fid = i[1]), e.node = t[0], t.children().each(function() { e[this.nodeName] = this.innerHTML, null == e[this .nodeName] && (e[this.nodeName] = $(this) .text()) }), o.push(e) }), r(o)) }, error: function(e, t, i) { r(null, e.statusText) }, timeout: 1e4 }) }, Y.prototype.getFeatureColumnNames = function() { if (this.featureColumnNames) return this.featureColumnNames; var e = $(this.geometryResponseData).find(this.wfsNamespace + "\\:sequence " + this.wfsNamespace + "\\:element"), t = (0 == e.length && (e = $(this.geometryResponseData).find("sequence").find("element")), []); return e.each(function() { var e = $(this); "geom" != e.attr("name").toLowerCase() && t.push(e.attr("name").toLowerCase()) }), this.featureColumnNames = t, this.featureColumnNames }, Y.prototype.refresh = function(e) { for (var t = this._tileManager.getAllTiles(), i = t.length, o = 0; o < i; o++) t[o].data.wfsLayerData[ this._guid] && t[o].data.wfsLayerData[this._guid].freeResources(), this.loadTile(t[o]); e && cl(this) }, Y.prototype.setVisibility = function(e) { if (this._visible != e) if (0 == (this._visible = e)) for (var t = (o = this._tileManager.getAllTiles()).length, i = 0; i < t; i++) o[i].data .wfsLayerData[this._guid] && o[i].data.wfsLayerData[this._guid].primitive && (o[i].data .wfsLayerData[this._guid].primitive.show = !1); else for (var o, t = (o = this._tileManager.getAllTiles()).length, i = 0; i < t; i++) o[i].data .wfsLayerData[this._guid] && (o[i].data.wfsLayerData[this._guid].primitive ? o[i].data .wfsLayerData[this._guid].primitive.show = !0 : this.loadTile(o[i])) }, Y.prototype.loadTile = function(e) { var t = this; e.data.wfsLayerData[this._guid] = { id: e.data.id, primitive: void 0, freeResources: function() { Cesium.defined(this.xhr) && (this.xhr.abort(), this.xhr = void 0), Cesium.defined(this .features) && (t.removeFeaturesFromLayer(this.features), this.features = void 0), Cesium.defined(this.primitive) && (t._tileManager.removeFromScene(this .primitive), this.primitive = void 0) } }, this.show && e.level >= this._level.min && e.level <= this._level.max && (this.statc = 0, this ._guide = this._guid, this.beginLoadWFSData(e)) }, Y.prototype.isDestroyed = function() { return !1 }, Y.prototype.destroy = function() { var e = this._tileManager.getAllTiles(), t = e.length; if (0 < t) for (var i = 0; i < t; i++) e[i].data.wfsLayerData[this._guid] && e[i].data.wfsLayerData[this._guid] .freeResources(); return this._tileManager._loadTileEvent.removeEventListener(Y.prototype.loadTile, this), Cesium .destroyObject(this) }, Y.prototype.sTag = function(e, t, i) { if (null == this._subdomains) return ""; e = (e + t + i) % this._subdomains.length; return this._subdomains[e] }, Y.prototype.cleanUrl = function(e) { return -1 != e.indexOf("?") ? e.split("?")[0] : e }, Y.prototype.beginLoadWFSData = function(t) { var i, o, e; null != this.latLon && !this.latLon || (null == this.BoundingBox || 0 != this.BoundingBox.width && 0 != this.BoundingBox.height || (this.BoundingBox.east += 1, this.BoundingBox.north += 1, this .BoundingBox.beenModified = !0), void 0 !== this.BoundingBox && void 0 === Cesium.Rectangle .intersection(this.BoundingBox, t.rectangle) || (e = [dl * t.rectangle.west, dl * t.rectangle .south, dl * t.rectangle.east, dl * t.rectangle.north ], o = (i = this).cleanUrl(this._url).replace("{s}", this.sTag(t.x, t.y, t.level)), o = ( o += ul(o)) + ( "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName=" + this ._layerName + "&srsName=EPSG:4326&BBOX=" + e.join(",")), e = Cesium.TrustedServers .contains(Bn(this._url, this._subdomains)), t.data.wfsLayerData[this._guid].xhr = $.ajax({ dataType: this._useWorkers ? "text" : "xml", url: encodeURI(o), cache: !0, xhrFields: { withCredentials: e }, success: function(e) { i.processWFSData(t, e) }, error: function(e, t, i) { "abort" !== i && console.log("Failed to retrieve data from " + o + " :" + i) }, complete: function() { t.data.wfsLayerData[i._guid].xhr = void 0 } }))) }, Y.prototype.processWFSData = function(e, t) { var i; e.data.wfsLayerData[this._guid].xhr = void 0, this._useWorkers ? ml.queueWorkItem({ id: e.data.id, text: t, geometryFieldName: (i = this)._geometryFieldName }).then(function(e) { i.addFeaturesToTile(e) }) : (t = this._gmlParser.read(t), this.addFeaturesToTile({ id: e.data.id, features: t })) }, Y.prototype.boundingSphereFromGML = function(e, i) { var t = viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel, o = this; ml.queueWorkItem({ id: "0", text: e, geometryFieldName: this._geometryFieldName }).then(function(e) { e = { parentLayer: o, features: e.features, sampleTerrainLevel: t + 1, isQuery: !0, onFinishedQuery: function(e) { var t; 0 < e.length && (t = Cesium.BoundingSphere.fromBoundingSpheres(e)), i(t) } }; o._entityCreator.createPrimitiveFromWFSFeatures(e) }) }, Y.prototype.boundingSphereFromFeature = function(e) { var t, i = viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel; return this._entityCreator.createPrimitiveFromWFSFeatures({ parentLayer: this, features: [e], sampleTerrainLevel: i + 1, isQuery: !0, onFinishedQuery: function(e) { 0 < e.length && (t = Cesium.BoundingSphere.fromBoundingSpheres(e)) } }), t }, Y.prototype.addRenderedFeatureId = function(e) { null == this._addedFeatures[e] && (this._addedFeatures[e] = 0), this._addedFeatures[e]++ }, Y.prototype.removeRenderedFeatureId = function(e) { null != this._addedFeatures[e] && this._addedFeatures[e]--, 0 == this._addedFeatures[e] && (this ._addedFeatures[e] = void 0) }, Y.prototype.isExistRenderedFeatureId = function(e) { return null != this._addedFeatures[e] }, Y.prototype.addFeaturesToTile = function(i, o) { var r, e, n = this._tileManager.getTile(i.id); void 0 !== n && (e = o ? n.data.wfsLayerData[this._guid].primitive._instanceIds : void 0, e = { parentLayer: r = this, originalInstanceIds: e, features: i.features, onFinishedCreatePrimitive: function(e) { var t; null != i.features && null != n.data.wfsLayerData && (n.data.wfsLayerData[r._guid] .features = i.features, o || r.addFeaturesToLayer(n.data.wfsLayerData[r ._guid].features), (void 0 === e.length || 0 < e.length) && (t = n.data .wfsLayerData[r._guid].primitive, e.show = r.show, (n.data.wfsLayerData[ r._guid].primitive = e).parentLayer = r, e.parentTileId = i.id, e ._guid = Cesium.createGuid(), o ? r._tileManager.replaceInScene(t, e) : r._tileManager.addToScene(e))) } }, this._entityCreator.createPrimitiveFromWFSFeatures(e)) }, Y.prototype.addFeaturesToLayer = function(e) { this._statistics.numberOfAddedFeatures += e.length, this._statistics.numberOfAddePositions += Cesium .defaultValue(e.numPositions, 0); for (var t = e.length, i = 0; i < t; i++) !1 === Object.prototype.hasOwnProperty.call(this._featuresMap, e[i].fid) ? this._featuresMap[e[i].fid] = { refCount: 1, feature: e[i] } : this._featuresMap[e[i].fid].refCount++ }, Y.prototype.removeFeaturesFromLayer = function(e) { this._statistics.numberOfDeletedFeatures += e.length, this._statistics.numberOfDeletedPositions += Cesium.defaultValue(e.numPositions, 0); for (var t = e.length, i = 0; i < t; i++) !1 !== Object.prototype.hasOwnProperty.call(this._featuresMap, e[i].fid) && (this._featuresMap[e[i].fid].refCount--, 0 === this._featuresMap[e[i].fid] .refCount && delete this._featuresMap[e[i].fid], this.removeRenderedFeatureId(e[i].fid)) }, Y.prototype.getFeature = function(e) { return !1 === Object.prototype.hasOwnProperty.call(this._featuresMap, e) ? null : this._featuresMap[e] }, Y.prototype.updateTile = function(e) { e = this._tileManager.getTile(e); void 0 !== e && (null == e.data.wfsLayerData[this._guid].features ? this.loadTile(e) : this .addFeaturesToTile(e.data.wfsLayerData[this._guid], !0)) }, Y.blockRequestPrimitiveFromPrimitive = function(e) { var t; if (null != e) return t = hl(e), null == t && (e._labelCollection && e._labelCollection ._billboardCollection ? t = hl(e._labelCollection._billboardCollection) : e ._billboardCollection && (t = hl(e._billboardCollection))), t }, Y.prototype.resetAttributesTable = function() { this.lastEditedCell = null, this.attrTblDialogMemo = null }, Object.defineProperties(pl.prototype, { quadtree: { get: function() { return this._quadtree }, set: function(e) { this._quadtree = e } }, ready: { get: function() { return !0 } }, tilingScheme: { get: function() { return this._tilingScheme } }, errorEvent: { get: function() { return this._errorEvent } }, loadTileEvent: { get: function() { return this._loadTileEvent } }, pauseStreaming: { get: function() { return this._pauseStreaming }, set: function(e) { this._pauseStreaming = e } }, streamSpeed: { get: function() { return this._streamSpeed }, set: function(e) { this._streamSpeed = e } }, bestLevelAvailable: { get: function() { for (var e = 0, t = 0; t < 22; t++) null != this._numTilesInLevel[t] && 0 < this ._numTilesInLevel[t] && e < t && (e = t); return e } } }), pl.prototype.streamSpeedFactor = function() { switch (this._streamSpeed) { case this.STREAM_SPEED_FAST: return 1; case this.STREAM_SPEED_NORMAL: return 3; case this.STREAM_SPEED_SLOW: return 20; default: return 3 } }; var bl, Tl = [], Sl = 0, Pl = !(pl.prototype.onPreFrame = function(e, t) { if (Sl++, !this._pauseStreaming) { if (this._streamSpeed == this.STREAM_SPEED_IMIDIATE) for (; 0 < this._primitivesWaitingToBeAddedToTheScene.length;) { var i = this._primitivesWaitingToBeAddedToTheScene.pop(); e.primitives.add(i) } else 0 < this._primitivesWaitingToBeAddedToTheScene.length && Sl % this .streamSpeedFactor() == 0 && ((i = this._primitivesWaitingToBeAddedToTheScene.pop()) ._instanceIds && 100 < i._instanceIds.length && this.streamSpeed === this .STREAM_SPEED_FAST && (this.streamSpeed = this.STREAM_SPEED_NORMAL), e.primitives .add(i)); $.each(Tl, function(e, t) { t.ready && viewer.scene.primitives.remove(t._parentCollection._primitiveOld) }) } }), El = (pl.prototype.initialize = function(e) { Pl || (viewer.scene.preRender.addEventListener(this.onPreFrame, this), Pl = !0) }, pl.prototype.beginUpdate = function(e) { this.quadtree.beginFrame(e) }, pl.prototype.endUpdate = function(e) { var t = this; e.afterRender.push(function() { t.quadtree.endFrame(e) }) }, pl.prototype.updateForPick = function(e) {}, pl.prototype.getLevelMaximumGeometricError = function( e) { return this._levelZeroMaximumError / (1 << e) * this._quadtree.maximumScreenSpaceError }, Math.PI, pl.prototype.placeHolder = function(e, t) { t = t || Cesium.Color.fromBytes(0, 255, 0, 255); t = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleOutlineGeometry({ rectangle: e.rectangle, height: viewer.camera.positionCartographic.height - .99 * TerraExplorer.internal.Navigate.HeightAboveGround }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(t) } }), appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }) }); e.data.primitive.add(t) }, pl.prototype.loadTile = function(e, t) { var i = this; null == this._numTilesInLevel[t._level] && (this._numTilesInLevel[t._level] = 0), this ._numTilesInLevel[t._level]++, t.state === Cesium.QuadtreeTileLoadState.START && (t.data = { primitive: new Cesium.PrimitiveCollection, wfsLayerData: [], id: Cesium.createGuid(), freeResources: function() { if (i._tileCache[t.data.id] && i._numTilesInLevel[t._level]--, i ._numTilesInLevel[t._level] < 0 && (i._numTilesInLevel[t._level] = 0), Cesium.defined(this.wfsLayerData)) { for (var e in this.wfsLayerData) Cesium.defined(this.wfsLayerData[e]) && this.wfsLayerData[e].freeResources(); this.wfsLayerData = void 0 } Cesium.defined(this.primitive) && (this.primitive.destroy(), this.primitive = void 0), delete i._tileCache[t.data.id] } }, this._tileCache[t.data.id] = t, Math.abs(6371e3 * (t.rectangle.south - t.rectangle .north)), t.data.boundingSphere3D = Cesium.BoundingSphere.fromRectangle3D(t.rectangle), t.data.boundingSphere2D = Cesium.BoundingSphere.fromRectangle2D(t.rectangle, e .mapProjection), t.rectangle.west, t.rectangle.south, t.rectangle.east, t.rectangle .north, this.loadTileEvent.raiseEvent(t), t.state = Cesium.QuadtreeTileLoadState.DONE, t .renderable = !0) }, pl.prototype.getTile = function(e) { return this._tileCache[e] }, pl.prototype.getAllTiles = function() { var e, t = []; for (e in this._tileCache) t.push(this._tileCache[e]); return t }, pl.prototype.computeTileVisibility = function(e, t, i) { var o = this.computeDistanceToTile(e, t); return e._distance = o, t.fog.enabled && 9 < e._level && 1 <= Cesium.Math.fog(o, t.fog.density) ? Cesium.Visibility.NONE : (o = t.mode === Cesium.SceneMode.SCENE3D ? e.data.boundingSphere3D : e .data.boundingSphere2D, t.cullingVolume.computeVisibility(o)) }, pl.prototype.showTileThisFrame = function(e, t) { e.data.primitive.update(t) }, pl.prototype.computeDistanceToTile = function(e, t) { var i = new Cesium.Cartesian3, e = t.mode === Cesium.SceneMode.SCENE3D ? e.data.boundingSphere3D : e.data.boundingSphere2D, e = Cesium.Cartesian3.subtract(e.center, t.camera.positionWC, i), t = Cesium.Cartesian3.magnitude(e); return Math.max(1, t - TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition) }, pl.prototype.isDestroyed = function() { return !1 }, pl.prototype.destroy = function() { return Cesium.destroyObject(this) }, pl.prototype.getInstance = function(t) { var i; return 0 == Cesium.defined(t.TileManager) && (t.TileManager = new e, i = new Cesium .QuadtreePrimitive({ tileProvider: t.TileManager, maximumScreenSpaceError: 2 }), t.scene.primitives.add(i)), t.TileManager }, pl.prototype.addToScene = function(e) { this._primitivesWaitingToBeAddedToTheScene.push(e) }, pl.prototype.removeFromScene = function(e) { var t = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); - 1 != t ? (this ._primitivesWaitingToBeAddedToTheScene[t].destroy(), this ._primitivesWaitingToBeAddedToTheScene.splice(t, 1)) : viewer.scene.primitives.remove(e) }, pl.prototype.replaceInScene = function(e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); if (-1 != i) this._primitivesWaitingToBeAddedToTheScene[i] = t; else switch (e.ID != t.ID && console.log( "TileManager.replaceInScene Warning: new primitive has a different ID than old primitive" ), null != e._replacmentPrimitive && viewer.scene.primitives.remove(e ._replacmentPrimitive), e._replacmentPrimitive = t, viewer.scene.primitives.add(t), t.ID .split(":")[0]) { case "billboards": gl(t, e); break; case "labels": _l(t, e); break; case "polygons": yl(t, e); break; case "models": vl(t, e); break; case "polylines": wl(t, e); break; case "points": Cl(0, e); break; default: console.log("Error updating layer"), viewer.scene.primitives.remove(e) } }, { billboards: gl, labels: _l, polygons: yl, models: vl, polylines: wl, points: Cl }); function xl(e, t) { this._viewer = e, this._cesium = t, bl = new pl } function Il(e) { this._viewer = e, this._cesium = Cesium, this._core = new f, this._tree = V } function Dl(e, t) { this._viewer = e, this._cesium = t } function Ll(e, t) { this._viewer = e, this._cesium = t, this._tree = V, this._core = new f, this._Color = new m(this._viewer, this._cesium) } function Ml(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } pl.prototype.replaceInSceneNew = function(e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); - 1 != i ? this ._primitivesWaitingToBeAddedToTheScene[i] = t : (e.ID !== t.ID && console.log( "TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"), this.addToScene(t), i = t.ID.split(":")[0], (i = El[i]) ? i(t, e) : (console.log( "Error updating layer"), viewer.scene.primitives.remove(e))) }, xl.prototype.CreateWfsFeatureLayer = function(e, t, i, o, r, n, a, s, l) { return new Y(e, t, i, o, r, n, a, s, l) }, xl.prototype.initTileManager = function() { this._viewer.scene; var i = this._viewer; i.scene.preRender.addEventListener(function(e, t) { bl.getInstance(i).streamSpeed = 2 }) }, Il.prototype.createPolylineVolume = function(e, t, i, o, r) { var n = { positions: [], shape: this.starPositions(7, 3e4, 2e4), material: this._cesium.Color.fromRandom({ alpha: 1 }) }; if (!this._core.isnull(o)) { o = this._core.extend(n, o, !0); var a = []; if (t[0].x || t[0].y) if (t[0].z) for (s = 0; s < t.length; s++) a.push(this._cesium.Cartesian3.fromDegrees(t[s].x, t[s].y, t[ s].z)); else for (s = 0; s < t.length; s++) a.push(this._cesium.Cartesian3.fromDegrees(t[s].x, t[s].y)); else if (2 === t[0].length) for (var s = 0; s < t.length; s++) a.push(this._cesium.Cartesian3.fromDegrees(t[s][0], t[s][ 1])); else if (3 === t[0].length) for (var s = 0; s < t.length; s++) a.push(this._cesium.Cartesian3.fromDegrees(t[s][0], t[s][1], t[s][2])); o.positions = a, "circle" === i ? o.shape = this.computeCircle(o.radius || 10) : "star" === i ? (o .shape = this.starPositions(o.arms || 7, o.rOuter || 30, o.rInner || 20), o.cornerType = Cesium.CornerType.MITERED) : "box" === i && (o.radius = o.radius || 10, o.shape = [new this ._cesium.Cartesian2(-o.radius, -o.radius), new this._cesium.Cartesian2(o.radius, -o .radius), new this._cesium.Cartesian2(o.radius, o.radius), new this._cesium .Cartesian2(-o.radius, o.radius) ], o.cornerType = Cesium.CornerType.BEVELED); n = this._viewer.entities.add({ id: this._core.getuid(), name: e, polylineVolume: o }); return this.item = n, this._tree.insertGroupId({ id: n.id, name: e, pId: this._core.isnull(r) ? 0 : r, type: "polylinevolume", item: this }, this._core.isnull(r) ? 0 : r), this } console.log("options is required") }, Il.prototype.getstyles = function() { var e = {}; return e.show = !this.item.polylineVolume.show || this.item.polylineVolume.show._value, e.positions = this.item.polylineVolume.positions.getValue().toString(), e.shape = this.item.polylineVolume.shape .toString(), e.cornerType = this.item.polylineVolume.cornerType ? this.item.polylineVolume .cornerType.toString() : null, e.granularity = this.item.polylineVolume.granularity ? this.item .polylineVolume.granularity.toString() : null, e.fill = this.item.polylineVolume.fill ? this.item .polylineVolume.fill._value : null, e.material = this.item.polylineVolume.material ? this.item .polylineVolume.material.toString() : null, e.outline = this.item.polylineVolume.outline ? this.item .polylineVolume.outline._value : null, e.outlineWidth = this.item.polylineVolume.outlineWidth ? this .item.polylineVolume.outlineWidth.toString() : null, e.outlineColor = this.item.polylineVolume .outlineColor && this.item.polylineVolume.outlineColor._value ? "rgba" + this.item.polylineVolume .outlineColor.toString() : null, e.near = this.item.polylineVolume.distanceDisplayCondition ? this .item.polylineVolume.distanceDisplayCondition._value.near : null, e.far = this.item.polylineVolume .distanceDisplayCondition ? this.item.polylineVolume.distanceDisplayCondition._value.far : null, e }, Il.prototype.executeWall = function(t, i) { var a = [], o = void 0, s = this, r = (e.prototype._init = function() { var n = this, e = (this.options.wall.maximumHeights = new s._cesium.CallbackProperty(function() { for (var e = [], t = 0; t < n.positions.length; t++) e.push(2e3); return e }, !1), this.options.wall.minimumHeights = new s._cesium.CallbackProperty( function() { for (var e = [], t = 0; t < n.positions.length; t++) e.push(1e3); return e }, !1), this.options.wall.positions = new s._cesium.CallbackProperty(function() { for (var e = [], t = 0; t < n.positions.length; t++) { if (!a[t]) return; var i = s._viewer.scene.globe.ellipsoid, o = new s._cesium.Cartesian3(a[t].x, a[t].y, a[t].z), i = i.cartesianToCartographic(o), o = s._cesium.Math.toDegrees(i.latitude), r = s._cesium.Math.toDegrees(i.longitude); i.height, e.push(r), e.push(o) } return s._cesium.Cartesian3.fromDegreesArray(e) }, !1), s._viewer.entities.add(this.options)); s.item = e, s._tree.insertGroupId({ id: this.options.id, name: t, pId: s._core.isnull(i) ? 0 : i, type: "wall", item: s }, s._core.isnull(i) ? 0 : i) }, e); function e(e) { this.options = { id: s._core.getuid(), type: "wall", wall: { positions: [], minimumHeights: [2e3, 2e3], maximumHeights: [1e3, 1e3], material: s._cesium.Color.AQUA.withAlpha(1) } }, this.positions = e, this._init() } var n = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); n.setInputAction(function(e) { e = s._viewer.scene.camera.pickEllipsoid(e.position, s._viewer.scene.globe.ellipsoid); 0 == a.length && a.push(y.clone(e)), a.push(y.clone(e)) }, s._cesium.ScreenSpaceEventType.LEFT_CLICK), n.setInputAction(function(e) { e = s._viewer.scene.camera.pickEllipsoid(e.endPosition, s._viewer.scene.globe.ellipsoid); 1 <= a.length && (s._cesium.defined(o) ? (a.pop(), a.push(e)) : o = new r(a)) }, s._cesium.ScreenSpaceEventType.MOUSE_MOVE), n.setInputAction(function(e) { n.destroy(), a.pop() }, s._cesium.ScreenSpaceEventType.RIGHT_CLICK) }, Il.prototype.starPositions = function(e, t, i) { for (var o = Math.PI / e, r = [], n = 0; n < 2 * e; n++) { var a = n % 2 == 0 ? t : i, a = new this._cesium.Cartesian2(Math.cos(n * o) * a, Math.sin(n * o) * a); r.push(a) } return r }, Il.prototype.computeCircle = function(e) { for (var t = [], i = 0; i < 360; i++) { var o = this._cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, Il.prototype.setVisibility = function(e) { this.item.polylineVolume.show = e }, Il.prototype.getVisibility = function() { return this.item.polylineVolume.show }, Il.prototype.deleteObject = function() { this._viewer.entities.remove(this.item) }, Object.defineProperties(Il.prototype, { rectangle: { get: function() { return this.item.rectangle }, set: function(e) { this.item.rectangle = e } } }), Object.defineProperties(Il.prototype, { polyline: { get: function() { return this.item.polyline }, set: function(e) { this.item.polyline = e } } }), Il.prototype.setItem = function(e) { this.item = e }, Il.prototype.setTreeobj = function(e) { this.treeobj = e }, Object.defineProperties(Il.prototype, { polygon: { get: function() { return this.item.polygon }, set: function(e) { this.item.polygon = e } } }), Object.defineProperties(Il.prototype, { point: { get: function() { return this.item.point }, set: function(e) { this.item.point = e } } }), Object.defineProperties(Il.prototype, { label: { get: function() { return this.item.label }, set: function(e) { this.item.label = e } } }), Object.defineProperties(Il.prototype, { model: { get: function() { return this.item.model }, set: function(e) { this.item.model = e } } }), Object.defineProperties(Il.prototype, { wall: { get: function() { return this.item.wall }, set: function(e) { this.item.wall = e } } }), Object.defineProperties(Il.prototype, { wallTempOptions: { get: function() { return { positions: [], maximumHeights: [], minimumHeights: [], show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, granularity: this._cesium.Math.RADIANS_PER_DEGREE, shadows: ShadowMode.DISABLED, distanceDisplayCondition: null } } } }), Dl.prototype.createPosition = function(e, t, i) { return new this.Cartesian3.fromDegrees(e, t, i) }, Dl.prototype.CreatePosition = function(e, t, i, o, r, n, a, s) { return { X: e, Y: t, Altitude: i, AltitudeType: o, Yaw: r, Pitch: n, Roll: a, Distance: s } }, Ll.prototype.createImageLabel = function(e, t, i, o) { var r = { id: this._core.getuid(), image: "../images/Cesium_Logo_overlay.png", show: !0, color: this._cesium.Color.IVORY }, r = this._core.extend(r, t, !0), t = (!r.color || this._core.isnull(r) || this._core.isnull(r.color) || "[" == r.color.toString() .charAt(0) && "]" == r.color.toString().charAt(r.color.length - 1) || (this._core.isHtmlColor(r .color) && /^#/.test(r.color.toString()) ? r.color = this._Color.colorFromHtmlColor(r .color) : (/^rgb/.test(r.color) && (r.color = this._Color.rgbaStringToRgbaObj(r.color)), 1 < r.color.r && (r.color.r = r.color.r / 255), 1 < r.color.g && (r.color.g = r.color .g / 255), 1 < r.color.b && (r.color.b = r.color.b / 255), 1 < r.color.a && (r.color .a = r.color.a / 255), r.color.r && (r.color = this._Color.createColor(r.color.r, r .color.g, r.color.b, r.color.a)))), r.near && r.far && (r.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(r.near, r.far)), this.item = this._viewer.entities .add({ name: o, position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), billboard: r }), { id: this.item.id, name: o, pId: this._core.isnull(i) ? 0 : i, type: "Imagelabel", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), this }, Ll.prototype.getstyles = function() { var e = {}; return e.show = !this.item.billboard.show || this.item.billboard.show._value, e.image = this.item .billboard.image && this.item.billboard.image._value ? this.item.billboard.image._value : void 0, e .scale = this.item.billboard.scale && this.item.billboard.scale._value ? this.item.billboard.scale ._value : void 0, e.pixelOffset = this.item.billboard.pixelOffset ? this.item.billboard.pixelOffset ._value : void 0, e.horizontalOrigin = this.item.billboard.horizontalOrigin && this.item.billboard .horizontalOrigin._value ? this.item.billboard.horizontalOrigin._value : void 0, e.verticalOrigin = this.item.billboard.verticalOrigin && this.item.billboard.verticalOrigin._value ? this.item .billboard.verticalOrigin._value : void 0, e.heightReference = this.item.billboard .heightReference && this.item.billboard.heightReference._value && this.item.billboard .heightReference._value ? this.item.billboard.heightReference._value : null, e.color = this.item .billboard.color && this.item.billboard.color._value ? "rgba" + this.item.billboard.color .toString() : void 0, e.width = this.item.billboard.width && this.item.billboard.width._value ? this .item.billboard.width._value : void 0, e.height = this.item.billboard.height && this.item.billboard .height._value ? this.item.billboard.height._value : void 0, e.near = this.item.billboard .distanceDisplayCondition ? this.item.billboard.distanceDisplayCondition._value.near : void 0, e .far = this.item.billboard.distanceDisplayCondition ? this.item.billboard.distanceDisplayCondition ._value.far : void 0, e.position = this.item.position.getValue().toString(), e }, Ll.prototype.deleteObject = function() { this._viewer.entities.remove(this.item) }, Ll.prototype.setDistanceDisplayCondition = function(e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._billboard.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, Ll.prototype.setUrl = function(e) { this.item._billboard.image = e }, Ll.prototype.setVisibility = function(e) { this.item.show = e }, Ll.prototype.getVisibility = function() { return this.item.show }, Ll.prototype.setColor = function(e) { try { this.item._billboard.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e), this.item .color = this.item._billboard.color } catch (e) { console.log(e) } return this }, Ll.prototype.setWidth = function(e) { try { this.item._billboard.width = e } catch (e) { console.log(e) } return this }, Ll.prototype.setColorAlpha = function(e) { try { this.item._billboard.color._value.alpha = e } catch (e) { console.log(e) } return this }, Ll.prototype.setHeight = function(e) { try { this.item._billboard.height = e } catch (e) { console.log(e) } return this }, Ll.prototype.setHeightType = function(e) { try { 1 == e ? this.item._billboard.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._billboard.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this .item._billboard.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, Ll.prototype.setRotation = function(e) { try { this.item._billboard.rotation = this._cesium.Math.toRadians(e) } catch (e) { console.log(e) } return this }, Ll.prototype.setItem = function(e) { this.item = e }, Ll.prototype.setScale = function(e) { try { this.item._billboard.scale = e } catch (e) { console.log(e) } return this }, Ll.prototype.CreateImageLabel = function(e, t, i, o, r) { i = { id: this._core.getuid(), image: Ll, show: !0, scale: i.Scale, color: i.IconColor, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(i.MinViewingHeight, i .MaxViewingHeight) }, this.item = this._viewer.entities.add({ name: r, position: this._cesium.Cartesian3.fromDegrees(positions.X, positions.X, positions.Altitude), billboard: i }), i = this.item.id, r = { id: this.item.id, name: i = "" == r ? r : i, pId: this._core.isnull(o) ? 0 : o, type: "Imagelabel", item: this }; return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(o) ? 0 : o), this }, Ll.prototype.export = function() { var e = null == this.item.billboard.image ? void 0 : this.item.billboard.image._value, t = null == this.item.billboard.show ? void 0 : this.item.billboard.show._value, i = null == this.item.billboard.scale ? void 0 : this.item.billboard.scale._value, o = null == this.item.billboard.horizontalOrigin ? void 0 : this.item.billboard.horizontalOrigin ._value, r = null == this.item.billboard.verticalOrigin ? void 0 : this.item.billboard.verticalOrigin._value, n = null == this.item.billboard.rotation ? void 0 : this.item.billboard.rotation._value, a = null == this.item.billboard.width ? void 0 : this.item.billboard.width._value, s = null == this.item.billboard.height ? void 0 : this.item.billboard.height._value, l = null == this.item.billboard.color ? void 0 : "rgba(" + this.item.billboard.color._value.red + "," + this.item.billboard.color._value.green + "," + this.item.billboard.color._value.blue + "," + this.item.billboard.color._value.alpha + ")", u = null == this.item.billboard.heightReference ? void 0 : this.item.billboard.heightReference ._value, c = this.item.billboard.distanceDisplayCondition, h = null == c ? void 0 : c._value.near, c = null == c ? void 0 : c._value.far, m = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "image", position: { x: this._cesium.Math.toDegrees(m.longitude), y: this._cesium.Math.toDegrees(m.latitude), z: this._cesium.Math.toDegrees(m.height) }, treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { image: e, show: t, scale: i, horizontalOrigin: o, verticalOrigin: r, rotation: n, width: a, height: s, color: l, heightReference: u, near: h, far: c } } }, Ll.prototype.setTreeobj = function(e) { this.treeobj = e }, Object.defineProperties(Ll.prototype, { position: { Altitude: { get: function() { return this._postion.Altitude }, set: function(e) { try { var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), o = this._cesium.Math.toDegrees(t.latitude), r = (this._cesium.Math.toDegrees(t.height), this._cesium.Cartesian3 .fromDegrees(i, o, e)); this.item.position.position = r, this._postion.Altitude = e } catch (e) { console.log(e) } } }, AltitudeType: { get: function() { return this._postion.AltitudeType }, set: function(e) { try { this._postion.AltitudeType = e } catch (e) { console.log(e) } } }, Cartesian: { get: function() { return this._postion.Cartesian }, set: function(e) { try { this._postion.Cartesian = e } catch (e) { console.log(e) } } }, Distance: { get: function() { return this._postion.Distance }, set: function(e) { try { this._postion.Distance = e } catch (e) { console.log(e) } } }, Pitch: { get: function() { return this._postion.Pitch }, set: function(e) { try { this._postion.Pitch = e } catch (e) { console.log(e) } } }, Roll: { get: function() { return this._postion.Roll }, set: function(e) { try { this._postion.Roll = e } catch (e) { console.log(e) } } }, X: { get: function() { return this._postion.X }, set: function(e) { try { this._postion.X = e; var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = (this._cesium.Math.toDegrees(t.longitude), this._cesium.Math.toDegrees(t .latitude)), o = this._cesium.Math.toDegrees(t.height), r = this._cesium.Cartesian3.fromDegrees(e, i, o); this.item.position.position = r } catch (e) { console.log(e) } } }, Y: { get: function() { return this._postion.Y }, set: function(e) { try { this._postion.Y = e; var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), o = (this._cesium.Math.toDegrees(t.latitude), this._cesium.Math.toDegrees(t .height)), r = this._cesium.Cartesian3.fromDegrees(i, e, o); this.item.position.position = r } catch (e) { console.log(e) } } }, Yaw: { get: function() { return this._postion.Yaw }, set: function(e) { try { this._postion.Yaw = e } catch (e) { console.log(e) } } } }, LabelStyle: { BackgroundColor: { get: function() { return "" }, set: function(e) {} }, Bold: { get: function() { return "" }, set: function(e) {} }, FontName: { get: function() { return "" }, set: function(e) {} }, FontSize: { get: function() { return "" }, set: function(e) {} }, FrameFileName: { get: function() { return "" }, set: function(e) {} }, IconColor: { set: y.debounce(function(e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor( e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor( e.r, e.g, e.b, e.a))), this.item.label.fillColor = e) }, 500), get: function() { var e = this.item.label.fillColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value .green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, Italic: { get: function() { return "" }, set: function(e) {} }, LimitScreenSize: { get: function() { return "" }, set: function(e) {} }, LineColor: { get: function() { return "" }, set: function(e) {} }, LineToGround: { get: function() { return "" }, set: function(e) {} }, LockMode: { get: function() { return "" }, set: function(e) {} }, MaxImageSize: { get: function() { return "" }, set: function(e) {} }, MaxViewingHeight: { get: function() { if (null != this.item._label.distanceDisplayCondition) return this.item._label .distanceDisplayCondition._value.far }, set: function(e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label .distanceDisplayCondition._value.near), this.item._label .distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(t, e) } }, MinViewingHeight: { get: function() { if (null != this.item._label.distanceDisplayCondition) return this.item._label .distanceDisplayCondition._value.near }, set: function(e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label .distanceDisplayCondition._value.far), this.item._label .distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, t) } }, MultilineJustification: { get: function() { return "" }, set: function(e) {} }, PivotAlignment: { get: function() { return "" }, set: function(e) {} }, Scale: { get: function() { if (null != this.item._label.scale) return this.item.label.scale.getValue() }, set: function(e) { this.item.label.scale.setValue(e) } }, TextAlignment: { get: function() { return "" }, set: function(e) {} }, TextColor: { get: function() { return "" }, set: function(e) {} }, TextOnImage: { get: function() { return "" }, set: function(e) {} }, Underline: { get: function() { return "" }, set: function(e) {} } } }), Ll.prototype.CreateImageLabel = function(e, t, i, o, r) { this._postion = e; t = { id: this._core.getuid(), image: t, backgroundColor: i.BackgroundColor, fillColor: i.IconColor, font: i.FontName, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, outlineColor: i.LineColor, show: !0, scale: i.Scale, showBackground: !1, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(i.MinViewingHeight, i .MaxViewingHeight) }, i.Italic && (t.font = "italic " + t.font), i.Italic && (t.font = "Bold " + t.font), t = this ._core.extend(t, i, !0), this.item = this._viewer.entities.add({ name: r, position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), billboard: t }), i = { id: this.item.id, name: r, pId: this._core.isnull(o) ? 0 : o, type: "ImageLabel", item: this }; return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), this }, Object.defineProperties(Ll.prototype, { Position: { Altitude: { get: function() { return this._postion.Altitude }, set: function(e) { try { this._postion.Altitude = e, this.item.position = this._cesium.Cartesian3 .fromDegrees(this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, AltitudeType: { get: function() { return this._postion.AltitudeType }, set: function(e) { try { this._postion.AltitudeType = e } catch (e) { console.log(e) } } }, Cartesian: { get: function() { return this._postion.Cartesian }, set: function(e) { try { this._postion.Cartesian = e } catch (e) { console.log(e) } } }, Distance: { get: function() { return this._postion.Distance }, set: function(e) { try { this._postion.Distance = e } catch (e) { console.log(e) } } }, Pitch: { get: function() { return this._postion.Pitch }, set: function(e) { try { this._postion.Pitch = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, Roll: { get: function() { return this._postion.Roll }, set: function(e) { try { this._postion.Roll = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } }, X: { get: function() { return this._postion.X }, set: function(e) { try { this._postion.X = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Y: { get: function() { return this._postion.Y }, set: function(e) { try { this._postion.Y = e, this.item.position = this._cesium.Cartesian3.fromDegrees( this._postion.X, this._postion.Y, this._postion.Altitude) } catch (e) { console.log(e) } } }, Yaw: { get: function() { return this._postion.Yaw }, set: function(e) { try { this._postion.Yaw = e, this.item.orientation = this._cesium.Transforms .headingPitchRollQuaternion(this.item.position._value, new this._cesium .HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw), this ._cesium.Math.toRadians(this._postion.Pitch), this._cesium.Math .toRadians(this._postion.Roll))) } catch (e) { console.log(e) } } } }, LabelStyle: { BackgroundColor: { set: y.debounce(function(e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor( e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor( e.r, e.g, e.b, e.a))), this.item.label.backgroundColor = e, this .item.backgroundColor = e) }, 500), get: function() { var e = this.item.label.backgroundColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value .green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, Bold: { get: function() { return -1 != this.item._label.font.getValue().indexOf("bold") }, set: function() { var e = "bold " + this.item._label.font.getValue(); this.item._label.font.setValue(e) } }, FontName: { get: function() { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++) if ("bold" != e[t] && -1 == e[t].indexOf("px") && -1 == e[t].indexOf("PX")) return e[t] }, set: function(e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t .length; o++) "bold" != t[o] && -1 == t[o].indexOf("px") && -1 == t[o].indexOf( "PX") || (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, FontSize: { get: function() { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++) if (-1 != e[t].indexOf("px")) return e[t] }, set: function(e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t .length; o++) - 1 != t[o].indexOf("px") && (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, FrameFileName: { get: function() { return "" }, set: function(e) {} }, IconColor: { set: y.debounce(function(e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor( e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor( e.r, e.g, e.b, e.a))), this.item.label.fillColor = e) }, 500), get: function() { var e = this.item.label.fillColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value .green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, Italic: { get: function() { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++) if (-1 != e[t].indexOf("italic")) return e[t] }, set: function(e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t .length; o++) - 1 != t[o].indexOf("italic") && (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, LimitScreenSize: { get: function() { return "" }, set: function(e) {} }, LineColor: { set: y.debounce(function(e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor( e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor( e.r, e.g, e.b, e.a))), this.item.label.outlineColor = e) }, 500), get: function() { var e = this.item.label.outlineColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value .green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, LineToGround: { get: function() { return "" }, set: function(e) {} }, LockMode: { get: function() { return "" }, set: function(e) {} }, MaxImageSize: { get: function() { return "" }, set: function(e) {} }, MaxViewingHeight: { get: function() { if (null != this.item._label.distanceDisplayCondition) return this.item._label .distanceDisplayCondition._value.far }, set: function(e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label .distanceDisplayCondition._value.near), this.item._label .distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(t, e) } }, MinViewingHeight: { get: function() { if (null != this.item._label.distanceDisplayCondition) return this.item._label .distanceDisplayCondition._value.near }, set: function(e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label .distanceDisplayCondition._value.far), this.item._label .distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, t) } }, MultilineJustification: { get: function() { return "" }, set: function(e) {} }, PivotAlignment: { get: function() { return "" }, set: function(e) {} }, Scale: { get: function() { if (null != this.item._label.scale) return this.item.label.scale.getValue() }, set: function(e) { this.item.label.scale.setValue(e) } }, TextAlignment: { get: function() { return "" }, set: function(e) {} }, TextColor: { get: function() { return "" }, set: function(e) {} }, TextOnImage: { get: function() { return "" }, set: function(e) {} }, Underline: { get: function() { return "" }, set: function(e) {} } } }), Ml.prototype.createWall = function(e, t, i, o) { var r = { show: !0, minimumHeights: [100, 100, 100, 100, 100, 100, 100], maximumHeights: [2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 2e3], material: this._cesium.Color.AQUA.withAlpha(1) }; if (!this._core.isnull(i)) { var n = new f, a = ((i = this._core.extend(r, i, !0)) && "ImageMaterialProperty" == i.material ? i.material = n .setImageMaterialProperty("../../img/arrow.png", this._cesium, 0, i.id) : i && "DrawCanvasColorUpdown" == i.material && (i.material = n.setImageMaterialProperty( "../../img/arrow.png", this._cesium, 1, i.id)), []); if (t[0].x || t[0].y) if (void 0 !== t[0].z) for (s = 0; s < t.length; s++) a.push(this._cesium.Cartesian3.fromDegrees(t[s].x, t[s].y, t[ s].z)); else for (s = 0; s < t.length; s++) a.push(this._cesium.Cartesian3.fromDegrees(t[s].x, t[s].y)); else if (2 === t[0].length) for (var s = 0; s < t.length; s++) a.push(this._cesium.Cartesian3.fromDegrees(t[s][0], t[s][ 1])); else if (3 === t[0].length) for (var s = 0; s < t.length; s++) a.push(this._cesium.Cartesian3.fromDegrees(t[s][0], t[s][1], t[s][2])); i.positions = a, void 0 !== i.minHeight && (i.minimumHeights = new Array(i.positions.length).fill(i .minHeight)), void 0 !== i.maxHeight && (i.maximumHeights = new Array(i.positions.length) .fill(i.maxHeight)); r = this._viewer.entities.add({ name: e, id: this._core.getuid(), wall: i }); return r.positions = i.positions, this.item = r, this._tree.insertGroupId({ id: r.id, name: e, pId: this._core.isnull(o) ? 0 : o, type: "wall", item: this }, this._core.isnull(o) ? 0 : o), this } console.log("options is required") }, Ml.prototype.executeWall = function(t, i) { var a = [], o = void 0, s = this, r = (e.prototype._init = function() { var n = this, e = (this.options.wall.maximumHeights = new s._cesium.CallbackProperty(function() { for (var e = [], t = 0; t < n.positions.length; t++) e.push(2e3); return e }, !1), this.options.wall.minimumHeights = new s._cesium.CallbackProperty( function() { for (var e = [], t = 0; t < n.positions.length; t++) e.push(1e3); return e }, !1), this.options.wall.positions = new s._cesium.CallbackProperty(function() { for (var e = [], t = 0; t < n.positions.length; t++) { if (!a[t]) return; var i = s._viewer.scene.globe.ellipsoid, o = new s._cesium.Cartesian3(a[t].x, a[t].y, a[t].z), i = i.cartesianToCartographic(o), o = s._cesium.Math.toDegrees(i.latitude), r = s._cesium.Math.toDegrees(i.longitude); i.height, e.push(r), e.push(o) } return s._cesium.Cartesian3.fromDegreesArray(e) }, !1), s._viewer.entities.add(this.options)); s.item = e, s._tree.insertGroupId({ id: this.options.id, name: t, pId: s._core.isnull(i) ? 0 : i, type: "wall", item: s }, s._core.isnull(i) ? 0 : i) }, e); function e(e) { this.options = { id: s._core.getuid(), type: "wall", wall: { positions: [], minimumHeights: [2e3, 2e3], maximumHeights: [1e3, 1e3], material: s._core.setImageMaterialProperty("img/arrow.png", s._cesium, 1) } }, this.positions = e, this._init() } var n = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); n.setInputAction(function(e) { e = s._viewer.scene.camera.pickEllipsoid(e.position, s._viewer.scene.globe.ellipsoid); 0 == a.length && a.push(y.clone(e)), a.push(y.clone(e)) }, s._cesium.ScreenSpaceEventType.LEFT_CLICK), n.setInputAction(function(e) { e = s._viewer.scene.camera.pickEllipsoid(e.endPosition, s._viewer.scene.globe.ellipsoid); 1 <= a.length && (s._cesium.defined(o) ? (a.pop(), a.push(e)) : o = new r(a)) }, s._cesium.ScreenSpaceEventType.MOUSE_MOVE), n.setInputAction(function(e) { n.destroy(), a.pop() }, s._cesium.ScreenSpaceEventType.RIGHT_CLICK) }; var Al = "a", Rl = 0; function Ol(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._BaiduImageryProvider = new Dr( e, t) } Ml.prototype.drawCanvasImage = function(e, t) { var i = document.getElementById("canvas-" + Al), o = i.getContext("2d"), r = new Image; return r.src = "img/arrow.png", o.clearRect(0, 0, 700, 100), r.onload = function() { Rl <= 700 ? (o.drawImage(r, Rl, 0), o.drawImage(r, Rl + 100, 0)) : Rl = 0, Rl += 5 }, Al = "a" === Al ? "b" : "a", i }, Ml.prototype.setVisibility = function(e) { this.item.wall.show = e }, Ml.prototype.getVisibility = function() { return this.item.wall.show }, Ml.prototype.deleteObject = function() { this._viewer.entities.remove(this.item) }, Object.defineProperties(Ml.prototype, { rectangle: { get: function() { return this.item.rectangle }, set: function(e) { this.item.rectangle = e } } }), Object.defineProperties(Ml.prototype, { polyline: { get: function() { return this.item.polyline }, set: function(e) { this.item.polyline = e } } }), Ml.prototype.setItem = function(e) { this.item = e }, Ml.prototype.setTreeobj = function(e) { this.treeobj = e }, Object.defineProperties(Ml.prototype, { polygon: { get: function() { return this.item.polygon }, set: function(e) { this.item.polygon = e } } }), Object.defineProperties(Ml.prototype, { point: { get: function() { return this.item.point }, set: function(e) { this.item.point = e } } }), Object.defineProperties(Ml.prototype, { label: { get: function() { return this.item.label }, set: function(e) { this.item.label = e } } }), Object.defineProperties(Ml.prototype, { model: { get: function() { return this.item.model }, set: function(e) { this.item.model = e } } }), Object.defineProperties(Ml.prototype, { wall: { get: function() { return this.item.wall }, set: function(e) { this.item.wall = e } } }), Object.defineProperties(Ml.prototype, { wallTempOptions: { get: function() { return { positions: [], maximumHeights: [], minimumHeights: [], show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, granularity: this._cesium.Math.RADIANS_PER_DEGREE, shadows: ShadowMode.DISABLED, distanceDisplayCondition: null } } } }), Ol.prototype.createArcGisImageryLayer = function(e, t, i, o, r, n) { var a = { url: "" }, s = null, a = (this._core.isUrl(t) ? (s = a).url = t : s = this._core.extend(a, t, !0), this._core.isnull( e) && (e = "新建影像图层"), new this._cesium.ArcGisMapServerImageryProvider(s)); let l = { alpha: s.alpha, brightness: s.brightness, availability: s.availability }; if (void 0 !== s.Level || void 0 !== s.level) { let e = this._core.defaultValue(s.Level, s.level); e.indexOf && -1 < e.indexOf(",") ? (e = e.split(","), l.maximumTerrainLevel = e[1], l .minimumTerrainLevel = e[0]) : l.minimumTerrainLevel = e } s.time && (l.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this ._cesium.Iso8601.MAXIMUM_VALUE })])), this.availability = l.availability, this.item = new this._cesium.ImageryLayer(a, l), this ._viewer.imageryLayers.add(this.item, o), r || this.setVisibility(!1), n && "function" == typeof n && n(this.item); t = this._core.getuid(), a = { id: s.id || t, name: e, checked: r, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", smtype: "arcgis", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, Ol.prototype.createImageryLayerGrid = function(e) { e = this._viewer.imageryLayers.addImageryProvider(new this._cesium.GridImageryProvider(e)); return this.item = e, this }, Ol.prototype.createWebMapServerImageLayer = function(e, t, i, o, r, n) { var a = { url: "", layers: "", parameters: { service: "WMS", format: "image/png", transparent: !0 } }, s = null, a = (this._core.isUrl(t) ? (s = a).url = t : s = this._core.extend(a, t, !0), this._core.isnull( e) && (e = "新建影像图层"), new this._cesium.WebMapServiceImageryProvider(s)); let l = { alpha: s.alpha, brightness: s.brightness, availability: s.availability }; if (void 0 !== s.Level || void 0 !== s.level) { let e = this._core.defaultValue(s.Level, s.level); e.indexOf && -1 < e.indexOf(",") ? (e = e.split(","), l.maximumTerrainLevel = e[1], l .minimumTerrainLevel = e[0]) : l.minimumTerrainLevel = e } s.time && (l.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this ._cesium.Iso8601.MAXIMUM_VALUE })])), this.availability = l.availability, this.item = new this._cesium.ImageryLayer(a, l), this ._viewer.imageryLayers.add(this.item, o), r || this.setVisibility(!1), n && "function" == typeof n && n(this.item); t = this._core.getuid(), a = { id: s.id || t, name: e, checked: r, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", smtype: "wms", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, Ol.prototype.createMVTWithStyle = function(e, t, i, o) { this.item = this._viewer.imageryLayers.addImageryProvider(t), checked || this.setVisibility(!1), t .show = !1; t = this._core.getuid(), t = { id: options.id || t, name: e, checked: checked, pId: (this._core.isnull(0), 0), type: "ImageryProvider", show: !1, item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, (this._core.isnull(0), 0)), this }, Ol.prototype.createWebMapTileServerImageLayer = function(e, t, i, o, r, n) { var a = { url: "" }, s = null; this._core.isUrl(t) ? (s = a).url = t : s = this._core.extend(a, t, !0), this._core.isnull(e) && (e = "新建影像图层"); let l = { alpha: s.alpha, brightness: s.brightness, availability: s.availability }; if (void 0 !== s.Level || void 0 !== s.level) { let e = this._core.defaultValue(s.Level, s.level); e.indexOf && -1 < e.indexOf(",") ? (e = e.split(","), l.maximumTerrainLevel = e[1], l .minimumTerrainLevel = e[0]) : l.minimumTerrainLevel = e } a = s.TD_SD ? new Ho(s.url, !1, l.minimumTerrainLevel || 0, l.maximumTerrainLevel || 21) : new this ._cesium.WebMapTileServiceImageryProvider(s), s.addLevel && (a.addLevel = s.addLevel), s.time && (l .availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this ._cesium.Iso8601.MAXIMUM_VALUE })])), this.availability = l.availability, this.item = new this._cesium.ImageryLayer(a, l), this ._viewer.imageryLayers.add(this.item, o), r || this.setVisibility(!1), n && "function" == typeof n && n(this.item); t = this._core.getuid(), a = { id: s.id || t, name: e, checked: r, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", smtype: "skymap", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, Ol.prototype.createUrlTemplateImageryProvider = function(e, t, i, o, r, n) { var a = { url: "" }, s = null, a = (this._core.isUrl(t) ? (s = a).url = t : s = this._core.extend(a, t, !0), this._core.isnull( e) && (e = "新建影像图层"), new this._cesium.UrlTemplateImageryProvider(s)); let l = { alpha: s.alpha, brightness: s.brightness, availability: s.availability }; if (void 0 !== s.Level || void 0 !== s.level) { let e = this._core.defaultValue(s.Level, s.level); e.indexOf && -1 < e.indexOf(",") ? (e = e.split(","), l.maximumTerrainLevel = e[1], l .minimumTerrainLevel = e[0]) : l.minimumTerrainLevel = e } s.time && (l.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this ._cesium.Iso8601.MAXIMUM_VALUE })])), this.availability = l.availability, this.item = new this._cesium.ImageryLayer(a, l), this ._viewer.imageryLayers.add(this.item, o), r || this.setVisibility(!1), n && "function" == typeof n && n(this.item); t = this._core.getuid(), a = { id: s.id || t, name: e, checked: r, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", smtype: "goglemap", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, Ol.prototype.createImageryProvider = function(e, t, i, o, r, n, a) { var s, i = this._core.extend({}, i, !0); "arcgis" == t ? s = new this._cesium.ArcGisMapServerImageryProvider(i) : "geoserver" == t || "wms" == t ? s = new this._cesium.WebMapServiceImageryProvider(i) : "cesiumBlack" == t || "tms" == t ? s = new this._cesium.TileMapServiceImageryProvider(i) : "skymap" == t ? s = new this._cesium .WebMapTileServiceImageryProvider(i) : "goglemap" == t ? s = new this._cesium .UrlTemplateImageryProvider(i) : "BingMap" == t ? s = new this._cesium.BingMapsImageryProvider(i) : "OpenStreetMap" == t ? s = new this._cesium.OpenStreetMapImageryProvider(i) : "MapBox" == t ? s = new this._cesium.MapboxImageryProvider(i) : "BaiduMap" == t && (s = new this._BaiduImageryProvider .BaiduImageryProvider(i)); let l = { alpha: i.alpha, brightness: i.brightness, availability: i.availability }; if (void 0 !== i.Level || void 0 !== i.level) { let e = this._core.defaultValue(i.Level, i.level); e.indexOf && -1 < e.indexOf(",") ? (e = e.split(","), l.maximumTerrainLevel = e[1], l .minimumTerrainLevel = e[0]) : l.minimumTerrainLevel = e } i.time && (l.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: i.time.start ? this._cesium.JulianDate.fromDate(new Date(i.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: i.time.end ? this._cesium.JulianDate.fromDate(new Date(i.time.end)) : this ._cesium.Iso8601.MAXIMUM_VALUE })])), this.availability = l.availability, this.item = new this._cesium.ImageryLayer(s, l), this ._viewer.imageryLayers.add(this.item, r), n || this.setVisibility(!1), a && "function" == typeof a && a(this.item), this._core.isnull(i.id) && (i.id = this._core.getuid()); t = { id: i.id, name: e, pId: this._core.isnull(o) ? 0 : o, type: "ImageryProvider", checked: n, item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, Ol.prototype.createCacheImageryProvider = function(e, t, i, o, r, n) { o |= 1; t = this._core.extend({ fileExtension: "jpg", cacheMaxLevel: 16 }, t, !0); let a = { alpha: t.alpha, brightness: t.brightness, availability: t.availability, show: !0 }, s = { alpha: t.alpha, brightness: t.brightness, availability: t.availability, show: !0 }; if (t.time && (a.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: t.time.start ? this._cesium.JulianDate.fromDate(new Date(t.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: t.time.end ? this._cesium.JulianDate.fromDate(new Date(t.time.end)) : this ._cesium.Iso8601.MAXIMUM_VALUE })]), s.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: t.time.start ? this._cesium.JulianDate.fromDate(new Date(t.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: t.time.end ? this._cesium.JulianDate.fromDate(new Date(t.time.end)) : this ._cesium.Iso8601.MAXIMUM_VALUE })])), void 0 !== t.Level || void 0 !== t.level) { let e = this._core.defaultValue(t.Level, t.level); e.indexOf && -1 < e.indexOf(",") ? ((e = e.split(","))[1] > t.cacheMaxLevel ? (a.show = !0, s .maximumTerrainLevel = e[1], s.show = !0) : (a.show = !0, s.show = !1), e[0] > t .cacheMaxLevel ? (a.show = !1, s.minimumTerrainLevel = e[0], s.show = !0) : (a.show = !0, s .minimumTerrainLevel = t.cacheMaxLevel)) : (e > t.cacheMaxLevel ? (a.show = !1, s .minimumTerrainLevel = e) : (a.show = !0, s.minimumTerrainLevel = t.cacheMaxLevel), s .show = !0) } else a.show = !0, s.minimumTerrainLevel = t.cacheMaxLevel, s.show = !0; this.availability = a.availability; a.show && (l = new this._cesium.TileMapServiceImageryProvider({ url: Cesium.buildModuleUrl(t.cacheUrl), fileExtension: t.fileExtension }), this.item = new this._cesium.ImageryLayer(l, a), this._viewer.imageryLayers.add(this.item, o)), this.items || (this.items = []); s.show && (t.minimumLevel = s.minimumTerrainLevel | t.cacheMaxLevel, s.maximumTerrainLevel && (t .maximumLevel = s.maximumTerrainLevel), l = new this._cesium.WebMapServiceImageryProvider( t), this.item ? (u = this.items.push(new this._cesium.ImageryLayer(l, s)), this._viewer .imageryLayers.add(this.items[u - 1], o + 1)) : (this.item = new this._cesium.ImageryLayer( l, s), this._viewer.imageryLayers.add(this.item, o + 1))), r || this.setVisibility(!1), n && "function" == typeof n && n(this.item), this._core.isnull(t.id) && (t.id = this._core.getuid()); var l, u = { id: t.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", checked: r, item: this }; return this.setTreeobj(u), this._tree.insertGroupId(u, this._core.isnull(i) ? 0 : i), this }, Ol.prototype.createPolylineImageryProviderer = function(e, t, i, o) { var t = this._core.extend({ url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" }, t, !0), r = new this._cesium.WebMapTileServiceImageryProvider(t), r = (this.item = this._viewer.imageryLayers.addImageryProvider(r), "function" == typeof o && o(this .item), this._core.isnull(t.id) && (t.id = this._core.getuid()), { id: t.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", item: this }); return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i), this }, Ol.prototype.createterrainProvider = function(e, t, i, o) { var t = this._core.extend({ url: "" }, t, !0), r = new this._cesium.CesiumTerrainProvider(t), r = (this._viewer.terrainProvider = r, this.item = this._viewer.terrainProvider, "function" == typeof o && o(dataSource), this._core.isnull(t.id) && (t.id = this._core.getuid()), { id: t.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "terrainProvider", item: this }); return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i), this }, Ol.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.item.imageryProvider.url; return { type: "ImageryLayer", treeobj: { name: this.treeobj.name, type: this.treeobj.smtype }, style: { show: e, url: t } } }, Ol.prototype.setTreeobj = function(e) { this.treeobj = e }, Ol.prototype.getLevel = function() { var e, t, i, o = this._viewer.camera; try { i = o && o.positionCartographic && o.positionCartographic.height ? (e = this._viewer.scene.globe .getHeight(o.positionCartographic) || 0, t = o.positionCartographic.height - e, Math.round( 80955.31 / (1 + Math.pow(t / 91610.74, 7096758e-11)) - 40467.74)) : 0 } catch (e) {} return i }, Ol.prototype.setVisibility = function(e) { if (this.isShow = e, this.item.show = e, this.item._availability && !e ? this.item._availability = void 0 : this.availability && e && (this.item._availability = this.availability), this.items) for (var t = 0; t < this.items.length; t++) this.items[t].show = e, this.items[t]._availability && ! e ? this.items[t]._availability = void 0 : this.availability && e && (this.items[t] ._availability = this.availability) }, Ol.prototype.getVisibility = function() { return this.item.show }, Ol.prototype.getType = function() { return { label: "影像", value: "ImageryProvider" } }, Ol.prototype.deleteObject = function() { return this._viewer.imageryLayers.remove(this.item) }, Object.defineProperties(Ol.prototype, { url: { set: function(e) {}, get: function() {} } }), Ol.prototype.setItem = function(e) { this.item = e }; var Hl = function(e, t) { if (Array.isArray(e)) return e; if (Symbol.iterator in Object(e)) { var i = t, o = [], r = !0, t = !1, n = void 0; try { for (var a, s = e[Symbol.iterator](); !(r = (a = s.next()).done) && (o.push(a.value), !i || o .length !== i); r = !0); } catch (e) { t = !0, n = e } finally { try { !r && s.return && s.return() } finally { if (t) throw n } } return o } throw new TypeError("Invalid attempt to destructure non-iterable instance") }, Vl = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; function kl(e) { if (Array.isArray(e)) { for (var t = 0, i = Array(e.length); t < e.length; t++) i[t] = e[t]; return i } return Array.from(e) } function Fl(e, t, i) { this._viewer = e, this._cesium = t, this._viewer = null, this._Cesium = i.Cesium, this.UrlData = { output: i.output, resultmode: i.resultmode, uid: i.uid, st: i.st, words: i.words, area: i.area, callback: i.callback }, this.minLevel1 = i.minLevel1, this.minLevel3 = i.minLevel3, this._url = i.url, this._urlTemplate = i .url, this._rectangle = i.rectangle, this._maximumLevel = i.maximumLevel || 19, this._minimumLevel = i .minimumLevel || 1, this.dx = {}, this._tilingScheme = i.tilingScheme || new this._Cesium .GeographicTilingScheme, this._tileRangeByLevel = {}, this._moveEndTimestamp = null, this._isRemoved = ! 1, this.cluster = "city", this.primitivecount = null, this._isCameraMoving = !1, this ._propertyToBeFiltered = null, this._valuesToBeFiltered = null, this._primitiveByTile = {}, this ._tileKeys = [], this._lowerLevelLimit = i.lowerLevelLimit || 1, this._upperLevelLimit = i .upperLevelLimit || null, this._cameraMoveEndHandler = this._cameraMoveEndHandler.bind(this), this ._cameraMoveStartHandler = this._cameraMoveStartHandler.bind(this), this.heightById = {}; for (var o = this._radianToDegree(this._rectangle.west), r = this._radianToDegree(this._rectangle.south), n = this._radianToDegree(this._rectangle.east), a = this._radianToDegree(this._rectangle.north), s = this._minimumLevel; s <= this._maximumLevel; s++) { var l = this._lonLatToTileInWGS84([o, r], s), u = this._lonLatToTileInWGS84([n, a], s), c = Math.min(l[0], u[0]), h = Math.max(l[0], u[0]), m = Math.min(l[1], u[1]), l = Math.max(l[1], u[1]); this._tileRangeByLevel[s] = { minCol: m, maxCol: l, minRow: c, maxRow: h } } this._tileRangeByLevel[0] = { minCol: 0, maxCol: 0, minRow: 0, maxRow: 0 }, this._primitiveCollection = new this._Cesium.PrimitiveCollection, this._stop = !1 } function Gl(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._Provider = void 0, this.labelCollections1 = [], this.labelCollections2 = [], this .labelCollections = this._cesium.PointPrimitiveCollection(), this.gd = 0, this.model = [], this .Legend = [], this.sj = !0 } Fl.prototype._serialize = function(e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : Vl(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))): i .push(o(t) + "=" + o(e[t])) } return i.join("&") }, Fl.prototype._fetch = function(r) { var n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; return new Promise(function(t, i) { var o = new XMLHttpRequest; if (o.open(n.method || "GET", r), n.headers) for (var e in n.headers) o.setRequestHeader(e, n.headers[e]); o.onload = function() { if (4 === o.readyState && 200 === o.status) try { var e = JSON.parse(o.responseText); t(e) } catch (e) { i(new Error("INVALID RESPONSE")) } }, o.onerror = function(e) { i(e) }, o.onloadend = function(e) { 200 !== e.target.status && i(new Error("[" + e.target.status + "]request failed: " + r)) }, o.send(n.body || null) }) }, Fl.prototype._lonLatToTileInWGS84 = function(e, t) { var e = Hl(e, 2), i = e[0], e = e[1]; return [Math.floor(Math.pow(2, t) * (90 - e) / 180), Math.floor(Math.pow(2, t) * (180 + i) / 180)] }, Fl.prototype._radianToDegree = function(e) { return e / Math.PI * 180 }, Fl.prototype._isTileInRange = function(e) { try { var t = this._tileRangeByLevel[e.level], i = t.minCol, o = t.maxCol, r = t.minRow, n = t.maxRow; return e.x >= i && e.x <= o && e.y >= r && e.y <= n } catch (e) { return !1 } }, Fl.prototype._cameraMoveStartHandler = function() { this._isCameraMoving = !0 }, Fl.prototype._loadTile = function(e, t) { var r = [], n = new this._Cesium.ColorGeometryInstanceAttribute(.75, .75, .75, 1), a = this; return e.features.forEach(function(e) { if (a._propertyToBeFiltered && Array.isArray(a._valuesToBeFiltered)) { var t = e.properties[a._propertyToBeFiltered]; if (a._valuesToBeFiltered.includes(t)) return } var o, t = e.geometry.type; "Polygon" === t || "MultiPolygon" === t ? (o = [], a.heightById[e.properties.house_id] = e .properties.height, e.geometry.coordinates.forEach(function(e, i) { o.push([]), e.forEach(function(e) { var t; 2 < e.length ? e.forEach(function(e) { var t; 2 <= e.length && (t = o[i]).push.apply(t, kl(e)) }) : (t = o[i]).push.apply(t, kl(e)) }); var e = new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3 .fromDegreesArray(o[i])), t = a._Cesium.BoundingSphere.fromPoints(e.positions).center, t = a._viewer.scene.globe.getHeight(a._Cesium.Cartographic .fromCartesian(t)) || 0, e = new a._Cesium.PolygonGeometry({ polygonHierarchy: e, height: t, vertexFormat: a._Cesium.PerInstanceColorAppearance .VERTEX_FORMAT, extrudedHeight: 1e3 }), t = new a._Cesium.GeometryInstance({ geometry: e, attributes: { color: n } }); r.push(t) })) : console.warn('GeoJSONVectorTileProviderPolymerization: geometry type "' + e .geometry.type + '" detected, but is not going to be rendered') }), new this._Cesium.Primitive({ allowPicking: !1, appearance: new this._Cesium.PerInstanceColorAppearance({ translucent: !1 }), geometryInstances: r }) }, Fl.prototype._cameraMoveEndHandler = function() { var t, e, i, o, r, n, a, s, l; this._stop || (t = this, n = Date.now(), s = (l = this._viewer.scene.globe._surface._tilesToRender).map( function(e) { return e.level }), e = Math.min.apply(Math, kl(s)), i = Math.max.apply(Math, kl(s)), t ._removeObsoletePrimitives(t._primitiveByTile, []), i < this._lowerLevelLimit && (t ._tileKeys = [], t._removeObsoletePrimitives(t._primitiveByTile, []), l = []), this ._upperLevelLimit && e > this._upperLevelLimit && (t._tileKeys = [], t ._removeObsoletePrimitives(t._primitiveByTile, []), l = []), (l = 2 < i - e ? l.filter( function(e) { return e.level >= i - 2 }) : l).sort(function(e, t) { return -(e.level - t.level) }), l = l.filter(function(e) { return t._isTileInRange(e) }), this._upperLevelLimit && (l = this._refineTiles(l, this._upperLevelLimit)), this ._isCameraMoving = !1, this._moveEndTimestamp = n, this._viewer.scene.primitives.remove(this .dx), this.dx = {}, this._primitiveByTile = {}, o = [], r = 0, s = this._viewer.camera .computeViewRectangle(), l = this._radianToDegree(s.west), n = this._radianToDegree(s.south), a = this._radianToDegree(s.east), s = this._radianToDegree(s.north), this.UrlData.area = "RECT(" + l + " " + n + "," + a + " " + s + ")", l = "", e <= this.minLevel1 || "Infinity" == e ? (this.cluster = "city", this.UrlData.cluster = this.cluster, l = this._urlTemplate + "?output=" + this.UrlData.output + "&resultmode=" + this.UrlData.resultmode + "&uid=" + this .UrlData.uid + "&st=" + this.UrlData.st + "&words=" + this.UrlData.words + "&area=" + this .UrlData.area + "&cluster=" + this.UrlData.cluster + "&callback=" + this.UrlData.callback) : e > this.minLevel1 && this.minLevel3 > e ? (this.cluster = "county", this.UrlData.cluster = this .cluster, l = this._urlTemplate + "?output=" + this.UrlData.output + "&resultmode=" + this .UrlData.resultmode + "&uid=" + this.UrlData.uid + "&st=" + this.UrlData.st + "&words=" + this.UrlData.words + "&area=" + this.UrlData.area + "&cluster=" + this.UrlData.cluster + "&callback=" + this.UrlData.callback) : e >= this.minLevel3 && (this.cluster = "", l = this ._urlTemplate + "?output=" + this.UrlData.output + "&resultmode=" + this.UrlData .resultmode + "&uid=" + this.UrlData.uid + "&st=" + this.UrlData.st + "&words=" + this .UrlData.words + "&area=" + this.UrlData.area + "&callback=" + this.UrlData.callback), t ._fetch(l).then(function(e) { e = t._loadTile(e, t.cluster); t._primitiveCollection = e, 0 <= ++r && (t._tileKeys = o, t._removeObsoletePrimitives(t ._primitiveByTile, o)) }).catch(function(e) { 0 <= ++r && (t._tileKeys = o, t._removeObsoletePrimitives(t._primitiveByTile, o)), e .message })) }, Fl.prototype._refineTiles = function(e, s) { var l = [], u = []; return e.forEach(function(e) { var t = "Z" + e.level + "X" + e.x + "Y" + e.y; if (e.level < s - 1) u.includes(t) || (l.push(e), u.push(t)); else if (e.level === s - 1) for (var i = 0; i < 2; i++) for (var o = 0; o < 2; o++) { var r = "Z" + (e.level + 1) + "X" + (2 * e.x + i) + "Y" + (2 * e.y + o); u.includes(r) || (l.push({ x: 2 * e.x + i, y: 2 * e.y + o, level: e.level + 1 }), u.push(r)) } else { var n, a = e.level - s; 0 == a ? u.includes(t) || (l.push(e), u.push(t)) : (t = 2 * a, a = Math.floor(e .x / t), t = Math.floor(e.y / t), u.includes(n = "Z" + s + "X" + a + "Y" + t) || (l.push({ x: a, y: t, level: s }), u.push(n))) } }), l }, Fl.prototype._removeObsoletePrimitives = function(e, t) { var i, o = []; for (i in 0 < t.length && (o = t), e) o.includes(i) || removed && delete e[i] }, Fl.prototype.addTo = function(e) { this._viewer = e, this._isRemoved = !1, this._viewer.camera.moveEnd.addEventListener(this ._cameraMoveEndHandler), this._viewer.camera.moveStart.addEventListener(this ._cameraMoveStartHandler), this._cameraMoveEndHandler() }, Fl.prototype.remove = function() { if (this._viewer) { for (var e in this._primitiveByTile) this._viewer.scene.primitives.remove(this._primitiveByTile[e]); this._primitiveByTile = {}, this._viewer.camera.moveEnd.removeEventListener(this ._cameraMoveEndHandler), this._viewer.camera.moveStart.removeEventListener(this ._cameraMoveStartHandler), this._viewer = null, this._isRemoved = !0 } }, Fl.prototype.setStatus = function(e) { this._stop = e }, Fl.prototype.isRemoved = function() { return this._isRemoved }, Fl.prototype.filterBy = function(e, t, i) { this._propertyToBeFiltered = e, this._valuesToBeFiltered = t }, Fl.prototype.removeFilter = function() { this._propertyToBeFiltered = null, this._valuesToBeFiltered = null }, Gl.prototype.createLabelPointGeoJsonFeatureLayer = function(e, t, s, i, l) { null == t && console.log("geojson is required"); var o = this._cesium.GeoJsonDataSource.load(t), u = this, o = (o.then(function(e) { for (var t = { Name: "", text: "", font: " 30px sans-serif", stylet: u._cesium.LabelStyle.OUTLINE, fillColor: u._cesium.Color.WHITE, outlineColor: u._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new u._cesium.Color(.165, .165, .165, .8), backgroundPadding: new u._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: u._cesium.HorizontalOrigin.CENTER, verticalOrigin: u._cesium.VerticalOrigin.CENTER, eyeOffset: u._cesium.Cartesian3.ZERO, pixelOffset: u._cesium.Cartesian2.ZERO, heightReference: u._cesium.HeightReference.NONE, scaleByDistance: new u._cesium.NearFarScalar(0, 0, 1, 1) }, i = (s.material, u._core.isnull(s) || u._core.isnull(s.fillColor) || /^\[/ .test(s.fillColor) && "[" == s.fillColor.toString().charAt(0) && "]" == s .fillColor.toString().charAt(s.fillColor.length - 1) || (u._core .isHtmlColor(s.fillColor) ? s.fillColor = u._color.colorFromHtmlColor(s .fillColor) : (/^rgb/.test(s.fillColor) && (s.fillColor = u._color .rgbaStringToRgbaObj(s.fillColor)), 1 < s.fillColor.r && (s .fillColor.r = s.fillColor.r / 255), 1 < s.fillColor.g && (s .fillColor.g = s.fillColor.g / 255), 1 < s.fillColor.b && (s .fillColor.b = s.fillColor.b / 255), 1 < s.fillColor.a && (s .fillColor.a = s.fillColor.a / 255), s.fillColor = u._color .createColor(s.fillColor.r, s.fillColor.g, s.fillColor.b, s .fillColor.a))), u._core.isnull(s) || u._core.isnull(s .material) || /^\[/.test(s.material) && "[" == s.material.toString().charAt( 0) && "]" == s.material.toString().charAt(s.material.length - 1) || (u ._core.isHtmlColor(s.material) ? s.material = u._color .colorFromHtmlColor(s.material) : (/^rgb/.test(s.material) && (s .material = u._color.rgbaStringToRgbaObj(s.material)), 1 < s .material.r && (s.material.r = s.fillColor.r / 255), 1 < s.material .g && (s.material.g = s.fillColor.g / 255), 1 < s.material.b && (s .material.b = s.material.b / 255), 1 < s.material.a && (s .material.a = s.material.a / 255), s.material = u._color .createColor(s.material.r, s.material.g, s.material.b, s.material.a) )), u._core.isnull(s) || u._core.isnull(s.outlineColor) || /^\[/ .test(s.outlineColor) && "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (u ._core.isHtmlColor(s.outlineColor) ? s.outlineColor = u._color .colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s .outlineColor = u._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = u._color.createColor(s.outlineColor.r, s .outlineColor.g, s.outlineColor.b, s.outlineColor.a))), u._core .isnull(s) || u._core.isnull(s.backgroundColor) || /^\[/.test(s .backgroundColor) && "[" == s.backgroundColor.toString().charAt(0) && "]" == s.backgroundColor.toString().charAt(s.backgroundColor.length - 1) || (u._core.isHtmlColor(s.backgroundColor) ? s.backgroundColor = u._color .colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s .backgroundColor) && (s.backgroundColor = u._color .rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor .r && (s.backgroundColor.r = s.backgroundColor.r / 255), 1 < s .backgroundColor.g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s .backgroundColor.b / 255), 1 < s.backgroundColor.a && (s .backgroundColor.a = s.backgroundColor.a / 255), s .backgroundColor = u._color.createColor(s.backgroundColor.r, s .backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a))), u._core.extend(t, s, !0)), o = (u.item = e).entities.values, t = (u._core .isnull(s.near) && (s.near = 0), u._core.isnull(s.far) && (s.far = 999999999), parseFloat(s.near)), e = parseFloat(s.far), t = new u ._cesium.DistanceDisplayCondition(t, e), r = (i.distanceDisplayCondition = t, u ._core.isnull(s.font_size) && (s.font_size = "30px"), u._core.isnull(s .font_family) && (s.font_family = " sans-serif"), i.font = parseFloat(s .font_size) + "px " + s.font_family, new u._cesium.LabelCollection), n = 0; n < o.length; n++) { var a = o[n], a = (i.position = a.position._value, i.text = "a label", "fillColor:" + 255 * i .fillColor.red + "," + 255 * i.fillColor.green + "," + 255 * i.fillColor .blue + ";outlineColor:" + 255 * i.outlineColor.red + "," + 255 * i .outlineColor.green + "," + 255 * i.outlineColor.blue); u.Legend.push(a), r.add(i) } e = u._viewer.scene.primitives.add(r); "function" == typeof l && l(e) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "labelPointLayer", item: this, url: t, style: options }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Gl.prototype.createLabelPolymerizationGeoJsonFeatureLayer = function(e, t, c, i, h, m) { var o = { Name: "", text: "", font: " 30px sans-serif", style: this._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.RELATIVE_TO_GROUND, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, d = this, p = (this._core.isnull(c) || this._core.isnull(c.fillColor) || (this._core.isHtmlColor(c .fillColor) ? c.fillColor = this._color.colorFromHtmlColor(c.fillColor) : (/^rgb/.test(c .fillColor) && (c.fillColor = this._color.rgbaStringToRgbaObj(c.fillColor)), 1 < c .fillColor.r && (c.fillColor.r = c.fillColor.r / 255), 1 < c.fillColor.g && (c.fillColor .g = c.fillColor.g / 255), 1 < c.fillColor.b && (c.fillColor.b = c.fillColor.b / 255), 1 < c.fillColor.a && (c.fillColor.a = c.fillColor.a / 255), c.fillColor = this ._color.createColor(c.fillColor.r, c.fillColor.g, c.fillColor.b, c.fillColor.a))), this ._core.isnull(c) || this._core.isnull(c.outlineColor) || (this._core.isHtmlColor(c .outlineColor) ? c.outlineColor = this._color.colorFromHtmlColor(c.outlineColor) : (/^rgb/ .test(c.outlineColor) && (c.outlineColor = this._color.rgbaStringToRgbaObj(c .outlineColor)), 1 < c.outlineColor.r && (c.outlineColor.r = c.outlineColor.r / 255), 1 < c.outlineColor.g && (c.outlineColor.g = c.outlineColor.g / 255), 1 < c .outlineColor.b && (c.outlineColor.b = c.outlineColor.b / 255), 1 < c.outlineColor.a && (c.outlineColor.a = c.outlineColor.a / 255), c.outlineColor = this._color.createColor(c .outlineColor.r, c.outlineColor.g, c.outlineColor.b, c.outlineColor.a))), this._core .isnull(c) || this._core.isnull(c.backgroundColor) || (this._core.isHtmlColor(c .backgroundColor) ? c.backgroundColor = this._color.colorFromHtmlColor(c.backgroundColor) : (/^rgb/.test(c.backgroundColor) && (c.backgroundColor = this._color.rgbaStringToRgbaObj(c .backgroundColor)), 1 < c.backgroundColor.r && (c.backgroundColor.r = c .backgroundColor.r / 255), 1 < c.backgroundColor.g && (c.backgroundColor.g = c .backgroundColor.g / 255), 1 < c.backgroundColor.b && (c.backgroundColor.b = c .backgroundColor.b / 255), 1 < c.backgroundColor.a && (c.backgroundColor.a = c .backgroundColor.a / 255), c.backgroundColor = this._color.createColor(c .backgroundColor.r, c.backgroundColor.g, c.backgroundColor.b, c.backgroundColor.a))), d ._core.isnull(c.near) && (c.near = 0), d._core.isnull(c.far) && (c.far = 999999999), this._core .extend(o, c, !0)), o = (this._viewer.scene.camera, this._viewer.scene.canvas, this._viewer.dataSources.add(this._cesium .GeoJsonDataSource.load(t))), d = this, o = (o.then(function(e) { var t = (d.item = e).entities.values; d._core.isnull(p.font_size) && (p.font_size = "30"), d._core.isnull(p.font_family) && (p .font_family = " sans-serif"), p.font = p.font_size + "px " + p.font_family; for (var i = 0; i < t.length; i++) { var o = t[i], r = (p.font = d._core.extendgl(o, c.font, p.font), p.style = parseInt(d._core .extendgl(o, c.stylet, p.stylet)), p.fillColor = d._core.extendgl(o, c .fillColor, p.fillColor), p.outlineColor = d._core.extendgl(o, c .outlineColor, p.outlineColor), p.outlineWidth = parseFloat(d._core .extendgl(o, c.outlineWidth, p.outlineWidth)), p.show = d._core .extendgl(o, c.show, p.show), p.showBackground = d._core.extendgl(o, c .showBackground, p.showBackground), p.backgroundColor = d._core .extendgl(o, c.backgroundColor, p.backgroundColor), p.backgroundPadding = d ._core.extendgl(o, c.backgroundPadding, p.backgroundPadding), p.scale = parseFloat(d._core.extendgl(o, c.scale, p.scale)), p.horizontalOrigin = d ._core.extendgl(o, c.horizontalOrigin, p.horizontalOrigin), p.pointHeight = parseFloat(d._core.extendgl(o, c.pointHeight, p.pointHeight)), p.text = d ._core.extendgl(o, c.text, p.text), parseFloat(d._core.extendgl(o, p.near)) ), n = parseFloat(d._core.extendgl(o, p.far)), r = new d._cesium.DistanceDisplayCondition(r, n), n = (p.distanceDisplayCondition = r, p.text = null == o.properties[p.text] ? p .text : o.properties[p.text]._value, o.billboard.color = d._cesium.Color .WHITE.withAlpha(0), o.label = new d._cesium.LabelGraphics(p), d._viewer .scene.globe.ellipsoid, d._cesium.Cartographic.fromCartesian(o.position ._value)), r = d._cesium.Math.toDegrees(n.longitude), a = d._cesium.Math.toDegrees(n.latitude), n = p.pointHeight || n.height, r = new d._cesium.Cartesian3.fromDegrees(r, a, n); o.position._value = r } e.clustering.enabled = !0, e.clustering.pixelRange = 45, e.clustering .minimumClusterSize = 3; for (var s, l = new d._cesium.PinBuilder, u = (l.fromText("50+", d._cesium.Color.RED, 48).toDataURL(), l.fromText("40+", d._cesium.Color.ORANGE, 48) .toDataURL(), l.fromText("30+", d._cesium.Color.YELLOW, 48).toDataURL(), l .fromText("20+", d._cesium.Color.GREEN, 48).toDataURL(), l.fromText("10+", d ._cesium.Color.BLUE, 48).toDataURL(), new Array(8)), i = 0; i < u.length; ++ i) u[i] = l.fromText("" + (i + 2), d._cesium.Color.VIOLET, 48).toDataURL(); s = d._cesium.defined(s) ? void s() : e.clustering.clusterEvent.addEventListener( function(e, t) { t.label.show = !1, t.point.show = !1, t.billboard.show = !0, t.billboard .id = t.label.id, t.billboard.verticalOrigin = d._cesium.VerticalOrigin .BOTTOM, 50 <= e.length ? t.billboard.image = l.fromText(e.length, d ._cesium.Color.RED, 48).toDataURL() : 40 <= e.length ? t.billboard .image = l.fromText(e.length, d._cesium.Color.ORANGE, 48).toDataURL() : 30 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium .Color.YELLOW, 48).toDataURL() : 20 <= e.length ? t.billboard .image = l.fromText(e.length, d._cesium.Color.GREEN, 48).toDataURL() : 10 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium .Color.BLUE, 48).toDataURL() : t.billboard.image = u[e.length - 2] }), s = e.clustering.pixelRange, e.clustering.pixelRange = 0, e.clustering .pixelRange = s, h || d.setVisibility(h), d._cesium.knockout.track({ pixelRange: 45, minimumClusterSize: 3 }), "function" == typeof m && m(ps) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: h, pId: this._core.isnull(i) ? 0 : i, type: "labelPointLayer", item: this, url: t }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Gl.prototype.createPointPolymerizationGeoJsonFeatureLayer = function(e, t, c, i, h, m) { var o = { color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, d = (this._core.isnull(c) || this._core.isnull(c.color) || "[" == c.color.toString().charAt(0) && "]" == c.color.toString().charAt(c.color.length - 1) || (this._core.isHtmlColor(c.color) ? c .color = this._color.colorFromHtmlColor(c.color) : (/^rgb/.test(c.color) && (c.color = this ._color.rgbaStringToRgbaObj(c.color)), 1 < c.color.r && (c.color.r = c.color.r / 255), 1 < c.color.g && (c.color.g = c.color.g / 255), 1 < c.color.b && (c.color.b = c.color.b / 255), 1 < c.color.a && (c.color.a = c.color.a / 255), c.color = this ._color.createColor(c.color.r, c.color.g, c.color.b, c.color.a))), this._core.isnull( c) || this._core.isnull(c.outlineColor) || "[" == c.outlineColor.toString().charAt(0) && "]" == c.outlineColor.toString().charAt(c.outlineColor.length - 1) || (this._core.isHtmlColor(c .outlineColor) ? c.outlineColor = this._color.colorFromHtmlColor(c.outlineColor) : ( /^rgb/.test(c.outlineColor) && (c.outlineColor = this._color.rgbaStringToRgbaObj(c .outlineColor)), 1 < c.outlineColor.r && (c.outlineColor.r = c.outlineColor.r / 255), 1 < c.outlineColor.g && (c.outlineColor.g = c.outlineColor.g / 255), 1 < c .outlineColor.b && (c.outlineColor.b = c.outlineColor.b / 255), 1 < c.outlineColor.a && (c.outlineColor.a = c.outlineColor.a / 255), c.outlineColor = this._color.createColor(c .outlineColor.r, c.outlineColor.g, c.outlineColor.b, c.outlineColor.a))), this._core .extend(o, c, !0)), o = (this._viewer.scene.camera, this._viewer.scene.canvas, this._viewer.dataSources.add(this._cesium .GeoJsonDataSource.load(t))), p = this, o = (o.then(function(e) { for (var t = (p.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (d.color = p._core.extendgl(o, c.color, d.color), d.pixelSize = parseInt(p ._core.extendgl(o, c.pixelSize, d.pixelSize)), d.outlineColor = p._core .extendgl(o, c.outlineColor, d.outlineColor), d.outlineWidth = parseFloat(p ._core.extendgl(o, c.outlineWidth, d.outlineWidth)), d.show = p._core .extendgl(o, c.show, d.show), d.height = parseFloat(p._core.extendgl(o, c .height, d.height)), d.scaleByDistance = p._core.extendgl(o, c .scaleByDistance, d.scaleByDistance), parseFloat(p._core.extendgl(o, d .minDistanceDisplay))), n = parseFloat(p._core.extendgl(o, d.maxDistanceDisplay)), r = new p._cesium.DistanceDisplayCondition(r, n), n = (o.billboard.image = "", d.distanceDisplayCondition = r, o.point = new p ._cesium.PointGraphics(d), d.pointHeight = p._core.extendgl(o, c .pointHeight, d.pointHeight), d.pointHeight = parseFloat(d.pointHeight), p._viewer.scene.globe.ellipsoid, p._cesium.Cartographic.fromCartesian(o .position._value)), r = p._cesium.Math.toDegrees(n.longitude), a = p._cesium.Math.toDegrees(n.latitude), n = d.pointHeight || n.height, r = new p._cesium.Cartesian3.fromDegrees(r, a, n); o.position._value = r } e.clustering.enabled = !0, e.clustering.pixelRange = 45, e.clustering .minimumClusterSize = 3; for (var s, l = new p._cesium.PinBuilder, u = (l.fromText("50+", p._cesium.Color.RED, 48).toDataURL(), l.fromText("40+", p._cesium.Color.ORANGE, 48) .toDataURL(), l.fromText("30+", p._cesium.Color.YELLOW, 48).toDataURL(), l .fromText("20+", p._cesium.Color.GREEN, 48).toDataURL(), l.fromText("10+", p ._cesium.Color.BLUE, 48).toDataURL(), new Array(8)), i = 0; i < u.length; ++ i) u[i] = l.fromText("" + (i + 2), p._cesium.Color.VIOLET, 48).toDataURL(); s = p._cesium.defined(s) ? void s() : e.clustering.clusterEvent.addEventListener( function(e, t) { t.label.show = !1, t.point.show = !1, t.billboard.show = !0, t.billboard .id = t.label.id, t.billboard.verticalOrigin = p._cesium.VerticalOrigin .BOTTOM, 50 <= e.length ? t.billboard.image = l.fromText(e.length, p ._cesium.Color.RED, 48).toDataURL() : 40 <= e.length ? t.billboard .image = l.fromText(e.length, p._cesium.Color.ORANGE, 48).toDataURL() : 30 <= e.length ? t.billboard.image = l.fromText(e.length, p._cesium .Color.YELLOW, 48).toDataURL() : 20 <= e.length ? t.billboard .image = l.fromText(e.length, p._cesium.Color.GREEN, 48).toDataURL() : 10 <= e.length ? t.billboard.image = l.fromText(e.length, p._cesium .Color.BLUE, 48).toDataURL() : t.billboard.image = u[e.length - 2] }), s = e.clustering.pixelRange, e.clustering.pixelRange = 0, e.clustering .pixelRange = s, h || p.setVisibility(h), p._cesium.knockout.track({ pixelRange: 45, minimumClusterSize: 3 }), "function" == typeof m && m(ps) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: h, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Gl.prototype._cameraMoveEndHandler = function() { if (this._viewer.camera.getMagnitude() < this.gd) { if (this.sj) { this._viewer.scene.primitives.remove(this.labelCollections), this.labelCollections = new this ._cesium.LabelCollection; for (var e = 0; e < this.labelCollections1.length; e++) this.labelCollections.add(this .labelCollections1[e]); this._viewer.scene.primitives.add(this.labelCollections), this.sj = !1 } } else { this._viewer.scene.primitives.remove(this.labelCollections), new this._cesium.BillboardCollection; for (e = 0; e < this.labelCollections2.length; e++) this.BillboardCollections.add(this .labelCollections2[e]); this._viewer.scene.primitives.add(this.BillboardCollections), this.sj = !0 } }, Gl.prototype.createLabelpolymerizationGeoJsonFeatureLayer = function(e, t, i, o, r, n) { for (var a = t, s = (this._viewer.scene.primitives, this._cameraMoveEndHandler = this ._cameraMoveEndHandler.bind(this), this._viewer.camera.moveEnd.addEventListener(this ._cameraMoveEndHandler), this.gd = i.height, new this._cesium.BillboardCollection, {}), l = [], u = 0; u < a.length; u++) { var c = { position: new this._cesium.Cartesian3.fromDegrees(a[u].lng, a[u].lat, 100), text: a[u].name }, h = (this.labelCollections1.push(c), a[u]); if (s[h[i.adminname]]) for (var m = 0; m < l.length; m++) { var d = l[m]; if (d.adminname == h[i.adminname]) { d.data.push(h); break } } else l.push({ adminname: h[i.adminname], name: h.name, showBackground: !0, lat: h.lat, lng: h.lng, data: [h] }), s[h[i.adminname]] = h } for (u = 0; u < l.length; u++) { c = { position: new this._cesium.Cartesian3.fromDegrees(l[u].lng, l[u].lat, 100), image: pinBuilder.fromText(l[u].data.length + "", this._cesium.Color.BLACK, 48).toDataURL() }; this.labelCollections2.push(c), this.BillboardCollections.add(c) } this._viewer.scene.primitives.add(this.BillboardCollections) }, Gl.prototype.createLabelpolymerizationGeoJsonFeatureLayers = function(e, t, i, o, r, n) { var a = { height: 0, material: this._cesium.Color.WHITE, size: 50, fill: this._cesium.Color.RED }, s = { url: t.url, upperLevelLimit: 21, lowerLevelLimit: 0, minLevel1: t.minLevel1, minLevel3: t.minLevel3, rectangle: this._cesium.Rectangle.fromDegrees(118.74324788700017, 32.036708147800084, 118.7994917630001, 32.07298490959994), Cesium: this._cesium, output: t.output, resultmode: t.resultmode, uid: t.uid, st: t.st, words: t.words, area: t.area, callback: t.callback }, l = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.toString().charAt( 0) && "]" == i.material.toString().charAt(i.material.length - 1) || (this._core.isHtmlColor(i .material) ? i.material = this._color.colorFromHtmlColor(i.material) : /^http/.test(i .material) || (/^rgb/.test(i.material) && (i.material = this._color.rgbaStringToRgbaObj( i.material)), 1 < i.material.r && (i.material.r = i.material.r / 255), 1 < i .material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i .material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material .a))), this._core.isnull(i) || this._core.isnull(i.fill) || "[" == i.fill.toString() .charAt(0) && "]" == i.fill.toString().charAt(i.fill.length - 1) || (this._core.isHtmlColor(i .fill) ? i.fill = this._color.colorFromHtmlColor(i.fill) : /^http/.test(i.fill) || ( /^rgb/.test(i.fill) && (i.fill = this._color.rgbaStringToRgbaObj(i.fill)), 1 < i.fill .r && (i.fill.r = i.fill.r / 255), 1 < i.fill.g && (i.fill.g = i.fill.g / 255), 1 < i .fill.b && (i.fill.b = i.fill.b / 255), 1 < i.fill.a && (i.fill.a = i.fill.a / 255), i .fill = this._color.createColor(i.fill.r, i.fill.g, i.fill.b, i.fill.a))), this._core .extend(a, i, !0)), u = this, a = new Fl(this._viewer, this._cesium, s), s = ((this._Provider = a)._loadTile = function(e, o) { u._viewer.scene.primitives.remove(u.labelCollections), u.labelCollections = new("" == o ? u ._cesium.PointPrimitiveCollection : u._cesium.BillboardCollection); var r = new u._cesium.PinBuilder; return e.result.features.forEach(function(e) { var t, i = {}; null != e.lng && (t = new u._cesium.Cartesian3.fromDegrees(e.lng, e.lat, l .height), i = "" == o ? { id: e, color: l.material, position: t } : { position: t, image: r.fromText(e.count + "", l.fill, l.size).toDataURL(), verticalOrigin: u._cesium.VerticalOrigin.BOTTOM }, u.labelCollections.add(i)) }), u._viewer.scene.primitives.add(u.labelCollections), u.item = u.labelCollections, u .labelCollections }, a.addTo(this._viewer), r || this.setVisibility(!1), this._core.isnull(l.id) && (l.id = this ._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), this.west = t.minx, this .south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, Gl.prototype.createLabelGeoJsonFeatureLayerProvider = function(e, t, a, i, o, r) { var n = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, s = this, n = (a.material, s._core.isnull(a) || s._core.isnull(a.fillColor) || /^\[/.test(a.fillColor) && "[" == a.fillColor.toString().charAt(0) && "]" == a.fillColor.toString().charAt(a.fillColor .length - 1) || (s._core.isHtmlColor(a.fillColor) ? a.fillColor = s._color .colorFromHtmlColor(a.fillColor) : (/^rgb/.test(a.fillColor) && (a.fillColor = s._color .rgbaStringToRgbaObj(a.fillColor)), 1 < a.fillColor.r && (a.fillColor.r = a .fillColor.r / 255), 1 < a.fillColor.g && (a.fillColor.g = a.fillColor.g / 255), 1 < a.fillColor.b && (a.fillColor.b = a.fillColor.b / 255), 1 < a.fillColor.a && (a .fillColor.a = a.fillColor.a / 255), a.fillColor = s._color.createColor(a.fillColor .r, a.fillColor.g, a.fillColor.b, a.fillColor.a))), s._core.isnull(a) || s._core .isnull(a.material) || /^\[/.test(a.material) && "[" == a.material.toString().charAt(0) && "]" == a.material.toString().charAt(a.material.length - 1) || (s._core.isHtmlColor(a.material) ? a.material = s._color.colorFromHtmlColor(a.material) : (/^rgb/.test(a.material) && (a .material = s._color.rgbaStringToRgbaObj(a.material)), 1 < a.material.r && (a .material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material .g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a.material .a && (a.material.a = a.material.a / 255), a.material = s._color.createColor(a.material .r, a.material.g, a.material.b, a.material.a))), s._core.isnull(a) || s._core .isnull(a.outlineColor) || /^\[/.test(a.outlineColor) && "[" == a.outlineColor.toString() .charAt(0) && "]" == a.outlineColor.toString().charAt(a.outlineColor.length - 1) || (s._core .isHtmlColor(a.outlineColor) ? a.outlineColor = s._color.colorFromHtmlColor(a .outlineColor) : (/^rgb/.test(a.outlineColor) && (a.outlineColor = s._color .rgbaStringToRgbaObj(a.outlineColor)), 1 < a.outlineColor.r && (a.outlineColor.r = a .outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor.g = a.outlineColor .g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor.a / 255), a.outlineColor = s ._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor .a))), s._core.isnull(a) || s._core.isnull(a.backgroundColor) || /^\[/.test(a .backgroundColor) && "[" == a.backgroundColor.toString().charAt(0) && "]" == a .backgroundColor.toString().charAt(a.backgroundColor.length - 1) || (s._core.isHtmlColor(a .backgroundColor) ? a.backgroundColor = s._color.colorFromHtmlColor(a.backgroundColor) : (/^rgb/.test(a.backgroundColor) && (a.backgroundColor = s._color.rgbaStringToRgbaObj(a .backgroundColor)), 1 < a.backgroundColor.r && (a.backgroundColor.r = a .backgroundColor.r / 255), 1 < a.backgroundColor.g && (a.backgroundColor.g = a .backgroundColor.g / 255), 1 < a.backgroundColor.b && (a.backgroundColor.b = a .backgroundColor.b / 255), 1 < a.backgroundColor.a && (a.backgroundColor.a = a .backgroundColor.a / 255), a.backgroundColor = s._color.createColor(a .backgroundColor.r, a.backgroundColor.g, a.backgroundColor.b, a.backgroundColor.a))), new v(this._viewer, this._cesium, n)), n = ((this._Provider = n)._loadTile = function(e) { var r, t = { Name: "", text: "", font: " 30px sans-serif", style: s._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: s._cesium.Color.WHITE, outlineColor: s._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new s._cesium.Color(.165, .165, .165, .8), backgroundPadding: new s._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: s._cesium.HorizontalOrigin.CENTER, verticalOrigin: s._cesium.VerticalOrigin.CENTER, eyeOffset: s._cesium.Cartesian3.ZERO, pixelOffset: s._cesium.Cartesian2.ZERO, heightReference: s._cesium.HeightReference.NONE, scaleByDistance: new s._cesium.NearFarScalar(0, 0, 1, 1), maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, n = s._core.extend(t, a, !0), t = (s._core.isnull(a.near) && (a.near = 0), s._core.isnull(a.far) && (a.far = 999999999), parseFloat(a.near)), i = parseFloat(a.far), t = new s._cesium.DistanceDisplayCondition(t, i); return n.distanceDisplayCondition = t, s._core.isnull(a.font_size) && (a.font_size = "30px"), s._core.isnull(a.font_family) && (a.font_family = " sans-serif"), n.font = parseFloat(a.font_size) + "px " + a.font_family, r = new(null != n.image && null != n .image ? s._cesium.BillboardCollection : s._cesium.LabelCollection), e.features .forEach(function(e) { n.id = e; var t, i = n.pointHeight, o = (/^\[/.test(i) && /\]$/.test(i) ? (o = i.replace(/\[/, "").replace(/\]/, ""), i = parseFloat(e.properties[o])) : null != i && "" != i ? i = parseFloat(i) : null != e.properties.height && (i = parseFloat(e .properties.height)), n.position = new s._cesium.Cartesian3 .fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], i), /^\[/.test(a.fillColor) && /\]$/.test(a.fillColor) && (t = a.fillColor .replace(/\[/, "").replace(/\]/, ""), n.fillColor = e.properties[t], s._core.isHtmlColor(n.fillColor) ? n.fillColor = s._color .colorFromHtmlColor(n.fillColor) : (/^rgb/.test(n.fillColor) && (n .fillColor = s._color.rgbaStringToRgbaObj(n.fillColor)), 1 < n.fillColor.r && (n.fillColor.r = n.fillColor.r / 255), 1 < n .fillColor.g && (n.fillColor.g = n.fillColor.g / 255), 1 < n .fillColor.b && (n.fillColor.b = n.fillColor.b / 255), 1 < n .fillColor.a && (n.fillColor.a = n.fillColor.a / 255), n .fillColor = s._color.createColor(n.fillColor.r, n.fillColor.g, n.fillColor.b, n.fillColor.a))), /^\[/.test(a .outlineColor) && /\]$/.test(a.outlineColor) && (t = a.outlineColor .replace(/\[/, "").replace(/\]/, ""), n.outlineColor = e.properties[ t], s._core.isHtmlColor(n.outlineColor) ? n.outlineColor = s ._color.colorFromHtmlColor(n.outlineColor) : (/^rgb/.test(n .outlineColor) && (n.outlineColor = s._color .rgbaStringToRgbaObj(n.outlineColor)), 1 < n.outlineColor .r && (n.outlineColor.r = n.outlineColor.r / 255), 1 < n .outlineColor.g && (n.outlineColor.g = n.outlineColor.g / 255), 1 < n.outlineColor.b && (n.outlineColor.b = n.outlineColor.b / 255), 1 < n.outlineColor.a && (n.outlineColor.a = n .outlineColor.a / 255), n.outlineColor = s._color .createColor(n.outlineColor.r, n.outlineColor.g, n.outlineColor .b, n.outlineColor.a))), "fillColor:" + 255 * n.fillColor .red + "," + 255 * n.fillColor.green + "," + 255 * n.fillColor.blue + ";outlineColor:" + 255 * n.outlineColor.red + "," + 255 * n.outlineColor .green + "," + 255 * n.outlineColor.blue); s.Legend.push(o), /^\[/.test(a.text) && /\]$/.test(a.text) && (t = a.text .replace(/\[/, "").replace(/\]/, ""), n.text = e.properties[t]), r.add( n) }), r }, a && a.time && (n.availability = new s._cesium.TimeIntervalCollection([new s._cesium .TimeInterval({ start: a.time.start ? s._cesium.JulianDate.fromDate(new Date(a.time .start)) : s._cesium.Iso8601.MINIMUM_VALUE, stop: a.time.end ? s._cesium.JulianDate.fromDate(new Date(a.time.end)) : s ._cesium.Iso8601.MAXIMUM_VALUE }) ])), this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: a.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "labelPointLayer", item: this, url: t.url, style: a }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Gl.prototype.createLabelRichtextGeoJsonFeatureLayerProvider = function(e, t, c, i, h, m) { null == t && console.log("geojson is required"); var o = this._cesium.GeoJsonDataSource.load(t), d = (this._viewer.dataSources.add(o), this), p = new this._cesium.PointPrimitiveCollection, o = (d.optiontext = [], o.then(function(e) { for (var t = (d.item = e).entities.values, i = 0; i < t.length; i++) { var o, r, n = t[i], n = (o = /^\[/.test(c.text) && /\]$/.test(c.text) ? (o = c.text.replace(/\[/, "").replace(/\]/, ""), n.properties[o]._value) : c.text, d.optiontext .push(o), n.billboard = void 0, d._viewer.scene.globe.ellipsoid, d._cesium .Cartographic.fromCartesian(n.position._value)), n = [d._cesium.Math.toDegrees(n.longitude), d._cesium.Math.toDegrees(n .latitude), c.pointHeight || n.height ], a = d._core.getuid(); n instanceof Array ? 2 === n.length ? r = d._cesium.Cartesian3.fromDegrees(n[0], n[ 1]) : 3 === n.length && (r = d._cesium.Cartesian3.fromDegrees(n[0], n[1], n[ 2])) : r = n.z ? d._cesium.Cartesian3.fromDegrees(n.x, n.y, n.z) : d._cesium .Cartesian3.fromDegrees(n.x, n.y), p.add({ id: "DivPoint" + a, position: r, color: d._cesium.Color.YELLOW, description: c.text }) } d.item = p, d.pointPrimitive = d._viewer.scene.primitives.add(p); var s, l, u = !0; d.pointPrimitive.update = function() { for (var e, t, i = 0; i < d.pointPrimitive.length; i++) { if (e = d.pointPrimitive.get(i), l = e.position, !(l = d._viewer.scene .cartesianToCanvasCoordinates(l))) return; (s = document.getElementById(e.id)) || (t = '
\n
' + d.optiontext[i] + "
\n
", $(".cesium-viewer") .append(t), s = document.getElementById(e.id)), e.description ? s.style .transform = "matrix(1, 0, 0, 1, " + l.x + ", " + (l.y - 157) + ")" : s .style.transform = "matrix(1, 0, 0, 1, " + l.x + ", " + (l.y - 134) + ")" } u && (h || d.setVisibility(!1), u = !1) }, "function" == typeof m && m(e) }), this._core.isnull(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "富文本"), { id: c.id, name: e, checked: h, pId: this._core.isnull(i) ? 0 : i, type: "DivPoint", item: this, url: t, style: c }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Gl.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer = function(e, t, s, i, l, o) { var r = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, u = this, r = new v(this._viewer, this._cesium, r), r = ((this._Provider = r)._loadTile = function(e) { var o, r, n = new u._cesium.PointPrimitiveCollection, a = (u.optiontext = [], e.features.forEach(function(e) { var t, i = options.pointHeight, i = (null != e.properties.height && (i = parseFloat(e.properties .height) + i), /^\[/.test(options.pointHeight) && /\]$/.test( options.pointHeight) && (t = options.pointHeight.replace(/\[/, "").replace(/\]/, ""), i = parseFloat(e.properties[t])), s .position = new u._cesium.Cartesian3.fromDegrees(e.geometry .coordinates[0], e.geometry.coordinates[1], i), /^\[/.test(s .text) && /\]$/.test(s.text) && (t = s.text.replace(/\[/, "") .replace(/\]/, ""), s.text = e.properties[t]), u._core.getuid() ); n.add({ id: "DivPoint" + i, position: Cartesian3, color: u._cesium.Color.YELLOW, description: s.text }), u.optiontext.push(option.text) }), u.pointPrimitive = u._viewer.scene.primitives.add(n), !0); return u.pointPrimitive.update = function() { for (var e, t, i = 0; i < u.pointPrimitive.length; i++) { if (e = u.pointPrimitive.get(i), r = e.position, !(r = u._viewer.scene .cartesianToCanvasCoordinates(r))) return; (o = document.getElementById(e.id)) || (t = '
\n
' + u.optiontext[i] + "
\n
", $(".cesium-viewer").append( t), o = document.getElementById(e.id)), e.description ? o.style.transform = "matrix(1, 0, 0, 1, " + r.x + ", " + (r.y - 157) + ")" : o.style.transform = "matrix(1, 0, 0, 1, " + r.x + ", " + (r.y - 134) + ")" } a && (l || u.setVisibility(!1), a = !1) }, u.item = n, "" }, r.addTo(this._viewer), l || this.setVisibility(!1), this._core.isnull(s.id) && (s.id = this ._core.getuid()), this._core.isnull(e) && (e = "富文本" + s.id), this.west = t.minx, this .south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: s.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "DivPoint", item: this, url: t.url, style: s }); return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i), "function" == typeof o && o(this.item), this }, Gl.prototype.createModelGeoJsonFeatureLayerProvider = function(e, t, n, i, o, r) { var a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, Cesium: this._cesium }, s = this, a = (n.material, s._core.isnull(n) || s._core.isnull(n.color) || /^\[/.test(n.color) && "[" == n .color.toString().charAt(0) && "]" == n.color.toString().charAt(n.color.length - 1) || (s._core .isHtmlColor(n.color) ? n.color = s._color.colorFromHtmlColor(n.color) : (/^rgb/.test(n .color) && (n.color = s._color.rgbaStringToRgbaObj(n.color)), 1 < n.color.r && (n .color.r = n.color.r / 255), 1 < n.color.g && (n.color.g = n.color.g / 255), 1 < n .color.b && (n.color.b = n.color.b / 255), 1 < n.color.a && (n.color.a = n.color.a / 255), n.color = s._color.createColor(n.color.r, n.color.g, n.color.b, n.color.a))), new v(this._viewer, this._cesium, a)), a = ((this._Provider = a)._loadTile = function(e) { var t = { url: "", modelMatrix: s._cesium.Transforms.eastNorthUpToFixedFrame(origin), color: s._cesium.Color.DARKSALMON, scale: 2 }, o = s._core.extend(t, n, !0), t = (s._core.isnull(n.near) && (n.near = 0), s._core.isnull(n.far) && (n.far = 999999999), parseFloat(n.near)), i = parseFloat(n.far), t = new s._cesium.DistanceDisplayCondition(t, i), r = (o.distanceDisplayCondition = t, new s._cesium.PrimitiveCollection); return e.features.forEach(function(e) { o.id = e; var t = o.height, i = (null != e.properties.height && (t = parseFloat(e.properties.height)), /^\[/.test(o.height) && /\]$/.test(o.height) && (i = o.height.replace( /\[/, "").replace(/\]/, ""), t = parseFloat(e.properties[i])), o .modelMatrix = s._cesium.Transforms.eastNorthUpToFixedFrame(s._cesium .Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry .coordinates[1], t)), s._cesium.Model.fromGltf({ id: e, url: o.uri, color: o.color, modelMatrix: o.modelMatrix, scale: o.scale, heightReference: parseInt(o.heightReference), distanceDisplayCondition: o.distanceDisplayCondition })); r.add(i) }), r }, this.item = a._primitiveCollection, a.addTo(this._viewer), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this .south = t.miny, this.east = t.maxx, this.north = t.maxy, o || this.setVisibility(!1), { id: n.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "modelLayer", item: this, url: t.url, style: n }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Gl.prototype.createPointGeoJsonFeatureLayerProvider = function(e, t, a, i, o, r) { var n = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, s = this, n = (s._core.isnull(a) || s._core.isnull(a.color) || /^\[/.test(a.color) && "[" == a.color .toString().charAt(0) && "]" == a.color.toString().charAt(a.color.length - 1) || (s._core .isHtmlColor(a.color) ? a.color = s._color.colorFromHtmlColor(a.color) : (/^rgb/.test(a .color) && (a.color = s._color.rgbaStringToRgbaObj(a.color)), 1 < a.color.r && (a .color.r = a.color.r / 255), 1 < a.color.g && (a.color.g = a.color.g / 255), 1 < a .color.b && (a.color.b = a.color.b / 255), 1 < a.color.a && (a.color.a = a.color.a / 255), a.color = s._color.createColor(a.color.r, a.color.g, a.color.b, a.color.a))), s._core.isnull(a) || s._core.isnull(a.outlineColor) || /^\[/.test(a.outlineColor) && "[" == a .outlineColor.toString().charAt(0) && "]" == a.outlineColor.toString().charAt(a.outlineColor .length - 1) || (s._core.isHtmlColor(a.outlineColor) ? a.outlineColor = s._color .colorFromHtmlColor(a.outlineColor) : (/^rgb/.test(a.outlineColor) && (a.outlineColor = s ._color.rgbaStringToRgbaObj(a.outlineColor)), 1 < a.outlineColor.r && (a .outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor .g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a .outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor .a / 255), a.outlineColor = s._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), new v(this._viewer, this._cesium, n)), n = ((this._Provider = n)._loadTile = function(e) { var t = { Name: "", text: "", font: " 30px sans-serif", pixelSize: 10, style: s._cesium.LabelStyle.OUTLINE, fillColor: s._cesium.Color.WHITE, outlineColor: s._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new s._cesium.Color(.165, .165, .165, .8), backgroundPadding: new s._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: s._cesium.HorizontalOrigin.CENTER, verticalOrigin: s._cesium.VerticalOrigin.CENTER, eyeOffset: s._cesium.Cartesian3.ZERO, pixelOffset: s._cesium.Cartesian2.ZERO, heightReference: s._cesium.HeightReference.NONE, scaleByDistance: new s._cesium.NearFarScalar(0, 0, 1, 1) }, r = (a.material, s._core.isnull(a) || s._core.isnull(a.backgroundColor) || /^\[/.test(a .backgroundColor) && "[" == a.backgroundColor.toString().charAt(0) && "]" == a .backgroundColor.toString().charAt(a.backgroundColor.length - 1) || (s._core .isHtmlColor(a.backgroundColor) ? a.backgroundColor = s._color .colorFromHtmlColor(a.backgroundColor) : (/^rgb/.test(a.backgroundColor) && (a .backgroundColor = s._color.rgbaStringToRgbaObj(a.backgroundColor)), 1 < a.backgroundColor.r && (a.backgroundColor.r = a.backgroundColor.r / 255), 1 < a.backgroundColor.g && (a.backgroundColor.g = a.backgroundColor.g / 255), 1 < a.backgroundColor.b && (a.backgroundColor.b = a.backgroundColor .b / 255), 1 < a.backgroundColor.a && (a.backgroundColor.a = a .backgroundColor.a / 255), a.backgroundColor = s._color.createColor(a .backgroundColor.r, a.backgroundColor.g, a.backgroundColor.b, a .backgroundColor.a))), s._core.extend(t, a, !0)), t = (s._core.isnull(a.near) && (a.near = 0), s._core.isnull(a.far) && (a.far = 999999999), parseFloat(a.near)), i = parseFloat(a.far), t = new s._cesium.DistanceDisplayCondition(t, i), n = (r.distanceDisplayCondition = t, s._core.isnull(a.font_size) && (a.font_size = "30px"), s._core.isnull(a.font_family) && (a.font_family = " sans-serif"), r .font = parseFloat(a.font_size) + "px " + a.font_family, new s._cesium .PointPrimitiveCollection); return e.features.forEach(function(e) { r.id = e; var t = 0, i = (/^\[/.test(r.pointHeight) && /\]$/.test(r.pointHeight) ? (i = r .pointHeight.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e .properties[i])) : void 0 !== r.pointHeight && "" !== r .pointHeight ? t = parseFloat(r.pointHeight) : null != e.properties .height && (t = parseFloat(e.properties.height)), /^\[/.test(a.color) && /\]$/.test(a.color) && (o = a.color.replace(/\[/, "").replace(/\]/, ""), r.color = e.properties[o], s._core.isHtmlColor(r.color) ? r.color = s._color.colorFromHtmlColor(r.color) : (/^rgb/.test(r.color) && (r .color = s._color.rgbaStringToRgbaObj(r.color)), 1 < r.color .r && (r.color.r = r.color.r / 255), 1 < r.color.g && (r.color .g = r.color.g / 255), 1 < r.color.b && (r.color.b = r.color .b / 255), 1 < r.color.a && (r.color.a = r.color.a / 255), r .color = s._color.createColor(r.color.r, r.color.g, r.color.b, r .color.a))), /^\[/.test(a.outlineColor) && /\]$/.test(a .outlineColor) && (o = a.outlineColor.replace(/\[/, "").replace( /\]/, ""), r.outlineColor = e.properties[o], s._core .isHtmlColor(r.outlineColor) ? r.outlineColor = s._color .colorFromHtmlColor(r.outlineColor) : (/^rgb/.test(r .outlineColor) && (r.outlineColor = s._color .rgbaStringToRgbaObj(r.outlineColor)), 1 < r.outlineColor .r && (r.outlineColor.r = r.outlineColor.r / 255), 1 < r .outlineColor.g && (r.outlineColor.g = r.outlineColor.g / 255), 1 < r.outlineColor.b && (r.outlineColor.b = r.outlineColor.b / 255), 1 < r.outlineColor.a && (r.outlineColor.a = r .outlineColor.a / 255), r.outlineColor = s._color .createColor(r.outlineColor.r, r.outlineColor.g, r.outlineColor .b, r.outlineColor.a))), r.position = new s._cesium .Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry .coordinates[1], t), r.text = e.properties.name, { show: r.show, position: r.position, pixelSize: r.pixelSize, color: r.color, outlineColor: r.outlineColor, outlineWidth: r.outlineWidth, id: e }), o = "color:" + 255 * r.color.red + "," + 255 * r.color.green + "," + 255 * r .color.blue + ";outlineColor:" + 255 * r.outlineColor.red + "," + 255 * r .outlineColor.green + "," + 255 * r.outlineColor.blue; s.Legend.push(o), n.add(i) }), n }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this ._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: a.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t.url, style: a }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Gl.prototype.createPointGeoJsonFeatureLayerProvider = function(e, t, a, i, o, r) { var n = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, s = this, n = (s._core.isnull(a) || s._core.isnull(a.color) || /^\[/.test(a.color) && "[" == a.color .toString().charAt(0) && "]" == a.color.toString().charAt(a.color.length - 1) || (s._core .isHtmlColor(a.color) ? a.color = s._color.colorFromHtmlColor(a.color) : (/^rgb/.test(a .color) && (a.color = s._color.rgbaStringToRgbaObj(a.color)), 1 < a.color.r && (a .color.r = a.color.r / 255), 1 < a.color.g && (a.color.g = a.color.g / 255), 1 < a .color.b && (a.color.b = a.color.b / 255), 1 < a.color.a && (a.color.a = a.color.a / 255), a.color = s._color.createColor(a.color.r, a.color.g, a.color.b, a.color.a))), s._core.isnull(a) || s._core.isnull(a.outlineColor) || /^\[/.test(a.outlineColor) && "[" == a .outlineColor.toString().charAt(0) && "]" == a.outlineColor.toString().charAt(a.outlineColor .length - 1) || (s._core.isHtmlColor(a.outlineColor) ? a.outlineColor = s._color .colorFromHtmlColor(a.outlineColor) : (/^rgb/.test(a.outlineColor) && (a.outlineColor = s ._color.rgbaStringToRgbaObj(a.outlineColor)), 1 < a.outlineColor.r && (a .outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor .g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a .outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor .a / 255), a.outlineColor = s._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), new v(this._viewer, this._cesium, n)), n = ((this._Provider = n)._loadTile = function(e) { var t = { Name: "", text: "", font: " 30px sans-serif", pixelSize: 10, style: s._cesium.LabelStyle.OUTLINE, fillColor: s._cesium.Color.WHITE, outlineColor: s._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new s._cesium.Color(.165, .165, .165, .8), backgroundPadding: new s._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: s._cesium.HorizontalOrigin.CENTER, verticalOrigin: s._cesium.VerticalOrigin.CENTER, eyeOffset: s._cesium.Cartesian3.ZERO, pixelOffset: s._cesium.Cartesian2.ZERO, heightReference: s._cesium.HeightReference.NONE, scaleByDistance: new s._cesium.NearFarScalar(0, 0, 1, 1) }, r = (a.material, s._core.isnull(a) || s._core.isnull(a.backgroundColor) || /^\[/.test(a .backgroundColor) && "[" == a.backgroundColor.toString().charAt(0) && "]" == a .backgroundColor.toString().charAt(a.backgroundColor.length - 1) || (s._core .isHtmlColor(a.backgroundColor) ? a.backgroundColor = s._color .colorFromHtmlColor(a.backgroundColor) : (/^rgb/.test(a.backgroundColor) && (a .backgroundColor = s._color.rgbaStringToRgbaObj(a.backgroundColor)), 1 < a.backgroundColor.r && (a.backgroundColor.r = a.backgroundColor.r / 255), 1 < a.backgroundColor.g && (a.backgroundColor.g = a.backgroundColor.g / 255), 1 < a.backgroundColor.b && (a.backgroundColor.b = a.backgroundColor .b / 255), 1 < a.backgroundColor.a && (a.backgroundColor.a = a .backgroundColor.a / 255), a.backgroundColor = s._color.createColor(a .backgroundColor.r, a.backgroundColor.g, a.backgroundColor.b, a .backgroundColor.a))), s._core.extend(t, a, !0)), t = (s._core.isnull(a.near) && (a.near = 0), s._core.isnull(a.far) && (a.far = 999999999), parseFloat(a.near)), i = parseFloat(a.far), t = new s._cesium.DistanceDisplayCondition(t, i), n = (r.distanceDisplayCondition = t, s._core.isnull(a.font_size) && (a.font_size = "30px"), s._core.isnull(a.font_family) && (a.font_family = " sans-serif"), r .font = parseFloat(a.font_size) + "px " + a.font_family, new s._cesium .PointPrimitiveCollection); return e.features.forEach(function(e) { r.id = e; var t = 0, i = (/^\[/.test(r.pointHeight) && /\]$/.test(r.pointHeight) ? (i = r .pointHeight.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e .properties[i])) : void 0 !== r.pointHeight && "" !== r .pointHeight ? t = parseFloat(r.pointHeight) : null != e.properties .height && (t = parseFloat(e.properties.height)), /^\[/.test(a.color) && /\]$/.test(a.color) && (o = a.color.replace(/\[/, "").replace(/\]/, ""), r.color = e.properties[o], s._core.isHtmlColor(r.color) ? r.color = s._color.colorFromHtmlColor(r.color) : (/^rgb/.test(r.color) && (r .color = s._color.rgbaStringToRgbaObj(r.color)), 1 < r.color .r && (r.color.r = r.color.r / 255), 1 < r.color.g && (r.color .g = r.color.g / 255), 1 < r.color.b && (r.color.b = r.color .b / 255), 1 < r.color.a && (r.color.a = r.color.a / 255), r .color = s._color.createColor(r.color.r, r.color.g, r.color.b, r .color.a))), /^\[/.test(a.outlineColor) && /\]$/.test(a .outlineColor) && (o = a.outlineColor.replace(/\[/, "").replace( /\]/, ""), r.outlineColor = e.properties[o], s._core .isHtmlColor(r.outlineColor) ? r.outlineColor = s._color .colorFromHtmlColor(r.outlineColor) : (/^rgb/.test(r .outlineColor) && (r.outlineColor = s._color .rgbaStringToRgbaObj(r.outlineColor)), 1 < r.outlineColor .r && (r.outlineColor.r = r.outlineColor.r / 255), 1 < r .outlineColor.g && (r.outlineColor.g = r.outlineColor.g / 255), 1 < r.outlineColor.b && (r.outlineColor.b = r.outlineColor.b / 255), 1 < r.outlineColor.a && (r.outlineColor.a = r .outlineColor.a / 255), r.outlineColor = s._color .createColor(r.outlineColor.r, r.outlineColor.g, r.outlineColor .b, r.outlineColor.a))), r.position = new s._cesium .Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry .coordinates[1], t), r.text = e.properties.name, { show: r.show, position: r.position, pixelSize: r.pixelSize, color: r.color, outlineColor: r.outlineColor, outlineWidth: r.outlineWidth, id: e }), o = "color:" + 255 * r.color.red + "," + 255 * r.color.green + "," + 255 * r .color.blue + ";outlineColor:" + 255 * r.outlineColor.red + "," + 255 * r .outlineColor.green + "," + 255 * r.outlineColor.blue; s.Legend.push(o), n.add(i) }), n }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this ._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: a.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t.url, style: a }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Gl.prototype.setTreeobj = function(e) { this.treeobj = e }, Gl.prototype.getLegend = function() { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, Gl.prototype.deleteObject = function() { if (null != this._Provider && this._Provider.setStatus(!1), null != this.items && null != this.items && 0 < this.items.length) for (var e = 0; e < this.items.length; e++) this._viewer.scene.primitives.remove(this.items[e]); else this._viewer.scene.primitives.remove(this.item); if ("DivPoint" === this.treeobj.type && this.item && null != this.item._pointPrimitives && null != this .item._pointPrimitives) for (e = 0; e < this.item._pointPrimitives.length; e++) { var t = document.getElementById(this.item._pointPrimitives[e].id); t && t.remove() } try { this._Provider.remove() } catch (e) {} }, Gl.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, Gl.prototype.setRefresh = function(e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) {} }, Gl.prototype.setVisibility = function(e) { if (null != this.treeobj && "DivPoint" === this.treeobj.type && this.item && null != this.item ._pointPrimitives && null != this.item._pointPrimitives) for (var t = 0; t < this.item._pointPrimitives.length; t++) { var i = document.getElementById(this.item._pointPrimitives[t].id); i && (i.style.display = e ? "block" : "none") } null != this.item && (this.item.show = e), this._Provider && this._Provider.setStatus(!e) }, Object.defineProperties(Gl.prototype, { labelText: { set: y.debounce(function(e) { var t = e; if (!this._core.isnull(e)) { var i = this.item.entities && this.item.entities.values; if (i && 0 < i.length) for (var o = 0; o < i.length; o++) if (/^\[/.test(e) && (t = e.replace(/\[/, "").replace(/\]/, ""), t = i[ o].properties[t]._value), i[o].label) { i[o].label.text = t; try { i[o].point.show = !1 } catch (e) {} } else { try { i[o].point.show = !1 } catch (e) {} i[o].label = new this._cesium.LabelGraphics({ text: t, font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE }) } } }, 500) }, labelStyles: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.style = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.style : void 0 } }, labelFont: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = 16; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[0]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++) t[r].label.font = o + "px " + e } } }, 500) }, labelFontSize1: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = "sans-serif"; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[1]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++) t[r].label.font = e + "px " + o } } }, 500) }, labelFontSize: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), (!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.font = e + "px sans-serif" } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? parseFloat(e[0].label.font) : void 0 } }, labelFillColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.fillColor = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? (e = e[0].label.fillColor, this._color.toHtmlColor("rgb(" + 255 * e ._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelOutlineColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.outlineColor = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, labelOutlineWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].label .outlineWidth = e } }, 200), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.outlineWidth; if (e) return e._value } } }, labelBackgroundColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.backgroundColor = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? (e = e[0].label.backgroundColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value .blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelBackground: { set: y.debounce(function(e) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.showBackground = e }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.background : void 0 } }, labelScale: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].label.scale = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.scale; if (e) return e._value } } }, labelHorizontalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.horizontalOrigin = parseInt(e) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.horizontalOrigin; if (e) return e._value } } }, labelVerticalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.verticalOrigin = parseInt(e) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.verticalOrigin; if (e) return e._value } } }, labelHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = 0; i < t.length; i++) t[i].label.heightReference = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[ 0].label) { e = e[0].label.heightReference; if (e) return e._value } } }, labelDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].label.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, parseInt(e)), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(i, 1, parseInt(e), 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label .distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, labelDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t .length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].label.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(parseInt(e), i), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(parseInt(e), 1, i, 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label .distanceDisplayCondition._value.near : 0 : void 0 } }, labelHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } }, labelShow: { set: y.debounce(function(e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) !t[i].label && e ? (t[i].point && (t[i].point .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].label = new this._cesium .LabelGraphics({ text: "label", font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE })) : (t[i].label && (t[i].label.show = e), t[i].point && (t[i].point .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) return e && 0 < e.length && e[0].label ? e[0].label.show : void 0 } }, modelShow: { set: y.debounce(function(e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) t[i].label && (t[i].label.show = !e), t[i] .point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = ! e), !t[i].model && e ? t[i].model = new this._cesium.ModelGraphics({ show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE }) : (t[i].model && (t[i].model.show = e), t[i].label && (t[i].label .show = !e), t[i].point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) return e && 0 < e.length && e[0].model ? e[0].model.show : void 0 } }, modelUri: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length) for (var i, o = 0; o < t.length; o++) t[o].model ? t[o].model.uri = e : ( /^\[/.test(e) && (e = 1 < (i = e.split("[")).length ? i[0] + i[1] .replace(/\[/, "").replace(/\]/, "") : (e = e.replace(/\[/, "") .replace(/\]/, ""), t[o].properties[e])), t[o].model = new this._cesium.ModelGraphics({ uri: e, show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE })) } }, 500) }, modelScale: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { e = parseFloat(e); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].model.scale = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.scale; if (e) return e._value } } }, modelShadows: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.shadows = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) return e && 0 < e.length && e[0].model ? e[0].model.shadows : void 0 } }, modelHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.heightReference = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.heightReference; if (e) return e._value } } }, modelDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].model.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; e && !/^point.fid/.test(e[0]._id) && null == e[0].model || e && 0 < e.length && e[0] .model && (e[0].model.distanceDisplayCondition ? e[0].model.distanceDisplayCondition ._value.far : Number.MAX_VALUE) } }, modelDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].model.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(e, i) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) return e && 0 < e.length && e[0].model ? e[0].model.distanceDisplayCondition ? e[0].model .distanceDisplayCondition._value.near : 0 : void 0 } }, modelColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.color = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, modelLightColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].model.lightColor = e } }, 100), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[ 0].model) { e = e[0].model.lightColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, modelHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } }, pointColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) t[i].point.color = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, pointShow: { set: y.debounce(function(e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) !t[i].point && e ? (t[i].label && (t[i].label .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].point = new this._cesium .PointGraphics({ color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0 })) : (t[i].point && (t[i].point.show = e), t[i].label && (t[i].label .show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) return e && 0 < e.length && e[0].point ? e[0].point.show : void 0 } }, pointPixelSize: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].point.pixelSize = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.pixelSize; if (e) return e._value } } }, pointOutlineColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) t[i].point.outlineColor = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, pointOutlineWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) /^\[/.test(e) && (e = e.replace(/\[/, "") .replace(/\]/, ""), e = t[i].properties[e]), t[i].point .outlineWidth = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.outlineWidth; if (e) return e._value } } }, pointHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = 0; i < t.length; i++) t[i].point.heightReference = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[ 0].point) { e = e[0].point.heightReference; if (e) return e._value } } }, pointDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].point.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e), t[o].point.scaleByDistance = new this ._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) return e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point .distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, pointDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t .length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].point.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(e, i), t[o].point.scaleByDistance = new this ._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) return e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point .distanceDisplayCondition._value.near : 0 : void 0 } }, pointHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } }, billboardShow: { set: y.debounce(function(e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++) !t[i].billboard && e ? (t[i].point && (t[i] .point.show = !e), t[i].label && (t[i].label.show = !e), t[i] .model && (t[i].model.show = !e), t[i].billboard = new this._cesium .BillboardGraphics({ show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE })) : (t[i].billboard && (t[i].billboard.show = e), t[i].point && (t[i] .point.show = !e), t[i].label && (t[i].label.show = !e), t[i] .billboard && (t[i].billboard.show = !e)) }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.show : void 0 } }, billboardImage: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length) for (var i, o = 0; o < t.length; o++) /^\[/.test(e) && (e = 1 < (i = e .split("[")).length ? i[0] + i[1].replace(/\[/, "").replace( /\]/, "") : (e = e.replace(/\[/, "").replace(/\]/, ""), t[o] .properties[e])), t[o].billboard ? t[o].billboard.image = e : t[o] .billboard = new this._cesium.BillboardGraphics({ image: e, show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE }) } }, 500) }, billboardScale: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.scale = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.scale; if (e) return e._value } } }, billboardHorizontalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.horizontalOrigin = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.horizontalOrigin : void 0 } }, billboardVerticalOrigin: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.verticalOrigin = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.verticalOrigin : void 0 } }, billboardWidth: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.width = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.width; if (e) return e._value } } }, billboardHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.height = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.height; if (e) return e._value } } }, billboardColor: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color .colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color .rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e .a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = 0; i < t.length; i++) t[i].billboard.color = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].billboard) { e = e[0].billboard.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e ._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) {} } } }, billboardHeightReference: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].model) for (var i = 0; i < t.length; i++) t[i].billboard.heightReference = e } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e .length && e[0].model) { e = e[0].billboard.heightReference; if (e) return e._value } } }, billboardDistanceDisplayMaxCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard .distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++) t[o].billboard.distanceDisplayCondition = new this._cesium .DistanceDisplayCondition(i, e), t[o].billboard.scaleByDistance = new this._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0] .billboard.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, billboardDistanceDisplayMinCondition: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t .length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard .distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++) t[o].billboard.distanceDisplayCondition = new this ._cesium.DistanceDisplayCondition(e, i), t[o].billboard .scaleByDistance = new this._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function() { var e = this.item.entities && this.item.entities.values; if (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) return e && 0 < e .length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0] .billboard.distanceDisplayCondition._value.near : 0 : void 0 } }, billboardPHeight: { set: y.debounce(function(e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t .length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function() { return 0 } } }); function Nl(e, c, h, m) { var d = [], p = void 0 !== e[0].longitude; return e.forEach(function(e) { var t, i, o, r, n, a, s, l, u = [], e = p ? e : Bl.scene.globe.ellipsoid.cartesianToCartographic(e); t = e, o = m, r = (i = c).west, n = c.east, a = c.south, i = c.north - a, s = 180 * t .longitude / Math.PI, l = 180 * t.latitude / Math.PI, t.normalizedLongitude = (s - r) / (n - r) * h, t.normalizedLatitude = (l - a) / i * o, e = t, u.push(e.normalizedLongitude), u .push(e.normalizedLatitude), d.push(u) }), d } var Bl, jl = function(e, t, i) { var o = t.west * Cesium.Math.DEGREES_PER_RADIAN, r = t.east * Cesium.Math.DEGREES_PER_RADIAN, n = t.south * Cesium.Math.DEGREES_PER_RADIAN, t = t.north * Cesium.Math.DEGREES_PER_RADIAN, o = new Cesium.Rectangle(o, n, r, t), a = Nl(e, o, 32, 32), n = "#FF0000", r = 32, t = 32; void 0 === (e = void 0), (e = document.createElement("canvas")).width = r, e.height = t; var s = e.getContext("2d"); if (!(a.length <= 0)) { s.moveTo(a[0][0], a[0][1]); for (var l = 0; l < a.length; l++) s.lineTo(a[l][0], a[l][1]); return null != n && (s.fillStyle = n, s.fill()), e } }; function zl(e, t) { return Math.floor(Math.random() * (t - e + 1)) + e } function Ul(e, o) { var t = Cesium.when.defer(), r = []; return e.forEach(function(e) { var t, i; r.push((e = e, t = o, i = Cesium.when.defer(), (zl = jl(e.vertices, t, e.heights[0])) .timeStamp = e.timeStamp, zl.mtHeight = e.heights, zl.mtType = e.mtType, zl .fromKML = e.fromKML, zl.rect = e.rectangle, zl.level = e.level, i.resolve(zl), i)) }), Cesium.when.all(r, function(e) { e[0].lenght; var o; 1 === e.length ? t.resolve(e[0]) : (e = e.sort(function(e, t) { return t.timeStamp - e.timeStamp }), o = e.shift(), e.forEach(function(i) { o.forEach(function(e, t) { e === zl && i[t] !== zl && (o[t] = i[t]) }) }), t.resolve(o)) }), t } function Wl(e, t) { if (Bl = e, !Cesium.defined(t)) throw new Cesium.DeveloperError("options is required."); this._errorEvent = new Cesium.Event, this._modelFloorMasks = {}, this._credit = t.credit, "string" == typeof this._credit && (this._credit = new Cesium.Credit(this._credit)), t.heightMapWidth = Cesium .defaultValue(t.heightMapWidth, 32), t.heightMapHeight = Cesium.defaultValue(t.heightMapHeight, 32), this._options = t, this.readyPromise = Cesium.when.resolve(!0), this._subdomains = t.subdomains, t .firstRequestUrl = t.url.replace("{s}", this.sTag(0, 0, 0)), this._firstRequest = t.firstRequestUrl + "?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&v=1&layers=" + t.layerName + "&Styles=&Format=image/mpt"; var i = this, e = t.pngOnly; void 0 !== t.maxTerrainLevel && isNaN(t.maxTerrainLevel) && (t.maxTerrainLevel = void 0), this ._maxTerrainLevel = Cesium.defaultValue(t.maxTerrainLevel, 30), e ? i.setFormatMPT(!1) : $.ajax({ url: t.cacheUrl ? t.cacheUrl + "/0/0/0.mpt" : this._firstRequest, success: function(e) { if (!!(Cesium.defined(e.childNodes) && 0 < e.childNodes.length)) return i.setFormatMPT(! 1), null; i.setFormatMPT(!0) }, error: function() { return i.setFormatMPT(!1), null }, async: !1 }), t.cacheUrl && (this.isCache = !0, this.cacheLevel = t.cacheLevel || 16, this._cacheUrl = t .cacheUrl + "/{z}/{x}/{y}.mpt"); let o = this._maxTerrainLevel; this._availability = { computeMaximumLevelAtPosition: function(e) { return Math.min(o, 16) } }, this._urlTemplate = t.url + "?request=GetMap&Version=1.3.0&Service=WMS&v=1&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers=" + t.layerName + "&Styles=&Format=image/" + this._format, this._allElevationLayers = null, this ._tilingScheme = new Cesium.GeographicTilingScheme, this._levelZeroMaximumGeometricError = Cesium .TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid, 4 * t .heightMapWidth, this._tilingScheme.getNumberOfXTilesAtLevel(0)), this._workerPool = new Jo({ workerPath: SmartEarthRootUrl + "Workers/ParseElevationWorker.js" }), this._pendingRequests = 0, this._requestGridSize = 8, this._requestsCache = {}, this ._requestsCacheKeys = [], this.errorEvent.addEventListener(function(e) {}, this) } Wl._geometricErrorFactor = 2, Object.defineProperties(Wl.prototype, { errorEvent: { get: function() { return this._errorEvent } }, availability: { get: function() { return this._availability } }, credit: { get: function() { return this._credit } }, hasVertexNormals: { get: function() { return !1 } }, tilingScheme: { get: function() { return this._tilingScheme } }, ready: { get: function() { return !0 } }, hasWaterMask: { get: function() { return !1 } }, heightMapHeight: { get: function() { return this._options.heightMapHeight } }, heightMapWidth: { get: function() { return this._options.heightMapWidth } }, pendingRequests: { get: function() { return this._pendingRequests } } }), Wl.prototype.setFormatMPT = function(e) { var t; e && this.pngOnly || (t = this._format, this._format = e ? "mpt" : "png", t !== this._format && (this ._isMPT = e, void 0 !== this._urlTemplate && (this._urlTemplate = this._urlTemplate.replace( "image/" + t, "image/" + this._format)))) }, Wl.prototype.getLevelMaximumGeometricError = function(e) { return this._levelZeroMaximumGeometricError / (1 << e) * Wl._geometricErrorFactor }, Wl.prototype.createKeyFromTile = function(e, t, i) { return e + "_" + t + "_" + i }, Wl.prototype.getTileDataAvailable = function(e, t, i) { var o = Math.min(this._maxTerrainLevel, 25); return !!this._isMPT || i < o }, Wl.prototype.requestFactorForLevel = function(e) { var t = Math.log(this._requestGridSize) / Math.log(2), t = Math.min(t, e); return Math.pow(2, t) }, Wl.prototype.getRequestBaseTerrainUrl = function(e, t, i, o) { return this.getRequestUrl(e, t, i, o) }, Wl.prototype.getRequestElevationLayer = function(e, t, i) { return this.getRequestUrl(e, t, i, !1, !0) }, Wl.prototype.getRequestUrl = function(e, t, i, o, r) { var n = i, a = null != o ? this.requestFactorForLevel(i) : 1, e = null != o ? (e - e % a) / a : e, t = null != o ? (t - t % a) / a : t, i = null != o ? i - Math.log(a) / Math.log(2) : i; if (this.isCache && 0 !== i && i <= this.cacheLevel) return this._cacheUrl.replace("{x}", e).replace( "{y}", t).replace("{z}", i); var s = this.tilingScheme.tileXYToNativeRectangle(e, t, i), o = this.heightMapWidth * a == 256 && o ? 1 : 0; return r && (o = 0), this._urlTemplate.replace("{south}", s.south).replace("{north}", s.north).replace( "{west}", s.west).replace("{east}", s.east).replace("{optimizedOnly}", o).replace("{width}", this.heightMapWidth * a).replace("{height}", this.heightMapHeight * a).replace("{s}", this.sTag( e, t, i)) + "&level=" + i + "&origLevel=" + n }, Wl.prototype.isT_Inside_E = function(e, t) { return e.west >= t.west * Cesium.Math.DEGREES_PER_RADIAN && e.east <= t.east * Cesium.Math .DEGREES_PER_RADIAN && e.south >= t.south * Cesium.Math.DEGREES_PER_RADIAN && e.north <= t.north * Cesium.Math.DEGREES_PER_RADIAN }, Wl.prototype.isT_Intersects_E = function(e, t) { var i = e.west * Cesium.Math.RADIANS_PER_DEGREE, o = e.east * Cesium.Math.RADIANS_PER_DEGREE, r = e.south * Cesium.Math.RADIANS_PER_DEGREE, e = e.north * Cesium.Math.RADIANS_PER_DEGREE, i = new Cesium.Rectangle(i, r, o, e); return Cesium.Rectangle.intersection(i, t, new Cesium.Rectangle) }, Wl.prototype.sTag = function(e, t, i) { if (null == this._subdomains) return ""; e = (e + t + i) % this._subdomains.length; return this._subdomains[e] }, Wl.prototype.refreshElevationLayer = function(e) { e.rectangle && void 0 !== Bl.scene.globe._surface._levelZeroTiles && this.findDirectParent(e.rectangle, !0).freeResources() }, Wl.prototype.findDirectParent = function(e, t) { function a(e, t, i) { if (e._rectangle.width <= t.width * (i ? 4.1 : 2.1) && Cesium.Rectangle.contains(e._rectangle, Cesium.Rectangle.center(t))) return e; for (var o = e.children.length, r = 0; r < o; r++) { var n = e.children[r]; if (Cesium.Rectangle.contains(n._rectangle, Cesium.Rectangle.center(t))) return a(n, t, i) } return null } if (e.width == Math.PI) return null; for (var i = 0; i < Bl.scene.globe._surface._levelZeroTiles.length; i++) { var o = a(Bl.scene.globe._surface._levelZeroTiles[i], e, t); if (o) return o } return null }, Wl.prototype.isTileAvailable = function(e, t, i) { var o = this._tilingScheme.tileXYToRectangle(e, t, i, new Cesium.Rectangle), r = this.findDirectParent(o); if (r && r.data && r.data.terrainData) { if (!(0 < r.data.terrainData._childTileMask)) return !1; for (var n = r.children.length, a = 0; a < n; a++) { var s = r.children[a]; if (Cesium.Rectangle.equals(s._rectangle, o)) return r.data.terrainData._childTileMask & 1 << a } } return !0 }, Wl.prototype.markTileAsUnavailable = function(e, t, i) { var o = this._tilingScheme.tileXYToRectangle(e, t, i, new Cesium.Rectangle), r = this.findDirectParent(o); r && r.data && r.data.terrainData && 0 < r.data.terrainData._childTileMask && $.each(r.children, function(e, t) { if (Cesium.Rectangle.equals(t._rectangle, o)) { switch (e) { case 0: r.data.terrainData._childTileMask &= -5; break; case 1: r.data.terrainData._childTileMask &= -9; break; case 2: r.data.terrainData._childTileMask &= -2; break; case 3: r.data.terrainData._childTileMask &= -3 } return !1 } return !0 }) }, Wl.prototype.requestBaseTerrainTileGeometry = function(e, t, i, o) { return this.requestTileGeometryBuffers(e, t, i, o) }, Wl.prototype.requestElevationLayerTileGeometry = function(e, t, i, o, r) { return this.requestTileGeometryBuffers(e, t, i, o, r) }, Wl.prototype.requestTileGeometryBuffers = function(e, t, i, o, r) { var m = this, d = {}; d.requestedRectangle = this.tilingScheme.tileXYToNativeRectangle(e, t, i), d.layer = r; var n, a, p = Cesium.when.defer(), s = this.requestTileHeightBuffer(e, t, i, o, void 0, r); return void 0 === s ? void 0 : (n = this.requestTileHeightBuffer(e + 1, t, i, o, !0, r), a = this .requestTileHeightBuffer(e, t + 1, i, o, !0, r), e = this.requestTileHeightBuffer(e + 1, t + 1, i, o, !0, r), Cesium.when.all([s, n, a, e], function(e) { if (null != e[0].myReject && e[0].myReject) p.reject(); else { for (var t = m.heightMapWidth + 1, i = m.heightMapHeight + 1, o = new Float32Array( t * i), r = e[0].isFloor, n = 0; n < t; n++) for (var a = 0; a < i; a++) { var s = n, l = a, u = 0, c = (a === t - 1 && (l = 0, u = 1, r && (u = 0, l = t - 2)), n === i - 1 && (s = 0, u = 2), n * t + a), s = s * m.heightMapWidth + l; null === e[u] || null != e[u].myReject && e[u].myReject || (o[c] = e[u][s]) } null != e[3].myReject && e[3].myReject || (o[t * i - 1] = e[3][0]); var h = m.arrayToHeightmapTerrainData(o, t, i, 15); d.buffer = h, p.resolve(d) } }).otherwise(function() { p.reject() }), p) }, Wl.prototype.requestTileGeometry = function(o, r, n, a) { var s = this, l = [], u = s.tilingScheme.tileXYToNativeRectangle(o, r, n), c = (null != this._allElevationLayers && 0 < this._allElevationLayers.length && 7 < n ? $(this ._allElevationLayers).each(function(e, t) { var i; t.show ? (i = t.rectangle, s.isT_Inside_E(u, i) ? (s.setFormatMPT(!1), l.push(s .requestElevationLayerTileGeometry(o, r, n, a, t))) : (null != s .isT_Intersects_E(u, i) ? (s.setFormatMPT(!1), l.push(s .requestElevationLayerTileGeometry(o, r, n, a, t))) : s.setFormatMPT(! 0), l.push(s.requestBaseTerrainTileGeometry(o, r, n, a)))) : (s.setFormatMPT(! 0), l.push(s.requestBaseTerrainTileGeometry(o, r, n, a))) }) : (s.setFormatMPT(!0), l.push(s.requestBaseTerrainTileGeometry(o, r, n, a))), Cesium.when .defer()); return Cesium.when.all(l, function(e) { var t, i; 1 === e.length ? (void 0 !== e.layer && console.log("missing scale and offset"), c.resolve( e[0].buffer)) : 1 < e.length ? (t = $.grep(e, function(e) { return void 0 !== e.layer }), i = $.grep(e, function(e) { return void 0 === e.layer }), 0 === t.length ? c.resolve(e[0].buffer) : (e = t[t.length - 1], t = i[i.length - 1], i = { tolerance: e.layer.nullTolerance, nullValueNumber: e.layer.nullValueNumber, verticesX: e.layer.polygonVerticesX, verticesY: e.layer.polygonVerticesY, scale: Cesium.defaultValue(e.layer.scale, 1), offset: Cesium.defaultValue(e.layer.offset, 0) }, c.resolve(s.mergeBuffers(t.buffer, e.buffer, i, t.requestedRectangle)))) : c.reject() }).otherwise(function() { c.reject() }), c }, Wl.prototype.mergeBuffers = function(e, t, i, o) { o.west, o.north, o.east, o.south, o.width, o.height; for (var r, n, a, s, l = i.scale, u = i.offset, o = i.nullValueNumber, c = i.tolerance, h = void 0 !== o && void 0 !== c, m = (h && (a = Cesium.defaultValue(i.nullValueNumber, 0), s = Cesium .defaultValue(Number(i.tolerance), 0)), new Float32Array(1089)), d = 0; d < 33; d++) for (r = 0, 0; r < 33; r++, 0) m[n = 33 * d + r] = h ? !t._buffer[n] || t._buffer[n] >= a - s && t ._buffer[n] <= a + s ? e._buffer[n] : t._buffer[n] * l + u : t._buffer[n] ? t._buffer[n] * l + u : e._buffer[n]; return this.arrayToHeightmapTerrainData(m, 33, 33, 15) }, Wl.prototype.requestTileHeightBuffer = function(u, c, h, e, t, o) { if (!isNaN(u + c + h)) { var i, m, r, n, d, p, e = 0 == (e = Cesium.defined(e) && !1 !== e ? e : new Cesium.Request({ defer: !0 })).defer, g = (t = Cesium.defaultValue(e, !1), Cesium.when.defer()); if (void 0 !== o ? (o.getUrlFromSTag = function(e, t, i) { return void 0 === o.subdomains ? o.url : o.subdomains[0] + "/SG" }, i = this.getRequestElevationLayer(u, c, h).replace(this._options.url, o.getUrlFromSTag(u, c, h) + "/Elevation").replace(this._options.layerName, o.name), "mpt" === o.format && ( i = i.replace("image/png", "image/mpt"))) : (i = this.getRequestBaseTerrainUrl(u, c, h, e || t), m = Bl.terrainProvider.tilingScheme.tileXYToRectangle(u, c, h), e = Bl .terrainProvider._modifyTerrainObjects, r = Cesium.when.defer(), void 0 !== e ? (n = [], e .forEach(function(e) { e.show && null != Cesium.Rectangle.intersection(m, e.rectangle, new Cesium .Rectangle) && n.push(e) }), !(0 < n.length) || 1 === n.length && n[0].modelFloorBestLevel && h > n[0] .modelFloorBestLevel ? r.resolve("NoMerge") : (t = Ul(n, m), Cesium.when(t, function( e) { r.resolve(e) }).otherwise(function(e) { console.log(e) }))) : r.resolve("NoMerge"), d = Cesium.when.defer(), 1 === (e = $.grep([], function( e) { return 0 < e._selectedTiles.length })).length && e[0].level && h > e[0].level ? d.resolve("NoFloor") : (p = !1, e.forEach( function(e) { if (e.ready && e.show && void 0 !== e.rootFloorRectangle && void 0 !== Cesium .Rectangle.intersection(m, e.rootFloorRectangle)) { for (var t = new Uint16Array(1024), i = m.west, o = (m.south, (m.east - m .west) / 32), r = (m.north - m.south) / 32, n = 0; n < 32; n++) for (var a = 0; a < 32; a++) { var s = m.north - r * n - r / 2, s = new Cesium.Cartographic(i + o * a + o / 2, s), l = 65535, u = e.getHRMTFP(e, s, !0); 65535 !== (l = null != u && u.content && u.content._model && u .content._model.floor ? u.content._model.floor.getHeight(s .longitude, s.latitude) : l) && (l += 1.5), t[32 * n + a] = l } p = !0, d.resolve(t) } }), p || d.resolve("NoFloor")), Bl.scene.globe.ellipsoid), !1 === this._requestsCache .hasOwnProperty(i)) { if (this._requestsCache[i] = {}, this._requestsCacheKeys.push(i), 100 < this._requestsCacheKeys .length) { for (var a = 0; a < 50; a++) delete this._requestsCache[this._requestsCacheKeys[a]]; this._requestsCacheKeys.splice(0, 50) } } else { t = this._requestsCacheKeys.indexOf(i); this._requestsCacheKeys.splice(t, 1), this._requestsCacheKeys.push(i) } var _, s = this._requestsCache[i]; if (void 0 !== s.dataLoaded || (s.dataLoaded = Cesium.Resource.fetchArrayBuffer(i), Cesium.defined(s .dataLoaded))) return (_ = this)._pendingRequests++, Cesium.when(s.dataLoaded, function(e) { void 0 === s.workerFinished && (s.workerFinished = _._workerPool.queueWorkItem({ buffer: e, isElevation: void 0 !== o, level: h })), Cesium.when.all([s.workerFinished, r, d], function(e) { var t = void 0 !== e[1] && "NoMerge" !== e[1], i = void 0 !== e[2] && "NoFloor" !== e[2]; if (e[0].rejected) { for (var o = _.heightMapWidth * _.heightMapHeight, r = new Int16Array(o), n = 0; n < o; n++) r[n] = 300; return 2 < h && (r.myReject = !0), g.resolve(r), g } var a = _.extractTileHeightBuffer(e[0].buffer, u, c, h); if (_._pendingRequests--, t) for (n = 0; n < 32; n++) for (var s = 0; s < 32; s++) a[l = 32 * n + s] = e[1].mtHeight[ 0]; if (i) { for (var l, n = 0; n < 32; n++) for (s = 0; s < 32; s++) a[l = 32 * n + s] = (65535 === e[2][ l] || 10500 < e[2][l] ? a : e[2])[l]; a.isFloor = !0 } g.resolve(a) }).otherwise(function() { for (var e = _.heightMapWidth * _.heightMapHeight, t = new Int16Array( e), i = 0; i < e; i++) t[i] = 300; return 2 < h && (t.myReject = !0), g.resolve(t), g }) }).otherwise(function() { _._pendingRequests--, g.reject() }), g } }, Wl.prototype.extractTileHeightBuffer = function(e, t, i, o) { try { for (var r = this.requestFactorForLevel(o), n = t % r, a = i % r, s = new Float32Array(this .heightMapWidth * this.heightMapHeight), l = 1e6, u = -1e5, c = 0; c < this .heightMapHeight; c++) for (var h = 0; h < this.heightMapWidth; h++) { var m = c + a * this.heightMapHeight, d = h + n * this.heightMapWidth, p = c * this.heightMapWidth + h, g = m * this.heightMapWidth * r + d; e[g] > u && (u = e[g]), e[g] < l && (l = e[g]), s[p] = e[g] } } catch (e) { console.log(e.message) } return s }, Wl.prototype.arrayToHeightmapTerrainData = function(e, t, i, o) { return !1 === Cesium.defined(e) && (e = new Int16Array(t * i)), new Cesium.HeightmapTerrainData({ buffer: e, width: t, height: i, childTileMask: o }) }; function Yl(e, t, i) { var o, r, n, a, s, l = t.west * Cesium.Math.DEGREES_PER_RADIAN, u = t.east * Cesium.Math.DEGREES_PER_RADIAN, c = t.south * Cesium.Math.DEGREES_PER_RADIAN, t = t.north * Cesium.Math.DEGREES_PER_RADIAN, l = new Cesium.Rectangle(l, c, u, t), h = (o = l, n = r = 32, a = [], s = void 0 !== e[0].longitude, e.forEach(function(e) { var t = [], e = s ? e : Ql.scene.globe.ellipsoid.cartesianToCartographic(e), e = ql(e, o, r, n); t.push(e.normalizedLongitude), t.push(e.normalizedLatitude), a.push(t) }), a), c = "#FF0000", u = 32, t = 32, m = (l = void 0, (l = document.createElement("canvas")).width = u, l.height = t, l.getContext("2d")); if (!(h.length <= 0)) { m.moveTo(h[0][0], h[0][1]); for (var d = 0; d < h.length; d++) m.lineTo(h[d][0], h[d][1]); return null != c && (m.fillStyle = c, m.fill()), l } } var Ql, ql = function(e, t, i, o) { var r = t.west, n = t.east, a = t.south, t = t.north - a, s = 180 * e.longitude / Math.PI, l = 180 * e.latitude / Math.PI; return e.normalizedLongitude = (s - r) / (n - r) * i, e.normalizedLatitude = (l - a) / t * o, e }; function Jl(e, t) { if (Ql = e, !Cesium.defined(t)) throw new Cesium.DeveloperError("options is required."); this._errorEvent = new Cesium.Event, this._credit = t.credit, "string" == typeof this._credit && (this ._credit = new Cesium.Credit(this._credit)), t.heightMapWidth = Cesium.defaultValue(t .heightMapWidth, 32), t.heightMapHeight = Cesium.defaultValue(t.heightMapHeight, 32), this ._options = t, this._subdomains = t.subdomains, t.url = t.url.replace("{s}", this.sTag(0, 0, 0)), this ._firstRequest = t.url + "?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&layers=" + t.layerName + "&Styles=&Format=image/mpt", t.token && (this._firstRequest += "&token=" + t.token), this ._requestVertexNormals = Cesium.defaultValue(t.requestVertexNormals, !1); var i = this; $.ajax({ url: this._firstRequest, success: function(e) { if (!!(Cesium.defined(e.childNodes) && 0 < e.childNodes.length)) return i._isMPT = !1, i ._format = "png", null; i._isMPT = !0, i._format = "mpt" }, error: function() { return i._isMPT = !1, i._format = "png", null }, async: !1 }); this._availability = { computeMaximumLevelAtPosition: function(e) { return Math.min(16, 16) } }, this._urlTemplate = t.url + "?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers=" + t.layerName + "&Styles=&Format=image/" + this._format, t.token && (this._urlTemplate += "&token=" + t .token), this._tilingScheme = new Cesium.GeographicTilingScheme, this ._levelZeroMaximumGeometricError = Cesium.TerrainProvider .getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid, 4 * t.heightMapWidth, this._tilingScheme.getNumberOfXTilesAtLevel(0)), this._workerPool = new Jo({ workerPath: SmartEarthRootUrl + "Workers/ParseElevationWorker.js" }), this._pendingRequests = 0, this._requestGridSize = 8, this._requestsCache = {}, this ._requestsCacheKeys = [], this.errorEvent.addEventListener(function(e) {}, this) } function Xl(e) { this.resource = e.resource, this.version = e.version, this.isHeightmap = e.isHeightmap, this .tileUrlTemplates = e.tileUrlTemplates, this.availability = e.availability, this.hasVertexNormals = e .hasVertexNormals, this.hasWaterMask = e.hasWaterMask, this.hasMetadata = e.hasMetadata, this .availabilityLevels = e.availabilityLevels, this.availabilityTilesLoaded = e.availabilityTilesLoaded, this.littleEndianExtensionSize = e.littleEndianExtensionSize, this.availabilityPromiseCache = {} } function Kl(e) { this._heightmapWidth = 65, this._heightmapStructure = void 0, this._hasWaterMask = !1, this ._hasVertexNormals = !1, this._ellipsoid = e.ellipsoid, this._requestVertexNormals = Cesium .defaultValue(e.requestVertexNormals, !1), this._requestWaterMask = Cesium.defaultValue(e .requestWaterMask, !1), this._requestMetadata = Cesium.defaultValue(e.requestMetadata, !0), this ._errorEvent = new Cesium.Event; var v, C, w, t = e.credit, i = ("string" == typeof t && (t = new Cesium.Credit(t)), this._credit = t, this._availability = void 0, Cesium.when.defer()), b = (this._ready = !1, this._readyPromise = i, this._tileCredits = void 0, this), T = this._layers = [], S = "", P = [], E = 0; function x(e) { if (!e.format) return u = "The tile format is not specified in the layer.json file.", void(w = Cesium .TileProviderError.handleError(w, b, b._errorEvent, u, void 0, void 0, void 0, D)); if (!e.tiles || 0 === e.tiles.length) return u = "The layer.json file does not specify any tile URL templates.", void(w = Cesium .TileProviderError.handleError(w, b, b._errorEvent, u, void 0, void 0, void 0, D)); var t = !1, i = !1, o = !1, r = !0, n = !1; if ("heightmap-1.0" === e.format) n = !0, Cesium.defined(b._heightmapStructure) || (b ._heightmapStructure = { heightScale: .2, heightOffset: -1e3, elementsPerHeight: 1, stride: 1, elementMultiplier: 256, isBigEndian: !1, lowestEncodedHeight: 0, highestEncodedHeight: 65535 }), b._requestWaterMask = i = !0; else if (0 !== e.format.indexOf("quantized-mesh-1.")) return u = 'The tile format "' + e.format + '" is invalid or not supported.', void(w = Cesium.TileProviderError.handleError(w, b, b ._errorEvent, u, void 0, void 0, void 0, D)); var a, s = e.tiles, l = e.maxzoom; if (E = Math.max(E, l), e.projection && "EPSG:4326" !== e.projection) { if ("EPSG:3857" !== e.projection) return u = 'The projection "' + e.projection + '" is invalid or not supported.', void(w = Cesium.TileProviderError.handleError(w, b, b ._errorEvent, u, void 0, void 0, void 0, D)); b._tilingScheme = new Cesium.WebMercatorTilingScheme({ numberOfLevelZeroTilesX: 1, numberOfLevelZeroTilesY: 1, ellipsoid: b._ellipsoid }) } else b._tilingScheme = new Cesium.GeographicTilingScheme({ numberOfLevelZeroTilesX: 2, numberOfLevelZeroTilesY: 1, ellipsoid: b._ellipsoid }); if (b._levelZeroMaximumGeometricError = Cesium.TerrainProvider .getEstimatedLevelZeroGeometricErrorForAHeightmap(b._tilingScheme.ellipsoid, b._heightmapWidth, b ._tilingScheme.getNumberOfXTilesAtLevel(0)), e.scheme && "tms" !== e.scheme && "slippyMap" !== e .scheme) return u = 'The scheme "' + e.scheme + '" is invalid or not supported.', void(w = Cesium .TileProviderError.handleError(w, b, b._errorEvent, u, void 0, void 0, void 0, D)); b._scheme = e.scheme, Cesium.defined(e.extensions) && -1 !== e.extensions.indexOf("octvertexnormals") ? t = !0 : Cesium.defined(e.extensions) && -1 !== e.extensions.indexOf("vertexnormals") && (r = !( t = !0)), Cesium.defined(e.extensions) && -1 !== e.extensions.indexOf("watermask") && (i = !0), Cesium.defined(e.extensions) && -1 !== e.extensions.indexOf("metadata") && (o = !0); var u = e.metadataAvailability, c = e.available; if (Cesium.defined(c) && !Cesium.defined(u)) for (var h = new Cesium.TileAvailability(b._tilingScheme, c.length), m = 0; m < c.length; ++m) { var d = c[m], p = b._tilingScheme.getNumberOfYTilesAtLevel(m); Cesium.defined(P[m]) || (P[m] = []); for (var g = 0; g < d.length; ++g) { var _ = d[g], f = p - _.endY - 1, y = p - _.startY - 1; P[m].push([_.startX, f, _.endX, y]), h.addAvailableTileRange(m, _.startX, f, _.endX, y) } } else Cesium.defined(u) && (a = new Cesium.TileAvailability(b._tilingScheme, l), h = new Cesium .TileAvailability(b._tilingScheme, l), P[0] = [ [0, 0, 1, 0] ], h.addAvailableTileRange(0, 0, 0, 1, 0)); b._hasWaterMask = b._hasWaterMask || i, b._hasVertexNormals = b._hasVertexNormals || t, b._hasMetadata = b._hasMetadata || o, Cesium.defined(e.attribution) && (0 < S.length && (S += " "), S += e .attribution), T.push(new Xl({ resource: v, version: e.version, isHeightmap: n, tileUrlTemplates: s, availability: h, hasVertexNormals: t, hasWaterMask: i, hasMetadata: o, availabilityLevels: u, availabilityTilesLoaded: a, littleEndianExtensionSize: r })); l = e.parentUrl; if (Cesium.defined(l)) { if (!Cesium.defined(h)) return console.log( "A layer.json can't have a parentUrl if it does't have an available array."), Cesium .when.resolve(); (v = v.getDerivedResource({ url: l })).appendForwardSlash(); n = (C = v.getDerivedResource({ url: "layer.json" })).fetchJson(); return Cesium.when(n, x, I) } return Cesium.when.resolve() } function I(e) { var t = "An error occurred while accessing " + C.url + "."; w = Cesium.TileProviderError.handleError(w, b, b._errorEvent, t, void 0, void 0, void 0, D) } function o(e) { x(e).then(function() { if (!Cesium.defined(w)) { var e, t = P.length; if (0 < t) for (var i = b._availability = new Cesium.TileAvailability(b._tilingScheme, E), o = 0; o < t; ++o) for (var r = P[o], n = 0; n < r.length; ++n) { var a = r[n]; i.addAvailableTileRange(o, a[0], a[1], a[2], a[3]) } 0 < S.length && (e = new Cesium.Credit(S), Cesium.defined(b._tileCredits) ? b ._tileCredits.push(e) : b._tileCredits = [e]), b._ready = !0, b._readyPromise .resolve(!0) } }) } function r(e) { o({ extensions: ["octvertexnormals"], format: "quantized-mesh-1.0", maxzoom: 18, minzoom: 0, name: "world", projection: "EPSG:3857", scheme: "slippyMap", tilejson: "1.0", tiles: ["{z}/{x}/{y}.terrain"], version: "1.0.0" }) } function D() { Cesium.when(C.fetchJson()).then(o).otherwise(r) } Cesium.when(e.url).then(function(e) { e = Cesium.Resource.createIfNeeded(e); e.appendForwardSlash(), C = (v = e).getDerivedResource({ url: "layer.json" }), b._tileCredits = e.credits, D() }).otherwise(function(e) { i.reject(e) }) } Jl._geometricErrorFactor = 2, Object.defineProperties(Jl.prototype, { errorEvent: { get: function() { return this._errorEvent } }, availability: { get: function() { return this._availability } }, credit: { get: function() { return this._credit } }, requestVertexNormals: { get: function() { return this._requestVertexNormals } }, hasVertexNormals: { get: function() { return this._requestVertexNormals } }, tilingScheme: { get: function() { return this._tilingScheme } }, ready: { get: function() { return !0 } }, hasWaterMask: { get: function() { return !1 } }, heightMapHeight: { get: function() { return this._options.heightMapHeight } }, heightMapWidth: { get: function() { return this._options.heightMapWidth } }, pendingRequests: { get: function() { return this._pendingRequests } } }), Jl.prototype.getLevelMaximumGeometricError = function(e) { return this._levelZeroMaximumGeometricError / (1 << e) * Jl._geometricErrorFactor }, Jl.prototype.createKeyFromTile = function(e, t, i) { return e + "_" + t + "_" + i }, Jl.prototype.getTileDataAvailable = function(e, t, i) { return this._isMPT ? void 0 : i < 16 }, Jl.prototype.requestFactorForLevel = function(e) { var t = Math.log(this._requestGridSize) / Math.log(2), t = Math.min(t, e); return Math.pow(2, t) }, Jl.prototype.getRequestUrl = function(e, t, i, o) { var r = this.requestFactorForLevel(i), n = (e = (e - e % r) / r, t = (t - t % r) / r, i -= Math.log(r) / Math.log(2), this.tilingScheme .tileXYToNativeRectangle(e, t, i)), o = this.heightMapWidth * r == 256 && o ? 1 : 0; return this._urlTemplate.replace("{south}", n.south).replace("{north}", n.north).replace("{west}", n .west).replace("{east}", n.east).replace("{optimizedOnly}", o).replace("{width}", this .heightMapWidth * r).replace("{height}", this.heightMapHeight * r).replace("{s}", this.sTag(e, t, i)) }, Jl.prototype.sTag = function(e, t, i) { if (null == this._subdomains) return ""; e = (e + t + i) % this._subdomains.length; return this._subdomains[e] }, Jl.prototype.findDirectParent = function(e) { function n(e, t) { if (e._rectangle.width <= 2.1 * t.width && Cesium.Rectangle.contains(e._rectangle, Cesium.Rectangle .center(t))) return e; for (var i = e.children.length, o = 0; o < i; o++) { var r = e.children[o]; if (Cesium.Rectangle.contains(r._rectangle, Cesium.Rectangle.center(t))) return n(r, t) } return null } if (e.width == Math.PI) return null; for (var t = 0; t < Ql.scene.globe._surface._levelZeroTiles.length; t++) { var i = n(Ql.scene.globe._surface._levelZeroTiles[t], e); if (i) return i } return null }, Jl.prototype.isTileAvailable = function(e, t, i) { var o = this._tilingScheme.tileXYToRectangle(e, t, i, new Cesium.Rectangle), r = this.findDirectParent(o); if (r && r.data && r.data.terrainData) { if (!(0 < r.data.terrainData._childTileMask)) return !1; for (var n = r.children.length, a = 0; a < n; a++) { var s = r.children[a]; if (Cesium.Rectangle.equals(s._rectangle, o)) return r.data.terrainData._childTileMask & 1 << a } } return !0 }, Jl.prototype.markTileAsUnavailable = function(e, t, i) { var o = this._tilingScheme.tileXYToRectangle(e, t, i, new Cesium.Rectangle), r = this.findDirectParent(o); r && r.data && r.data.terrainData && 0 < r.data.terrainData._childTileMask && $.each(r.children, function(e, t) { if (Cesium.Rectangle.equals(t._rectangle, o)) { switch (e) { case 0: r.data.terrainData._childTileMask &= -5; break; case 1: r.data.terrainData._childTileMask &= -9; break; case 2: r.data.terrainData._childTileMask &= -2; break; case 3: r.data.terrainData._childTileMask &= -3 } return !1 } return !0 }) }, Jl.prototype.requestTileGeometry = function(h, m, d, e) { var p, t, i, g, o = this.requestTileHeightBuffer(h, m, d, e); if (void 0 !== o) return p = this, t = this.requestTileHeightBuffer(h + 1, m, d, e, !0), i = this .requestTileHeightBuffer(h, m + 1, d, e, !0), e = this.requestTileHeightBuffer(h + 1, m + 1, d, e, !0), g = Cesium.when.defer(), Cesium.when.all([o, t, i, e], function(e) { if (null != e[0].myReject && e[0].myReject) return p.markTileAsUnavailable(h, m, d), void g.reject(); for (var t = p.heightMapWidth + 1, i = p.heightMapHeight + 1, o = new Float32Array(t * i), r = 0; r < t; r++) for (var n = 0; n < i; n++) { var a = r, s = n, l = 0, u = (n === t - 1 && (s = 0, l = 1), r === i - 1 && (a = 0, l = 2), r * t + n), a = a * p.heightMapWidth + s; null === e[l] || null != e[l].myReject && e[l].myReject || (o[u] = e[l][a]) } null != e[3].myReject && e[3].myReject || (o[t * i - 1] = e[3][0]); var c = p.arrayToHeightmapTerrainData(o, t, i, 15); g.resolve(c) }).otherwise(function() { g.reject() }), g }, Jl.prototype.requestTileHeightBuffer = function(l, u, c, e, t, i) { if (!isNaN(l + u + c)) { var e = 0 == (e = Cesium.defined(e) && !1 !== e ? e : new Cesium.Request({ defer: !0 })).defer, h = (t = Cesium.defaultValue(e, !1), Cesium.when.defer()), t = this.getRequestUrl(l, u, c, e || t); if (!1 === this._requestsCache.hasOwnProperty(t)) { if (this._requestsCache[t] = {}, this._requestsCacheKeys.push(t), 100 < this._requestsCacheKeys .length) { for (var o = 0; o < 50; o++) delete this._requestsCache[this._requestsCacheKeys[o]]; this._requestsCacheKeys.splice(0, 50) } } else { var r = this._requestsCacheKeys.indexOf(t); this._requestsCacheKeys.splice(r, 1), this._requestsCacheKeys.push(t) } var n, m, d, p, a = this._requestsCache[t]; if (void 0 !== a.dataLoaded || (a.dataLoaded = e ? Cesium.RequestScheduler.request(t, Cesium .loadArrayBuffer) : Cesium.loadArrayBuffer(t), Cesium.defined(a.dataLoaded))) return n = Ql .terrainProvider.tilingScheme.tileXYToRectangle(l, u, c), r = Ql.terrainProvider ._modifyTerrainObjects, (d = m = null) != r && 0 < r.length && r.forEach(function(e) { e.show && Cesium.Rectangle.intersection(n, e.rectangle, new Cesium.Rectangle) && ( m = Yl((d = e).vertices, n, d.heights[0])) }), (p = this)._pendingRequests++, Cesium.when(a.dataLoaded, function(e) { void 0 === a.workerFinished && (a.workerFinished = p._workerPool.queueWorkItem({ buffer: e, isElevation: void 0 !== i, level: c })), Cesium.when(a.workerFinished, function(e) { if (e.rejected) { for (var t = p.heightMapWidth * p.heightMapHeight, i = new Int16Array(t), o = 0; o < t; o++) i[o] = 300; return 2 < c && (p.markTileAsUnavailable(l, u, c), i.myReject = !0), h.resolve(i), h } var r = p.extractTileHeightBuffer(e.buffer, l, u, c); if (null != m) for (var n = m.getContext("2d").getImageData(0, 0, 32, 32).data, a = 0; a < 32; a++) for (var s = 0; s < 32; s++) 0 !== n[4 * (32 * a + s)] && (r[ 32 * (31 - a) + s] = d.heights[0]); p._pendingRequests--, h.resolve(r) }) }).otherwise(function() { p._pendingRequests--, h.reject() }), h } }, Jl.prototype.extractTileHeightBuffer = function(e, t, i, o) { try { for (var r = this.requestFactorForLevel(o), n = t % r, a = i % r, s = new Float32Array(this .heightMapWidth * this.heightMapHeight), l = 1e6, u = -1e5, c = 0; c < this .heightMapHeight; c++) for (var h = 0; h < this.heightMapWidth; h++) { var m = c + a * this.heightMapHeight, d = h + n * this.heightMapWidth, p = c * this.heightMapWidth + h, g = m * this.heightMapWidth * r + d; e[g] > u && (u = e[g]), e[g] < l && (l = e[g]), s[p] = e[g] } } catch (e) { console.log(e.message) } return s }, Jl.prototype.arrayToHeightmapTerrainData = function(e, t, i, o) { return !1 === Cesium.defined(e) && (e = new Int16Array(t * i)), new Cesium.HeightmapTerrainData({ buffer: e, width: t, height: i, childTileMask: o }) }; var $l = { OCT_VERTEX_NORMALS: 1, WATER_MASK: 2, METADATA: 4 }; function Zl(e) { return Cesium.defined(e) && 0 !== e.length ? { Accept: "application/vnd.quantized-mesh;extensions=" + e.join("-") + ",application/octet-stream;q=0.9,*/*;q=0.01" } : { Accept: "application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01" } } function eu(N, B, j, z, U, e) { if (!Cesium.defined(U)) return Cesium.when.reject(new Cesium.RuntimeError("Terrain tile doesn't exist")); var t = U.tileUrlTemplates; if (0 !== t.length) { i = N._scheme && "tms" !== N._scheme ? j : N._tilingScheme.getNumberOfYTilesAtLevel(z) - j - 1; var i, o, r = [], t = (N._requestVertexNormals && U.hasVertexNormals && r.push(U.littleEndianExtensionSize ? "octvertexnormals" : "vertexnormals"), N._requestWaterMask && U.hasWaterMask && r.push( "watermask"), N._requestMetadata && U.hasMetadata && r.push("metadata"), t[(B + i + z) % t .length]), n = U.resource, r = Cesium.defined(n._ionEndpoint) && !Cesium.defined(n._ionEndpoint.externalType) ? (0 !== r .length && (o = { extensions: r.join("-") }), Zl(void 0)) : Zl(r), n = n.getDerivedResource({ url: t, templateValues: { version: U.version, z: z, x: B, y: i }, queryParameters: o, headers: r, request: e }).fetchArrayBuffer(); if (Cesium.defined(n)) return n.then(function(e) { if (Cesium.defined(N._heightmapStructure)) return h = N, u = e, c = new Uint16Array(u, 0, h._heightmapWidth * h._heightmapWidth), new Cesium.HeightmapTerrainData({ buffer: c, childTileMask: new Uint8Array(u, c.byteLength, 1)[0], waterMask: new Uint8Array(u, c.byteLength + 1, u.byteLength - c .byteLength - 1), width: h._heightmapWidth, height: h._heightmapWidth, structure: h._heightmapStructure, credits: h._tileCredits }); for (var t = N, i = e, o = z, r = B, n = j, a = U, s = a.littleEndianExtensionSize, l = 0, u = 3 * Float64Array.BYTES_PER_ELEMENT, c = 4 * Float64Array .BYTES_PER_ELEMENT, h = 3 * Uint16Array.BYTES_PER_ELEMENT, e = Uint16Array .BYTES_PER_ELEMENT, m = 3 * e, d = new DataView(i), V = new Cesium.Cartesian3(d .getFloat64(l, !0), d.getFloat64(l + 8, !0), d.getFloat64(l + 16, !0)), p = d.getFloat32(l += u, !0), g = (l += Float32Array.BYTES_PER_ELEMENT, d .getFloat32(l, !0)), k = (l += Float32Array.BYTES_PER_ELEMENT, new Cesium .BoundingSphere(new Cesium.Cartesian3(d.getFloat64(l, !0), d.getFloat64(l + 8, !0), d.getFloat64(l + 16, !0)), d.getFloat64(l + u, !0))), c = (l += c, new Cesium.Cartesian3(d.getFloat64(l, !0), d.getFloat64(l + 8, !0), d .getFloat64(l + 16, !0))), _ = d.getUint32(l += u, !0), u = (l += Uint32Array.BYTES_PER_ELEMENT, new Uint16Array(i, l, 3 * _)), h = (l += _ * h, 65536 < _ && (m = 3 * (e = Uint32Array.BYTES_PER_ELEMENT)), u.subarray(0, _)), f = u.subarray(_, 2 * _), y = u.subarray(2 * _, 3 * _), h = (Cesium .AttributeCompression.zigZagDeltaDecode(h, f, y), l % e != 0 && (l += e - l % e), d.getUint32(l, !0)), v = (l += Uint32Array.BYTES_PER_ELEMENT, Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(_, i, l, 3 * h)), C = ( l += h * m, 0), F = v.length, w = 0; w < F; ++w) { var b = v[w]; v[w] = C - b, 0 === b && ++C } var T, S, u, c, f = d.getUint32(l, !0), y = (l += Uint32Array.BYTES_PER_ELEMENT, Cesium.IndexDatatype .createTypedArrayFromArrayBuffer(_, i, l, f)), h = d.getUint32(l += f * e, !0), m = (l += Uint32Array.BYTES_PER_ELEMENT, Cesium.IndexDatatype .createTypedArrayFromArrayBuffer(_, i, l, h)), f = d.getUint32(l += h * e, !0), h = (l += Uint32Array.BYTES_PER_ELEMENT, Cesium.IndexDatatype .createTypedArrayFromArrayBuffer(_, i, l, f)), f = d.getUint32(l += f * e, !0), G = (l += Uint32Array.BYTES_PER_ELEMENT, Cesium.IndexDatatype .createTypedArrayFromArrayBuffer(_, i, l, f)); for (l += f * e; l < d.byteLength;) { var P = d.getUint8(l, !0), E = (l += Uint8Array.BYTES_PER_ELEMENT, d.getUint32(l, s)); if (l += Uint32Array.BYTES_PER_ELEMENT, P === $l.OCT_VERTEX_NORMALS && t ._requestVertexNormals) T = new Uint8Array(i, l, 2 * _); else if (P === $l.WATER_MASK && t._requestWaterMask) S = new Uint8Array(i, l, E); else if (P === $l.METADATA && t._requestMetadata) { P = d.getUint32(l, !0); if (0 < P) { var x = Cesium.getJsonFromTypedArray(new Uint8Array(i), l + Uint32Array .BYTES_PER_ELEMENT, P).available; if (Cesium.defined(x)) for (var I = 0; I < x.length; ++I) for (var D = o + I + 1, L = x[I], M = t._tilingScheme .getNumberOfYTilesAtLevel(D), A = 0; A < L.length; ++A) { var R = L[A], O = M - R.endY - 1, H = M - R.startY - 1; t.availability.addAvailableTileRange(D, R.startX, O, R.endX, H), a.availability.addAvailableTileRange(D, R.startX, O, R.endX, H) } } a.availabilityTilesLoaded.addAvailableTileRange(o, r, n, r, n) } l += E } return f = 5 * t.getLevelMaximumGeometricError(o), e = t._tilingScheme .tileXYToRectangle(r, n, o), e = Cesium.OrientedBoundingBox.fromRectangle(e, p, g, t ._tilingScheme.ellipsoid), new Cesium.QuantizedMeshTerrainData({ center: V, minimumHeight: p, maximumHeight: g, boundingSphere: k, orientedBoundingBox: e, horizonOcclusionPoint: c, quantizedVertices: u, encodedNormals: T, indices: v, westIndices: y, southIndices: m, eastIndices: h, northIndices: G, westSkirtHeight: f, southSkirtHeight: f, eastSkirtHeight: f, northSkirtHeight: f, childTileMask: t.availability.computeChildMaskForTile(o, r, n), waterMask: S, credits: t._tileCredits }) }).otherwise(function(e) { return Cesium.when.resolve(new Cesium.HeightmapTerrainData({ buffer: new Uint8Array(256), width: 16, height: 16 })) }) } } function tu(e, t, i, o) { if (0 !== o) return e = e.availabilityLevels, e = o % e == 0 ? o - e : (o / e | 0) * e, o = 1 << o - e, { level: e, x: t / o | 0, y: i / o | 0 } } function iu(e, t, i, o, r, n) { if (!Cesium.defined(r.availabilityLevels)) return { result: !1 }; for (var a, s, l, u = function() { delete r.availabilityPromiseCache[l] }, c = r.availabilityTilesLoaded, h = r.availability, m = tu(r, t, i, o); Cesium.defined(m);) { if (h.isTileAvailable(m.level, m.x, m.y) && !c.isTileAvailable(m.level, m.x, m.y)) return n || (l = m .level + "-" + m.x + "-" + m.y, s = r.availabilityPromiseCache[l], Cesium.defined(s) || (a = new Cesium.Request({ throttle: !1, throttleByServer: !0, type: Cesium.RequestType.TERRAIN }), s = eu(e, m.x, m.y, m.level, r, a), Cesium.defined(s) && (r .availabilityPromiseCache[l] = s).then(u))), { result: !0, promise: s }; m = tu(r, m.x, m.y, m.level) } return { result: !1 } } Kl.prototype.requestTileGeometry = function(e, t, i, o) { var r, n = this._layers, a = n.length; if (1 === a) r = n[0]; else for (var s = 0; s < a; ++s) { var l = n[s]; if (!Cesium.defined(l.availability) || l.availability.isTileAvailable(i, e, t)) { r = l; break } } return eu(this, e, t, i, r, o) }, Object.defineProperties(Kl.prototype, { errorEvent: { get: function() { return this._errorEvent } }, credit: { get: function() { return this._credit } }, tilingScheme: { get: function() { return this._tilingScheme } }, ready: { get: function() { return this._ready } }, readyPromise: { get: function() { return this._readyPromise.promise } }, hasWaterMask: { get: function() { return this._hasWaterMask && this._requestWaterMask } }, hasVertexNormals: { get: function() { return this._hasVertexNormals && this._requestVertexNormals } }, hasMetadata: { get: function() { return this._hasMetadata && this._requestMetadata } }, requestVertexNormals: { get: function() { return this._requestVertexNormals } }, requestWaterMask: { get: function() { return this._requestWaterMask } }, requestMetadata: { get: function() { return this._requestMetadata } }, availability: { get: function() { return this._availability } } }), Kl.prototype.getLevelMaximumGeometricError = function(e) { return this._levelZeroMaximumGeometricError / (1 << e) }, Kl.prototype.getTileDataAvailable = function(e, t, i) { if (Cesium.defined(this._availability)) { if (i > this._availability._maximumLevel) return !1; if (this._availability.isTileAvailable(i, e, t)) return !0; if (!this._hasMetadata) return !1; for (var o = this._layers, r = o.length, n = 0; n < r; ++n) if (iu(this, e, t, i, o[n], 0 === n).result) return; return !1 } }, Kl.prototype.loadTileDataAvailability = function(e, t, i) { if (!(!Cesium.defined(this._availability) || i > this._availability._maximumLevel || this._availability .isTileAvailable(i, e, t)) && this._hasMetadata) for (var o = this._layers, r = o.length, n = 0; n < r; ++n) { var a = iu(this, e, t, i, o[n], 0 === n); if (Cesium.defined(a.promise)) return a.promise } }, Kl._getAvailabilityTile = tu; const ou = new Uint8Array([172, 223, 96, 7, 210, 166, 80, 193, 62, 133, 0, 92, 97, 125, 81, 193, 175, 204, 114, 156, 24, 171, 39, 65, 215, 131, 189, 193, 92, 143, 98, 193, 172, 223, 224, 55, 148, 164, 80, 193, 62, 133, 128, 115, 254, 122, 81, 193, 175, 204, 114, 40, 74, 169, 39, 65, 199, 225, 33, 1, 165, 221, 10, 65, 165, 248, 77, 38, 221, 233, 229, 191, 118, 168, 124, 106, 57, 4, 231, 191, 208, 126, 103, 119, 149, 64, 191, 63, 9, 0, 0, 0, 254, 127, 253, 127, 254, 127, 253, 127, 0, 0, 254, 255, 255, 127, 0, 128, 0, 0, 254, 127, 253, 127, 0, 0, 254, 127, 0, 128, 0, 0, 0, 0, 253, 255, 254, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 2, 0, 5, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 2, 0, 9, 0, 7, 0, 4, 0, 9, 0, 1, 0, 5, 0, 9, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, 1, 0, 7, 0, 2, 0, 3, 0, 0, 0, 7, 0, 5, 0, 8, 0, 3, 0, 0, 0, 4, 0, 5, 0, 6, 0 ]); class ru { constructor(e = {}) { if (this.ready = !1, this.dummyTile = Eo(ou.buffer), this.tilingScheme = e.tilingScheme || new Cesium.WebMercatorTilingScheme, void 0 === e.url) throw new Error("url option is missing"); void 0 !== e.credit && (this.credits = [new Cesium.Credit(e.credit)]), this.urlTemplates = e.url, 0 !== this.urlTemplates.length && "/" === this.urlTemplates[this.urlTemplates.length - 1] || ( this.urlTemplates = this.urlTemplates + "/"), this.readyPromise = Promise.resolve(!0), this .ready = !0 } getUrl(e, t, i) { return this.urlTemplates + (i + `/${e}/${t}.terrain`) } generateDummyTileHeader(e, t, i) { var o = this.tilingScheme.tileXYToRectangle(e, t, i), e = this.tilingScheme.tileXYToNativeRectangle(e, t, i), t = Cesium.Cartographic.toCartesian(Cesium.Rectangle.center(o)), i = Cesium.Ellipsoid.WGS84.transformPositionToScaledSpace(t); return { centerX: t.x, centerY: t.y, centerZ: t.z, minHeight: 0, maxHeight: 0, boundingSphereCenterX: t.x, boundingSphereCenterY: t.y, boundingSphereCenterZ: t.z, boundingSphereRadius: e.height, horizonOcclusionPointX: i.x, horizonOcclusionPointY: i.y, horizonOcclusionPointZ: i.z } } createQuantizedMeshData(e, t, i, o) { t = this.tilingScheme.tileXYToRectangle(t, i, o), i = new Cesium.Cartesian3(e.header .boundingSphereCenterX, e.header.boundingSphereCenterY, e.header.boundingSphereCenterZ), o = new Cesium.BoundingSphere(i, e.header.boundingSphereRadius), i = new Cesium.Cartesian3(e.header .horizonOcclusionPointX, e.header.horizonOcclusionPointY, e.header.horizonOcclusionPointZ); let r; return t.width < Cesium.Math.PI_OVER_TWO + Cesium.Math.EPSILON5 && (r = Cesium.OrientedBoundingBox .fromRectangle(t, e.header.minHeight, e.header.maxHeight)), new Cesium .QuantizedMeshTerrainData({ minimumHeight: e.header.minHeight, maximumHeight: e.header.maxHeight, quantizedVertices: e.vertexData, indices: e.triangleIndices, boundingSphere: o, orientedBoundingBox: r, horizonOcclusionPoint: i, westIndices: e.westIndices, southIndices: e.southIndices, eastIndices: e.eastIndices, northIndices: e.northIndices, westSkirtHeight: 100, southSkirtHeight: 100, eastSkirtHeight: 100, northSkirtHeight: 100, childTileMask: 15, credits: this.credits }) } generateDummyTile(e, t, i) { return Object.assign({}, this.dummyTile, this.generateDummyTileHeader(e, t, i)) } decodeResponse(e, t, i, o) { return e.arrayBuffer().then(e => Eo(e)).catch(e => (console.error("Decoding failed on tile " + this .getUrl(t, i, o)), console.error(e), this.generateDummyTile(t, i, o))) } requestTileGeometry(t, i, o) { var e = this.getUrl(t, i, o); return window.fetch(e).then(e => 200 !== e.status ? this.generateDummyTile(t, i, o) : this .decodeResponse(e, t, i, o)).then(e => this.createQuantizedMeshData(e, t, i, o)).catch( e => { console.error(e) }) } getTileDataAvailable(e, t, i) { return !0 } getLevelMaximumGeometricError(e) { return Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this.tilingScheme .ellipsoid, 65, this.tilingScheme.getNumberOfXTilesAtLevel(0)) / (1 << e) } } function nu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._url = "", this._show = !0 } function au(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this.item = { show: !0 }, this._primitive = void 0, this._Provider = void 0, this.Legend = [], this.datas = [], this .PrimitiveData = [], this.PrimitiveObj = { key: "", data: {} }, this.Primitivekey = [], this.tilesLength = 0, this.returnCount = 0, this._primitiveByTile = {}, this ._tileKeys = [], this._primitiveCollection = new this._cesium.PrimitiveCollection, this._cache = !1, this._forceRefreshPrvimitive = null } nu.prototype.createTerrainLayer = function(e, t, i, o, r, n) { "Topography" == n ? this.createTerrain(e, t, i, o, r) : "sgs" == n ? this.createSFSTerrain(e, t, i, o, r) : "Arcgis" == n ? this.createArcGISTerrain(e, t, i, o, r) : "Cesium" == r && this .createCesiumTerrain(e, t, i, o) }, nu.prototype.createTerrain = function(e, t, i, o, r) { var n = { type: "default", url: "", requestVertexNormals: !1, requestWaterMask: !1, requestMetadata: !0, credit: "" }, r = (this.name = e, this.option = t, this.GroupID = i, this.checked = o, this.Description = r, this .type = "createTerrain", null); if (this._core.isUrl(t) ? (r = n).url = t : r = this._core.extend(n, t, !0), this._options = r, this ._url = r.url, !o) return a = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this; V.setVisibility(i, !1, this._viewer, this._cesium); var n = new("vector" === r.type ? Kl : Cesium.CesiumTerrainProvider)(r), a = (this._viewer.scene.terrainProvider = n, this.item = n, this._show = !0, { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, nu.prototype.createCesiumTerrain = function(e, t, i, o) { this.name = e, this.option = t, this.GroupID = i, this.checked = o, this.type = "createCesiumTerrain"; var r = this._core.extend({ requestVertexNormals: !0 }, t, !0), r = (this._options = r, Cesium.createWorldTerrain(r)); if (this.type = "Cesium", this.item = r, !o) return n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), this; V.setVisibility(i, !1, this._viewer, this._cesium), this._viewer.scene.terrainProvider = r, this ._show = !0; var n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }; return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), this }, nu.prototype.createSFSTerrain = function(e, t, i, o, r) { var n = new Wl(this._viewer, { url: t.url, layerName: t.layerName, requestVertexNormals: t.requestVertexNormals, token: t.token, cacheUrl: t.cacheUrl, cacheLevel: t.cacheLevel }); if (this.name = e, this.option = t, this.GroupID = i, this.checked = o, this.Description = r, this .type = "createSFSTerrain", this.type = "SGS", this._url = t.url, this.layerName = t.layerName, this .requestVertexNormals = t.requestVertexNormals, !o) return this._show = !0, a = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this; V.setVisibility(i, !1, this._viewer, this._cesium), this._viewer.terrainProvider = n, this.item = n, this._show = !0; var a = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, nu.prototype.createSFSTerrain71 = function(e, t, i, o, r) { var n = new Jl(this._viewer, { url: t.url, layerName: t.layerName }); if (this.name = e, this.option = t, this.GroupID = i, this.checked = o, this.Description = r, this .type = "createSFSTerrain", this.type = "SGS71", this._url = t.url, this.layerName = t.layerName, this.requestVertexNormals = t.requestVertexNormals, !o) return this._show = !0, a = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this; V.setVisibility(i, !1, this._viewer, this._cesium), this._viewer.terrainProvider = n, this.item = n, this._show = !0; var a = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, nu.prototype.createWMTSTerrain = function(e, t, i, o, r) { var n = new ru({ url: t.url }); if (this._viewer.scene.mode = this._cesium.SceneMode.COLUMBUS_VIEW, this.name = e, this.option = t, this .GroupID = i, this.checked = void 0 === o || o, this.Description = r, this.type = "createWMTSTerrain", this.type = "WMTSTerrain", this._url = t.url, this.layerName = t.layerName, this.requestVertexNormals = t.requestVertexNormals, !this.checked) return this._show = !0, a = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this; V.setVisibility(i, !1, this._viewer, this._cesium), this._viewer.terrainProvider = n, this.item = n, this._show = !0; var a = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, nu.prototype.createArcGISTerrain = function(e, t, i, o, r) { var n = { url: "" }, r = (this.name = e, this.option = t, this.GroupID = i, this.checked = o, this.Description = r, this .type = "createArcGISTerrain", null), n = (this._core.isUrl(t) ? (r = n).url = t : r = this._core.extend(n, t, !0), this.type = "ArcGIS", this._url = r.url, new this._cesium.ArcGISTiledElevationTerrainProvider(r)); if (!o) return this._show = !0, a = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this; V.setVisibility(i, !1, this._viewer, this._cesium), this._viewer.terrainProvider = n, this.item = n, this._show = !0; var a = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, nu.prototype.getType = function() { return { label: "影像", value: "TerrainProvider" } }, nu.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.item._layers[0].resource.url; return { type: "TerrainLayer", treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, url: t } } }, nu.prototype.setVisibility = function(e) { var t, i; e ? (V.setVisibility(this.GroupID, !1, this._viewer, this._cesium), i = "SGS" === this.type ? (t = this .option, new Wl(this._viewer, { url: t.url, layerName: t.layerName, requestVertexNormals: t.requestVertexNormals, token: t.token, cacheUrl: t.cacheUrl, cacheLevel: t.cacheLevel })) : "SGS71" === this.type ? (t = this.option, new Jl(this._viewer, { url: t.url, layerName: t.layerName, requestVertexNormals: t.requestVertexNormals, token: t.token, cacheUrl: t.cacheUrl, cacheLevel: t.cacheLevel })) : "ArcGIS" === this.type ? (t = this.option, new Cesium.ArcGISTiledElevationTerrainProvider( t)) : "Cesium" === this.type ? Cesium.createWorldTerrain(this._options) : (e = this ._options, i = { url: "", requestVertexNormals: !1, requestWaterMask: !1, requestMetadata: !0, credit: "" }, this._core.isUrl(e) ? (t = i).url = e : t = this._core.extend(i, e, !0), new this._cesium .CesiumTerrainProvider(t)), this._show = !0, this.item = i) : (i = new this._cesium .EllipsoidTerrainProvider({}), this.item = i, this._show = !1), this._viewer.scene .terrainProvider = i }, nu.prototype.getVisibility = function() { return this._show }, nu.prototype.setTreeobj = function(e) { this.treeobj = e }, nu.prototype.deleteObject = function() { try { this.item = new this._cesium.EllipsoidTerrainProvider({}), this._viewer.scene.terrainProvider = this .item } catch (e) { console.log(e.message) } }, Object.defineProperties(nu.prototype, {}), au.prototype.createVolumeVectorGeoJsonFeatureLayer = function( o, r, e, a, s, t, i) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED }, l = (this._core.isnull(e) || this._core.isnull(e.material) || "[" == e.material.toString().charAt( 0) && "]" == e.material.toString().charAt(e.material.length - 1) || (this._core.isHtmlColor(e .material) ? e.material = this._color.colorFromHtmlColor(e.material) : (/^rgb/.test(e .material) && (e.material = this._color.rgbaStringToRgbaObj(e.material)), 1 < e .material.r && (e.material.r = e.material.r / 255), 1 < e.material.g && (e.material.g = e.material.g / 255), 1 < e.material.b && (e.material.b = e.material.b / 255), 1 < e .material.a && (e.material.a = e.material.a / 255), e.material = this._color .createColor(e.material.r, e.material.g, e.material.b, e.material.a))), this._core.extend(n, e, !0)), u = (this._core.isnull(a) && (a = 16), this._core.isnull(s) && (s = 14), null == r && console.log( "url is required"), null == o && console.log("layername is required"), []), c = this, n = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = styleOption .level_max - 1, this._Provider.loadTile = function(e, t) { if ((this.tile = t).state === c._cesium.QuadtreeTileLoadState.START) if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= s && t.level < a) { var i = y.filter(u, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != i.length && i[0].data && 0 < i[0].data.length) return t.data .geometryPrimitive = new c._cesium.Primitive({ geometryInstances: i[0].data, appearance: new c._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: c._cesium.ShadowMode.ENABLED }), t.state = c._cesium.QuadtreeTileLoadState.LOADING, void(t.state === c ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t .data.geometryPrimitive.update(e, []), t.state = c._cesium .QuadtreeTileLoadState.DONE, t.renderable = !0)); u.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), n = t, c._core.xhr({ url: r + "?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=" + o + "&STYLE=&TILEMATRIX=EPSG:4490:" + n.level + "&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL=" + n.x + "&TILEROW=" + n.y, type: "get", dataType: "json", success: function(e) { var t = []; for (var i = 0; i < e.features.length; i++) { var o = [], r = (! function e(t) { for (var i = 0; i < t.length; i++) Array .isArray(t[i]) ? e(t[i]) : o.push(t[i]) }(e.features[i].geometry.coordinates[0]), c._cesium .Cartesian3.fromDegreesArray(o)), r = (l.positions = r, new c._cesium.GeometryInstance({ geometry: new c._cesium .PolylineVolumeGeometry({ polylinePositions: l.positions }), attributes: { color: new c._cesium .ColorGeometryInstanceAttribute .fromColor(Cesium.Color.WHITE) } })); t.push(r) } y.filter(u, function(e) { return e.x == n.x && e.y == n.y })[0].data = t, n.data.geometryPrimitive = new c._cesium .Primitive({ geometryInstances: t, appearance: new c._cesium .PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: c._cesium.ShadowMode.ENABLED }) }, error: function() { u = y.remove(u, function(e) { return e.x == n.x && e.y == n.y && e.level == n .level }) }, complete: function() { n.state = c._cesium.QuadtreeTileLoadState.LOADING, n.state === c ._cesium.QuadtreeTileLoadState.LOADING && (n.data .geometryPrimitive && n.data.geometryPrimitive.update(e, []), n.state = c._cesium.QuadtreeTileLoadState.DONE, n.renderable = !0) } }) } else t.state = c._cesium.QuadtreeTileLoadState.LOADING, t.state === c._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data .geometryPrimitive.update(e, []), t.state = c._cesium.QuadtreeTileLoadState .DONE, t.renderable = !0); var n }, this._primitive = new c._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene); n.primitives.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this._primitive) }, au.prototype.createVolumeGeoJsonFeatureLayer1 = function(e, t, n, i, a) { var s = { polylinePositions: void 0, shapePositions: void 0, ellipsoid: this._cesium.Ellipsoid.WGS84, granularity: this._cesium.Math.RADIANS_PER_DEGREE, vertexFormat: this._cesium.VertexFormat.DEFAULT, cornerType: this._cesium.CornerType.ROUNDED }, o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), l = this, u = [], t = (s.shapePositions = this.computeCircle(n.radius), o.then(function(e) { for (var t = l._cesium.Color.WHITE, i = (l._core.isnull(n) || l._core.isnull(n .material) || (t = "[" == n.material.toString().charAt(0) && "]" == n .material.toString().charAt(n.material.length - 1) ? n.material.replace( /\[/, "").replace("/]/", "") : y.clone(n.material), t = l._core .isHtmlColor(t) ? l._color.colorFromHtmlColor(n.material) : (1 < (t = /^rgb/.test(t) ? l._color.rgbaStringToRgbaObj(t) : t).r && (t .r = t.r / 255), 1 < t.g && (t.g = t.g / 255), 1 < t.b && (t.b = t.b / 255), 1 < t.a && (t.a = t.a / 255), l._color.createColor(t .r, t.g, t.b, t.a))), e.entities.values), o = 0; o < i.length; o++) { var r = i[o], r = (s.polylinePositions = r.polyline.positions._value, new l._cesium .PolylineVolumeGeometry(s)), r = l._cesium.PolylineVolumeGeometry.createGeometry(r), r = new l._cesium.GeometryInstance({ geometry: r }); u.push(r) } e = "material:" + 255 * t.red + "," + 255 * t.green + "," + 255 * t.blue, l.Legend.push( e), e = l._viewer.scene.primitives.add(new l._cesium.Primitive({ geometryInstances: u, appearance: new l._cesium.MaterialAppearance({ material: new l._cesium.Material({ fabric: { type: "Color", uniforms: { color: t } } }), faceForward: !0, flat: !1 }) })); l.item = e, 0 == n.show && (e.show = !1), "function" == typeof a && a(e) }), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建管状图层" + n.id), { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: geoOptions.url, style: n }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), this }, au.prototype.computeCircle = function(e) { this._core.isnull(e) && (e = 4); for (var t = [], i = 0; i < 360; i++) { var o = this._cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, au.prototype.createVolumeGeoJsonFeatureLayerProvider1 = function(e, t, c, i, o, r) { var h = this, n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.RECEIVE_ONLY }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, m = (this._core.isnull(c) || this._core.isnull(c.material) || "[" == c.material.toString().charAt( 0) && "]" == c.material.toString().charAt(c.material.length - 1) || (this._core.isHtmlColor(c .material) ? c.material = this._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c .material) && (c.material = this._color.rgbaStringToRgbaObj(c.material)), 1 < c .material.r && (c.material.r = c.material.r / 255), 1 < c.material.g && (c.material.g = c.material.g / 255), 1 < c.material.b && (c.material.b = c.material.b / 255), 1 < c .material.a && (c.material.a = c.material.a / 255), c.material = this._color .createColor(c.material.r, c.material.g, c.material.b, c.material.a))), this._core.extend(n, c, !0)), n = new v(this._viewer, this._cesium, a), d = (this._Provider = n, this), a = (n._loadTile = function(e) { var u = new d._cesium.PrimitiveCollection; return d.Legend = [], e.features.forEach(function(e) { var t = []; /^\[/.test(c.material) && /\]$/.test(c.material) && (s = c.material.replace( /\[/, "").replace(/\]/, ""), m.material = e.properties[s], h._core .isHtmlColor(m.material) ? m.material = h._color.colorFromHtmlColor(m .material) : (/^rgb/.test(m.material) && (m.material = h._color .rgbaStringToRgbaObj(m.material)), 1 < m.material.r && (m .material.r = m.material.r / 255), 1 < m.material.g && (m .material.g = m.material.g / 255), 1 < m.material.b && (m .material.b = m.material.b / 255), 1 < m.material.a && (m .material.a = m.material.a / 255), m.material = h._color .createColor(m.material.r, m.material.g, m.material.b, m.material.a) )); for (var i = 0; i < e.geometry.coordinates.length; i++) { var o = e.geometry.coordinates[i]; if (0 < o.length) if (Array.isArray(o[0])) for (var r = 0; r < o.length; r++) { var n = o[r], n = d._cesium.Cartesian3.fromDegrees(n[0], n[1], m.height); t.push(n) } else { var a = d._cesium.Cartesian3.fromDegrees(o[0], o[1], m.height); t.push(a) } } m.position = t, e.positions = t, "0" == m.slttype || 0 == m.slttype ? m.shape = d._core.computeCircle(m.radius) : "1" == m.slttype || 1 == m.slttype ? m .shape = d._core.starPositions(m.number, m.exradius, m.inradius) : "2" != m .slttype && 2 != m.slttype || (s = m.orth_width / 2, l = m.orth_height / 2, m.shape = [new d._cesium.Cartesian2(-s, -l), new d._cesium.Cartesian2(s, -l), new d._cesium.Cartesian2(s, l), new d._cesium.Cartesian2(- s, l)]); var s = { polylinePositions: m.position, shapePositions: m.shape, cornerType: m.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }, l = new d._cesium.PolylineVolumeGeometry(s), s = new d._cesium.GeometryInstance({ id: e, geometry: l, attributes: { color: new d._cesium.ColorGeometryInstanceAttribute.fromColor(m .material) } }), l = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m.material.blue, l = (d.Legend.push(l), new d._cesium.Primitive({ allowPicking: !0, appearance: new d._cesium.MaterialAppearance({ material: new d._cesium.Material({ fabric: { type: "Color", uniforms: { color: m.material } } }), faceForward: !0, flat: !1 }), shadows: m.shadows, geometryInstances: s })); u.add(l) }), u }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this ._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: m.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: t.url, style: c }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, au.prototype.createVolumeGeoJsonFeatureLayerProvider = function(e, t, w, i, o, r) { var n = this, a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.RECEIVE_ONLY, radiusScale: 1 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4490") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4490"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, Cesium: this._cesium }, b = (this._core.isnull(w) || this._core.isnull(w.material) || "[" == w.material.toString().charAt( 0) && "]" == w.material.toString().charAt(w.material.length - 1) || (this._core.isHtmlColor(w .material) ? w.material = this._color.colorFromHtmlColor(w.material) : (/^rgb/.test(w .material) && (w.material = this._color.rgbaStringToRgbaObj(w.material)), 1 < w .material.r && (w.material.r = w.material.r / 255), 1 < w.material.g && (w.material.g = w.material.g / 255), 1 < w.material.b && (w.material.b = w.material.b / 255), 1 < w .material.a && (w.material.a = w.material.a / 255), w.material = this._color .createColor(w.material.r, w.material.g, w.material.b, w.material.a))), this._core.extend(a, w, !0)), a = ("string" == typeof b.radius && -1 < b.radius.indexOf("[") && -1 < b.radius.indexOf("]") ? (b .radius = b.radius.replace("[", ""), b.radius = b.radius.replace("]", ""), b.shape = void 0 ) : "0" == b.slttype || 0 == b.slttype ? (b.shape = this._core.computeCircle(b.radius), l = b.radius / 2, u = b.radius / 2, b.shape1 = [new this._cesium.Cartesian2(-l, -u), new this ._cesium.Cartesian2(l, -u), new this._cesium.Cartesian2(l, u), new this._cesium .Cartesian2(-l, u) ]) : "1" == b.slttype || 1 == b.slttype ? b.shape = this._core.starPositions(b.number, b .exradius, b.inradius) : "2" != b.slttype && 2 != b.slttype || (l = b.orth_width / 2, u = b .orth_height / 2, b.shape = [new this._cesium.Cartesian2(-l, -u), new this._cesium .Cartesian2(l, -u), new this._cesium.Cartesian2(l, u), new this._cesium.Cartesian2(-l, u) ]), this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), this._Provider = new T( this._viewer, this._cesium), this._Provider._normalTile = w.level_max - 1, this._Provider ._minimumHeight = parseFloat(w.height || 0), this.item.show = o, this._Provider.loadTile = function(e, t) { var y = e, v = t, C = n; if (v.state === Cesium.QuadtreeTileLoadState.START) { if (v.data = { lines: [], geometryPrimitive: void 0 }, 0 === C.item.show || !1 === C.item.show || "" === C.item.show || void 0 === C .item.show) return void(v.state = Cesium.QuadtreeTileLoadState.DONE, v .renderable = !0); if (!(v.level >= w.level_min && v.level < w.level_max && C.item.show)) return void(v .state = Cesium.QuadtreeTileLoadState.DONE, v.renderable = !0); e = C._urlTemplate.replace(window.encodeURIComponent("{x}"), v.x).replace(window .encodeURIComponent("{y}"), v.y).replace(window.encodeURIComponent("{z}"), v .level); C._cache && (e += "&" + C._core.getuid()), C._core.xhr({ url: e, type: "get", dataType: "json", success: function(t) { if (null == t) return v.state = Cesium.QuadtreeTileLoadState.DONE, void(v.renderable = !0); if (!b.shape && "string" == typeof b.radius && 0 < t.features .length) { let e; t.features[0] && t.features[0].properties[b.radius] ? (e = t .features[0].properties[b.radius]).indexOf && (-1 < e .indexOf("*") || -1 < e.indexOf("x") || -1 < e.indexOf( "X")) ? (-1 < e.indexOf("*") ? e = e.split("*") : - 1 < e.indexOf("X") ? e = e.split("X") : -1 < e.indexOf( "x") && (e = e.split("x")), _ = parseFloat(e[0]) * b .radiusScale, f = parseFloat(e[1]) * b.radiusScale, b .shape = [new C._cesium.Cartesian2(-_, -f), new C ._cesium.Cartesian2(_, -f), new C._cesium .Cartesian2(_, f), new C._cesium.Cartesian2(-_, f) ]) : b.shape = C._core.computeCircle(e * b .radiusScale) : b.shape = C._core.computeCircle(.5) } C.Legend = []; for (var e = [], i = 0; i < t.features.length; i++) { for (var o = t.features[i], r = (/^\[/.test(w.material) && /\]$/ .test(w.material) && (p = w.material.replace(/\[/, "").replace(/\]/, ""), b.material = o .properties[p], C._core.isHtmlColor(b .material) ? b.material = C._color .colorFromHtmlColor(b.material) : (/^rgb/.test(b .material) && (b.material = C._color .rgbaStringToRgbaObj(b.material)), 1 < b .material.r && (b.material.r = b.material .r / 255), 1 < b.material.g && (b .material.g = b.material.g / 255), 1 < b .material.b && (b.material.b = b.material .b / 255), 1 < b.material.a && (b .material.a = b.material.a / 255), b .material = C._color.createColor(b.material .r, b.material.g, b.material.b, b .material.a))), []), n = [], a = parseFloat(w.height || 0), s = 0; s < o.geometry .coordinates.length; s++) { var l = o.geometry.coordinates[s]; if (0 < l.length) if (Array.isArray(l[0])) for (var u = 0; u < l.length; u++) { var c = l[u], a = a < (c[2] || 0) ? c[2] || 0 : a, c = C._cesium.Cartesian3.fromDegrees(c[0], c[1], b.height); r.push(c), n.push(b.material) } else { a = a < (l[2] || 0) ? l[2] || 0 : a; var h = C._cesium.Cartesian3.fromDegrees(l[0], l[1], b.height); r.push(h), n.push(b.material) } } v._minimumHeight = a, b.position = r, o.positions = r; var m, d = "", p = "", g = (p = "0" != b.slttype && 0 != b.slttype || v.level >= parseFloat(w.level_max) - 8 && 19 < parseFloat(w .level_max) || v.level >= parseFloat(w.level_max) - 4 && 16 < parseFloat(w.level_max) || v.level >= parseFloat(w.level_max) - 4 ? (d = b.shape, m = { polylinePositions: b.position, shapePositions: d, cornerType: b.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }, new C._cesium.PolylineVolumeGeometry(m)) : (d = "", m = { positions: b.position, width: 1, vertexFormat: C._cesium.PolylineColorAppearance .VERTEX_FORMAT, colors: n }, new C._cesium.PolylineGeometry(m)), new C._cesium .GeometryInstance({ id: o, geometry: p, attributes: { color: new C._cesium .ColorGeometryInstanceAttribute .fromColor(b.material) } })); "" == d && (g = new C._cesium.GeometryInstance({ id: o, geometry: p })), e.push(g) } var _ = "material:" + 255 * b.material.red + "," + 255 * b.material .green + "," + 255 * b.material.blue, f = (C.Legend.push(_), 0 == e.length && (v.state = Cesium .QuadtreeTileLoadState.DONE, v.renderable = !0), null), f = "" == d ? new C._cesium.Primitive({ appearance: new C._cesium.PolylineColorAppearance, geometryInstances: e }) : new C._cesium.Primitive({ allowPicking: !0, appearance: new C._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: C._core.Shaders( "vertexShaderSource"), fragmentShaderSource: C._core.Shaders( "fragmentShaderSource") }), shadows: b.shadows, geometryInstances: e }); v.data.geometryPrimitive = f, v.state = Cesium.QuadtreeTileLoadState .LOADING, v.state === Cesium.QuadtreeTileLoadState.LOADING && (v .data.geometryPrimitive.update(y, []), v.state = Cesium .QuadtreeTileLoadState.DONE, v.renderable = !0) }, error: function() { null == v.count && (v.count = 0), v.count += 1, 2 <= v.count ? (v .state = Cesium.QuadtreeTileLoadState.DONE, v.renderable = ! 0) : v.state = Cesium.QuadtreeTileLoadState.START } }), v.state = Cesium.QuadtreeTileLoadState.LOADING } }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), l = a.primitives, u = (w && w.time && (this._Provider._availability = new n._cesium.TimeIntervalCollection([new n ._cesium.TimeInterval({ start: w.time.start ? n._cesium.JulianDate.fromDate(new Date(w.time .start)) : n._cesium.Iso8601.MINIMUM_VALUE, stop: w.time.end ? n._cesium.JulianDate.fromDate(new Date(w.time.end)) : n ._cesium.Iso8601.MAXIMUM_VALUE }) ]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), l.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(b.id) && (b.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + b.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: b.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: t.url, style: w }); return this.setTreeobj(u), this._tree.insertGroupId(u, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }; var su = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; function lu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this.item = { show: !0 }, this._option = void 0, this._primitive = void 0, this._Provider = void 0, this.Legend = [], this .datas = [], this.PrimitiveData = [], this.PrimitiveObj = { key: "", data: {} }, this.Primitivekey = [], this.tilesLength = 0, this.returnCount = 0, this._cache = !1, this ._forceRefreshPrvimitive = null } au.prototype._serialize = function(e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : su(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))): i .push(o(t) + "=" + o(e[t])) } return i.join("&") }, au.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization = function(e, t, h, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.RECEIVE_ONLY }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, m = (this._core.isnull(h) || this._core.isnull(h.material) || "[" == h.material.toString().charAt( 0) && "]" == h.material.toString().charAt(h.material.length - 1) || (this._core.isHtmlColor(h .material) ? h.material = this._color.colorFromHtmlColor(h.material) : (/^rgb/.test(h .material) && (h.material = this._color.rgbaStringToRgbaObj(h.material)), 1 < h .material.r && (h.material.r = h.material.r / 255), 1 < h.material.g && (h.material.g = h.material.g / 255), 1 < h.material.b && (h.material.b = h.material.b / 255), 1 < h .material.a && (h.material.a = h.material.a / 255), h.material = this._color .createColor(h.material.r, h.material.g, h.material.b, h.material.a))), this), d = this._core.extend(n, h, !0), s = ("0" == d.slttype || 0 == d.slttype ? d.shape = m._core.computeCircle(d.radius) : "1" == d .slttype || 1 == d.slttype ? d.shape = m._core.starPositions(d.number, d.exradius, d.inradius) : "2" != d.slttype && 2 != d.slttype || (n = d.orth_width / 2, l = d.orth_height / 2, d.shape = [ new m._cesium.Cartesian2(-n, -l), new m._cesium.Cartesian2(n, -l), new m._cesium .Cartesian2(n, l), new m._cesium.Cartesian2(-n, l) ]), null == t && console.log("geoOptions is required"), null == e && console.log( "layername is required"), []), n = (this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this ._viewer, this._cesium), this._Provider._normalTile = h.level_max - 1, this._Provider .loadTile = function(e, t) { var c, i, o; this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && m .item.show && (c = "z" + t.level + "x" + t.x + "y" + t.y, t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= h.level_min && t.level < h.level_max && m.item.show ? m.Primitivekey .includes(c) || (i = t, o = m._urlTemplate.replace(window.encodeURIComponent("{x}"), i.x).replace(window.encodeURIComponent("{y}"), i.y).replace(window .encodeURIComponent("{z}"), i.level), m.tilesLength++, m._cache && (o += "&" + m._core.getuid()), m._core.xhr({ url: o, type: "get", dataType: "json", success: function(e) { var i = [], o = new m._cesium.PrimitiveCollection; function r(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? r( e[t]) : s.push(e[t]) } function t() { /^\[/.test(h.material) && /\]$/.test(h.material) && (e = h .material.replace(/\[/, "").replace(/\]/, ""), d .material = l.properties[e], m._core.isHtmlColor(d .material) ? d.material = m._color .colorFromHtmlColor(d.material) : (/^rgb/.test(d .material) && (d.material = m._color .rgbaStringToRgbaObj(d.material)), 1 < d .material.r && (d.material.r = d.material.r / 255), 1 < d.material.g && (d.material.g = d .material.g / 255), 1 < d.material.b && (d .material.b = d.material.b / 255), 1 < d .material.a && (d.material.a = d.material.a / 255), d.material = m._color.createColor(d .material.r, d.material.g, d.material.b, d .material.a))); var e = m._cesium.Cartesian3.fromDegreesArray(s), e = (d.position = e, l.positions = e, { polylinePositions: d.position, shapePositions: d.shape, cornerType: d.cornerType }), e = new m._cesium.PolylineVolumeGeometry(e), e = new m._cesium.GeometryInstance({ id: l, geometry: e, attributes: { color: new m._cesium .ColorGeometryInstanceAttribute .fromColor(d.material) } }), t = "material:" + 255 * d.material.red + "," + 255 * d .material.green + "," + 255 * d.material.blue, t = (m.Legend.push(t), i.push(e), new m._cesium .Primitive({ allowPicking: !0, appearance: new m._cesium .MaterialAppearance({ material: new m._cesium .Material({ fabric: { type: "Color", uniforms: { color: d .material } } }), faceForward: !0, flat: !1 }), shadows: d.shadows, geometryInstances: e })); o.add(t) } m.Legend = []; for (var n, a = 0; a < e.features.length; a++) { var s = [], l = e.features[a]; if (Array.isArray(l.geometry.coordinates) && 0 < l.geometry .coordinates.length) if (Array.isArray(l.geometry.coordinates[0][0])) for (var u = 0; u < l.geometry.coordinates .length; u++) s = [], l.geometry.coordinates[u] .pop(), r(l.geometry.coordinates[u]), 2 < s .length && t(); else r(l.geometry.coordinates), 2 < s.length && t() } 0 < i.length && (m.PrimitiveObj.data = o, m.PrimitiveObj.key = m .Primitivekey[m.returnCount], n = { key: m.Primitivekey[m.returnCount], data: o }, m.PrimitiveData.push(n), m._primitiveCollection.add( o), m._viewer.scene.primitives.add(o), m.datas.push( o), m.returnCount++, m._primitiveByTile[c] = o) }, error: function() { s = y.remove(s, function(e) { return e.x == i.x && e.y == i.y && e.level == i .level }) }, complete: function(e, t) { i.state = m._cesium.QuadtreeTileLoadState.LOADING, i.state === m ._cesium.QuadtreeTileLoadState.LOADING && (i.data .geometryPrimitive && (i.state = m._cesium .QuadtreeTileLoadState.DONE), i.renderable = !0) } })) : (t.state = m._cesium.QuadtreeTileLoadState.LOADING, t.state === m._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = m ._cesium.QuadtreeTileLoadState.DONE), t.renderable = !0))) }, this._primitive = new m._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene), l = (n.primitives.add(this._primitive), n.primitivesQuadTrees && n.primitivesQuadTrees.push(this ._primitive), o || this.setVisibility(!1), this._core.isnull(d.id) && (d.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + d.id), this.west = t.minx, this.south = t .miny, this.east = t.maxx, this.north = t.maxy, { id: d.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: h }); this.setTreeobj(l), this._tree.insertGroupId(l, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, au.prototype.setTreeobj = function(e) { this.treeobj = e }, au.prototype._removeObsoletePrimitives = function(e, t) { var i, o = []; for (i in 0 < t.length && (o = t), e) o.includes(i) || this._primitiveCollection.remove(e[i]) && delete e[i] }, au.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, au.prototype.deleteObject = function() { this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) {} }, au.prototype.getLegend = function() { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, au.prototype.setRefresh = function(e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) {} }, au.prototype.setVisibility = function(e) { this.item.show = e, this._Provider && this._Provider.setStatus(e) }, au.prototype.isCache = function(e) { this._cache = e }, au.prototype.edit = function(e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider .edit(e, t) }, au.prototype.forceRefresh = function() { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) this._Provider.quadtree ._levelZeroTiles[e].freeResources() } catch (e) {} }; var uu = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; function cu(e, t) { this._viewer = e, this._cesium = t, this.SkyBoxFS = "uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n", this.SkyBoxVS = "attribute vec3 position;\nuniform mat3 u_rotateMatrix;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n" } function hu(e, t) { this._viewer = e, this._cesium = t, this._core = new f } lu.prototype._serialize = function(e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : uu(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))): i .push(o(t) + "=" + o(e[t])) } return i.join("&") }, lu.prototype.createVolumeVectorGeoJsonFeatureLayer = function(e, t, o, i, r, n) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, u = (this._core.isnull(o) || this._core.isnull(o.material) || "[" == o.material.toString().charAt( 0) && "]" == o.material.toString().charAt(o.material.length - 1) || (this._core.isHtmlColor(o .material) ? o.material = this._color.colorFromHtmlColor(o.material) : (/^rgb/.test(o .material) && (o.material = this._color.rgbaStringToRgbaObj(o.material)), 1 < o .material.r && (o.material.r = o.material.r / 255), 1 < o.material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o .material.a && (o.material.a = o.material.a / 255), o.material = this._color .createColor(o.material.r, o.material.g, o.material.b, o.material.a))), this._option = this ._core.extend(a, o, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), c = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, h = this; this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider.loadTile = function( i, t) { if ((this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && h.item.show) if (t.level, t.x, t.y, t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= o.level_min && t.level < o.level_max && h.item.show) { var e = y.filter(u, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != e.length && e[0].data && 0 < e[0].data.length) return t.data .geometryPrimitive = new h._cesium.Primitive({ geometryInstances: e[0].data, appearance: new h._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: h._cesium.ShadowMode.ENABLED }), t.state = h._cesium.QuadtreeTileLoadState.LOADING, void(t.state === h ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t .data.geometryPrimitive.update(), t.state = h._cesium .QuadtreeTileLoadState.DONE, t.renderable = !0)); u.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), l = t, e = h._urlTemplate.replace(window.encodeURIComponent("{x}"), l.x) .replace(window.encodeURIComponent("{y}"), l.y).replace(window.encodeURIComponent( "{z}"), l.level), h._cache && (e += "&" + h._core.getuid()), h._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o(e[ t]) : n.push(e[t]) } function t() { /^\[/.test(h._option.extrudedHeight) && /\]$/.test(h._option .extrudedHeight) ? (e = h._option.extrudedHeight .replace(/\[/, "").replace(/\]/, ""), c.extrudedHeight = parseFloat(a.properties[e])) : c.extrudedHeight = parseFloat(h._option.extrudedHeight), c.material = h._option .material, /^\[/.test(h._option.material) && /\]$/.test(h ._option.material) ? (e = h._option.material.replace( /\[/, "").replace(/\]/, ""), c.material = a .properties[e], h._core.isHtmlColor(c.material) ? c .material = h._color.colorFromHtmlColor(c.material) : ( /^rgb/.test(c.material) && (c.material = h._color .rgbaStringToRgbaObj(c.material)), 1 < c .material.red && (c.material.red = c.material.red / 255), 1 < c.material.green && (c.material .green = c.material.green / 255), 1 < c.material .blue && (c.material.blue = c.material.blue / 255), 1 < c.material.alpha && (c.material.a = c.material .alpha / 255), c.material = h._color .createColor(c.material.red, c.material.green, c .material.blue, c.material.alpha))) : (h._option .material && (c.material = h._option.material), c .material && (h._core.isHtmlColor(c.material) ? c .material = h._color.colorFromHtmlColor(c .material) : (/^rgb/.test(c.material) && (c .material = h._color.rgbaStringToRgbaObj(c .material)), 1 < c.material.red && (c .material.red = c.material.red / 255), 1 < c .material.green && (c.material.green = c .material.green / 255), 1 < c.material .blue && (c.material.blue = c.material.blue / 255), 1 < c.material.alpha && (c.material .a = c.material.alpha / 255), c.material = h ._color.createColor(c.material.red, c.material .green, c.material.blue, c.material.alpha))) ); var e = h._cesium.Cartesian3.fromDegreesArray(n), e = (c.polygonHierarchy = new h._cesium.PolygonHierarchy(e), new h._cesium.PolygonGeometry(c)), e = h._cesium.PolygonGeometry.createGeometry(e), e = new h._cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new h._cesium .ColorGeometryInstanceAttribute.fromColor(c .material) } }), t = "material:" + 255 * c.material.red + "," + 255 * c .material.green + "," + 255 * c.material.blue; h.Legend.push(t), i.push(e) } h.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry .coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++) n = [], a.geometry.coordinates[s].pop(), o(a .geometry.coordinates[s]), t(); else o(a.geometry.coordinates), t() } l.data.geometryPrimitive = new h._cesium.Primitive({ geometryInstances: i, appearance: new h._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders( "vertexShaderSource"), fragmentShaderSource: h._core.Shaders( "fragmentShaderSource") }), shadows: h._option.shadows }) }, error: function() { u = y.remove(u, function(e) { return e.x == l.x && e.y == l.y && e.level == l.level }) }, complete: function(e, t) { l.state = h._cesium.QuadtreeTileLoadState.LOADING, l.state === h ._cesium.QuadtreeTileLoadState.LOADING && (l.data .geometryPrimitive && l.data.geometryPrimitive.update(i), l .state = h._cesium.QuadtreeTileLoadState.DONE, l .renderable = !0) } }) } else t.state = h._cesium.QuadtreeTileLoadState.LOADING, t.state === h._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive .update(i, []), t.state = h._cesium.QuadtreeTileLoadState.DONE, t.renderable = !0); var l }, this._primitive = new h._cesium.QuadtreePrimitive({ tileProvider: this._Provider }); a = this._viewer.scene.primitives, o && o.time && (this._Provider._availability = new h._cesium .TimeIntervalCollection([new h._cesium.TimeInterval({ start: o.time.start ? h._cesium.JulianDate.fromDate(new Date(o.time.start)) : h ._cesium.Iso8601.MINIMUM_VALUE, stop: o.time.end ? h._cesium.JulianDate.fromDate(new Date(o.time.end)) : h ._cesium.Iso8601.MAXIMUM_VALUE })]), this._Provider.isAvailable = function(e) { if (!Cesium.defined(e)) throw new Cesium.DeveloperError("time is required."); var t = this._availability; return !Cesium.defined(t) || t.contains(e) }), a.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(c.id) && (c.id = this ._core.getuid()), this._core.isnull(e) && (e = "新建图层" + c.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, s = { id: c.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: o }; this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item) }, lu.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization = function(e, t, a, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = (this._core.isnull(a) || this._core.isnull(a.material) || "[" == a.material.toString().charAt( 0) && "]" == a.material.toString().charAt(a.material.length - 1) || (this._core.isHtmlColor(a .material) ? a.material = this._color.colorFromHtmlColor(a.material) : (/^rgb/.test(a .material) && (a.material = this._color.rgbaStringToRgbaObj(a.material)), 1 < a .material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a .material.a && (a.material.a = a.material.a / 255), a.material = this._color .createColor(a.material.r, a.material.g, a.material.b, a.material.a))), this._option = this ._core.extend(n, a, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), c = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, h = this; this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = a.level_max - 1, this._Provider.loadTile = function( e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && h .item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= a.level_min && t.level < a.level_max && h.item.show) { var o = y.filter(l, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) return t.data .geometryPrimitive = new h._cesium.Primitive({ geometryInstances: o[0].data, appearance: new h._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: h._cesium.ShadowMode.ENABLED }), t.state = h._cesium.QuadtreeTileLoadState.LOADING, void(t.state === h ._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t .state = h._cesium.QuadtreeTileLoadState.DONE), t.renderable = !0)); if (0 < h.PrimitiveData.length) for (var r = 0; r < h.PrimitiveData.length; r++) if (h.PrimitiveData[r].key == i) return void h.Primitivekey.push(i); h.Primitivekey.includes(i) || (h.Primitivekey.push(i), l.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), n = t, o = h._urlTemplate.replace(window.encodeURIComponent("{x}"), n.x) .replace(window.encodeURIComponent("{y}"), n.y).replace(window .encodeURIComponent("{z}"), n.level), h._cache && (o += "&" + h._core .getuid()), h.tilesLength++, h._core.xhr({ url: o, type: "get", dataType: "json", success: function(e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++) Array.isArray(e[t]) ? o( e[t]) : n.push(e[t]) } function t() { /^\[/.test(h._option.extrudedHeight) && /\]$/.test(h._option .extrudedHeight) && (e = h._option.extrudedHeight .replace(/\[/, "").replace(/\]/, ""), c .extrudedHeight = parseFloat(a.properties[e])), c .extrudedHeight = parseFloat(h._option.extrudedHeight), c.material = h._option.material, /^\[/.test(h._option .material) && /\]$/.test(h._option.material) ? (e = h._option.material.replace(/\[/, "").replace(/\]/, ""), c.material = a.properties[e], h._core .isHtmlColor(c.material) ? c.material = h._color .colorFromHtmlColor(c.material) : (/^rgb/.test(c .material) && (c.material = h._color .rgbaStringToRgbaObj(c.material)), 1 < c .material.red && (c.material.red = c.material .red / 255), 1 < c.material.green && (c .material.green = c.material.green / 255), 1 < c.material.blue && (c.material.blue = c .material.blue / 255), 1 < c.material .alpha && (c.material.a = c.material.alpha / 255), c.material = h._color.createColor(c .material.red, c.material.green, c.material .blue, c.material.alpha))) : (h._option .material && (c.material = h._option.material), c .material && (h._core.isHtmlColor(c.material) ? c .material = h._color.colorFromHtmlColor(c .material) : (/^rgb/.test(c.material) && (c .material = h._color .rgbaStringToRgbaObj(c.material)), 1 < c .material.red && (c.material.red = c .material.red / 255), 1 < c.material .green && (c.material.green = c.material .green / 255), 1 < c.material.blue && (c .material.blue = c.material.blue / 255), 1 < c.material.alpha && (c.material.a = c .material.alpha / 255), c.material = h ._color.createColor(c.material.red, c .material.green, c.material.blue, c .material.alpha)))); var e = h._cesium.Cartesian3.fromDegreesArray(n), e = (c.polygonHierarchy = new h._cesium .PolygonHierarchy(e), new h._cesium.PolygonGeometry( c)), e = new h._cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new h._cesium .ColorGeometryInstanceAttribute .fromColor(c.material) } }), t = "material:" + 255 * c.material.red + "," + 255 * c .material.green + "," + 255 * c.material.blue; h.Legend.push(t), i.push(e) } h.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry .coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates .length; s++) n = [], a.geometry.coordinates[s] .pop(), o(a.geometry.coordinates[s]), t(); else o(a.geometry.coordinates), t() } var l = new h._cesium.Primitive({ geometryInstances: i, appearance: new h._cesium .PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders( "vertexShaderSource"), fragmentShaderSource: h._core.Shaders( "fragmentShaderSource") }), shadows: h._option.shadows }), u = (h.PrimitiveObj.data = l, h.PrimitiveObj.key = h .Primitivekey[h.returnCount], { key: h.Primitivekey[h.returnCount], data: l }); h.PrimitiveData.push(u), h._viewer.scene.primitives.add(l), h .datas.push(l), h.returnCount++, h.returnCount >= h .tilesLength && (h.returnCount = 0, h.tilesLength = 0, h .Primitivekey = []) }, error: function() { l = y.remove(l, function(e) { return e.x == n.x && e.y == n.y && e.level == n .level }) }, complete: function(e, t) { n.state = h._cesium.QuadtreeTileLoadState.LOADING, n.state === h ._cesium.QuadtreeTileLoadState.LOADING && (n.data .geometryPrimitive && (n.state = h._cesium .QuadtreeTileLoadState.DONE), n.renderable = !0) } })) } else t.state = h._cesium.QuadtreeTileLoadState.LOADING, t.state === h._cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = h._cesium .QuadtreeTileLoadState.DONE), t.renderable = !0) } var n }, this._primitive = new h._cesium.QuadtreePrimitive({ tileProvider: this._Provider }); this._viewer.scene.primitives.add(this._primitive), o || this.setVisibility(!1), this._core.isnull(c .id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + c.id), this.west = t .minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; n = { id: c.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: a }; this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, lu.prototype.createVolumeVectorGeoJsonFeatureLayersd = function(e, t, o, i, r, n) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = (this._core.isnull(o) || this._core.isnull(o.material) || "[" == o.material.toString().charAt( 0) && "]" == o.material.toString().charAt(o.material.length - 1) || (this._core.isHtmlColor(o .material) ? o.material = this._color.colorFromHtmlColor(o.material) : (/^rgb/.test(o .material) && (o.material = this._color.rgbaStringToRgbaObj(o.material)), 1 < o .material.r && (o.material.r = o.material.r / 255), 1 < o.material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o .material.a && (o.material.a = o.material.a / 255), o.material = this._color .createColor(o.material.r, o.material.g, o.material.b, o.material.a))), this._core.isnull( o) || this._core.isnull(o.outlineColor) || "[" == o.outlineColor.toString().charAt(0) && "]" == o.outlineColor.toString().charAt(o.outlineColor.length - 1) || (this._core.isHtmlColor(o .outlineColor) ? o.outlineColor = this._color.colorFromHtmlColor(o.outlineColor) : ( /^rgb/.test(o.outlineColor) && (o.outlineColor = this._color.rgbaStringToRgbaObj(o .outlineColor)), 1 < o.outlineColor.r && (o.outlineColor.r = o.outlineColor.r / 255), 1 < o.outlineColor.g && (o.outlineColor.g = o.outlineColor.g / 255), 1 < o .outlineColor.b && (o.outlineColor.b = o.outlineColor.b / 255), 1 < o.outlineColor.a && (o.outlineColor.a = o.outlineColor.a / 255), o.outlineColor = this._color.createColor(o .outlineColor.r, o.outlineColor.g, o.outlineColor.b, o.outlineColor.a))), this._option = this._core.extend(a, o, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), h = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: Cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: Cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: Cesium.ArcType.GEODESIC, material: Cesium.Color.RED }, m = this, a = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url.split("geoserver")[0] + "geoserver/polygon/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=" + s.urlParams .LAYER + "&outputFormat=application%2Fjson"); m._core.xhr({ url: a, type: "get", async: !1, dataType: "json", success: function(e) { m.datas = e.features } }), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider.loadTile = function(i, t) { if ((this.tile = t).state === Cesium.QuadtreeTileLoadState.START && m.item.show) if (t.level, t.x, t.y, t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= o.level_min && t.level < o.level_max && m.item.show) { var e = y.filter(l, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != e.length && e[0].data && 0 < e[0].data.length) return t.data .geometryPrimitive = new Cesium.Primitive({ geometryInstances: e[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, void(t.state === Cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data .geometryPrimitive.update(), t.state = Cesium.QuadtreeTileLoadState .DONE, t.renderable = !0)); l.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), c = t, e = m._urlTemplate.replace(window.encodeURIComponent("{x}"), c.x) .replace(window.encodeURIComponent("{y}"), c.y).replace(window.encodeURIComponent( "{z}"), c.level), m._cache && (e += "&" + m._core.getuid()), m._core.xhr({ url: e, type: "get", dataType: "json", success: function(e) { var t = []; m.Legend = []; for (var i, o, r = 0; r < e.features.length; r++) { var n = [], a = e.features[r].id, a = parseInt(a.split(".")[1]) + 1, s = m.datas[a]; if (Array.isArray(s.geometry.coordinates) && 0 < s.geometry .coordinates.length && Array.isArray(s.geometry.coordinates[ 0][0][0])) for (var l = 0; l < s.geometry.coordinates[0].length; l++) n = [], function e(t) { for (var i = 0; i < t.length; i++) Array.isArray(t[ i]) ? (3 == t[i].length && (t[i].splice(2, 1), t[i].push(this._option.height)), e( t[i])) : n.push(t[i]) }(s.geometry.coordinates[0][l]), o = i = void 0, /^\[/ .test(m._option.extrudedHeight) && /\]$/.test(m._option .extrudedHeight) ? (i = m._option.extrudedHeight .replace(/\[/, "").replace(/\]/, ""), h .extrudedHeight = parseFloat(s.properties[i])) : h .extrudedHeight = parseFloat(m._option.extrudedHeight), h.material = m._option.material, /^\[/.test(m._option .material) && /\]$/.test(m._option.material) ? (i = m._option.material.replace(/\[/, "").replace(/\]/, ""), h.material = s.properties[i], m._core .isHtmlColor(h.material) ? h.material = m._color .colorFromHtmlColor(h.material) : (/^rgb/.test(h .material) && (h.material = m._color .rgbaStringToRgbaObj(h.material)), 1 < h .material.red && (h.material.red = h.material .red / 255), 1 < h.material.green && (h .material.green = h.material.green / 255), 1 < h.material.blue && (h.material.blue = h .material.blue / 255), 1 < h.material .alpha && (h.material.a = h.material.alpha / 255), h.material = m._color.createColor(h .material.red, h.material.green, h.material .blue, h.material.alpha))) : (m._option .material && (h.material = m._option.material), h .material && (m._core.isHtmlColor(h.material) ? h .material = m._color.colorFromHtmlColor(h .material) : (/^rgb/.test(h.material) && (h .material = m._color .rgbaStringToRgbaObj(h.material)), 1 < h .material.red && (h.material.red = h .material.red / 255), 1 < h.material .green && (h.material.green = h.material .green / 255), 1 < h.material.blue && (h .material.blue = h.material.blue / 255), 1 < h.material.alpha && (h.material.a = h .material.alpha / 255), h.material = m ._color.createColor(h.material.red, h .material.green, h.material.blue, h .material.alpha)))), i = Cesium .Cartesian3.fromDegreesArrayHeights(n), h .polygonHierarchy = new Cesium.PolygonHierarchy(i), i = { positions: Cesium.Cartesian3 .fromDegreesArrayHeights(n), width: m._option.outlineWidth, color: Cesium.ColorGeometryInstanceAttribute .fromColor(m._option.outlineColor) }, i = new Cesium.PolylineGeometry(i), i = new Cesium .GeometryInstance({ geometry: i }), o = "material:" + 255 * h.material.red + "," + 255 * h.material.green + "," + 255 * h.material.blue, m.Legend .push(o), t.push(i) } var u = new Cesium.PrimitiveCollection; u.add(new Cesium.Primitive({ geometryInstances: t, appearance: new Cesium.PolylineColorAppearance })), c.data.geometryPrimitive = u }, error: function() { l = y.remove(l, function(e) { return e.x == c.x && e.y == c.y && e.level == c.level }) }, complete: function(e, t) { c.state = Cesium.QuadtreeTileLoadState.LOADING, c.state === Cesium .QuadtreeTileLoadState.LOADING && (c.data.geometryPrimitive && c .data.geometryPrimitive.update(i), c.state = Cesium .QuadtreeTileLoadState.DONE, c.renderable = !0) } }) } else t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive .update(i, []), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0); var c }, this._primitive = new m._cesium.QuadtreePrimitive({ tileProvider: this._Provider }); this._viewer.scene.primitives.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(h .id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), this.west = t .minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; s = { id: h.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: o }; return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item), this }, lu.prototype.createVolumeVectorGeoJsonFeatureLayerDth = function(e, t, o, i, r, n) { var a = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, level_max: 20, level_min: 10 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, l = (this._option = this._core.extend(a, o, !0), null == t && console.log("url is required"), null == e && console.log("layername is required"), []), c = (Cesium.VertexFormat.DEFAULT, Cesium.Ellipsoid.WGS84, Cesium.ArcType.GEODESIC, Cesium.Color .WHITE), h = this; this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider.loadTile = function( e, t) { if ((this.tile = t).state === Cesium.QuadtreeTileLoadState.START && h.item.show) if (t.level, t.x, t.y, t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= o.level_min && t.level < o.level_max && h.item.show) { var i = y.filter(l, function(e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != i.length && i[0].data && 0 < i[0].data.length) return t.data .geometryPrimitive = new Cesium.Primitive({ geometryInstances: i[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, void(t.state === Cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data .geometryPrimitive.update(e, []), t.state = Cesium.QuadtreeTileLoadState .DONE, t.renderable = !0)); l.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), u = t, i = h._urlTemplate.replace(window.encodeURIComponent("{x}"), u.x) .replace(window.encodeURIComponent("{y}"), u.y).replace(window.encodeURIComponent( "{z}"), u.level), h._cache && (i += "&" + h._core.getuid()), h._core.xhr({ url: i, type: "get", dataType: "json", success: function(e) { var t = [], i = (h.Legend = [], new h._cesium.PrimitiveCollection); for (var o = 0; o < e.features.length; o++) { var r, n = [], a = e.features[o], s = (! function e(t) { for (var i = 0; i < t.length; i++) Array.isArray(t[ i]) ? e(t[i]) : n.push(t[i]) }(e.features[o].geometry.coordinates[0]), /^\[/.test(h ._option.extrudedHeight) && /\]$/.test(h._option .extrudedHeight) ? (r = h._option.extrudedHeight .replace(/\[/, "").replace(/\]/, ""), h._option .extrudedHeight = parseFloat(a.properties[r])) : h ._option.extrudedHeight = parseFloat(h._option .extrudedHeight), 1 == h._option.heightReference && delete h._option.height, 1 == h._option .extrudedHeightReference && delete h._option .extrudedHeight, /^\[/.test(h._option.material) && /\]$/ .test(h._option.material) ? (r = h._option.material .replace(/\[/, "").replace(/\]/, ""), h._option .material = a.properties[r], h._core.isHtmlColor(h ._option.material) ? h._option.material = h ._color.colorFromHtmlColor(h._option.material) : ( /^rgb/.test(h._option.material) && (h._option .material = h._color.rgbaStringToRgbaObj(h ._option.material)), 1 < h._option .material.red && (h._option.material.red = h ._option.material.red / 255), 1 < h._option .material.green && (h._option.material.green = h ._option.material.green / 255), 1 < h ._option.material.blue && (h._option.material .blue = h._option.material.blue / 255), 1 < h._option.material.alpha && (h._option.material .a = h._option.material.alpha / 255), h ._option.material = h._color.createColor(h ._option.material.red, h._option.material .green, h._option.material.blue, h._option .material.alpha))) : (h._option.material && (h._option.material = h._option.material), h._option .material && (h._core.isHtmlColor(h._option .material) ? h._option.material = h._color .colorFromHtmlColor(h._option.material) : ( /^rgb/.test(h._option.material) && (h ._option.material = h._color .rgbaStringToRgbaObj(h._option.material) ), 1 < h._option.material.red && (h ._option.material.red = h._option .material.red / 255), 1 < h._option .material.green && (h._option.material .green = h._option.material.green / 255 ), 1 < h._option.material.blue && (h ._option.material.blue = h._option .material.blue / 255), 1 < h._option .material.alpha && (h._option.material.a = h ._option.material.alpha / 255), h ._option.material = h._color.createColor(h ._option.material.red, h._option .material.green, h._option.material .blue, h._option.material.alpha)))), Cesium.Cartesian3.fromDegreesArray(n)), s = (a.positions = s, h._option.polygonHierarchy = new Cesium.PolygonHierarchy(s), new Cesium .PolygonGeometry(h._option)), s = Cesium.PolygonGeometry.createGeometry(s), l = "material:" + 255 * c.red + "," + 255 * c.green + "," + 255 * c.blue, l = (h.Legend.push(l), new Cesium.GeometryInstance({ id: a, geometry: s, attributes: { color: new h._cesium .ColorGeometryInstanceAttribute .fromColor(h._option.material) } }), new Cesium.ClassificationPrimitive({ geometryInstances: t, appearance: new Cesium .PerInstanceColorAppearance({ closed: !0, flat: !1 }), classificationType: h._option .classificationType, shadows: Cesium.ShadowMode.ENABLED })); i.add(l) } u.data.geometryPrimitive = i }, error: function() { l = y.remove(l, function(e) { return e.x == u.x && e.y == u.y && e.level == u.level }) }, complete: function() { u.state = Cesium.QuadtreeTileLoadState.LOADING, u.state === Cesium .QuadtreeTileLoadState.LOADING && (u.data.geometryPrimitive && u .data.geometryPrimitive.update(e, []), u.state = Cesium .QuadtreeTileLoadState.DONE, u.renderable = !0) } }) } else t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium .QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive .update(e, []), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0); var u }, this._primitive = new h._cesium.QuadtreePrimitive({ tileProvider: this._Provider }); this._viewer.scene.primitives.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(h ._option.id) && (h._option.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h ._option.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: h._option.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: o }; this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item) }, lu.prototype.createVolumeGeoJsonFeatureLayer = function(e, t, n, i, a) { var s = { polylinePositions: void 0, shapePositions: void 0, ellipsoid: this._cesium.Ellipsoid.WGS84, granularity: this._cesium.Math.RADIANS_PER_DEGREE, vertexFormat: this._cesium.VertexFormat.DEFAULT, cornerType: this._cesium.CornerType.ROUNDED }, o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), l = this, u = [], t = (s.shapePositions = this.computeCircle(n.radius), o.then(function(e) { for (var t = l._cesium.Color.WHITE, i = (l._core.isnull(n) || l._core.isnull(n .material) || (t = "[" == n.material.toString().charAt(0) && "]" == n .material.toString().charAt(n.material.length - 1) ? n.material.replace( /\[/, "").replace("/]/", "") : y.clone(n.material), t = l._core .isHtmlColor(t) ? l._color.colorFromHtmlColor(n.material) : (1 < (t = /^rgb/.test(t) ? l._color.rgbaStringToRgbaObj(t) : t).r && (t .r = t.r / 255), 1 < t.g && (t.g = t.g / 255), 1 < t.b && (t.b = t.b / 255), 1 < t.a && (t.a = t.a / 255), l._color.createColor(t .r, t.g, t.b, t.a))), e.entities.values), o = 0; o < i.length; o++) { var r = i[o], r = (s.polylinePositions = r.polyline.positions._value, new l._cesium .PolylineVolumeGeometry(s)), r = l._cesium.PolylineVolumeGeometry.createGeometry(r), r = new l._cesium.GeometryInstance({ geometry: r }); u.push(r) } e = l._viewer.scene.primitives.add(new l._cesium.Primitive({ geometryInstances: u, appearance: new l._cesium.MaterialAppearance({ material: new l._cesium.Material({ fabric: { type: "Color", uniforms: { color: t } } }), faceForward: !0, flat: !1 }) })); l.item = e, 0 == n.show && (e.show = !1), "function" == typeof a && a(e) }), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建管状图层" + n.id), { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: geoOptions.url, style: n }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), this }, lu.prototype.computeCircle = function(e) { this._core.isnull(e) && (e = 4); for (var t = [], i = 0; i < 360; i++) { var o = this._cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, lu.prototype.createVolumeGeoJsonFeatureLayerProvider = function(e, t, c, i, o, r) { var n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.RECEIVE_ONLY }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, Cesium: this._cesium }, h = (this._core.isnull(c) || this._core.isnull(c.material) || "[" == c.material.toString().charAt( 0) && "]" == c.material.toString().charAt(c.material.length - 1) || (this._core.isHtmlColor(c .material) ? c.material = this._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c .material) && (c.material = this._color.rgbaStringToRgbaObj(c.material)), 1 < c .material.r && (c.material.r = c.material.r / 255), 1 < c.material.g && (c.material.g = c.material.g / 255), 1 < c.material.b && (c.material.b = c.material.b / 255), 1 < c .material.a && (c.material.a = c.material.a / 255), c.material = this._color .createColor(c.material.r, c.material.g, c.material.b, c.material.a))), this._core.extend(n, c, !0)), n = new v(this._viewer, this._cesium, a), m = (this._Provider = n, this), a = (n._loadTile = function(e) { var u = new m._cesium.PrimitiveCollection; return e.features.forEach(function(e) { var t = []; /^\[/.test(c.material) && /\]$/.test(c.material) && (s = c.material.replace( /\[/, "").replace(/\]/, ""), h.material = e.properties[s], that ._core.isHtmlColor(h.material) ? h.material = that._color .colorFromHtmlColor(h.material) : (/^rgb/.test(h.material) && (h .material = that._color.rgbaStringToRgbaObj(h.material)), 1 < h .material.r && (h.material.r = h.material.r / 255), 1 < h.material .g && (h.material.g = h.material.g / 255), 1 < h.material.b && (h .material.b = h.material.b / 255), 1 < h.material.a && (h .material.a = h.material.a / 255), h.material = that._color .createColor(h.material.r, h.material.g, h.material.b, h.material.a) )); for (var i = 0; i < e.geometry.coordinates.length; i++) { var o = e.geometry.coordinates[i]; if (0 < o.length) if (Array.isArray(o[0])) for (var r = 0; r < o.length; r++) { var n = o[r], n = m._cesium.Cartesian3.fromDegrees(n[0], n[1], h.height); t.push(n) } else { var a = m._cesium.Cartesian3.fromDegrees(o[0], o[1], h.height); t.push(a) } } h.position = t, e.positions = t, "0" == h.slttype || 0 == h.slttype ? h.shape = m._core.computeCircle(h.radius) : "1" == h.slttype || 1 == h.slttype ? h .shape = m._core.starPositions(h.number, h.exradius, h.inradius) : "2" != h .slttype && 2 != h.slttype || (s = h.orth_width / 2, l = h.orth_height / 2, h.shape = [new m._cesium.Cartesian2(-s, -l), new m._cesium.Cartesian2(s, -l), new m._cesium.Cartesian2(s, l), new m._cesium.Cartesian2(- s, l)]); var s = { polylinePositions: h.position, shapePositions: h.shape, cornerType: h.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }, l = new m._cesium.PolylineVolumeGeometry(s), s = m._cesium.PolylineVolumeGeometry.createGeometry(l), l = new m._cesium.GeometryInstance({ id: e, geometry: s, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute.fromColor(h .material) } }), s = new m._cesium.Primitive({ allowPicking: !0, appearance: new m._cesium.MaterialAppearance({ material: new m._cesium.Material({ fabric: { type: "Color", uniforms: { color: h.material } } }), faceForward: !0, flat: !1 }), shadows: h.shadows, geometryInstances: l }); u.add(s) }), u }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this ._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h .id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: h.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: t.url, style: c }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, lu.prototype.setTreeobj = function(e) { this.treeobj = e }, lu.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, lu.prototype.deleteObject = function() { this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) {} }, lu.prototype.setRefresh = function(e) { try { this._Provider && this._Provider.setStatus(e) } catch (e) {} }, lu.prototype.setVisibility = function(e) { try { null != this.item && null != this.item.show && (this.item.show = e), this._Provider && this ._Provider.setStatus(e) } catch (e) {} }, lu.prototype.isCache = function(e) { this._cache = e }, lu.prototype.edit = function(e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider .edit(e, t) }, lu.prototype.forceRefresh = function() { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) this._Provider.quadtree ._levelZeroTiles[e].freeResources() } catch (e) {} }, cu.prototype.setSpaceBackground = function(e) { return this.clear && this.clear(), this._viewer.container.style.backgroundImage = "url(" + e + ")", this ._viewer.scene.backgroundColor = new this._cesium.Color(0, 0, 0, 0), this._viewer.scene .skyAtmosphere.show = !1, this._viewer.scene.skyBox && (this._viewer.scene.skyBox.show = !1), this .clear = () => { this._viewer.container.style.backgroundImage = "unset", this._viewer.scene.skyBox && (this ._viewer.scene.skyBox.show = !0), this._viewer.scene.backgroundColor = new this._cesium .Color(0, 0, 0, 1), this._viewer.scene.skyAtmosphere.show = !0 }, this }, cu.prototype.SkyBox = function(e, t) { this.defaultSky || (this.defaultSky = this._viewer.scene.skyBox, this.defaultSky && !this.defaultSky .show && (this.defaultSky.show = !0)), this.NearGround = e; var i = this, o = this._viewer, r = this.getSkyBox(t); function n() { var e = o.camera.position; i._cesium.Cartographic.fromCartesian(e).height < 23e4 ? (r && (o.scene.skyBox = r), o.scene .skyAtmosphere.show = !1) : (i.defaultSky && (o.scene.skyBox = i.defaultSky), o.scene .skyAtmosphere.show = !0) } return this._SkyBox = r, o.scene.skyBox = r, e && this._viewer.scene.postRender.addEventListener(n), this.clear = function() { i.defaultSky && (i._viewer.scene.skyBox = i.defaultSky), i.defaultSky = void 0, i._viewer.scene .skyAtmosphere.show = !0, i.NearGround && i._viewer.scene.postRender.removeEventListener(n), i.clear = void 0 }, this }, cu.prototype.getSkyBox = function(e) { var s = this, e = new this._cesium.SkyBox({ sources: e }); return this.NearGround && (e.update = function(e, t) { var i = this; if (this.show && (e.mode === s._cesium.SceneMode.SCENE3D || e.mode === s._cesium.SceneMode .MORPHING) && e.passes.render) { var o, r, n = e.context, a = (this._sources !== this.sources && (this._sources = this.sources, "string" == typeof(r = this.sources).positiveX ? s._cesium.loadCubeMap(n, this._sources) .then(function(e) { i._cubeMap = i._cubeMap && i._cubeMap.destroy(), i._cubeMap = e }) : (this._cubeMap = this._cubeMap && this._cubeMap.destroy(), this ._cubeMap = new s._cesium.CubeMap({ context: n, source: r }))), this._command); if (s._cesium.defined(a.vertexArray) || (a.uniformMap = { u_cubeMap: function() { return i._cubeMap }, u_rotateMatrix: function() { return s.NearGround ? (a.modelMatrix = s._cesium.Transforms .eastNorthUpToFixedFrame(e.camera._positionWC), s._cesium .Matrix4.getMatrix3(a.modelMatrix, new s._cesium.Matrix3)) : s._cesium.Matrix3.IDENTITY } }, r = s._cesium.BoxGeometry.createGeometry(s._cesium.BoxGeometry .fromDimensions({ dimensions: new s._cesium.Cartesian3(2, 2, 2), vertexFormat: s._cesium.VertexFormat.POSITION_ONLY })), o = this._attributeLocations = s._cesium.GeometryPipeline .createAttributeLocations(r), a.vertexArray = s._cesium.VertexArray .fromGeometry({ context: n, geometry: r, attributeLocations: o, bufferUsage: s._cesium.BufferUsage.STATIC_DRAW }), a.renderState = s._cesium.RenderState.fromCache({ blending: s._cesium.BlendingState.ALPHA_BLEND })), s._cesium.defined(a.shaderProgram) && this._useHdr === t || (r = new s ._cesium.ShaderSource({ defines: [t ? "HDR" : ""], sources: [s.SkyBoxFS] }), a.shaderProgram = s._cesium.ShaderProgram.fromCache({ context: n, vertexShaderSource: s.SkyBoxVS, fragmentShaderSource: r, attributeLocations: this._attributeLocations }), this._useHdr = t), s._cesium.defined(this._cubeMap)) return a } }), e }, hu.prototype.createWindField = function(e, t) { var i = this; return this.WindFieldOption = { color: this._cesium.Color.WHITE, speed: .15, num: 2e3, maxAge: 10, brighten: 1.5 }, (t = t || {}).color && (t.color = this._cesium.Color.fromCssColorString(t.color)), this .WindFieldOption = this._core.extend(this.WindFieldOption, t, !1), this.destroy(), this.windData = void 0, this.windField = void 0, this.particles = [], this.lines = void 0, this.timer = void 0, this .primitives = this._viewer.scene.primitives, $.ajax({ type: "get", async: !1, url: e, dataType: "json", success: function(e) { i.windData = e, i._init(), i.timer = setInterval(function() { i.animate() }, 200) }, error: function(e) { console.log("请求风场数据失败!") } }), this }, hu.prototype._init = function() { this.windField = this.createField(); for (var e = 0; e < this.WindFieldOption.num; e++) this.particles.push(this.randomParticle(new mu)) }, hu.prototype.createField = function() { var e = this._parseWindJson(); return new du(e) }, hu.prototype.animate = function() { var o, r, n = this, a = n.windField, e = n.particles, s = []; e.forEach(function(e) { var t, i; e.age <= 0 && n.randomParticle(e), 0 < e.age && (t = e.x, i = e.y, a.isInBound(t, i) ? (r = a.getIn(t, i), o = t + n.WindFieldOption.speed * r[0], r = i + n.WindFieldOption .speed * r[1], e.path.push(o, r), e.x = o, e.y = r, s.push(n ._createLineInstance(n._map(e.path), e.age / e.birthAge)), e.age--) : e .age = 0) }), s.length <= 0 && this.removeLines(), n._drawLines(s) }, hu.prototype._parseWindJson = function() { var t = null, i = null, o = null; return this.windData.forEach(function(e) { switch (e.header.parameterCategory + "," + e.header.parameterNumber) { case "2,2": t = e.data, o = e.header; break; case "2,3": i = e.data } }), { header: o, uComponent: t, vComponent: i } }, hu.prototype.removeLines = function() { this.lines && (this.primitives.remove(this.lines), this.lines.destroy()) }, hu.prototype._map = function(e) { for (var t = e.length, i = this.windField, o = i.dx, r = i.dy, n = i.west, a = i.north, s = [], l = 0; l <= t - 2; l += 2) s.push(n + e[l] * o, a - e[l + 1] * r); return s }, hu.prototype._createLineInstance = function(e, t) { for (var i = [], o = e.length, r = o / 2, n = 0; n < o; n++) i.push("random" === this.WindFieldOption .color ? this._cesium.Color.fromRandom({ alpha: n / r * t * this.WindFieldOption.brighten }) : this.WindFieldOption.color.withAlpha(n / r * t * this.WindFieldOption.brighten)); return new this._cesium.GeometryInstance({ geometry: new this._cesium.PolylineGeometry({ positions: this._cesium.Cartesian3.fromDegreesArray(e), colors: i, width: 1.5, colorsPerVertex: !0 }) }) }, hu.prototype._drawLines = function(e) { this.removeLines(); e = new this._cesium.Primitive({ appearance: new this._cesium.PolylineColorAppearance({ translucent: !0 }), geometryInstances: e, asynchronous: !1 }); this.lines = this.primitives.add(e) }, hu.prototype.randomParticle = function(e) { for (var t, i, o = 30; t = Math.floor(Math.random() * (this.windField.cols - 2)), i = Math.floor(Math .random() * (this.windField.rows - 2)), this.windField.getIn(t, i)[2] <= 0 && o++ < 30;); return e.x = t, e.y = i, e.age = Math.round(Math.random() * this.WindFieldOption.maxAge), e.birthAge = e .age, e.path = [t, i], e }, hu.prototype.changeColor = function(e) { this.WindFieldOption.color = "random" === e ? e : this._cesium.Color.fromCssColorString(e) }, hu.prototype.setSpeed = function(e) { this.WindFieldOption.speed = e }, hu.prototype.setMaxAge = function(e) { this.WindFieldOption.maxAge = e }, hu.prototype.setBrighten = function(e) { this.WindFieldOption.brighten = e }, hu.prototype.destroy = function() { this.timer && clearInterval(this.timer), this.timer = void 0, this.removeLines() }; var mu = function() { this.x = null, this.dx = null, this.dx = null, this.y = null, this.age = null, this.birthAge = null, this.path = null }, du = function(e) { this.west = null, this.east = null, this.south = null, this.north = null, this.rows = null, this.cols = null, this.dx = null, this.dy = null, this.unit = null, this.date = null, this.grid = null, this ._init(e) }; function pu(e) { this._viewer = e, this.PrimitiveCollection = [], this.lineColor = Cesium.Color.fromCssColorString("#330066") .withAlpha(.8), this.pointColor = Cesium.Color.fromCssColorString("#CCFFFF").withAlpha(1) } function gu(e) { this._viewer = e, this.PrimitiveCollection = [], this.color = Cesium.Color.BLUE } function _u(e, t) { this._viewer = e, this._cesium = t, this._Color = new m(this._viewer, this._cesium), this._core = new f, this._getPosition = new et(this._viewer, this._cesium), this._tree = V, this._points = [], this ._polylines = [], this.Streamerpath = new pu(this._viewer), this.Streamerwall = new gu(this._viewer) } function fu(e) { this._viewer = e, this._cesium = Cesium, this._core = new f, this._Buffer = new zi(e, Cesium), this._tree = V } function yu(e) { this._viewer = e, this._scene = e.scene, this._core = new f, this._tooltip = this._core.CreateTooltip(), this._drawColor = { point: Cesium.Color.BLUE, polyline: Cesium.Color.YELLOW, polygon: Cesium.Color.YELLOW.withAlpha(.5) }, this.selectDatum = !0, this.onlyTerrain = !0, this.tin = !1, this._volumeTin = [], this.loadingImg = window.SmartEarthRootUrl + D.loading } function vu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function Q(e) { this._viewer = e, this._core = new f, this._tree = V, this._getPosition = new et(this._viewer, Cesium), this ._popupmessage = new tt(this._viewer, Cesium), this.tooltip = this._core.CreateTooltip({ id: "_jb" }), this.objectsToExclude = [], this.MilitaryStandardObj = [], this.drawHandler = void 0, this .editHandler = null, this.heightpointsId = [], this.state = 0, this.isEditting = !1, this.editProp = !0 } function Cu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._Provider = void 0 } function wu(e) { this._viewer = e, this._cesium = Cesium, this._core = new f, this._tree = V, this.texturePixel = 1024 } function bu(e) { this._viewer = e, this._core = new f } function Tu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function Su(e) { if (this._viewer = e, this._cesium = Cesium, this._core = new f, this._tree = V, !window.h337) { let e = new se(!1); e.addJs(document.body, window.SmartEarthRootUrl + "Workers/heatmap/heatmap.min.js"), e.addJs(document .body, window.SmartEarthRootUrl + "Workers/heatmap/webgl-heatmap.js") } } function Pu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this.TrailEntitys = [] } function Eu(e) { this.lon = 0, this.lat = 0, this.hei = e, this.phei = e / 2, this.time = 0 } function xu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._getPosition = new et(this ._viewer, this._cesium), this.tooltip = this._core.CreateTooltip() } du.prototype = { constructor: du, _init: function(e) { for (var t, i = e.header, o = e.uComponent, r = e.vComponent, n = (this.west = +i.lo1, this .east = +i.lo2, this.south = +i.la2, this.north = +i.la1, this.rows = +i.ny, this .cols = +i.nx, this.dx = +i.dx, this.dy = +i.dy, this.unit = i.parameterUnit, this .date = i.refTime, this.grid = [], 0), a = null, s = 0; s < this.rows; s++) { for (var a = [], l = 0; l < this.cols; l++, n++) t = this._calcUV(o[n], r[n]), a.push(t); this.grid.push(a) } }, _calcUV: function(e, t) { return [+e, +t, Math.sqrt(e * e + t * t)] }, _bilinearInterpolation: function(e, t, i, o, r, n) { var a = 1 - e, s = 1 - t, l = a * s, s = e * s, a = a * t, e = e * t, t = i[0] * l + o[0] * s + r[0] * a + n[0] * e, i = i[1] * l + o[1] * s + r[1] * a + n[1] * e; return this._calcUV(t, i) }, getIn: function(e, t) { var i = Math.floor(e), o = Math.floor(t); if (i === e && o === t) return this.grid[t][e]; var r = i + 1, n = o + 1, a = this.getIn(i, o), s = this.getIn(r, o), l = this.getIn(i, n), r = this.getIn(r, n); return this._bilinearInterpolation(e - i, t - o, a, s, l, r) }, isInBound: function(e, t) { return 0 <= e && e < this.cols - 2 && 0 <= t && t < this.rows - 2 } }, pu.prototype.create = function(e = {}) { this.position = e.position || void 0, this.positions = e.positions || void 0, this.linewidth = e .linewidth || void 0, this.near = e.near, this.far = e.far, this._speed = e.speed, Cesium.defined( this._speed) || (this._speed = 1), this._id = e.id, e.lineColor && (this.lineColor = Cesium .Color.fromCssColorString(e.lineColor).withAlpha(e.lineAlpha || 1)), e.pointColor && (this .pointColor = Cesium.Color.fromCssColorString(e.pointColor).withAlpha(e.pointAlpha || 1)), this .getShader(), this.collection = new Cesium.PrimitiveCollection, this.collection._guid = this._id, this._viewer.scene.primitives.add(this.collection), this.position ? this.getInstance() : this .positions && this.getInstances(), this.addGroundLine(), this.PrimitiveCollection.push(this .collection) }, pu.prototype.getById = function(e) { for (var t = null, i = this._viewer.scene.primitives, o = i.length, r = 0; r < o; r++) { var n = i.get(r); n._guid === e && (t = n) } return t }, pu.prototype.remove = function(e) { e = this.getById(e); e && this._viewer.scene.primitives.remove(e) }, pu.prototype.removeAll = function() { for (var e = 0; e < this.PrimitiveCollection.length; e++) { var t = this.PrimitiveCollection[e]; this._viewer.scene.primitives.remove(t) } this.PrimitiveCollection = [] }, pu.prototype.show = function(e) { for (var t = 0; t < this.PrimitiveCollection.length; t++) this.PrimitiveCollection[t].show = e }, pu.prototype.getInstance = function() { let e; e = this.position[0] instanceof Cesium.Cartesian3 ? this.position : Cesium.Cartesian3.fromDegreesArray( this.position); var t = new Cesium.GroundPolylineGeometry({ positions: e, width: this.linewidth, vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT }); this.instances = new Cesium.GeometryInstance({ geometry: t, attributes: { distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( this.near, this.far) } }) }, pu.prototype.getInstances = function() { this.instances = []; for (let t = 0; t < this.positions.length; t++) { let e; e = this.positions[t][0] instanceof Cesium.Cartesian3 ? this.positions[t] : Cesium.Cartesian3 .fromDegreesArray(this.positions[t]); var i = new Cesium.GeometryInstance({ geometry: new Cesium.GroundPolylineGeometry({ positions: e, width: this.linewidth, vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT }), attributes: { distanceDisplayCondition: new Cesium .DistanceDisplayConditionGeometryInstanceAttribute(this.near, this.far) } }); this.instances.push(i) } }, pu.prototype.addGroundLine = async function() { this.instances.forEach(e => { e = new Cesium.GroundPolylinePrimitive({ geometryInstances: e, appearance: new Cesium.MaterialAppearance({ material: new Cesium.Material({ fabric: { source: this.fs, uniforms: { u_moveColor: this.pointColor, u_lineColor: this.lineColor } } }) }) }); this.collection.add(e) }) }, pu.prototype.addLine = function() { var e = new Cesium.PolylineMaterialAppearance({ material: new Cesium.Material({ fabric: { source: this.fs, uniforms: { u_moveColor: this.pointColor, u_lineColor: this.lineColor } } }) }), e = new Cesium.Primitive({ geometryInstances: this.instances, appearance: e }); this.collection.add(e) }, pu.prototype.getShader = function() { this.fs = ` uniform vec4 u_moveColor; uniform vec4 u_lineColor; #define PI_OVER_TWO 1.5707963 czm_material czm_getMaterial(czm_materialInput materialInput){ czm_material material = czm_getDefaultMaterial(materialInput); float iTime = czm_frameNumber / 60.0 * ${this._speed.toFixed(1)}; vec2 uv = materialInput.st; vec4 finalColor = u_lineColor; float dt = clamp(tan(uv.x * 5.0 - iTime * 1.0) * 0.3 - 0.1, 0.5, PI_OVER_TWO); finalColor = mix(finalColor, u_moveColor, dt); float alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0); material.diffuse = finalColor.xyz; material.alpha = alpha; return material; } ` }, gu.prototype.create = function(e = {}) { this.position = e.position || void 0, this.positions = e.positions || void 0, this.height = e .height || 50, this.minHeight = e.minHeight, this.near = e.near, this.far = e.far, this._speed = e.speed || 1, this._id = e.id, e.color && (this.color = Cesium.Color.fromCssColorString(e .color)), this.getShader(), this.collection = new Cesium.PrimitiveCollection, this .collection._guid = this._id, this._viewer.scene.primitives.add(this.collection), this .position ? this.getInstance() : this.positions && this.getInstances(), this.addWall(), this .PrimitiveCollection.push(this.collection) }, gu.prototype.getById = function(e) { for (var t = null, i = this._viewer.scene.primitives, o = i.length, r = 0; r < o; r++) { var n = i.get(r); n._guid === e && (t = n) } return t }, gu.prototype.remove = function(e) { e = this.getById(e); null != e && this._viewer.scene.primitives.remove(e) }, gu.prototype.removeAll = function() { for (var e = 0; e < this.PrimitiveCollection.length; e++) { var t = this.PrimitiveCollection[e]; this._viewer.scene.primitives.remove(t) } this.PrimitiveCollection = [] }, gu.prototype.show = function(e) { for (var t = 0; t < this.PrimitiveCollection.length; t++) this.PrimitiveCollection[t].show = e }, gu.prototype.getInstance = function() { let e; e = this.position[0] instanceof Cesium.Cartesian3 ? this.position : Cesium.Cartesian3 .fromDegreesArray(this.position); var t = Array(e.length).fill(this.height), i = Array(e.length).fill(this.minHeight || 0), t = new Cesium.WallGeometry({ positions: e, maximumHeights: t, minimumHeights: i }); this.instances = [new Cesium.GeometryInstance({ geometry: t, attributes: { distanceDisplayCondition: new Cesium .DistanceDisplayConditionGeometryInstanceAttribute(this.near, this.far) } })] }, gu.prototype.getInstances = function() { this.instances = []; for (let t = 0; t < this.positions.length; t++) { let e; e = this.positions[t][0] instanceof Cesium.Cartesian3 ? this.positions[t] : Cesium.Cartesian3 .fromDegreesArray(this.positions[t]); var i = Array(e.length).fill(this.height), o = Array(e.length).fill(this.minHeight || 0), i = new Cesium.GeometryInstance({ geometry: new Cesium.WallGeometry({ positions: e, maximumHeights: i, minimumHeights: o }), attributes: { distanceDisplayCondition: new Cesium .DistanceDisplayConditionGeometryInstanceAttribute(this.near, this.far) } }); this.instances.push(i) } }, gu.prototype.addWall = async function() { this.instances.forEach(e => { e = new Cesium.Primitive({ geometryInstances: e, appearance: new Cesium.MaterialAppearance({ material: new Cesium.Material({ fabric: { source: this.fs, uniforms: { u_wallColor: this.color.withAlpha(.5), u_moveColor: this.color } } }) }) }); this.collection.add(e) }) }, gu.prototype.getShader = function() { this.fs = ` uniform vec4 u_moveColor; uniform vec4 u_wallColor; #define PI_OVER_TWO 1.5707963 czm_material czm_getMaterial(czm_materialInput materialInput){ czm_material material = czm_getDefaultMaterial(materialInput); float iTime = czm_frameNumber / 60.0 * ${this._speed.toFixed(1)}; vec2 uv = materialInput.st; vec4 finalColor = u_wallColor; float dt = clamp(tan(uv.y * 5.0 - iTime) * 0.3 - 0.1, 0.5, PI_OVER_TWO); finalColor = mix(finalColor, u_moveColor, dt); float alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0); if(uv.y < 0.5){ alpha = 1.0; finalColor = u_wallColor; if(uv.y > 0.4){ alpha = (0.5 - uv.y) * 5.0 + 0.5; } } material.diffuse = finalColor.xyz; material.alpha = alpha; return material; } ` }, _u.prototype.createPathLayer = function(e = {}) { var t = { lineColor: e.color || "#0033FF", lineAlpha: e.alpha || 1, linewidth: e.width || 5, pointColor: e.pointColor || "#FFFFFF", pointAlpha: e.pointAlpha || 1, id: e.id || this._core.getuid(), near: e.near, far: e.far, speed: e.speed || 1 }; let i = Cesium.GeoJsonDataSource.load(e.url); i.then(e => { var i = e.entities.values; let o = []; for (let t = 0; t < i.length; t++) { let e = i[t]; e.polyline ? o.push(e.polyline.positions.getValue()) : e.polygon && o.push(e .polygon.hierarchy.getValue().positions) } this.Streamerpath.create({ positions: o, ...t }) }); e = { id: t.id, name: "新建流光线图层", pId: 0, type: "TrailLineLayer", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, _u.prototype.createWallLayer = function(e = {}) { var t = { color: e.color || "#0000ff", id: e.id || this._core.getuid(), speed: e.speed, height: e.height, minHeight: e.minHeight, near: e.near, far: e.far }; let i = Cesium.GeoJsonDataSource.load(e.url); i.then(e => { var i = e.entities.values; let o = []; for (let t = 0; t < i.length; t++) { let e = i[t]; e.polyline ? o.push(e.polyline.positions.getValue()) : e.polygon && o.push(e .polygon.hierarchy.getValue().positions) } this.Streamerwall.create({ positions: o, ...t }) }); e = { id: t.id, name: "新建流动墙图层", pId: 0, type: "TrailLineLayer", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, _u.prototype.getLinePosition = function(e) { let i = []; return e.geometries && e.geometries.forEach(e => { let t = []; e.coordinates.forEach(e => { t.push(e[0], e[1]) }), i.push(t) }), e.features && e.features.forEach(e => { let t = []; e.geometry.coordinates.forEach(e => { t.push(e[0], e[1]) }), i.push(t) }), i }, _u.prototype.createPath = function(e, t, i) { var o = { time: 3e3, LineColor: this._core.defaultValue((i = "number" == typeof(i = i || {}) ? { time: i } : i).color, "#ff0000"), LinkImage: this._core.defaultValue(i.url, window.SmartEarthRootUrl + D.TrailLine), height: 5e4, num: 100, width: 2, LightSpot: !1, alpha: .3 }, r = ((o = this._core.extend(o, i, !0)).twoColor && (m = { color1: o.twoColor.color1 || "#00ff00", color2: o.twoColor.color2 || "#ff0000" }), o.LightSpot && (m = { LightSpot: !0, color: o.LightSpotColor || o.LineColor }), new ne(o.LineColor, this._core.defaultValue(m, o.LinkImage), o.time)), n = (r.alpha = o.alpha, i.inflow); let a, s; for (var l = 0; l < t.length; l++) { n ? (a = t[l], s = e) : (s = t[l], a = e); for (var u = this.parabolaEquation({ pt1: a, pt2: s, height: o.height, num: o.num }), c = [], h = 0; h < u.length; h++) c.push(u[h][0], u[h][1], u[h][2]); this._polylines.push(this._viewer.entities.add({ name: "PolylineTrailLink" + l, polyline: { positions: this._cesium.Cartesian3.fromDegreesArrayHeights(c), width: o.width, material: r, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, o .far || 1 / 0) } })) } this.pathMaterial = r, o.static && this.pathMaterial.setScale(0); var m = { id: this._core.getuid(), name: "新建流动路径", pId: 0, type: "TrailLine", item: this }; return this.setTreeobj(m), this._tree.insertGroupId(m, 0), this }, _u.prototype.createFlyingLine = function(e, t = {}) { var i = { time: 3e3, LineColor: this._core.defaultValue(t.color, "#ffffff"), LinkImage: this._core.defaultValue(t.url, window.SmartEarthRootUrl + D.TrailLine), minHeight: 0, width: 1, alpha: 0 }, t = { LightSpot: !0, color: (i = this._core.extend(i, t, !0)).LightSpotColor || i.LineColor }, o = new ne(i.LineColor, this._core.defaultValue(t, i.LinkImage), i.time); o.alpha = i.alpha; let r; e.forEach(e => { r = [e.lon, e.lat, i.minHeight, e.lon, e.lat, e.height], this._polylines.push(this ._viewer.entities.add({ name: "FlyingLine", polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights(r), width: i.width, material: o } })) }); t = { id: this._core.getuid(), name: "新建垂直飞线", pId: 0, type: "TrailLine", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, 0), this }, _u.prototype.createLine = function(e, t) { var i = { time: 3e3, LineColor: this._core.defaultValue((t = "number" == typeof(t = t || {}) ? { time: t } : t).color, "#ff0000"), LinkImage: this._core.defaultValue(t.url, window.SmartEarthRootUrl + D.TrailLine), width: 10 }, t = new ne((i = this._core.extend(i, t, !0)).LineColor, i.LinkImage, i.time), o = []; if (e[0].x || e[0].y) if (void 0 !== e[0].z) if (-180 <= e[0].x && e[0].x <= 180) for (r = 0; r < e.length; r++) o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[ r].y, e[r].z)); else o = e; else for (r = 0; r < e.length; r++) o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[r].y)); else if (2 === e[0].length) for (var r = 0; r < e.length; r++) o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][ 1 ])); else if (3 === e[0].length) for (var r = 0; r < e.length; r++) o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][ 1 ], e[r][2])); this._polylines.push(this._viewer.entities.add({ name: "PolylineTrail", polyline: { positions: o, width: i.width, material: t, clampToGround: i.clampToGround } })); t = { id: this._core.getuid(), name: "新建流动线", pId: 0, type: "TrailLine", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, 0), this }, _u.prototype.createWall = function(e, t) { var i = { time: 9e3, LineColor: this._core.defaultValue((t = "number" == typeof(t = t || {}) ? { time: t } : t).color, this._cesium.Color.ORANGE), LinkImage: this._core.defaultValue(t.url, window.SmartEarthRootUrl + D.colors3) }, t = new ne((i = this._core.extend(i, t, !0)).LineColor, i.LinkImage, i.time || 9e3), o = []; if (e[0].x || e[0].y) if (void 0 !== e[0].z) if (-180 <= e[0].x && e[0].x <= 180) for (r = 0; r < e.length; r++) o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[ r].y, e[r].z)); else o = e; else for (r = 0; r < e.length; r++) o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[r].y)); else if (2 === e[0].length) for (var r = 0; r < e.length; r++) o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][ 1 ])); else if (3 === e[0].length) for (var r = 0; r < e.length; r++) o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][ 1 ], e[r][2])); this._polylines.push(this._viewer.entities.add({ name: "WallTrail", wall: { positions: o, material: t, maximumHeights: i.maximumHeights, minimumHeights: i.minimumHeights } })); t = { id: this._core.getuid(), name: "新建流动墙", pId: 0, type: "TrailLine", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, 0), this }, _u.prototype.parabolaEquation = function(e, t) { var i = this._core.defaultValue(e.height, 5e3), o = Math.abs(e.pt1.lon - e.pt2.lon) > Math.abs(e.pt1.lat - e.pt2.lat) ? Math.abs(e.pt1.lon - e.pt2.lon) : Math.abs(e.pt1.lat - e.pt2.lat), r = e.num && 50 < e.num ? e.num : 50, n = [], a = o / r, s = e.pt1.height || 0, l = e.pt2.height || 0; if (Math.abs(e.pt1.lon - e.pt2.lon) > Math.abs(e.pt1.lat - e.pt2.lat)) { var u = (e.pt2.lat - e.pt1.lat) / r; 0 < e.pt1.lon - e.pt2.lon && (a = -a); for (var c = 0; c <= r; c++) { var h = i - 4 * Math.pow(-.5 * o + Math.abs(a) * c, 2) * i / Math.pow(o, 2) + s + (l - s) * c / r, m = e.pt1.lon + a * c, d = e.pt1.lat + u * c; n.push([m, d, h]) } } else { var p = (e.pt2.lon - e.pt1.lon) / r; 0 < e.pt1.lat - e.pt2.lat && (a = -a); for (c = 0; c <= r; c++) { h = i - 4 * Math.pow(-.5 * o + Math.abs(a) * c, 2) * i / Math.pow(o, 2) + s + (l - s) * c / r, m = e.pt1.lon + p * c, d = e.pt1.lat + a * c; n.push([m, d, h]) } } return n }, _u.prototype.setThisPosition = function(e, t) { var i; this.pathMaterial && (i = this._cesium.Cartesian3.fromDegrees(e[0].lon, e[0].lat), e = this ._cesium.Cartesian3.fromDegrees(e[1].lon, e[1].lat), t = this._cesium.Cartesian3 .fromDegrees(t.lon, t.lat), e = this._core.getSpaceDistancem([i, e], this._cesium), i = this._core.getSpaceDistancem([i, t], this._cesium), this.pathMaterial.setScale(i / e)) }, _u.prototype.clear = function() { if (0 < this._points.length) for (var e = 0; e < this._points.length; e++) this._viewer.entities.remove(this._points[e]); if (0 < this._polylines.length) for (e = 0; e < this._polylines.length; e++) this._viewer.entities.remove(this._polylines[ e]); this._points = [], this._polylines = [], this.Streamerpath.removeAll(), this.Streamerwall .removeAll() }, _u.prototype.setTreeobj = function(e) { this.treeobj = e }, _u.prototype.deleteObject = function() { this.clear() }, _u.prototype.setVisibility = function(e) { if (0 < this._points.length) for (var t = 0; t < this._points.length; t++) this._points[t].show = e; if (0 < this._polylines.length) for (t = 0; t < this._polylines.length; t++) this._polylines[t].show = e; this.Streamerpath.show(e), this.Streamerwall.show(e) }, fu.prototype.createRoad = function(e = {}) { var t = { id: e.id || this._core.getuid(), image: window.SmartEarthRootUrl + D.road, height: 1, width: 20, alpha: 1 }, t = this._core.extend(t, e, !0); let i = []; e.positions.forEach(e => { e = this._core.toDegrees(e); i.push([e.lon, e.lat]) }); var o = Cesium_turf.lineString(i), o = this._Buffer.getBuff(o, t.width, { steps: 0 }), o = (this.item = this._Buffer.addBufferPolyogn(o, { material: new Cesium.ImageMaterialProperty({ image: t.image, color: Cesium.Color.WHITE.withAlpha(t.alpha) }), height: e.height, perPositionHeight: !1, stRotation: 90, heightReference: 0, outline: !1 }), { id: t.id, name: "新建道路图层", pId: 0, type: "RoadLayer", item: this }); return this.setTreeobj(o), this._tree.insertGroupId(o, 0), this }, fu.prototype.setTreeobj = function(e) { this.treeobj = e }, fu.prototype.deleteObject = function() { this.item && this._viewer.entities.remove(this.item) }, fu.prototype.setVisibility = function(e) { this.item && (this.item.show = e) }, yu.prototype.deleteObject = yu.prototype.cleanUp = function() { void 0 !== this._prevEntity && (this._viewer.entities.remove(this._prevEntity), this ._prevEntity = void 0), void 0 !== this._prevEntity1 && (this._viewer.entities.remove( this._prevEntity1), this._prevEntity1 = void 0), void 0 !== this._volumeLabel && (this ._viewer.entities.remove(this._volumeLabel), this._volumeLabel = void 0), void 0 !== this._volumeLabel1 && (this._viewer.entities.remove(this._volumeLabel1), this ._volumeLabel1 = void 0), this._volumeTin.forEach(e => { this._viewer.entities.remove(e) }), this._volumeTin = [], this.addPointHandle && (this.addPointHandle.destroy(), this .addPointHandle = void 0), this.Triangulation = [], this.tinData = void 0, this._tooltip .show(!1) }, yu.prototype.startDrawing = function(e = {}, t = "auto", a) { var s, l = this._scene, r = this._tooltip, u = [], c = [], h = [], m = (this._positions = c, this._degreesArr = h, this._drawColor.point = e.point || this ._drawColor.point, this._drawColor.polyline = e.polyline || this._drawColor.polyline, this._drawColor.polygon = e.polygon || this._drawColor.polygon, this.loadingImg = e .loading || this.loadingImg, this.tin = this._core.defaultValue(e.tin, !0), this .onlyTerrain = this._core.defaultValue(e.onlyTerrain, !0), this.selectDatum = this._core .defaultValue(e.selectDatum, !0), this), e = (this._mouseHandler && this._mouseHandler.destroy(), this.loading || this.addLoading(), new Cesium.ScreenSpaceEventHandler(l.canvas)); this._mouseHandler = e, this.cleanUp(), this._core.mouse(this._viewer.container, 1, window .SmartEarthRootUrl + D.draw); let d; function p() { return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(u)) } return e.setInputAction(function(e) { if (null != e.position) { var t = l.camera.getPickRay(e.position), t = l.globe.pick(t, l); if (!this._viewer.scene.pick(e.position) || (i = this._viewer.scene .pickPosition(e.position)) && (t = i), t) { var i = Cesium.Cartographic.fromCartesian(t), o = Cesium.Math.toDegrees(i.longitude), i = Cesium.Math.toDegrees(i.latitude); if (0 === u.length && (u.push(o, i), h.push([o, i]), c.push(t), s = t), 4 <= c.length) { var r = Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._viewer .scene, s); if (void 0 !== r) { var n = r.x - e.position.x, r = r.y - e.position.y; if (n * n + r * r < 16) return u.splice(u.length - 2, 2), c.pop(), void this.stopDrawing(a) } } u.push(o, i), h.push([o, i]), c.push(t), 2 !== c.length || d || (d = this ._viewer.entities.add({ name: "临时线", polyline: { positions: new Cesium.CallbackProperty(function() { return c }, !1), clampToGround: !0, material: m._drawColor.polygon, width: 3 } })), 3 === c.length && (d && this._viewer.entities.remove(d), this ._prevEntity = this._viewer.entities.add({ polygon: { hierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3 .fromDegreesArray(u)), material: m._drawColor.polygon, fill: !0 } }), this._prevEntity.polygon.hierarchy = new Cesium .CallbackProperty(p, !1)) } } }.bind(this), Cesium.ScreenSpaceEventType.LEFT_CLICK), e.setInputAction(function(e) { var t, i, o, e = e.endPosition; null != e && (0 === c.length ? r.showAt(e, "点击开始绘制第一个点") : (o = l.camera.getPickRay( e), o = l.globe.pick(o, l), (o = this._viewer.scene.pick(e) && (i = this._viewer.scene.pickPosition(e)) ? i : o) && (i = Cesium .Cartographic.fromCartesian(o), t = Cesium.Math.toDegrees(i .longitude), i = Cesium.Math.toDegrees(i.latitude), u.splice(u .length - 2, 2), h.pop(), c.pop(), u.push(t, i), h.push([t, i]), c.push(o), r.showAt(e, "右键结束绘制"), 3 <= c.length && 4 <= c.length && (void 0 !== (t = Cesium.SceneTransforms.wgs84ToWindowCoordinates( this._viewer.scene, s)) && (i = t.x - e.x, o = t.y - e.y, document.body.style.cursor = i * i + o * o < 16 ? "pointer" : "default"))))) }.bind(this), Cesium.ScreenSpaceEventType.MOUSE_MOVE), e.setInputAction(function(e) { this.end && this.end() }.bind(this), Cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { void 0 !== this._mouseHandler && (this._mouseHandler.destroy(), this._mouseHandler = void 0), this._core.mouse(this._viewer.container, 0), this._tooltip.show(!1), d && this._viewer.entities.remove(d), this.end = void 0, c.length < 3 || (this ._prevEntity && (this._prevEntity.polygon.hierarchy = Cesium.Cartesian3 .fromDegreesArray(u)), "cancel" === e ? this._prevEntity && this._viewer .entities.remove(this._prevEntity) : this.stopDrawing(t, a)) }, this }, yu.prototype.stopDrawing = function(i, o) { void 0 !== this._mouseHandler && (this._mouseHandler.destroy(), this._mouseHandler = void 0), void 0 !== this._volumeLabel && (this._viewer.entities.remove(this._volumeLabel), this ._volumeLabel = void 0), void 0 !== this._volumeLabel1 && (this._viewer.entities.remove( this._volumeLabel1), this._volumeLabel1 = void 0), this._volumeTin.forEach(e => { this._viewer.entities.remove(e) }), this._volumeTin = [], this.isLoading(!0), setTimeout(() => { var e = this.computeCutVolume(i, this.onlyTerrain); let t = i => { var e = i.maxHeight, t = i.minHeight, t = (this._prevEntity.polygon.height = i.minHeight, this._prevEntity .polygon.heightReference = 0, { id: this._core.getuid(), polygon: { hierarchy: { positions: this._positions }, height: t, extrudedHeight: e, closeTop: !1, closeBottom: !1, material: Cesium.Color.CYAN.withAlpha(.2), outline: !0, outlineColor: Cesium.Color.RED, outlineWidth: 2 } }); if (this._prevEntity1 = this._viewer.entities.add(t), "function" == typeof o && o(i), this.selectDatum) { let t = () => { this.addPoint(e => { this.setDatum(e, e => { "function" == typeof o && o({ ...i, ...e }), t() }) }) }; t() } }; this.onlyTerrain ? e.then(e => { t(e) }) : t(e) }, 100) }, yu.prototype.computeCentroidOfPolygon = function(e) { for (var t = [], i = [], o = 0, r = 0, n = 0; n < e.length; n++) { var a = Cesium.Cartographic.fromCartesian(e[n]); o += a.longitude, r += a.latitude, t.push(a.longitude), i.push(a.latitude) } var s = o / e.length, l = r / e.length; return new Cesium.Cartographic(s, l) }, yu.prototype.computeCutVolume = function(u, e) { var t, c = 15e3, h = -15e3; "auto" === u && (t = Cesium.BoundingSphere.fromPoints(this._positions), u = t.radius / 20); let m = this._core.getPointsInPolygon(this._degreesArr, u, !0), d = Cesium_turf.polygon([this._degreesArr]), i = () => { let e = this._core.tinFromPoints(m, { getArea: !0, polygon: d })["tin"], i = (this.tinData = e, { fill: 0, dig: 0 }), o = { fill: "立方米", dig: "立方米" }; var r, n, a, s, l = { fill: 1, dig: 1 }, t = (this.Triangulation = [], e.features.forEach(e => { var t; e.positions && (this.tin && (t = this._viewer.entities.add({ polygon: { hierarchy: new Cesium.PolygonHierarchy(e .positions), material: this._drawColor.polygon, perPositionHeight: !0, outline: !0, outlineColor: Cesium.Color.YELLOW } }), this._volumeTin.push(t)), t = e.geometry.coordinates[0], a = t[0][2], r = t[1][2], n = t[2][2], s = e.area, this .Triangulation.push({ bottomArea: s, height: [a, r, n] }), 0 < (a = (a - c + r - c + n - c) / 3) ? i.dig = i.dig + s * a * l.dig : i.fill = i.fill - s * a * l.fill, 1e10 < i.dig && "立方米" === o.dig && (i.dig = i.dig / 1e9, o.dig = "立方千米", l.dig = 1e-9), 1e10 < i.fill && "立方米" === o.fill && (i.fill = i .fill / 1e9, o.fill = "立方千米", l.fill = 1e-9)) }), this.computeCentroidOfPolygon(this._positions)); return this._volumeLabel = this._viewer.entities.add({ position: Cesium.Cartesian3.fromRadians(t.longitude, t.latitude, h), label: { text: "挖方体积:" + i.dig.toFixed(4) + o.dig, pixelOffset: { x: 0, y: -30 }, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), this._volumeLabel1 = this._viewer.entities.add({ position: Cesium.Cartesian3.fromRadians(t.longitude, t.latitude, h), label: { text: "填方体积:" + i.fill.toFixed(4) + o.fill, pixelOffset: { x: 0, y: -70 }, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), this.isLoading(!1), { maxHeight: h, minHeight: c, volume: i, unit: o, spacing: u } }; if (e) { let t = []; return m.features.forEach(e => { e = e.geometry.coordinates; t.push(Cesium.Cartographic.fromDegrees(e[0], e[1])) }), this._core.getHeightsFromLonLat(this._viewer, t).then(o => (m.features.forEach((e, t) => { let i = e.geometry.coordinates; i[2] = o[t] || 0, h < i[2] && (h = i[2]), c > i[2] && (c = i[2]) }), i())) } return m.features.forEach(e => { let t = e.geometry.coordinates; e = new Cesium.Cartographic(Cesium.Math.toRadians(t[0]), Cesium.Math.toRadians(t[ 1])); t[2] = Viewer.scene.sampleHeight(e) || 0, h < t[2] && (h = t[2]), c > t[2] && (c = t[2]) }), i() }, yu.prototype.addLoading = function() { var e = document.createElement("div"), t = (e.id = "cesiumLoading", e.style.cssText = "width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;", document.createElement("img")); t.style.cssText = "position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;", t.src = this.loadingImg, e.appendChild(t), this.loading = e, this._viewer.container .appendChild(e) }, yu.prototype.isLoading = function(e) { this.loading.style.display = e ? "block" : "none" }, yu.prototype.removeLoading = function() { this.loading && this.loading.remove(), this.loading = void 0 }, yu.prototype.addPoint = function(i) { this.addPointHandle && (this.addPointHandle.destroy(), this.addPointHandle = null), this ._prevEntity1 && (this.addPointHandle = new Cesium.ScreenSpaceEventHandler(this._viewer .scene.canvas), this.addPointHandle.setInputAction(function(e) { var t = this._viewer.scene.pick(e.position); t && t.id && t.id.id === this._prevEntity1.id && ((t = this._viewer.scene .pickPosition(e.position)) && (e = Cesium.Cartographic .fromCartesian(t), this.addPointHandle.destroy(), this .addPointHandle = null, i && "function" == typeof i && i(e.height .toFixed(1)))) }.bind(this), Cesium.ScreenSpaceEventType.LEFT_CLICK), this.addPointHandle .setInputAction(function(e) { var t = this._viewer.scene.pick(e.endPosition); t && t.id && t.id.id === this._prevEntity1.id ? this._tooltip.showAt(e .endPosition, "点击修改基准面高度") : this._tooltip.show(!1) }.bind(this), Cesium.ScreenSpaceEventType.MOUSE_MOVE)) }, yu.prototype.showTin = function(e) { this.tin = e, this._volumeTin.forEach(e => { this._viewer.entities.remove(e) }), this._volumeTin = [], e && this.tinData && this.tinData.features.forEach(e => { e.positions && (e = this._viewer.entities.add({ polygon: { hierarchy: new Cesium.PolygonHierarchy(e.positions), material: this._drawColor.polygon, perPositionHeight: !0, outline: !0, outlineColor: Cesium.Color.YELLOW } }), this._volumeTin.push(e)) }) }, yu.prototype.setDatum = function(t, e) { var i, o, r, n, a; this.Triangulation && 0 < this.Triangulation.length && (r = { fill: 0, dig: 0 }, n = { fill: "立方米", dig: "立方米" }, a = { fill: 1, dig: 1 }, this.Triangulation.forEach(function(e) { i = e.bottomArea, o = e.height, 0 < (o = (o[0] - t + o[1] - t + o[2] - t) / 3) ? r.dig = r.dig + i * o * a.dig : r.fill = r.fill - i * o * a.fill, 1e10 < r .dig && "立方米" === n.dig && (r.dig = r.dig / 1e9, n.dig = "立方千米", a.dig = 1e-9), 1e10 < r.fill && "立方米" === n.fill && (r.fill = r.fill / 1e9, n .fill = "立方千米", a.fill = 1e-9) }), this._volumeLabel.label.text = "挖方体积:" + r.dig.toFixed(4) + n.dig, this ._volumeLabel1.label.text = "填方体积:" + r.fill.toFixed(4) + n.fill, this._prevEntity .polygon.height = t, e && "function" == typeof e && e({ volume: r, unit: n })) }, vu.prototype.createHawkeye = function(e, t) { var i = document.createElement("div"); i.id = "Hawkeye", i.style.position = "absolute", i.style.width = "15%", i.style.height = "20%", i.style.bottom = "0", i.style.right = "0", i.style.pointerEvents = "none", t && (t.width && (i.style.width = t.width), t.height && (i.style.height = t.height), t.bottom && (i.style .bottom = t.bottom), t.right && (i.style.right = t.right), t.top && (i.style.top = t .top, i.style.bottom = "unset"), t.left && (i.style.left = t.left, i.style.right = "unset")), this._viewer.container.appendChild(i); let o; o = e.url ? new this._cesium.SingleTileImageryProvider({ url: e.url }) : e.imageryProvider; var r = new this._cesium.Viewer("Hawkeye", { imageryProvider: o, baseLayerPicker: !1, shadows: !1, shouldAnimate: !0, animation: !0, scene3DOnly: !0, fullscreenButton: !1, geocoder: !1, homeButton: !1, infoBox: !1, selectionIndicator: !1, timeline: !1, navigationHelpButton: !1 }), n = (r._cesiumWidget._creditContainer.style.display = "none", this); let a = this._core.defaultValue(t && t.height, 1e4); function s() { var e = n._viewer.camera.position; let t = Cesium.Cartographic.fromCartesian(e); t.height += a, r.camera.setView({ destination: Cesium.Cartographic.toCartesian(t), orientation: { heading: n._viewer.camera.heading, pitch: n._viewer.camera.pitch, roll: n._viewer.camera.roll } }) } return n._viewer.scene.preRender.addEventListener(s), this.close = function() { n._viewer.scene.preRender.removeEventListener(s), r.destroy(), i.remove(), n.close = void 0 }, this }, Q.prototype.createBezierline = function(o, t) { var r, n = this, a = this._viewer, s = [], l = [], u = void 0, c = "单击开始绘制"; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this._core .mouse(this._viewer.container, 1, window.SmartEarthRootUrl + D.draw), this.drawHandler = new Cesium.ScreenSpaceEventHandler(a.scene.canvas), V.states = 1, this.drawHandler .setInputAction(function(e) { c = "左键添加点 右键结束"; e = e.position, e = n._createGeoPoints(a, [{ x: e.x, y: e.y }]); 0 == s.length && (s.push({ x: e[0], y: e[1], z: e[2] }), l.push(e)), l.push(e), s.push({ x: e[0], y: e[1], z: e[2] }) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(function(e) { n._core.CreateTooltip(c, e.endPosition, !0); var t, i, e = e.endPosition; 0 < s.length && (Cesium.defined(u) ? (s.pop(), l.pop(), i = n._createGeoPoints(a, [{ x: e.x, y: e.y }]), s.push({ x: i[0], y: i[1], z: i[2] }), l.push(i), t = n._createBezierPoints(s), i = [], t.forEach(e => { i.push(e.x, e.y, s[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (t = n ._createBezierPoints(s), i = [], t.forEach(e => { i.push(e.x, e.y, s[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i), (u = a.entities .add({ name: "Bezierline", polyline: { positions: new Cesium.CallbackProperty(function() { return r }, !1), clampToGround: !0, width: n._core.defaultValue(o.width, 2), material: Cesium.Color.fromCssColorString(n._core .defaultValue(o.color, "#ff0000")) } })).GeoType = "Bezierline", n.MilitaryStandardObj.push(u.id))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(function(e) { n.end && n.end() }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), this.end = e => { this.end = void 0, u && (u.pottingPoint = l), n.drawHandler.destroy(), n._core .CreateTooltip(c, void 0, !1), n._core.mouse(n._viewer.container, 0), setTimeout( function() { V.states = 0 }, 100), "cancel" === e ? u && (a.entities.remove(u), n.MilitaryStandardObj .pop()) : t && t(u) }, this }, Q.prototype.createBezierArrow = function(o, t) { var r, n = this, a = this._viewer, s = "单击开始绘制", l = [], u = [], c = void 0; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), n._core .mouse(n._viewer.container, 1, window.SmartEarthRootUrl + D.draw), V.states = 1, n .drawHandler = new Cesium.ScreenSpaceEventHandler(a.scene.canvas), n.drawHandler .setInputAction(function(e) { s = "左键添加点 右键结束"; e = e.position, e = n._createGeoPoints(a, [{ x: e.x, y: e.y }]); 0 == l.length && (l.push({ x: e[0], y: e[1], z: e[2] }), u.push(e)), l.push({ x: e[0], y: e[1], z: e[2] }), u.push(e) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), n.drawHandler.setInputAction(function(e) { n._core.CreateTooltip(s, e.endPosition, !0); var t, i, e = e.endPosition; 0 < l.length && (Cesium.defined(c) ? (l.pop(), u.pop(), i = n._createGeoPoints(a, [{ x: e.x, y: e.y }]), l.push({ x: i[0], y: i[1], z: i[2] }), u.push(i), t = n._createBezierPoints(l), i = [], t.forEach(e => { i.push(e.x, e.y, l[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (t = n ._createBezierPoints(l), i = [], t.forEach(e => { i.push(e.x, e.y, l[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i), (c = a.entities .add({ name: "BezierArrow", polyline: { positions: new Cesium.CallbackProperty(function() { return r }, !1), clampToGround: !0, width: n._core.defaultValue(o.width, 5), material: new Cesium.PolylineArrowMaterialProperty( Cesium.Color.fromCssColorString(n._core .defaultValue(o.color, "#ff0000"))) } })).GeoType = "BezierArrow", n.MilitaryStandardObj.push(c.id))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), n.drawHandler.setInputAction(function(e) { n.end && n.end() }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), this.end = e => { this.end = void 0, c && (c.pottingPoint = u), n.drawHandler.destroy(), n._core .CreateTooltip(s, void 0, !1), n._core.mouse(n._viewer.container, 0), setTimeout( function() { V.states = 0 }, 100), "cancel" === e ? c && (a.entities.remove(c), n.MilitaryStandardObj .pop()) : t && t(c) }, this }, Q.prototype.createSwallowtailArrow = function(e, o, t) { var r, n = e, a = this, s = this._viewer, l = void 0, u = [], c = [], h = "单击开始绘制"; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), a._core .mouse(a._viewer.container, 1, window.SmartEarthRootUrl + D.draw), V.states = 1, a .drawHandler = new Cesium.ScreenSpaceEventHandler(s.scene.canvas), a.drawHandler .setInputAction(function(e) { var e = e.position; h = "单击完成绘制", 0 == c.length ? (e = a._createGeoPoints(s, [{ x: e.x, y: e.y }]), c.push({ x: e[0], y: e[1], z: e[2] }, { x: e[0] + 1e-7, y: e[1] + 1e-7, z: e[2] }), u.push(e, e)) : 2 == c.length && a.end && a.end() }, Cesium.ScreenSpaceEventType.LEFT_CLICK), a.drawHandler.setInputAction(function(e) { a._core.CreateTooltip(h, e.endPosition, !0); var t, i, e = e.endPosition; 1 < c.length && (Cesium.defined(l) ? (c.pop(), u.pop(), i = a._createGeoPoints(s, [{ x: e.x, y: e.y }]), c.push({ x: i[0], y: i[1], z: i[2] }), u.push(i), t = a._computeSwallowtailArrow(c), i = [], t.forEach( e => { i.push(e.x, e.y, c[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (l = a .plotingSwallowtailArrow(s, c, n, o), t = a._computeSwallowtailArrow(c), i = [], t.forEach(e => { i.push(e.x, e.y, c[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i), l.polygon .hierarchy = new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(r) }, !1), l.GeoType = "SwallowtailArrow", a.MilitaryStandardObj.push(l.id) )) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), a.drawHandler.setInputAction(function(e) { a.end && a.end() }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), this.end = e => { this.end = void 0, l && (l.pottingPoint = u), a._core.CreateTooltip(h, void 0, !1), a .drawHandler.destroy(), a._core.mouse(a._viewer.container, 0), setTimeout( function() { V.states = 0 }, 100), "cancel" === e ? l && (s.entities.remove(l), a.MilitaryStandardObj.pop()) : t && t(l) }, this }, Q.prototype.createStraightArrow = function(e, o, t) { var r, n = e, a = this, s = this._viewer, l = [], u = void 0, c = [], h = "单击开始绘制"; return V.states = 1, this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), a._core.mouse(a._viewer.container, 1, window.SmartEarthRootUrl + D.draw), a .drawHandler = new Cesium.ScreenSpaceEventHandler(s.scene.canvas), a.drawHandler .setInputAction(function(e) { var e = e.position; h = "单击完成绘制", 0 == l.length ? (e = a._createGeoPoints(s, [{ x: e.x, y: e.y }]), l.push({ x: e[0], y: e[1], z: e[2] }, { x: e[0] + 1e-7, y: e[1] + 1e-7, z: e[2] }), c.push(e, e)) : 2 == l.length && a.end && a.end() }, Cesium.ScreenSpaceEventType.LEFT_CLICK), a.drawHandler.setInputAction(function(e) { var t, i, e = e.endPosition; a._core.CreateTooltip(h, e, !0), 1 < l.length && (Cesium.defined(u) ? (l.pop(), c .pop(), i = a._createGeoPoints(s, [{ x: e.x, y: e.y }]), l.push({ x: i[0], y: i[1], z: i[2] }), c.push(i), t = a.calculateMorePoints(l), i = [], t.forEach(e => { i.push(e.x, e.y, l[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (t = a .calculateMorePoints(l), i = [], t.forEach(e => { i.push(e.x, e.y, l[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i), "polygon" == n ? u = s.entities.add({ name: "StraightArrow", polygon: { hierarchy: r, material: Cesium.Color.fromCssColorString(a._core .defaultValue(o.color, "rgba(255,0,0,0.6)")) } }) : "box" == n && (u = s.entities.add({ name: "StraightArrow", polygon: { hierarchy: r, material: Cesium.Color.fromCssColorString(a._core .defaultValue(o.color, "rgba(255,0,0,0.6)")), extrudedHeight: i[2] + a._core.defaultValue(o .extrudedHeight, 200), height: i[2], outline: a._core.defaultValue(o.outline, !0), outlineColor: Cesium.Color.fromCssColorString(a._core .defaultValue(o.outlineColor, "rgba(255,0,0,0.6)")) } })), u.polygon.hierarchy = new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(r) }, !1), u.GeoType = "StraightArrow", a.MilitaryStandardObj.push(u.id))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), a.drawHandler.setInputAction(function(e) { a.end && a.end() }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), this.end = e => { this.end = void 0, u && (u.pottingPoint = c), a._core.CreateTooltip(h, void 0, !1), a .drawHandler.destroy(), a._core.mouse(a._viewer.container, 0), setTimeout( function() { V.states = 0 }, 100), "cancel" === e ? u && (s.entities.remove(u), a.MilitaryStandardObj.pop()) : t && t(u) }, this }, Q.prototype.createRoundedRectangle = function(e, o, t) { var r, n = e, a = "单击开始绘制", s = this, l = this._viewer, u = [], c = [], h = void 0; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), s._core .mouse(s._viewer.container, 1, window.SmartEarthRootUrl + D.draw), V.states = 1, s .drawHandler = new Cesium.ScreenSpaceEventHandler(l.scene.canvas), s.drawHandler .setInputAction(function(e) { var e = e.position; a = "单击完成绘制", 0 == u.length ? (e = s._createGeoPoints(l, [{ x: e.x, y: e.y }]), u.push({ x: e[0], y: e[1], z: e[2] }, { x: e[0] + 1e-7, y: e[1] + 1e-7, z: e[2] }), c.push(e, e)) : 2 == u.length && s.end && s.end() }, Cesium.ScreenSpaceEventType.LEFT_CLICK), s.drawHandler.setInputAction(function(e) { s._core.CreateTooltip(a, e.endPosition, !0); var t, i, e = e.endPosition; 1 < u.length && (Cesium.defined(h) ? (u.pop(), c.pop(), i = s._createGeoPoints(l, [{ x: e.x, y: e.y }]), u.push({ x: i[0], y: i[1], z: i[2] }), c.push(i), t = s._computeRoundedRectanglePoints(u), i = [], t .forEach(e => { i.push(e.x, e.y, u[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (t = s ._computeRoundedRectanglePoints(u), i = [], t.forEach(e => { i.push(e.x, e.y, u[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i), "polygon" == n ? h = l.entities.add({ name: "RoundedRectangle", polygon: { hierarchy: r, material: Cesium.Color.fromCssColorString(s._core .defaultValue(o.color, "rgba(255,0,0,0.6)")), outline: s._core.defaultValue(o.outline, !0), outlineColor: Cesium.Color.fromCssColorString(s._core .defaultValue(o.outlineColor, "rgba(255,0,0,0.6)")) } }) : "box" == n && (h = l.entities.add({ name: "RoundedRectangle", polygon: { hierarchy: r, material: Cesium.Color.fromCssColorString(s._core .defaultValue(o.color, "rgba(255,0,0,0.6)")), outline: s._core.defaultValue(o.outline, !0), outlineColor: Cesium.Color.fromCssColorString(s._core .defaultValue(o.outlineColor, "rgba(255,0,0,0.6)")), extrudedHeight: i[2] + s._core.defaultValue(o .extrudedHeight, 200), height: i[2] } })), h.polygon.hierarchy = new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(r) }, !1), h.GeoType = "RoundedRectangle", s.MilitaryStandardObj.push(h.id) )) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), s.drawHandler.setInputAction(function(e) { s.end && s.end() }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), this.end = e => { this.end = void 0, h && (h.pottingPoint = c), s._core.CreateTooltip(a, void 0, !1), s .drawHandler.destroy(), s._core.mouse(s._viewer.container, 0), setTimeout( function() { V.states = 0 }, 100), "cancel" === e ? h && (l.entities.remove(h), s.MilitaryStandardObj.pop()) : t && t(h) }, this }, Q.prototype.createSector = function(e, o, t) { var r, n, a, s = e, l = "单击开始绘制", u = this._viewer, c = this, h = [], m = []; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), c._core .mouse(c._viewer.container, 1, window.SmartEarthRootUrl + D.draw), V.states = 1, c .drawHandler = new Cesium.ScreenSpaceEventHandler(u.scene.canvas), c.drawHandler .setInputAction(function(e) { l = "单击添加点"; e = e.position, e = c._createGeoPoints(u, [{ x: e.x, y: e.y }]); 0 == h.length ? (h.push({ x: e[0], y: e[1], z: e[2] }, { x: e[0], y: e[1], z: e[2] }), m.push(e, e)) : 2 == h.length ? (h.push({ x: e[0], y: e[1], z: e[2] }), m.push(e)) : 3 == h.length && c.end && c.end(), 2 !== m.length || n || (n = u.entities.add({ name: "临时线", polyline: { positions: new Cesium.CallbackProperty(function() { return [Cesium.Cartesian3.fromDegrees(m[0][0], m[0][ 1 ]), Cesium.Cartesian3.fromDegrees(m[1][0], m[1][1])] }, !1), clampToGround: !0, material: Cesium.Color.fromCssColorString(c._core.defaultValue(o .color, "rgba(255,0,0,0.6)")), width: 3 } })) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), c.drawHandler.setInputAction(function(e) { c._core.CreateTooltip(l, e.endPosition, !0); var t, i, e = e.endPosition; 2 === h.length && (h.pop(), m.pop(), i = c._createGeoPoints(u, [{ x: e.x, y: e.y }]), h.push({ x: i[0], y: i[1], z: i[2] }), m.push(i)), 2 < h.length && (n && u.entities.remove(n), Cesium.defined(r) ? (h.pop(), m.pop(), i = c._createGeoPoints(u, [{ x: e.x, y: e.y }]), h.push({ x: i[0], y: i[1], z: i[2] }), m.push(i), t = c._computeSectorPoints(h), i = [], t.forEach(e => { i.push(e.x, e.y, h[0].z) }), a = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (t = c ._computeSectorPoints(h), i = [], t.forEach(e => { i.push(e.x, e.y, h[0].z) }), a = Cesium.Cartesian3.fromDegreesArrayHeights(i), "polygon" == s ? r = u.entities.add({ name: "Sector", polygon: { hierarchy: a, material: Cesium.Color.fromCssColorString(c._core .defaultValue(o.color, "rgba(255,0,0,0.6)")), outline: c._core.defaultValue(o.outline, !0), outlineColor: Cesium.Color.fromCssColorString(c._core .defaultValue(o.outlineColor, "rgba(255,0,0,0.6)")) } }) : "box" == s && (r = u.entities.add({ name: "Sector", polygon: { hierarchy: a, material: Cesium.Color.fromCssColorString(c._core .defaultValue(o.color, "rgba(255,0,0,0.6)")), outline: c._core.defaultValue(o.outline, !0), outlineColor: Cesium.Color.fromCssColorString(c._core .defaultValue(o.outlineColor, "rgba(255,0,0,0.6)")), extrudedHeight: i[2] + c._core.defaultValue(o .extrudedHeight, 200), height: i[2] } })), r.polygon.hierarchy = new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(a) }, !1), r.GeoType = "Sector", c.MilitaryStandardObj.push(r.id))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), c.drawHandler.setInputAction(function(e) { c.end && c.end() }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), this.end = e => { this.end = void 0, r && (r.pottingPoint = m), c._core.CreateTooltip(l, void 0, !1), c .drawHandler.destroy(), c._core.mouse(c._viewer.container, 0), n && u.entities .remove(n), setTimeout(function() { V.states = 0 }, 100), "cancel" === e ? r && (u.entities.remove(r), c.MilitaryStandardObj.pop()) : t && t(r) }, this }, Q.prototype.createBow = function(e, r, t) { var n, a = e, s = this, l = this._viewer, u = "单击开始绘制", c = [], h = [], m = void 0; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), s._core .mouse(s._viewer.container, 1, window.SmartEarthRootUrl + D.draw), V.states = 1, s .drawHandler = new Cesium.ScreenSpaceEventHandler(l.scene.canvas), s.drawHandler .setInputAction(function(e) { u = "单击添加点"; e = e.position, e = s._createGeoPoints(l, [{ x: e.x, y: e.y }]); 0 == c.length ? (c.push({ x: e[0], y: e[1], z: e[2] }), h.push(e)) : 1 == c.length ? (c.push({ x: e[0], y: e[1], z: e[2] }, { x: e[0] + 1e-7, y: e[1] + 1e-7, z: e[2] }), h.push(e, e)) : 3 == c.length && s.end && s.end() }, Cesium.ScreenSpaceEventType.LEFT_CLICK), s.drawHandler.setInputAction(function(e) { var t, i, o = e.endPosition; s._core.CreateTooltip(u, e.endPosition, !0), 2 < c.length && (Cesium.defined(m) ? (c .pop(), h.pop(), i = s._createGeoPoints(l, [{ x: o.x, y: o.y }]), c.push({ x: i[0], y: i[1], z: i[2] }), h.push(i), t = s._computeBowPoints(c), i = [], t.forEach(e => { i.push(e.x, e.y, c[0].z) }), n = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (t = s ._computeBowPoints(c), i = [], t.forEach(e => { i.push(e.x, e.y, c[0].z) }), n = Cesium.Cartesian3.fromDegreesArrayHeights(i), "polygon" == a ? m = l.entities.add({ name: "Bow", polygon: { hierarchy: n, material: Cesium.Color.fromCssColorString(s._core .defaultValue(r.color, "rgba(255,0,0,0.6)")), outline: s._core.defaultValue(r.outline, !0), outlineColor: Cesium.Color.fromCssColorString(s._core .defaultValue(r.outlineColor, "rgba(255,0,0,0.6)")) } }) : "box" == a && (m = l.entities.add({ name: "Bow", polygon: { hierarchy: n, material: Cesium.Color.fromCssColorString(s._core .defaultValue(r.color, "rgba(255,0,0,0.6)")), outline: s._core.defaultValue(r.outline, !0), outlineColor: Cesium.Color.fromCssColorString(s._core .defaultValue(r.outlineColor, "rgba(255,0,0,0.6)")), extrudedHeight: i[2] + s._core.defaultValue(r .extrudedHeight, 200), height: i[2] } })), m.polygon.hierarchy = new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(n) }, !1), m.GeoType = "Bow", s.MilitaryStandardObj.push(m.id))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), s.drawHandler.setInputAction(function(e) { s.end && s.end() }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), this.end = e => { this.end = void 0, m && (m.pottingPoint = h), s._core.CreateTooltip(u, void 0, !1), s .drawHandler.destroy(), s._core.mouse(s._viewer.container, 0), setTimeout( function() { V.states = 0 }, 100), "cancel" === e ? m && (l.entities.remove(m), s.MilitaryStandardObj.pop()) : t && t(m) }, this }, Q.prototype.createPincerArrow = function(e, o, r) { var n = e, a = this, s = this._viewer, l = [], u = [], c = void 0, h = "单击开始绘制"; this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), a._core.mouse(a ._viewer.container, 1, window.SmartEarthRootUrl + D.draw), V.states = 1, a.drawHandler = new Cesium.ScreenSpaceEventHandler(s.scene.canvas), a.drawHandler.setInputAction(function( e) { var t, i = e.position; h = "单击增加点", (t = a._getPosition.getMousePosition(e)) && (4 < l.length ? (a._core .CreateTooltip(h, e.position, !1), c.pottingPoint = u, a.drawHandler .destroy(), a._core.mouse(a._viewer.container, 0), setTimeout( function() { V.states = 0 }, 100), r && r(c)) : (l.push(t), e = a._createGeoPoints(s, [{ x: i.x, y: i.y }]), u.push(e))) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), a.drawHandler.setInputAction(function(e) { var t, i; l.length < 2 || (a._core.CreateTooltip(h, e.endPosition, !0), (t = a._getPosition .getMousePosition(e)) && 2 <= l.length && (Cesium.defined(c) ? (l.pop(), u.pop(), l.push(t), i = a._createGeoPoints(s, [e.endPosition]), u .push(i)) : (l.push(t), i = a._createGeoPoints(s, [e.endPosition]), u.push(i), (c = a.showArrowOnMap(l, n, o)).GeoType = "PincerArrow", a.MilitaryStandardObj.push(c.id)))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) }, Q.prototype.createAttackArrow = function(e, o, t) { var r = e, n = this, a = this._viewer, s = [], l = [], u = void 0, c = "单击开始绘制"; this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), n._core.mouse(n ._viewer.container, 1, window.SmartEarthRootUrl + D.draw), V.states = 1, n.drawHandler = new Cesium.ScreenSpaceEventHandler(a.scene.canvas), n.drawHandler.setInputAction(function( e) { var t; c = "单击增加点", (t = n._getPosition.getMousePosition(e)) && (s.push(t), t = n ._createGeoPoints(a, [e.position]), l.push(t)) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), n.drawHandler.setInputAction(function(e) { 1 < s.length && (s.pop(), l.pop()) }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), n.drawHandler.setInputAction(function( e) { var t, i; s.length < 2 || (n._core.CreateTooltip(c, e.endPosition, !0), (t = n._getPosition .getMousePosition(e)) && 2 <= s.length && (Cesium.defined(u) ? (s.pop(), l.pop(), s.push(t), i = n._createGeoPoints(a, [e.endPosition]), l .push(i)) : (s.push(t), i = n._createGeoPoints(a, [e.endPosition]), l.push(i), (u = n.showAttackArrowOnMap(s, r, o)).GeoType = "AttackArrow", n.MilitaryStandardObj.push(u.id)))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), n.drawHandler.setInputAction(function(e) { n._core.CreateTooltip(c, e.position, !1), u.pottingPoint = l, n.drawHandler .destroy(), n._core.mouse(n._viewer.container, 0), setTimeout(function() { V.states = 0 }, 100), t && t(u) }, Cesium.ScreenSpaceEventType.RIGHT_DOWN) }, Q.prototype.createHandlerPolygon = function(e, a, i) { var s, l = e, u = "单击开始绘制", c = this, h = this._viewer, m = [], d = [], p = void 0; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), c._core .mouse(c._viewer.container, 1, window.SmartEarthRootUrl + D.draw), V.states = 1, c .drawHandler = new Cesium.ScreenSpaceEventHandler(h.scene.canvas), c.drawHandler .setInputAction(function(e) { var t, e = e.position; u = "单击完成绘制", 0 == m.length ? (t = c._createGeoPoints(h, [{ x: e.x, y: e.y }]), m.push({ x: t[0], y: t[1], z: t[2] }, { x: t[0] + 1e-7, y: t[1] + 1e-7, z: t[2] }), d.push(t, t)) : 2 == m.length && (c._core.CreateTooltip(u, e, !1), p .pottingPoint = d, setTimeout(function() { V.states = 0 }, 100), c.drawHandler.destroy(), c._core.mouse(c._viewer.container, 0), i && i(p)) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), c.drawHandler.setInputAction(function(e) { var t, i, o, r, n = e.endPosition; c._core.CreateTooltip(u, e.endPosition, !0), 1 < m.length && (Cesium.defined(p) ? (m .pop(), d.pop(), r = c._createGeoPoints(h, [{ x: n.x, y: n.y }]), m.push({ x: r[0], y: r[1], z: r[2] }), d.push(r), i = c._computeGatheringPlacePoints(m), o = c .createCloseCardinal(i), r = [], (t = c.calculatePointsFBZ3(o, 100)) .forEach(e => { r.push(e.x, e.y, m[0].z) }), s = r) : (i = c._computeGatheringPlacePoints(m), o = c .createCloseCardinal(i), t = c.calculatePointsFBZ3(o, 100), r = [], t .forEach(e => { r.push(e.x, e.y, m[0].z) }), s = r, (p = c.plotingGatheringPlace(h, m, l, a)).polygon.hierarchy = new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(Cesium.Cartesian3 .fromDegreesArrayHeights(s)) }, !1), p.GeoType = "GatheringPlace", c.MilitaryStandardObj.push(p.id))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), m }, Q.prototype.plotingGatheringPlace = function(e, t, i, o) { t = this._computeGatheringPlacePoints(t), t = this.createCloseCardinal(t), t = this .calculatePointsFBZ3(t, 100), t = this._createGeoPoints(e, t), i = "polygon" == i ? e .entities.add({ name: "GatheringPlace", polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights(t), material: Cesium.Color.fromCssColorString(this._core.defaultValue(o.color, "rgba(255,0,0,0.6)")), outline: this._core.defaultValue(o.outline, !0), outlineColor: Cesium.Color.fromCssColorString(this._core.defaultValue(o .outlineColor, "rgba(255,0,0,0.6)")) } }) : e.entities.add({ name: "GatheringPlace", polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights(t), extrudedHeight: this._core.defaultValue(o.extrudedHeight, 200) + t[2], height: t[2], material: Cesium.Color.fromCssColorString(this._core.defaultValue(o.color, "rgba(255,0,0,0.6)")), outline: this._core.defaultValue(o.outline, !0), outlineColor: Cesium.Color.fromCssColorString(this._core.defaultValue(o .outlineColor, "rgba(255,0,0,0.6)")) } }); return i }, Q.prototype.addFeature = function(e) { let t, i = e.geometry.coordinates, o = []; if ("PincerArrow" == e.type) { var r = j.algorithm.doubleArrow(i); let e = []; - 1 == JSON.stringify(r.polygonalPoint).indexOf("null") && (e = r .polygonalPoint), t = e } else if ("AttackArrow" == e.type) { r = j.algorithm.tailedAttackArrow(i); let e = []; - 1 == JSON.stringify(r.polygonalPoint).indexOf("null") && (e = r .polygonalPoint), t = e } else i.forEach(e => { o.push({ x: e[0], y: e[1], z: e[2] }) }), "StraightArrow" == e.type ? t = this.calculateMorePoints(o) : "RoundedRectangle" == e .type ? t = this._computeRoundedRectanglePoints(o) : "Sector" == e.type ? t = this ._computeSectorPoints(o) : "Bow" == e.type ? t = this._computeBowPoints(o) : "GatheringPlace" == e.type ? (r = this._computeGatheringPlacePoints(o), r = this .createCloseCardinal(r), t = this.calculatePointsFBZ3(r, 100)) : "SwallowtailArrow" == e .type ? t = this._computeSwallowtailArrow(o) : "Bezierline" != e.type && "BezierArrow" != e .type || (t = this._createBezierPoints(o)); let n; n = "AttackArrow" !== e.type && "PincerArrow" !== e.type ? (n = [], t.forEach(e => { n.push(e.x, e.y, o[0].z) }), Cesium.Cartesian3.fromDegreesArrayHeights(n)) : t; let a; return (a = 0 <= e.type.indexOf("Bezier") ? this._viewer.entities.add({ name: e.name, polyline: { positions: new Cesium.CallbackProperty(function() { return n }, !1), width: e.style.width, clampToGround: !0, material: "BezierArrow" === e.type ? new Cesium .PolylineArrowMaterialProperty(new Cesium.Color.fromCssColorString(e .style.fillColor.color).withAlpha(e.style.fillColor.alpha)) : new Cesium.Color.fromCssColorString(e.style.fillColor.color).withAlpha(e .style.fillColor.alpha) } }) : this._viewer.entities.add({ name: e.name, polygon: { hierarchy: new Cesium.CallbackProperty(function() { return new Cesium.PolygonHierarchy(n) }, !1), fill: !0, extrudedHeight: void 0 !== e.style.extrudedHeight ? e.style.extrudedHeight + e.style.height : void 0, height: e.style.height, material: new Cesium.Color.fromCssColorString(e.style.fillColor.color) .withAlpha(e.style.fillColor.alpha), outline: e.style.outline, outlineColor: e.style.outlineColor ? new Cesium.Color.fromCssColorString(e .style.outlineColor.color).withAlpha(e.style.outlineColor.alpha) : void 0 } })).GeoType = e.type, a.pottingPoint = i, this.MilitaryStandardObj.push(a.id), a }, Q.prototype.open = function(e) { var t = this, i = this._viewer, o = new FileReader, r = (o.readAsText(e), new Cesium.EntityCollection); o.onload = function() { let e = JSON.parse(this.result).features; e.forEach(e => { e = t.addFeature(e); r.add(e) }), i.flyTo(r), t.MilitaryStandardObj.length && !t.editHandler && t.edit(t.openEdit, t.editOption) } }, Q.prototype.clear = function() { var t = this._viewer; this.MilitaryStandardObj.forEach(e => { t.entities.removeById(e) }), this.MilitaryStandardObj = [], window.layuiLayer.close(SmartEarthPopupData.layerIndex), !this.MilitaryStandardObj.length && this.editHandler && this.edit(!1) }, Q.prototype.getColor = function(e) { return { color: this.colorHex("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")"), alpha: e.alpha } }, Q.prototype.getFeature = function(e) { let t = { type: e.GeoType, name: e.name, editType: "" }; var i = e.pottingPoint; return e.polyline ? (t.editType = "GroundPolyline", t.geometry = { type: "polyline", coordinates: i }, t.style = { fillColor: this.getColor(e.polyline.material.color._value), width: e.polyline.width.getValue() }) : (t.editType = "GroundPolygon", t.geometry = { type: "polygon", coordinates: i }, t.style = { fillColor: this.getColor(e.polygon.material.color._value) }, e.polygon.extrudedHeight && (t.editType = "ExtrudedPolygon", t.style.height = e .polygon.height.getValue(), t.style.extrudedHeight = e.polygon.extrudedHeight .getValue() - e.polygon.height.getValue(), e.polygon.outline && (t.style.outline = e .polygon.outline.getValue()), e.polygon.outlineColor && (t.style.outlineColor = this.getColor(e.polygon.outlineColor._value)))), t }, Q.prototype.save = function() { var t, i = this._viewer, o = { type: "FeatureCollection", features: [] }, e = (this.MilitaryStandardObj.forEach(e => { e = i.entities.getById(e); e && (t = this.getFeature(e)), o.features.push(t) }), JSON.stringify(o)), e = new Blob([e], { type: "text/plain;charset=utf-8" }); this._core.saveAs(e, "军标.json") }, Q.prototype.colorHex = function(e) { if (/^(rgb|RGB)/.test(e)) { for (var t = e.replace(/(rgb|RGB)*/g, "").replace("(", "").replace(")", "").split(","), i = "#", o = 0; o < t.length; o++) { var r = Number(t[o]).toString(16); "0" === (r = 1 === r.length ? "0" + r : r) && (r += r), i += r } return i = 7 !== i.length ? e : i } if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)) return e; var n = e.replace(/#/, "").split(""); if (6 === n.length) return e; if (3 === n.length) { for (var a = "#", o = 0; o < n.length; o += 1) a += n[o] + n[o]; return a } }, Q.prototype.copyJb = function(e) { var t; return "StraightArrow" == e.type || "SwallowtailArrow" == e.type || "PincerArrow" == e.type ? ( t = { holes: [], positions: this.szposis(e.pos) }, t = this._viewer.entities.add({ name: "StraightArrow", polygon: { hierarchy: t, material: Cesium.Color.RED.withAlpha(.5) } })) : "BezierArrow" == e.type ? t = this._viewer.entities.add({ name: "BezierArrow", polyline: { positions: this.szposis(e.pos), width: 5, clampToGround: !0, material: new Cesium.PolylineArrowMaterialProperty(Cesium.Color.RED) } }) : e.img ? t = this._viewer.entities.add({ position: this.zfsz(e.pos), billboard: { image: e.img, show: !0 } }) : e.text && (t = this._viewer.entities.add({ position: this.zfsz(e.pos), label: { text: e.text, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.CENTER, show: !0, showBackground: !1 } })), t._id = e.id, that.objectsToExclude.push(t), t }, Q.prototype.getEntityById = function(e) { var t, e = this._viewer.entities.getById(e); return null != e.polyline && e.polyline ? t = { obj: e.polyline, type: e.name, posion: e.polyline.positions.getValue() } : null != e.polygon && e.polygon ? t = { obj: e.polygon, type: e.name, posion: e.polygon.hierarchy.getValue().positions } : null != e.label && e.label ? t = { obj: e.label, type: "lable", text: e.label.text.getValue(), posion: e.position.getValue() } : null != e.billboard && e.billboard && (t = { obj: e.billboard, type: "img", img: e.billboard.image.getValue(), posion: e.position.getValue() }), t }, Q.prototype.szposis = function(e) { for (var t = [], i = e.split(",("), o = 0; o < i.length; o++) { var r = this.zfsz(i[o]); t.push(r) } return t }, Q.prototype.zfsz = function(e) { for (var t = e.split(","), i = 0; i < t.length; i++)(-1 != t[i].indexOf("(") || -1 != t[i] .indexOf(")")) && (t[i] = t[i].replace("(", "")); return { x: parseFloat(t[0]), y: parseFloat(t[1]), z: parseFloat(t[2]) } }, Q.prototype.showArrowOnMap = function(a, e, t) { function i() { if (a.length < 3) return null; for (var e = [], t = 0; t < a.length; t++) { var i = s._viewer.scene.globe.ellipsoid.cartesianToCartographic(a[t]), o = Cesium.Math.toDegrees(i.latitude), i = Cesium.Math.toDegrees(i.longitude); e.push([i, o]) } var r = j.algorithm.doubleArrow(e), n = []; return -1 == JSON.stringify(r.polygonalPoint).indexOf("null") && (n = r.polygonalPoint), new Cesium.PolygonHierarchy(n) } var o, s = this, r = s._viewer.scene.globe.ellipsoid.cartesianToCartographic(a[0]).height; return "polygon" == e ? o = s._viewer.entities.add({ name: "PincerArrow", polygon: new Cesium.PolygonGraphics({ hierarchy: new Cesium.CallbackProperty(i, !1), show: !0, fill: !0, material: Cesium.Color.fromCssColorString(s._core.defaultValue(t.color, "rgba(255,0,0,0.6)")), outline: s._core.defaultValue(t.outline, !0), outlineColor: Cesium.Color.fromCssColorString(s._core.defaultValue(t .outlineColor, "rgba(255,0,0,0.6)")) }) }) : "box" == e && (o = s._viewer.entities.add({ name: "PincerArrow", polygon: new Cesium.PolygonGraphics({ hierarchy: new Cesium.CallbackProperty(i, !1), show: !0, fill: !0, material: Cesium.Color.fromCssColorString(s._core.defaultValue(t .color, "rgba(255,0,0,0.6)")), outline: s._core.defaultValue(t.outline, !0), outlineColor: Cesium.Color.fromCssColorString(s._core.defaultValue(t .outlineColor, "rgba(255,0,0,0.6)")), extrudedHeight: r + s._core.defaultValue(t.extrudedHeight, 200), height: r }) })), o }, Q.prototype.showAttackArrowOnMap = function(n, e, t) { var a = this, i = a._viewer.scene.globe.ellipsoid.cartesianToCartographic(n[0]).height; return this._viewer.entities.add({ name: "AttackArrow", polygon: new Cesium.PolygonGraphics({ hierarchy: new Cesium.CallbackProperty(function() { if (n.length < 3) return null; for (var e = [], t = 0; t < n.length; t++) { var i = a.cartesianToLatlng(n[t]); e.push(i) } var o = j.algorithm.tailedAttackArrow(e), r = []; return -1 == JSON.stringify(o.polygonalPoint).indexOf( "null") && (r = o.polygonalPoint), new Cesium .PolygonHierarchy(r) }, !1), show: !0, fill: !0, classificationType: Cesium.ClassificationType.TERRAIN, extrudedHeight: "box" === e ? a._core.defaultValue(t.extrudedHeight, 200) + i : void 0, height: "box" === e ? i : void 0, material: Cesium.Color.fromCssColorString(a._core.defaultValue(t.color, "rgba(255,0,0,0.6)")), outline: a._core.defaultValue(t.outline, !0), outlineColor: Cesium.Color.fromCssColorString(a._core.defaultValue(t .outlineColor, "rgba(255,0,0,0.6)")) }) }) }, Q.prototype.cartesianToLatlng = function(e) { var e = this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e), t = Cesium.Math.toDegrees(e.latitude); return [Cesium.Math.toDegrees(e.longitude), t] }, Q.prototype.getCatesian3FromPX = function(e, t) { for (var i, o = this._viewer.scene.drillPick(e), r = (this._viewer.render(), !0), n = 0; n < o .length; n++)(o[n] && o[n].primitive || o[n] instanceof Cesium.Cesium3DTileFeature) && ( r = !0); if (r) i = this._viewer.scene.pickPosition(e); else { e = this._viewer.camera.getPickRay(e); if (!e) return null; i = this._viewer.scene.globe.pick(e, this._viewer.scene) } return i }, Q.prototype._createGeoPoints = function(e, t) { for (var i, o, r, n, a = [], s = 0; s < t.length; s++)(i = (n = e.camera.getPickRay(t[s])) ? e .scene.globe.pick(n, e.scene) : i) && (n = Cesium.Cartographic.fromCartesian(i), o = Cesium.Math.toDegrees(n.longitude), r = Cesium.Math.toDegrees(n.latitude), n = n.height, a.push(o, r, n)); return a }, Q.prototype._createScreenPoints = function(e, t) { for (var i, o = [], r = 0; r < t.length; r++) i = e.scene.cartesianToCanvasCoordinates(t[r]), o .push(i); return o }, Q.prototype._createBezierPoints = function(e) { for (var t = [], i = 0; i <= 100; i++) { var o = this._computeBezierPoints(e, i / 100); t.push(o) } return t }, Q.prototype._computeBezierPoints = function(e, t) { for (var i = 0, o = 0, r = this._computeBinomial(e), n = 0; n < e.length; n++) { var a = e[n]; i += a.x * Math.pow(1 - t, e.length - 1 - n) * Math.pow(t, n) * r[n], o += a.y * Math.pow( 1 - t, e.length - 1 - n) * Math.pow(t, n) * r[n] } return { x: i, y: o } }, Q.prototype._computeBinomial = function(e) { var t = e.length, i = []; i.push(1); for (var o = 1; o < t - 1; o++) { for (var r = 1, n = 1, a = 0; a < o; a++) r *= t - 1 - a, n *= o - a; i.push(r / n) } return i.push(1), i }, Q.prototype._computeGatheringPlacePoints = function(e) { var t, i, o, r, n, a, s = []; return 2 == e.length && (t = e[0], n = { x: (e = e[e.length - 1]).x - t.x, y: e.y - t.y }, a = Math.sqrt(n.x * n.x + n.y * n.y), i = this.calculateVector(n, Math.PI / 3, Math .sqrt(3) / 12 * a)[1], i = { x: t.x + i.x, y: t.y + i.y }, o = { x: (t.x + e.x) / 2, y: (t.y + e.y) / 2 }, r = this.calculateVector(n, 2 * Math.PI / 3, Math.sqrt(3) / 12 * a)[1], r = { x: e.x + r.x, y: e.y + r.y }, a = { x: (n = this.calculateVector(n, Math.PI / 2, .5 * a)[0]).x + o.x, y: n.y + o.y }, s.push(t, i, o, r, e, a)), s }, Q.prototype.createCloseCardinal = function(e) { if (null == e || e.length < 3) return e; for (var t = e[0], i = (e.push(t), e), o = [], r = i.length - 1, n = 0; n <= r - 1; n++) { d = n == r - 1 ? (a = i[r - 1], s = i[0], i[1]) : (a = i[n], s = i[n + 1], i[n + 2]); var a, s, l = { x: void 0, y: void 0 }, u = { x: void 0, y: void 0 }, c = s.x - a.x, h = s.y - a.y, m = d.x - s.x, d = d.y - s.y, p = Math.sqrt(c * c + h * h), g = Math.sqrt(m * m + d * d), c = c / p, h = h / p, m = m / g, d = d / g, _ = c + m, f = h + d, y = Math.sqrt(_ * _ + f * f), _ = _ / y, f = f / y; Math.abs(1 - (c * m + h * d)) < .005 ? (l.x = s.x - m * p * .4, l.y = s.y - d * p * .4, u .x = s.x + c * g * .4, u.y = s.y + h * g * .4) : (l.x = s.x - _ * p * .4, l.y = s .y - f * p * .4, u.x = s.x + _ * g * .4, u.y = s.y + f * g * .4), n == r - 1 ? (o[ 0] = s, o[1] = u, o[3 * (r - 2) + 2 + 3] = l, o[3 * (r - 2) + 2 + 4] = i[r]) : (o[ 3 * n + 2] = l, o[3 * n + 2 + 1] = s, o[3 * n + 2 + 2] = u) } return o }, Q.prototype.calculatePointsFBZ3 = function(e, t) { var i = [], o = .05; 0 < (t = t || 20) && (o = 1 / t); for (var r = 0; r < e.length - 3;) { var n = e[r], a = e[r + 1], s = e[r + 2], l = e[r + 3]; i.push(n); for (var u = 0; u < 1;) { var c = (1 - u) * (1 - u) * (1 - u) * n.x + 3 * u * (1 - u) * (1 - u) * a.x + 3 * u * u * (1 - u) * s.x + u * u * u * l.x, h = (1 - u) * (1 - u) * (1 - u) * n.y + 3 * u * (1 - u) * (1 - u) * a.y + 3 * u * u * (1 - u) * s.y + u * u * u * l.y; i.push({ x: c, y: h }), u += o }(r += 3) >= e.length && i.push(n) } return i[i.length - 1], e[e.length - 1], i }, Q.prototype.calculateVector = function(e, t, i) { t = t || Math.PI / 2, i = i || 1; var o, r, n, a, s, l, u, c, h = Math.sqrt(e.x * e.x + e.y * e.y); return 0 == e.y ? (s = l = h * i * Math.cos(t) / e.x, 0 < e.x ? c = -(u = Math.sqrt(i * i - s * s)) : e.x < 0 && (u = -(c = Math.sqrt(i * i - s * s))), o = { x: s, y: u }, r = { x: l, y: c }) : (a = 1 + (n = -e.x / e.y) * n, t = (h = i * h * Math.cos(t) / e.y) * h - i * i, u = n * (s = (-(i = 2 * n * h) - Math.sqrt(i * i - 4 * a * t)) / (2 * a)) + h, c = n * (l = (- i + Math.sqrt(i * i - 4 * a * t)) / (2 * a)) + h, 0 <= e.y ? (o = { x: s, y: u }, r = { x: l, y: c }) : e.y < 0 && (o = { x: l, y: c }, r = { x: s, y: u })), [o, r] }, Q.prototype.plotingSwallowtailArrow = function(e, t, i, o) { var r, n = this._computeSwallowtailArrow(t), a = []; return n.forEach(e => { a.push(e.x, e.y, t[0].z) }), "polygon" == i ? r = e.entities.add({ name: "SwallowtailArrow", polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights(a), material: Cesium.Color.fromCssColorString(this._core.defaultValue(o.color, "rgba(255,0,0,0.6)")) } }) : "box" == i && (r = e.entities.add({ name: "SwallowtailArrow", polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights(a), material: Cesium.Color.fromCssColorString(this._core.defaultValue(o.color, "rgba(255,0,0,0.6)")), extrudedHeight: a[2] + this._core.defaultValue(o.extrudedHeight, 200), height: a[2], outline: this._core.defaultValue(o.outline, !0), outlineColor: Cesium.Color.fromCssColorString(this._core.defaultValue(o .outlineColor, "rgba(255,0,0,0.6)")) } })), r }, Q.prototype._computeSwallowtailArrow = function(e) { var t = e[0].x, i = e[0].y, o = e[1].x, e = e[1].y, r = (15.8 * o + 3.2 * t) / 19, n = (15.8 * e + 3.2 * i) / 19, a = new Array(7); return a[0] = { x: o, y: e }, a[1] = { x: r + .265625 * (e - n), y: n - .265625 * (o - r) }, a[2] = { x: r + .078125 * (e - n), y: n - .078125 * (o - r) }, a[3] = { x: t + 1.6 / 19 * (e - i), y: i - 1.6 / 19 * (o - t) }, a[4] = { x: (3.2 * o + 15.8 * t) / 19, y: (3.2 * e + 15.8 * i) / 19 }, a[5] = { x: t - 1.6 / 19 * (e - i), y: i + 1.6 / 19 * (o - t) }, a[6] = { x: r - .078125 * (e - n), y: n + .078125 * (o - r) }, a[7] = { x: r - .265625 * (e - n), y: n + .265625 * (o - r) }, a }, Q.prototype.calculateMorePoints = function(e) { if (2 < e.length) { for (var t, i, o = 0, r = 0; r < e.length - 1; r++) t = e[r], i = e[r + 1], o += Math.sqrt(( i.y - t.y) * (i.y - t.y) + (i.x - t.x) * (i.x - t.x)); for (var n = o / 6, a = [], s = [], l = { x: void 0, y: void 0 }, u = { x: void 0, y: void 0 }, c = 0; c < e.length - 2; c++) { var h, m = e[c], d = e[c + 1], p = e[c + 2], g = { x: d.x - m.x, y: d.y - m.y }, p = { x: p.x - d.x, y: p.y - d.y }, _ = this.calculateVector(g, Math.PI / 2, n / 2), f = _[0], _ = _[1], y = this.calculateVector(p, Math.PI / 2, n / 2), v = y[0], y = y[1], f = { x: m.x + f.x, y: m.y + f.y }, m = { x: m.x + _.x, y: m.y + _.y }, _ = { x: d.x + v.x, y: d.y + v.y }, v = { x: d.x + y.x, y: d.y + y.y }, d = this.calculateIntersection(g, p, f, _), y = this.calculateIntersection(g, p, m, v); p = 0 == c ? (h = { x: ((l = f).x + d.x) / 2, y: (l.y + d.y) / 2 }, { x: ((u = m).x + y.x) / 2, y: (u.y + y.y) / 2 }) : (_ = a[a.length - 1], g = s[s.length - 1], h = { x: (_.x + d.x) / 2, y: (_.y + d.y) / 2 }, { x: (g.x + y.x) / 2, y: (g.y + y.y) / 2 }), a.push(h), s.push(p), a.push(d), s.push(y) } for (var C, w, b, T = e[e.length - 2], S = e[e.length - 1], P = { x: S.x - T.x, y: S.y - T.y }, E = Math.sqrt(P.x * P.x + P.y * P.y), x = [], I = { x: void 0, y: void 0 }, D = { x: void 0, y: void 0 }, L = { x: void 0, y: void 0 }, M = { x: void 0, y: void 0 }, A = { x: void 0, y: void 0 }, V = { x: void 0, y: void 0 }, R = a[a.length - 1], O = s[s.length - 1], V = E <= n ? (I = (x = this .calculateVector(P, Math.PI / 2, n / 2))[0], D = x[1], w = { x: T.x + I.x, y: T.y + I.y }, b = { x: T.x + D.x, y: T.y + D.y }, L = { x: (R.x + w.x) / 2, y: (R.y + w.y) / 2 }, M = { x: (O.x + b.x) / 2, y: (O.y + b.y) / 2 }, a.push(L), s.push(M), A = { x: 2 * w.x - T.x, y: 2 * w.y - T.y }, { x: 2 * b.x - T.x, y: 2 * b.y - T.y }) : (E = S.x - T.x, T = S.y - T.y, C = Math.sqrt(E * E + T * T), E = S.x - E * n / C, T = S.y - T * n / C, I = (x = this.calculateVector(P, Math.PI / 2, n / 2))[ 0], D = x[1], w = { x: E + I.x, y: T + I.y }, b = { x: E + D.x, y: T + D.y }, L = { x: (R.x + w.x) / 2, y: (R.y + w.y) / 2 }, M = { x: (O.x + b.x) / 2, y: (O.y + b.y) / 2 }, a.push(L), s.push(M), A = { x: 2 * w.x - E, y: 2 * w.y - T }, { x: 2 * b.x - E, y: 2 * b.y - T }), H = [], k = [], r = 0; r < a.length - 2; r++) var F = [], G = [], N = a[r], B = a[r + 1], j = a[r + 2], z = s[r], U = s[r + 1], W = s[r + 2], N = (F.push(N, B, j), G.push(z, U, W), this._createBezierPoints(F)), B = this._createBezierPoints(G), H = H.concat(N), k = k.concat(B); (C = (C = [l]).concat(H)).push(w), C.push(A), C.push(S), C.push(V), C.push(b), (C = C .concat(k.reverse())).push(u) } else C = this.calculateTwoPoints(e); return C }, Q.prototype.calculateIntersection = function(e, t, i, o) { var r, e = e.y * t.x - e.x * t.y == 0 ? 0 < e.x * t.x || 0 < e.y * t.y ? (r = (i.x + o.x) / 2, ( i.y + o.y) / 2) : (r = o.x, o.y) : (r = (e.x * t.x * (o.y - i.y) + i.x * e.y * t.x - o .x * t.y * e.x) / (e.y * t.x - e.x * t.y), 0 != e.x ? (r - i.x) * e.y / e.x + i.y : (r - o.x) * t.y / t.x + o.y); return { x: r, y: e } }, Q.prototype.calculateTwoPoints = function(e) { var t = e[0], e = e[1], i = [], o = { x: e.x - t.x, y: e.y - t.y }, r = Math.sqrt((e.x - t.x) * (e.x - t.x) + (e.y - t.y) * (e.y - t.y)), n = t.x + 5 * (e.x - t.x) / 6, a = t.y + 5 * (e.y - t.y) / 6, o = this.calculateVector(o, Math.PI / 2, r / 6 / 2), r = o[0], o = o[1], s = { x: t.x + r.x, y: t.y + r.y }, l = { x: n + r.x, y: a + r.y }, r = { x: n + 2 * r.x, y: a + 2 * r.y }, e = { x: e.x, y: e.y }, u = { x: n + 2 * o.x, y: a + 2 * o.y }, n = { x: n + o.x, y: a + o.y }, a = { x: t.x + o.x, y: t.y + o.y }; return i.push(s, l, r, e, u, n, a), i }, Q.prototype._computeRoundedRectanglePoints = function(e) { for (var t = (e[0].x + e[1].x) / 2, i = (e[0].y + e[1].y) / 2, o = Math.abs(e[0].x - e[1].x), e = Math.abs(e[0].y - e[1].y), r = .1 * Math.min(o, e), n = t - o / 2 + r, a = i - e / 2 + r, s = t + o / 2 - r, l = i - e / 2 + r, u = t + o / 2 - r, c = i + e / 2 - r, h = t - o / 2 + r, m = i + e / 2 - r, d = Math.PI / 180, p = [], g = Math.PI, _ = 1.5 * Math .PI, f = g, y = 0; y < Math.abs(g - _); y += d) { var v = n + r * Math.cos(f), C = a + r * Math.sin(f), f = (f = (f += d) < 0 ? 2 * Math.PI + f : f) > 2 * Math.PI ? 2 * Math.PI - f : f; p.push({ x: v, y: C }) } for (var w = p, b = 3 * Math.PI / 2, T = 2 * Math.PI, S = b, y = 0; y < Math.abs(b - T); y += d) { v = s + r * Math.cos(S), C = l + r * Math.sin(S), S = (S = (S += d) < 0 ? 2 * Math.PI + S : S) > 2 * Math.PI ? 2 * Math.PI - S : S; w.push({ x: v, y: C }) } for (var P = w, E = .5 * Math.PI, x = 0, y = 0; y < Math.abs(0 - E); y += d) { v = u + r * Math.cos(x), C = c + r * Math.sin(x), x = (x = (x += d) < 0 ? 2 * Math.PI + x : x) > 2 * Math.PI ? 2 * Math.PI - x : x; P.push({ x: v, y: C }) } for (var I = P, D = .5 * Math.PI, L = Math.PI, M = D, y = 0; y < Math.abs(D - L); y += d) { v = h + r * Math.cos(M), C = m + r * Math.sin(M), M = (M = (M += d) < 0 ? 2 * Math.PI + M : M) > 2 * Math.PI ? 2 * Math.PI - M : M; I.push({ x: v, y: C }) } return I }, Q.prototype._computeSectorPoints = function(e) { for (var t = this.calculateAngle(e[0], e[1]), i = this.calculateAngle(e[0], e[2]), o = (i < t && (i = 2 * Math.PI + i), Math.PI / 180), r = t, n = [e[0]], a = Math.sqrt((e[1].x - e[ 0].x) * (e[1].x - e[0].x) + (e[1].y - e[0].y) * (e[1].y - e[0].y)), s = 0; s < Math.abs( t - i); s += o) { var l = e[0].x + a * Math.cos(r), u = e[0].y + a * Math.sin(r), r = (r = (r += o) < 0 ? 2 * Math.PI + r : r) > 2 * Math.PI ? r - 2 * Math.PI : r; n.push({ x: l, y: u }) } return n }, Q.prototype.calculateAngle = function(e, t) { t = { x: t.x - e.x, y: t.y - e.y }, e = Math.atan2(t.y, t.x); return e < 0 && (e += 2 * Math.PI), e }, Q.prototype._computeBowPoints = function(e) { var t = 2 * (e[1].x - e[0].x), i = 2 * (e[1].y - e[0].y), o = e[1].x * e[1].x + e[1].y * e[1].y - e[0].x * e[0].x - e[0].y * e[0].y, r = 2 * (e[2].x - e[1].x), n = 2 * (e[2].y - e[1].y), a = e[2].x * e[2].x + e[2].y * e[2].y - e[1].x * e[1].x - e[1].y * e[1].y, s = (o * n - a * i) / (t * n - r * i), l = (t * a - r * o) / (t * n - r * i), a = { x: s, y: l }, u = Math.sqrt((e[0].x - s) * (e[0].x - s) + (e[0].y - l) * (e[0].y - l)), c = this.calculateAngle(a, e[0]), h = this.calculateAngle(a, e[1]), o = this.calculateAngle(a, e[2]), m = Math.PI / 180, d = void 0, p = []; if (c < o && o < h || h < o && o < c) { d = c < h ? c : h; for (var g = 0; g < Math.abs(c - h); g += m) { var _ = s + u * Math.cos(d), f = l + u * Math.sin(d), d = (d = (d += m) < 0 ? 2 * Math.PI + d : d) > 2 * Math.PI ? 2 * Math.PI - d : d; p.push({ x: _, y: f }) } } else { d = h < c ? c : h; for (g = 0; g < 2 * Math.PI - Math.abs(c - h); g += m) { _ = s + u * Math.cos(d), f = l + u * Math.sin(d); d = (d = (d += m) < 0 ? 2 * Math.PI + d : d) > 2 * Math.PI ? d - 2 * Math.PI : d, p .push({ x: _, y: f }) } } return p }, Q.prototype.Cdcl = function(e, t, i, o) { var r = Math.PI; function n(e) { return e * r / 180 } var a = n((e + i) / 2), e = n((e - i) / 2), i = n((t - o) / 2), t = Math.sin(e), o = Math.sin(i), e = Math.sin(a), i = (t *= t) * (1 - (o *= o)) + (1 - (e *= e)) * o, a = (1 - t) * (1 - o) + e * o; return 2 * (o = Math.atan(Math.sqrt(i / a))) * 6378137 * (1 + 1 / 298.257 * ((3 * (o = Math .sqrt(i * a) / o) - 1) / 2 / a * e * (1 - t) - (3 * o + 1) / 2 / i * (1 - e) * t)) }, Q.prototype.createPoint = function(e, t) { if (e) return this._viewer.entities.add({ position: e, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE, heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY }, show: t }) }, Q.prototype.setEdit = function(e, t) { void 0 === e && (e = !0), this.editOption = t = t || {}, this.openEdit = e }, Q.prototype.openEditProp = function(e, i) { var t = this; if ((i = i || (this.editOption || { editPropData: {} }), !SmartEarthPopupData.editGraphic || !SmartEarthPopupData.editGraphic.entity) && !this .startEdit(e)) return; i.editPropData || (i.editPropData = {}), this._popupmessage.createPopupProp("属性编辑", { width: i.editPropData.width || 360, height: i.editPropData.height || "90%", url: "Workers/prop/jb_prop.html", shade: i.editPropData.shade, offset: i.editPropData.offset, type: e.polyline ? "GroundPolyline" : 0 < t.heightpoints.length ? "ExtrudedPolygon" : "GroundPolygon", fn: { success: function(e, t) { i.editPropData.success && i.editPropData.success(e, t), SmartEarthPopupData.layerIndex = t, SmartEarthPopupData.window = e .find("iframe")[0].contentWindow }, end: function() { i.callBack && i.callBack.end && i.callBack.end(e), t.endThisEdit && t .endThisEdit(), SmartEarthPopupData.layerIndex = void 0, SmartEarthPopupData.window = void 0 } } }) }, Q.prototype.startEdit = function(t) { var i = this._viewer; if (-1 !== this.MilitaryStandardObj.indexOf(t.id)) { let e = t; t = e.pottingPoint; if (t) { this.isEditting = !0; var o, r = t, n = { x: 0, y: 0, z: 0 }; for (o in r) { var a, s, l = r[o], u = (n.x += l[0], n.y += l[1], n.z += l[2], Cesium.Cartesian3 .fromDegreesArrayHeights(l)), c = i.entities.add({ name: "polygon_point", position: u[0], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); c.pottingPoint = l, V.pointsId.push(c.id), this.objectsToExclude.push(c), e .polygon && e.polygon.extrudedHeight && (u = u.x ? Cesium.Cartographic .fromCartesian(u) : Cesium.Cartographic.fromCartesian(u[0]), s = Cesium.Math .toDegrees(u.longitude), u = Cesium.Math.toDegrees(u.latitude), a = e .polygon.extrudedHeight.getValue(), s = Cesium.Cartesian3.fromDegrees(s, u, a), (u = i.entities.add({ name: "box_point", position: s, point: { color: Cesium.Color.YELLOW, pixelSize: 12, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, heightReference: Cesium.HeightReference.NONE, disableDepthTestDistance: Number.POSITIVE_INFINITY } })).pottingPoint = l, u.pointid = c.id, this.objectsToExclude.push(u), this .heightpoints.push(u), this.heightpointsId.push(u.id)) } return n.x /= r.length, n.y /= r.length, n.z /= r.length, this.movePoint = i.entities .add({ name: "move_point", position: Cesium.Cartesian3.fromDegrees(n.x, n.y, n.z), point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, heightReference: Cesium.HeightReference.NONE, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), SmartEarthPopupData.editGraphic = { entity: e, graphic: e.polygon || e.polyline, heightpoints: this.heightpoints }, !0 } } }, Q.prototype.edit = function(e, i) { var L = this, M = this._viewer; if (void 0 !== (i = i || {}).editProp && (this.editProp = i.editProp), this.editHandler) { for (var t in this.editHandler.destroy(), this.editHandler = void 0, V.pointsId) this ._viewer.entities.removeById(V.pointsId[t]); V.pointsId = [] } if (e = void 0 === e ? !0 : e) { var A, R = void 0, O = (this.isEditting = !1, void 0), H = void 0; for (t in this.editHandler = new Cesium.ScreenSpaceEventHandler(M.scene.canvas), this .editHandler.setInputAction(e => { var t; Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView) ? L.isEditting && (L .endThisEdit(), L.defaultEvent(!1)) : V.editVector || (e = e.position, ( e = M.scene.pick(e)) && e.id instanceof Cesium.Entity ? (e = e.id, L .isEditting || 0 != V.states ? "box_point" == e.name || "polygon_point" == e.name || "move_point" == e.name ? (L .defaultEvent(!1), A = "box_point" == e.name ? (H = e.position .getValue(), t = Cesium.Cartographic.fromCartesian(H), H = { lon: Cesium.Math.toDegrees(t.longitude), lat: Cesium.Math.toDegrees(t.latitude), height: t.height }, "box_point") : "move_point" == e.name ? "move_point" : "polygon_point", O = e) : R && e.id === R.id || L .endThisEdit() : this.startEdit(e) && (R = e, this.editProp && this .openEditProp(R, i))) : L.endThisEdit()) }, Cesium.ScreenSpaceEventType.LEFT_DOWN), this.editHandler.setInputAction(function(e) { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView)) L.isEditting && (L .endThisEdit(), L.defaultEvent(!1)); else if (!V.editVector) { var i = M.scene.pick(e.endPosition); if (Cesium.defined(i)) if (L.isEditting && !O) { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth .underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView )) return void(L.isEditting && (L.endThisEdit(), L .defaultEvent(!1))); !i.id || "move_point" !== i.id.name && "polygon_point" !== i.id .name ? i.id && "box_point" === i.id.name ? L.tooltip.showAt(e .endPosition, "拖拽修改高度") : i.id == R && L.tooltip.show(!1) : L.tooltip.showAt(e.endPosition, "拖拽修改位置") } else L.isEditting || 0 !== V.states || (i.id && -1 < L .MilitaryStandardObj.indexOf(i.id.id) ? L.tooltip.showAt(e .endPosition, "点击激活编辑,右键删除") : L.tooltip.show(!1)); else 0 != V.states || O || L.tooltip.show(!1); if (L.isEditting && O) { L.tooltip.showAt(e.endPosition, "释放后完成修改"); i = e.startPosition; if (y = (i = M.camera.getPickRay(i)) ? M.scene.globe.pick(i, M.scene) : y) { var t = void 0; if ("polygon_point" == A) { for (var r in O.position = y, V.pointsId) if (V.pointsId[r] == O.id) { var o = M.entities.getById(L.heightpointsId[r]); if (!o) break; var n = Cesium.Cartographic.fromCartesian(y), a = Cesium.Math.toDegrees(n.longitude), s = Cesium.Math.toDegrees(n.latitude), l = Cesium.Cartographic.fromCartesian(o.position ._value), u = n.height + l.height; o.position = Cesium.Cartesian3.fromDegrees(a, s, u) } var c = [], h = [], m = new Cesium.Cartesian3; for (r in V.pointsId) { var d = M.entities.getById(V.pointsId[r]).position._value, p = Cesium.Cartographic.fromCartesian(d), p = { x: Cesium.Math.toDegrees(p.longitude), y: Cesium.Math.toDegrees(p.latitude), z: p.height }; c.push(p), h.push([p.x, p.y, p.z]), m.x += d.x, m.y += d.y, m.z += d.z } if (m.x /= c.length, m.y /= c.length, m.z /= c.length, L .movePoint && (L.movePoint.position = m), "StraightArrow" == R.GeoType) x = L.calculateMorePoints(c); else if ("RoundedRectangle" == R.GeoType) x = L ._computeRoundedRectanglePoints(c); else if ("Sector" == R.GeoType) x = L._computeSectorPoints(c); else if ("Bow" == R.GeoType) x = L._computeBowPoints(c); else if ("GatheringPlace" == R.GeoType) { var g = L._computeGatheringPlacePoints(c), g = L.createCloseCardinal(g); x = L.calculatePointsFBZ3(g, 100) } else if ("SwallowtailArrow" == R.GeoType) x = L ._computeSwallowtailArrow(c); else if ("Bezierline" == R.GeoType) x = L._createBezierPoints( c); else if ("BezierArrow" == R.GeoType) x = L._createBezierPoints( c); else if ("PincerArrow" == R.GeoType) { g = j.algorithm.doubleArrow(h); let e = []; var _ = JSON.stringify(g.polygonalPoint).indexOf("null"); x = e = -1 == _ ? g.polygonalPoint : e } else if ("AttackArrow" == R.GeoType) { _ = j.algorithm.tailedAttackArrow(h), g = JSON.stringify(_ .polygonalPoint).indexOf("null"); let e = []; x = e = -1 == g ? _.polygonalPoint : e } let t; t = "AttackArrow" !== R.GeoType && "PincerArrow" !== R.GeoType ? (t = [], x.forEach(e => { t.push(e.x, e.y, c[0].z) }), Cesium.Cartesian3.fromDegreesArrayHeights(t)) : x, R .pottingPoint = h, 0 <= R.GeoType.indexOf("Bezier") ? R .polyline.positions = new Cesium.CallbackProperty( function() { return t }, !1) : R.polygon.hierarchy = new Cesium.CallbackProperty( function() { return new Cesium.PolygonHierarchy(t) }, !1) } else if ("box_point" == A) { var f, i = M.camera.getPickRay(e.endPosition), y = M.scene.globe.pick(i, M.scene), v = Cesium.Cartographic.fromCartesian(y), C = Cesium.Math.toDegrees(v.longitude), w = Cesium.Math.toDegrees(v.latitude), b = H.lon, T = H.lat, t = u = L.Cdcl(w, C, T, b); for (f in L.heightpointsId) { var S = M.entities.getById(L.heightpointsId[f]), P = S.position._value, P = Cesium.Cartographic.fromCartesian(P), E = Cesium.Math.toDegrees(P.longitude), P = Cesium.Math.toDegrees(P.latitude), E = Cesium.Cartesian3.fromDegrees(E, P, t); S.position = E } R.polygon.extrudedHeight = new Cesium.CallbackProperty( function() { return t }, !1), SmartEarthPopupData.window && SmartEarthPopupData .window.document.querySelector( '.ExtrudedPolygon input[name="height"]') && ( SmartEarthPopupData.window.document.querySelector( '.ExtrudedPolygon input[name="height"]').value = parseInt(t)) } else { var x, v = Cesium.Cartographic.fromCartesian(y), C = Cesium.Math.toDegrees(v.longitude), w = Cesium.Math.toDegrees(v.latitude), g = (H = O.position.getValue(), Cesium.Cartographic .fromCartesian(H)), I = C - (b = (H = { lon: Cesium.Math.toDegrees(g.longitude), lat: Cesium.Math.toDegrees(g.latitude), height: g.height }).lon), D = w - (T = H.lat), c = (O.position = y, []), h = []; for (r in V.pointsId) { let e, t, i = M.entities.getById(V.pointsId[r]), o = (i && (e = i.position.getValue(), t = Cesium .Cartographic.fromCartesian(e), e = { lon: Cesium.Math.toDegrees(t.longitude), lat: Cesium.Math.toDegrees(t.latitude), height: t.height }, i.position = Cesium.Cartesian3.fromDegrees(e .lon + I, e.lat + D, e.height), c.push({ x: e.lon + I, y: e.lat + D, z: e.height }), h.push([e.lon + I, e.lat + D, e.height])), M .entities.getById(L.heightpointsId[r])); o && (e = o.position.getValue(), t = Cesium.Cartographic .fromCartesian(e), e = { lon: Cesium.Math.toDegrees(t.longitude), lat: Cesium.Math.toDegrees(t.latitude), height: t.height }, o.position = Cesium.Cartesian3.fromDegrees(e .lon + I, e.lat + D, e.height)) } if ("StraightArrow" == R.GeoType) x = L.calculateMorePoints(c); else if ("RoundedRectangle" == R.GeoType) x = L ._computeRoundedRectanglePoints(c); else if ("Sector" == R.GeoType) x = L._computeSectorPoints(c); else if ("Bow" == R.GeoType) x = L._computeBowPoints(c); else if ("GatheringPlace" == R.GeoType) { _ = L._computeGatheringPlacePoints(c), e = L .createCloseCardinal(_); x = L.calculatePointsFBZ3(e, 100) } else if ("SwallowtailArrow" == R.GeoType) x = L ._computeSwallowtailArrow(c); else if ("Bezierline" == R.GeoType) x = L._createBezierPoints( c); else if ("BezierArrow" == R.GeoType) x = L._createBezierPoints( c); else if ("PincerArrow" == R.GeoType) { i = j.algorithm.doubleArrow(h); let e = []; v = JSON.stringify(i.polygonalPoint).indexOf("null"); x = e = -1 == v ? i.polygonalPoint : e } else if ("AttackArrow" == R.GeoType) { C = j.algorithm.tailedAttackArrow(h), g = JSON.stringify(C .polygonalPoint).indexOf("null"); let e = []; x = e = -1 == g ? C.polygonalPoint : e } let t; t = "AttackArrow" !== R.GeoType && "PincerArrow" !== R.GeoType ? (t = [], x.forEach(e => { t.push(e.x, e.y, c[0].z) }), Cesium.Cartesian3.fromDegreesArrayHeights(t)) : x, R .pottingPoint = h, 0 <= R.GeoType.indexOf("Bezier") ? R .polyline.positions = new Cesium.CallbackProperty( function() { return t }, !1) : R.polygon.hierarchy = new Cesium.CallbackProperty( function() { return new Cesium.PolygonHierarchy(t) }, !1) } } } } }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.editHandler.setInputAction(function( e) { Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView) ? L.isEditting && (L .endThisEdit(), L.defaultEvent(!1)) : V.editVector || (O = void 0, L .defaultEvent(!0)) }, Cesium.ScreenSpaceEventType.LEFT_UP), this.editHandler.setInputAction(function(e) { var t, i; Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView) ? L.isEditting && (L .endThisEdit(), L.defaultEvent(!1)) : V.editVector || (t = M.scene.pick( e.position), Cesium.defined(t) && 0 == V.states && (i = t.id, -1 !== L.MilitaryStandardObj.indexOf(i.id) && L.delButton(!0, e.position, function() { M.entities.removeById(i.id); var e = L.MilitaryStandardObj.indexOf(i.id); L.MilitaryStandardObj.splice(e, 1), L.delButton(!1), L .tooltip.show(!1), L.endThisEdit(), !L .MilitaryStandardObj.length && L.editHandler && L.edit(! 1) }))) }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), L.defaultEvent(!0), V.pointsId) M.entities .removeById(V.pointsId[t]); for (t in L.heightpointsId) M.entities.removeById(L.heightpointsId[t]); L.heightpointsId = [], L.heightpoints = [], V.pointsId = [], this.endThisEdit = () => { for (var e in L.defaultEvent(!0), V.pointsId) M.entities.removeById(V.pointsId[e]); for (var e in L.heightpointsId) M.entities.removeById(L.heightpointsId[e]); L.movePoint && M.entities.remove(L.movePoint), L.movePoint = void 0, R = void 0, window.layuiLayer.close(SmartEarthPopupData.layerIndex), SmartEarthPopupData .editGraphic = {}, L.isEditting = !1, V.pointsId = [], L.heightpointsId = [], L .heightpoints = [], L.delButton(!1) } } }, Q.prototype.spArray = function(e, t) { for (var i = [], o = 0; o < t.length;) i.push(t.slice(o, o += e)); return i }, Q.prototype.delButton = function(e, t, i) { if (e) { let e = document.getElementById("DeleteMilitaryStandardDelete"); e || ((e = document.createElement("button")).id = "DeleteMilitaryStandardDelete", e .innerText = "删除对象", e.style.cssText = `height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`, this._viewer.container.appendChild(e)), e.style.display = "block", e.style.top = t.y + "px", e.style.left = t.x + "px", e.onclick = i } else { let e = document.getElementById("DeleteMilitaryStandardDelete"); e && (e.style.display = "none", e.onclick = null) } }, Q.prototype.defaultEvent = function(e) { var t = this._viewer.scene; t.screenSpaceCameraController.enableRotate = e, t.screenSpaceCameraController.enableTranslate = e, t.screenSpaceCameraController.enableZoom = e, t.screenSpaceCameraController.enableTilt = e, t.screenSpaceCameraController.enableLook = e }, Cu.prototype.createKmlLayer = function(e, t, r) { var i = { camera: this._viewer.scene.camera, canvas: this._viewer.scene.canvas }, n = t, a = (this._cesium.HeightReference.CLAMP_TO_GROUND, { show: !0, position: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, eyeOffset: this._cesium.Cartesian3.ZERO, heightReference: this._cesium.HeightReference.NONE, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, scale: 1, image: n, imageSubRegion: void 0, color: this._cesium.Color.WHITE, id: void 0, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, scaleByDistance: void 0, translucencyByDistance: void 0, pixelOffsetScaleByDistance: void 0, sizeInMeters: !1, distanceDisplayCondition: void 0 }), s = this; this._cesium.KmlDataSource.load(e, i).then(function(e) { if (e.entities, "model" == r) for (var t = 0; t < e.entities.values.length; t++) { var i = e.entities.values[t]; s._viewer.entities.add({ name: "", position: i.position, model: { uri: n, heightReference: s._cesium.HeightReference.CLAMP_TO_GROUND, minimumPixelSize: 128, maximumScale: 20, scale: 1, runAnimations: !1 } }) } else if ("billboard" == r) { for (var o = s._core.extend(a, option, !0), t = 0; t < e.entities.values .length; t++) { i = e.entities.values[t]; o.position = i.position._value, billboardCollections.add(o) } s._viewer.scene.primitives.add(billboardCollections) } }) }, Cu.prototype.addKmlLayer = function(e, t, i, o) { var r = { camera: this._viewer.scene.camera, canvas: this._viewer.scene.canvas }, n = this; let a = t, s; a.id && (s = a.id, a = a.url); t = this._cesium.KmlDataSource.load(a, r), this._viewer.dataSources.add(t), t.then(function(e) { n.item = e, i || n.setVisibility(!1), o && "function" == typeof o && o(e) }), r = { id: s || this._core.getuid(), name: e, pId: 0, type: "KML", item: this }; return this.setTreeobj(r), this._tree.insertGroupId(r, 0), this }, Cu.prototype.export = function() { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, Cu.prototype.deleteObject = function() { this._viewer.dataSources.remove(this.item) }, Cu.prototype.setTreeobj = function(e) { this.treeobj = e }, Cu.prototype.setVisibility = function(e) { null != this.item && (this.item.show = e) }, wu.prototype.createModifyMesh = function(e, t, i, o, r) { var n = t.length, n = new Array(n), i = (n.fill(i), o.id || Cesium.createGuid()), a = Date.now(), s = Cesium.Rectangle.fromCartesianArray(t), i = (void 0 === o.modifyMeshObject && (o.modifyMeshObject = []), { id: i, show: !0, name: e, rectangle: s, vertices: t, polygon: t, heights: n, meshObject: o, timeStamp: a, polygonGeometry: new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium.PolygonHierarchy(t) }), image: this.createTexture(t), texture: null }); return o.modifyMeshObject = i, this.item = o, this }, wu.prototype.createTexture = function(e) { var t = Cesium.Rectangle.fromCartesianArray(e), i = 180 * t.west / Math.PI, o = 180 * t.south / Math.PI, r = 180 * t.east / Math.PI, t = 180 * t.north / Math.PI, n = new Cesium.Rectangle(i, o, r, t), a = [], s = this, i = (e.forEach(function(e) { e = e.longitude ? e : Cesium.Ellipsoid.WGS84.cartesianToCartographic(e), e = s .getPointRelativePosition(e, n, s.texturePixel, s.texturePixel); a.push([e.normalizedLongitude, e.normalizedLatitude]) }), this.createCanvas(a, "#FF0000", s.texturePixel, s.texturePixel)), o = new Image; return o.width = s.texturePixel, o.height = s.texturePixel, o.src = i.toDataURL("image/png"), o }, wu.prototype.getPointRelativePosition = function(e, t, i, o) { var r = t.east - t.west, n = t.north - t.south, a = 180 * e.longitude / Math.PI, s = 180 * e.latitude / Math.PI; return e.normalizedLongitude = (a - t.west) / r * i, e.normalizedLatitude = (s - t.south) / n * o, e }, wu.prototype.createCanvas = function(e, t, i, o) { var r = document.createElement("canvas"), n = (r.width = i, r.height = o, r.getContext("2d")); if (n.fillStyle = "#000", n.fillRect(0, 0, i, i), !(e.length <= 0)) { n.moveTo(e[0][0], e[0][1]); for (var a = 0; a < e.length; a++) n.lineTo(e[a][0], e[a][1]); return n.fillStyle = t, n.fill(), r } }, wu.prototype.remove = function() { this.item.modifyMeshObject = void 0 }, bu.prototype.addClipping = function(r, n = {}) { if (this.remove(), "polygon" === n.type) { let e = n.positions, t = []; e.forEach(e => { t.push(this._core.toDegrees(e)) }), t.push(t[0]); let i, o = ((i = n.isInner ? this.isClockWise(t) : !this.isClockWise(t)) && t.reverse(), []); var a = this.getInverseTransform(r); for (let e = 0; e < t.length - 1; e++) { var s = this.createPlane(t[e], t[e + 1], a); o.push(s) } r.clippingPlanes = new Cesium.ClippingPlaneCollection({ planes: o, unionClippingRegions: !n.isInner }) } return this.item = r, this }, bu.prototype.getInverseTransform = function(e) { let t, i = e.root.transform; return t = i && i.equals(Cesium.Matrix4.IDENTITY) || !i ? Cesium.Transforms .eastNorthUpToFixedFrame(e.boundingSphere.center) : Cesium.Matrix4.fromArray(e.root .transform), Cesium.Matrix4.inverseTransformation(t, new Cesium.Matrix4) }, bu.prototype.getOriginCoordinateSystemPoint = function(e, t) { e = Cesium.Cartesian3.fromDegrees(e.lon, e.lat); return Cesium.Matrix4.multiplyByPoint(t, e, new Cesium.Cartesian3(0, 0, 0)) }, bu.prototype.createPlane = function(e, t, i) { e = this.getOriginCoordinateSystemPoint(e, i), t = this.getOriginCoordinateSystemPoint(t, i), i = new Cesium.Cartesian3(0, 0, 1), t = Cesium.Cartesian3.subtract(t, e, new Cesium .Cartesian3), t = Cesium.Cartesian3.cross(t, i, new Cesium.Cartesian3), t = Cesium .Cartesian3.normalize(t, t), i = Cesium.Plane.fromPointNormal(e, t); return Cesium.ClippingPlane.fromPlane(i) }, bu.prototype.isClockWise = function(t) { if (t.length < 3) return null; t[0] === t[t.length - 1] && (t = t.slice(0, t.length - 1)); let i = { i: -1, val: 90 }; for (let e = 0; e < t.length; e++) { var o = t[e]["lat"]; o < i.val && (i.val = o, i.i = e) } var e = (i.i + t.length - 1) % t.length, r = i.i, n = (i.i + 1) % t.length; let a = t[r].lat - t[e].lat, s = t[r].lon - t[e].lon, l = t[n].lat - t[r].lat, u = t[n].lon - t[r].lon; r = u * a - s * l; return 0 == r ? t[n].lon < t[e].lon : 0 < r }, bu.prototype.remove = function() { this.item && this.item.clippingPlanes && this.item.clippingPlanes.removeAll(), this.item && ( this.item.clippingPlanes = void 0) }, Tu.prototype.addCZML = function(e, t, i) { var o = this, r = (t = t || {}, new this._cesium.CzmlDataSource), r = (this._viewer.dataSources.add(r), this.item = r, this._option = t, this.item.process(e) .then(function(e) { o.Pretreatment(e, t), i && "function" == typeof i && i(e) }), { id: this._core.getuid(), name: "新建CZML", pId: 0, type: "CZML", item: this }); return this.setTreeobj(r), this._tree.insertGroupId(r, 0), this }, Tu.prototype.process = function(e, t) { let i = this; this.item && this.item.process(e).then(function(e) { i.Pretreatment(e, i._option), t && "function" == typeof t && t(e) }) }, Tu.prototype.Pretreatment = function(e, t) { let o = this, i = e.entities.values; i.forEach(i => { var e; 0 === i.id.indexOf("Link_") ? i.polyline.material = o._core.getLinkMaterial(t .linkColor, t.linkPointColor, t.linkTime) : 0 === i.id.indexOf( "ConeRadar_") ? i.cylinder.material = o._core.getConeRadarMaterial(t .coneRadarColor) : 0 === i.id.indexOf("MultiCircleScan_") ? i.ellipse .material = o._core.getMultiCircleScanMaterial(t.multiCircleColor, t .multiCircleTime) : 0 === i.id.indexOf("SectorScan_") ? (e = o._core .defaultValue(t.sectorScanAngle, 45), i.ellipse.material = o._core .getSectorScanMaterial(t.sectorScanColor, e), i.ellipse.stRotation = new o ._cesium.CallbackProperty(function(e, t) { e = i.orientation.getValue(e, t); return o._cesium.HeadingPitchRoll.fromQuaternion(e).heading - Math .PI / 2 }, !1)) : 0 === i.id.indexOf("CircleScan_") ? i.ellipse.material = o._core .getCircleScanMaterial(t.circleScanColor, t.circleScanTime) : 0 === i.id .indexOf("RadarScan_") && (i.ellipse.material = o._core.getRadarScanMaterial(t .radarScanColor, t.radarScanTime)) }) }, Tu.prototype.deleteObject = function() { this._viewer.dataSources.remove(this.item) }, Tu.prototype.setTreeobj = function(e) { this.treeobj = e }, Tu.prototype.setVisibility = function(e) { null != this.item && (this.item.show = e) }, Su.prototype.addHeatMap = function(e, t = {}) { "HeatmapGL" === t.type ? this.item = new yo(this._viewer, t) : this.item = new vo(this._viewer, t), t.sourceData && this.item.create(t.sourceData); t = { id: this._core.getuid(), name: e, pId: 0, type: "Heatmap", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, 0), this }, Su.prototype.setData = function(e) { this.item && this.item.setData(e) }, Su.prototype.flyToBounding = function() { this.item && this.item.flyToBounding() }, Su.prototype.deleteObject = function() { this.item && this.item.destroy() }, Su.prototype.setTreeobj = function(e) { this.treeobj = e }, Su.prototype.setVisibility = function(e) { null != this.item && this.item.show(e) }, Pu.prototype.createSatelliteTrail = function(t) { t = t || {}; let e = this._viewer, i = new Cesium.JulianDate.fromDate(new Date), o = Cesium.JulianDate.addSeconds(i, 3600, new Cesium.JulianDate), r = (e.clock.startTime = t.start || i.clone(), e.clock.stopTime = t.stop || o.clone(), e .clock.currentTime = t.start || i.clone(), e.clock.clockRange = Cesium.ClockRange .LOOP_STOP, e.clock.multiplier = t.speed || 2, this.flyHeight = t.height || 7e5, []); return t.path ? r = t.path : this.getRandState(r, 2), r.forEach(e => { this.getStatePath(e, t) }), this }, Pu.prototype.getStatePath = function(e, t) { let i = this._viewer; var o = i.clock.startTime.clone(), r = i.clock.stopTime.clone(), n = this.computeCirclularFlight(e, 2); let a = i.entities.add({ availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({ start: o, stop: r })]), position: n, orientation: new Cesium.VelocityOrientationProperty(n), cylinder: { HeightReference: Cesium.HeightReference.CLAMP_TO_GROUND, length: this.flyHeight, topRadius: 0, bottomRadius: this.flyHeight / 2, material: this._core.getConeRadarMaterial(t.radarColor || "#00ff00"), outline: !1, numberOfVerticalLines: 0 } }); a.position.setInterpolationOptions({ interpolationDegree: 5, interpolationAlgorithm: Cesium.LagrangePolynomialApproximation }), this.TrailEntitys.push(a); n = this.computeCirclularFlight(e, 1); let s = { availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({ start: o, stop: r })]), position: n, orientation: new Cesium.VelocityOrientationProperty(n), path: { resolution: 1, material: new Cesium.PolylineGlowMaterialProperty({ color: Cesium.Color.DEEPSKYBLUE }), width: t.width || 5 } }, l = (t.img ? "object" == typeof t.img ? s.billboard = t.img : "string" == typeof t.img && (s .billboard = { image: t.img, scale: t.scale }) : s.model = { uri: t.model || window.SmartEarthRootUrl + D.flyModel, minimumPixelSize: 32, scale: t.scale }, i.entities.add(s)); l.position.setInterpolationOptions({ interpolationDegree: 5, interpolationAlgorithm: Cesium.LagrangePolynomialApproximation }), this.TrailEntitys.push(l) }, Pu.prototype.clear = function() { this.TrailEntitys.forEach(e => { this._viewer.entities.remove(e) }), this.TrailEntitys = [] }, Pu.prototype.faster = function() { this._viewer.animation.viewModel.faster() }, Pu.prototype.slower = function() { this._viewer.animation.viewModel.slower() }, Pu.prototype.setSpeed = function(e) { this._viewer.clock.multiplier = parseFloat(e) }, Pu.prototype.isPause = function(e) { this._viewer.clockViewModel.shouldAnimate = !e }, Pu.prototype.computeCirclularFlight = function(t, e) { var i = this._viewer.clock.startTime.clone(); let o = new Cesium.SampledPositionProperty; if (1 == e) for (let e = 0; e < t.length; e++) { var r = Cesium.JulianDate.addSeconds(i, t[e].time, new Cesium.JulianDate), n = Cesium.Cartesian3.fromDegrees(t[e].lon, t[e].lat, t[e].hei); o.addSample(r, n) } else if (2 == e) for (let e = 0; e < t.length; e++) { var a = Cesium.JulianDate.addSeconds(i, t[e].time, new Cesium.JulianDate), s = Cesium.Cartesian3.fromDegrees(t[e].lon, t[e].lat, t[e].phei); o.addSample(a, s) } return o }, Pu.prototype.getRandState = function(t, i) { var o = this.flyHeight; for (let e = 0; e < i; e++) { let i = []; var r = Math.floor(180 * Math.random()); for (let t = 0; t <= 360; t += 30) { let e = new Eu(o); t <= 180 ? (e.lon = r, e.lat = t - 90) : (e.lon = r - 180, e.lat = 270 - t), e.time = 10 * t, i.push(e) } t.push(i) } for (let e = 0; e < i; e++) { let i = []; var n = Math.floor(180 * Math.random()) - 90; for (let t = -180; t <= 180; t += 30) { let e = new Eu(o); e.lon = t, e.lat = n, e.time = 10 * (t + 180), i.push(e) } t.push(i) } }, xu.prototype.createViewCone = function(s, l) { s = s || {}, s = this._core.extend({ roll: 0, fov: 60, near: 1, fillColor: "rgba(0,255,0,0.1)", outlineColor: "rgba(0,255,0,1)" }, s, !0), this._option = s, this._core.mouse(this._viewer.container, 1, window .SmartEarthRootUrl + D.draw); let u = this, c = this._viewer, h = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this .drawHandler = new this._cesium.ScreenSpaceEventHandler(c.scene.canvas), V.states = 1, []); return this.drawHandler.setInputAction(e => { var t, i, o, r, n, a, e = u._getPosition.getMousePosition(e); e && (0 === h.length ? h.push(e, e) : (u.drawHandler.destroy(), u.drawHandler = void 0, u.tooltip.show(!1), setTimeout(function() { V.states = 0 }, 100), u._core.mouse(u._viewer.container, 0, "0"), l && "function" == typeof l && l(u.item)), u.item || (u.viewConeCamera = new Cesium.Camera( c.scene), e = Cesium.Cartesian3.normalize(Cesium.Cartesian3 .subtract(h[1], h[0], new Cesium.Cartesian3), new Cesium.Cartesian3 ), u.viewConeCamera.position = h[0], u.viewConeCamera.direction = e, u.viewConeCamera.frustum.fov = Cesium.Math.toRadians(s.fov), u .viewConeCamera.frustum.near = s.near, u.viewConeCamera.frustum.far = 1, n = new Cesium.Cartesian3, a = new Cesium.Matrix3, t = new Cesium .Quaternion, i = u.viewConeCamera.positionWC, o = u.viewConeCamera.upWC, r = u.viewConeCamera.rightWC, r = Cesium.Cartesian3.negate(r, n), n = a, Cesium.Matrix3.setColumn(n, 0, r, n), Cesium.Matrix3.setColumn(n, 1, o, n), Cesium.Matrix3.setColumn(n, 2, e, n), a = Cesium.Quaternion .fromRotationMatrix(n, t), s.fill && (u._planesPrimitive = new Cesium .Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumGeometry({ origin: i, orientation: a, frustum: u.viewConeCamera.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute .fromColor(Cesium.Color .fromCssColorString(s.fillColor)) }, id: s.id }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !0, flat: !0 }), asynchronous: !1, allowPicking: !1 })), u._outlinePrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumOutlineGeometry({ origin: i, orientation: a, frustum: u.viewConeCamera.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute .fromColor(Cesium.Color.fromCssColorString(s .outlineColor)) }, id: s.id }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0 }), asynchronous: !1, allowPicking: !1 }), u.item = new Cesium.PrimitiveCollection, u._viewer.scene.primitives .add(u.item), u._outlinePrimitive && u.item.add(u._outlinePrimitive), u ._planesPrimitive && u.item.add(u._planesPrimitive))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { var t; 0 < h.length ? (u.tooltip.showAt(e.endPosition, "再次点击结束绘制"), (t = u._getPosition .getMousePosition(e)) && (h[1] = t, u.viewConeCamera.direction = Cesium .Cartesian3.normalize(Cesium.Cartesian3.subtract(h[1], h[0], new Cesium .Cartesian3), new Cesium.Cartesian3), u.updata({ heading: Cesium.Math.toDegrees(u.viewConeCamera.heading), pitch: Cesium.Math.toDegrees(u.viewConeCamera.pitch), far: u._core.getSpaceDistancem(h, Cesium) }))) : u.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, xu.prototype.addViewCone = function(e) { var t = { position: this._viewer.camera.position.clone(), heading: 0, pitch: 0, roll: 0, fov: 60, near: 1, far: 60, fillColor: "rgba(0,255,0,0.1)", outlineColor: "rgba(0,255,0,1)" }, t = ((e = e || {}).position && e.position.lon && (e.position = Cesium.Cartesian3 .fromDegrees(e.position.lon, e.position.lat, e.position.height)), e = this._core .extend(t, e, !0), this.viewConeCamera = new Cesium.Camera(this._viewer.scene), this .viewConeCamera.setView({ destination: e.position, orientation: { heading: Cesium.Math.toRadians(e.heading), pitch: Cesium.Math.toRadians(e.pitch), roll: Cesium.Math.toRadians(e.roll) } }), this.viewConeCamera.frustum.fov = Cesium.Math.toRadians(e.fov), this.viewConeCamera .frustum.near = e.near, this.viewConeCamera.frustum.far = e.far, new Cesium.Cartesian3), i = new Cesium.Matrix3, o = new Cesium.Quaternion, r = this.viewConeCamera.positionWC, n = this.viewConeCamera.directionWC, a = this.viewConeCamera.upWC, s = this.viewConeCamera.rightWC, s = Cesium.Cartesian3.negate(s, t), t = i, i = (Cesium.Matrix3.setColumn(t, 0, s, t), Cesium.Matrix3.setColumn(t, 1, a, t), Cesium .Matrix3.setColumn(t, 2, n, t), Cesium.Quaternion.fromRotationMatrix(t, o)); return e.fill && (this._planesPrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumGeometry({ origin: r, orientation: i, frustum: this.viewConeCamera.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium .Color.fromCssColorString(e.fillColor)) }, id: e.id }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !0, flat: !0 }), asynchronous: !1, allowPicking: !1 })), this._outlinePrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumOutlineGeometry({ origin: r, orientation: i, frustum: this.viewConeCamera.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color .fromCssColorString(e.outlineColor)) }, id: e.id }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0 }), asynchronous: !1, allowPicking: !1 }), this._option = e, this.item = new Cesium.PrimitiveCollection, this._viewer.scene .primitives.add(this.item), this._outlinePrimitive && this.item.add(this._outlinePrimitive), this._planesPrimitive && this.item.add(this._planesPrimitive), this }, xu.prototype.updata = function(e) { (e = e || {}).position && e.position.lon && (e.position = Cesium.Cartesian3.fromDegrees(e .position.lon, e.position.lat, e.position.height)), e = this._core.extend(this._option, e, !0), this._outlinePrimitive && this._outlinePrimitive.destroy(), this ._planesPrimitive && this._planesPrimitive.destroy(), this.item.removeAll(), this .viewConeCamera.setView({ destination: e.position, orientation: { heading: Cesium.Math.toRadians(e.heading), pitch: Cesium.Math.toRadians(e.pitch), roll: Cesium.Math.toRadians(e.roll) } }), this.viewConeCamera.frustum.fov = Cesium.Math.toRadians(e.fov), this.viewConeCamera .frustum.near = e.near, this.viewConeCamera.frustum.far = e.far; var t = new Cesium.Cartesian3, i = new Cesium.Matrix3, o = new Cesium.Quaternion, r = this.viewConeCamera.positionWC, n = this.viewConeCamera.directionWC, a = this.viewConeCamera.upWC, s = this.viewConeCamera.rightWC, s = Cesium.Cartesian3.negate(s, t), t = i, i = (Cesium.Matrix3.setColumn(t, 0, s, t), Cesium.Matrix3.setColumn(t, 1, a, t), Cesium .Matrix3.setColumn(t, 2, n, t), Cesium.Quaternion.fromRotationMatrix(t, o)); e.fill && (this._planesPrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumGeometry({ origin: r, orientation: i, frustum: this.viewConeCamera.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium .Color.fromCssColorString(e.fillColor)) }, id: e.id }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !0, flat: !0 }), asynchronous: !1, allowPicking: !1 })), this._outlinePrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumOutlineGeometry({ origin: r, orientation: i, frustum: this.viewConeCamera.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color .fromCssColorString(e.outlineColor)) }, id: e.id }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0 }), asynchronous: !1, allowPicking: !1 }), this._option = e, this.item.add(this._outlinePrimitive), this._planesPrimitive && this .item.add(this._planesPrimitive) }, xu.prototype.destroy = function() { return this._outlinePrimitive && this._outlinePrimitive.destroy(), this._planesPrimitive && this ._planesPrimitive.destroy(), this.item && this._viewer.scene.primitives.removeAndDestroy( this.item), Cesium.destroyObject(this) }; var Iu = Object.freeze({ UNLOADED: 0, LOADING: 1, PARSING: 2, READY: 3, FAILED: 4 }), Me = Object.freeze({ LUMINANCE_8: 1, LUMINANCE_16: 2, ALPHA: 3, ALPHA_4_LUMINANCE_4: 4, LUMINANCE_ALPHA: 5, RGB_565: 6, BGR565: 7, RGB: 10, BGR: 11, ARGB: 12, ABGR: 13, BGRA: 14, WEBP: 25, RGBA: 28, DXT1: 17, DXT2: 18, DXT3: 19, DXT4: 20, DXT5: 21 }), Te = Object.freeze({ encNONE: 0, enrS3TCDXTN: 14, enrPVRTPF_PVRTC2: 19, enrPVRTPF_PVRTC: 20, enrPVRTPF_PVRTC_4bpp: 21, enrPVRTPF_ETC1: 22 }), Du = Object.freeze({ SVC_Vertex: 1, SVC_Normal: 2, SVC_VertexColor: 4, SVC_SecondColor: 8, SVC_TexutreCoord: 16, SVC_TexutreCoordIsW: 32 }), Lu = function o(r, n, a) { function s(i, e) { if (!n[i]) { if (!r[i]) { var t = "function" == typeof require && require; if (!e && t) return t(i, !0); if (l) return l(i, !0); e = new Error("Cannot find module '" + i + "'"); throw e.code = "MODULE_NOT_FOUND", e } t = n[i] = { exports: {} }; r[i][0].call(t.exports, function(e) { var t = r[i][1][e]; return s(t || e) }, t, t.exports, o, r, n, a) } return n[i].exports } for (var l = "function" == typeof require && require, e = 0; e < a.length; e++) s(a[e]); return s }({ 1: [function(e, t, i) { var o = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array, r = (i.assign = function(e) { for (var t = Array.prototype.slice.call(arguments, 1); t.length;) { var i = t.shift(); if (i) { if ("object" != typeof i) throw new TypeError(i + "must be non-object"); for (var o in i) i.hasOwnProperty(o) && (e[o] = i[o]) } } return e }, i.shrinkBuf = function(e, t) { return e.length === t ? e : e.subarray ? e.subarray(0, t) : (e.length = t, e) }, { arraySet: function(e, t, i, o, r) { if (t.subarray && e.subarray) e.set(t.subarray(i, i + o), r); else for (var n = 0; n < o; n++) e[r + n] = t[i + n] }, flattenChunks: function(e) { for (var t, i, o, r = 0, n = 0, a = e.length; n < a; n++) r += e[n] .length; for (o = new Uint8Array(r), n = t = 0, a = e.length; n < a; n++) i = e[n], o.set(i, t), t += i.length; return o } }), n = { arraySet: function(e, t, i, o, r) { for (var n = 0; n < o; n++) e[r + n] = t[i + n] }, flattenChunks: function(e) { return [].concat.apply([], e) } }; i.setTyped = function(e) { e ? (i.Buf8 = Uint8Array, i.Buf16 = Uint16Array, i.Buf32 = Int32Array, i.assign( i, r)) : (i.Buf8 = Array, i.Buf16 = Array, i.Buf32 = Array, i.assign(i, n)) }, i.setTyped(o) }, {}], 2: [function(e, t, i) { var l = e("./common"), r = !0, n = !0; try { String.fromCharCode.apply(null, [0]) } catch (e) { r = !1 } try { String.fromCharCode.apply(null, new Uint8Array(1)) } catch (e) { n = !1 } for (var u = new l.Buf8(256), o = 0; o < 256; o++) u[o] = 252 <= o ? 6 : 248 <= o ? 5 : 240 <= o ? 4 : 224 <= o ? 3 : 192 <= o ? 2 : 1; function c(e, t) { if (t < 65537 && (e.subarray && n || !e.subarray && r)) return String.fromCharCode .apply(null, l.shrinkBuf(e, t)); for (var i = "", o = 0; o < t; o++) i += String.fromCharCode(e[o]); return i } u[254] = u[254] = 1, i.string2buf = function(e) { for (var t, i, o, r, n = e.length, a = 0, s = 0; s < n; s++) 55296 == (64512 & ( i = e.charCodeAt(s))) && s + 1 < n && 56320 == (64512 & (o = e .charCodeAt(s + 1))) && (i = 65536 + (i - 55296 << 10) + (o - 56320), s++), a += i < 128 ? 1 : i < 2048 ? 2 : i < 65536 ? 3 : 4; for (t = new l.Buf8(a), s = r = 0; r < a; s++) 55296 == (64512 & (i = e .charCodeAt(s))) && s + 1 < n && 56320 == (64512 & (o = e.charCodeAt(s + 1))) && (i = 65536 + (i - 55296 << 10) + (o - 56320), s++), i < 128 ? t[ r++] = i : (i < 2048 ? t[r++] = 192 | i >>> 6 : (i < 65536 ? t[r++] = 224 | i >>> 12 : (t[r++] = 240 | i >>> 18, t[r++] = 128 | i >>> 12 & 63), t[r++] = 128 | i >>> 6 & 63), t[r++] = 128 | 63 & i); return t }, i.buf2binstring = function(e) { return c(e, e.length) }, i.binstring2buf = function(e) { for (var t = new l.Buf8(e.length), i = 0, o = t.length; i < o; i++) t[i] = e .charCodeAt(i); return t }, i.buf2string = function(e, t) { for (var i, o, r = t || e.length, n = new Array(2 * r), a = 0, s = 0; s < r;) if ((i = e[s++]) < 128) n[a++] = i; else if (4 < (o = u[i])) n[a++] = 65533, s += o - 1; else { for (i &= 2 === o ? 31 : 3 === o ? 15 : 7; 1 < o && s < r;) i = i << 6 | 63 & e[s++], o--; 1 < o ? n[a++] = 65533 : i < 65536 ? n[a++] = i : (i -= 65536, n[a++] = 55296 | i >> 10 & 1023, n[a++] = 56320 | 1023 & i) } return c(n, a) }, i.utf8border = function(e, t) { for (var i = (t = (t = t || e.length) > e.length ? e.length : t) - 1; 0 <= i && 128 == (192 & e[i]);) i--; return !(i < 0) && 0 !== i && i + u[e[i]] > t ? i : t } }, { "./common": 1 }], 3: [function(e, t, i) { t.exports = function(e, t, i, o) { for (var r = 65535 & e | 0, n = e >>> 16 & 65535 | 0, a = 0; 0 !== i;) { for (i -= a = 2e3 < i ? 2e3 : i; n = n + (r = r + t[o++] | 0) | 0, --a;); r %= 65521, n %= 65521 } return r | n << 16 | 0 } }, {}], 4: [function(e, t, i) { t.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 } }, {}], 5: [function(e, t, i) { var s = function() { for (var e = [], t = 0; t < 256; t++) { for (var i = t, o = 0; o < 8; o++) i = 1 & i ? 3988292384 ^ i >>> 1 : i >>> 1; e[t] = i } return e }(); t.exports = function(e, t, i, o) { var r = s, n = o + i; e ^= -1; for (var a = o; a < n; a++) e = e >>> 8 ^ r[255 & (e ^ t[a])]; return -1 ^ e } }, {}], 6: [function(e, t, i) { t.exports = function() { this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this .done = !1 } }, {}], 7: [function(e, t, i) { t.exports = function(e, t) { var i, o, r, n, a, s, l = e.state, u = e.next_in, c = e.input, h = u + (e.avail_in - 5), m = e.next_out, d = e.output, p = m - (t - e.avail_out), g = m + (e.avail_out - 257), _ = l.dmax, f = l.wsize, y = l.whave, v = l.wnext, C = l.window, w = l.hold, b = l.bits, T = l.lencode, S = l.distcode, P = (1 << l.lenbits) - 1, E = (1 << l.distbits) - 1; e: do { for (b < 15 && (w += c[u++] << b, b += 8, w += c[u++] << b, b += 8), i = T[w & P];;) { if (w >>>= o = i >>> 24, b -= o, 0 === (o = i >>> 16 & 255)) d[ m++] = 65535 & i; else { if (!(16 & o)) { if (0 == (64 & o)) { i = T[(65535 & i) + (w & (1 << o) - 1)]; continue } if (32 & o) { l.mode = 12; break e } e.msg = "invalid literal/length code", l.mode = 30; break e } for (r = 65535 & i, (o &= 15) && (b < o && (w += c[u++] << b, b += 8), r += w & (1 << o) - 1, w >>>= o, b -= o), b < 15 && (w += c[u++] << b, b += 8, w += c[u++] << b, b += 8), i = S[w & E];;) { if (w >>>= o = i >>> 24, b -= o, !(16 & (o = i >>> 16 & 255))) { if (0 == (64 & o)) { i = S[(65535 & i) + (w & (1 << o) - 1)]; continue } e.msg = "invalid distance code", l.mode = 30; break e } if (n = 65535 & i, b < (o &= 15) && (w += c[u++] << b, (b += 8) < o && (w += c[u++] << b, b += 8)), _ < (n += w & (1 << o) - 1)) { e.msg = "invalid distance too far back", l.mode = 30; break e } if (w >>>= o, b -= o, (o = m - p) < n) { if (y < (o = n - o) && l.sane) { e.msg = "invalid distance too far back", l.mode = 30; break e } if (s = C, (a = 0) === v) { if (a += f - o, o < r) { for (r -= o; d[m++] = C[a++], --o;); a = m - n, s = d } } else if (v < o) { if (a += f + v - o, (o -= v) < r) { for (r -= o; d[m++] = C[a++], --o;); if (a = 0, v < r) { for (r -= o = v; d[m++] = C[a++], --o;); a = m - n, s = d } } } else if (a += v - o, o < r) { for (r -= o; d[m++] = C[a++], --o;); a = m - n, s = d } for (; 2 < r;) d[m++] = s[a++], d[m++] = s[a++], d[ m++] = s[a++], r -= 3; r && (d[m++] = s[a++], 1 < r && (d[m++] = s[a++])) } else { for (a = m - n; d[m++] = d[a++], d[m++] = d[a++], d[ m++] = d[a++], 2 < (r -= 3);); r && (d[m++] = d[a++], 1 < r && (d[m++] = d[a++])) } break } } break } } while (u < h && m < g); w &= (1 << (b -= (r = b >> 3) << 3)) - 1, e.next_in = u -= r, e.next_out = m, e .avail_in = u < h ? h - u + 5 : 5 - (u - h), e.avail_out = m < g ? g - m + 257 : 257 - (m - g), l.hold = w, l.bits = b } }, {}], 8: [function(e, t, i) { var M = e("../utils/common"), A = e("./adler32"), R = e("./crc32"), O = e("./inffast"), H = e("./inftrees"), V = 1, k = 2, F = 0, G = -2, N = 1, o = 852, r = 592; function B(e) { return (e >>> 24 & 255) + (e >>> 8 & 65280) + ((65280 & e) << 8) + ((255 & e) << 24) } function n() { this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this .lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this .ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this .lens = new M.Buf16(320), this.work = new M.Buf16(288), this.lendyn = null, this .distdyn = null, this.sane = 0, this.back = 0, this.was = 0 } function a(e) { var t; return e && e.state ? (t = e.state, e.total_in = e.total_out = t.total = 0, e.msg = "", t.wrap && (e.adler = 1 & t.wrap), t.mode = N, t.last = 0, t.havedict = 0, t.dmax = 32768, t.head = null, t.hold = 0, t.bits = 0, t.lencode = t .lendyn = new M.Buf32(o), t.distcode = t.distdyn = new M.Buf32(r), t.sane = 1, t.back = -1, F) : G } function s(e) { var t; return e && e.state ? ((t = e.state).wsize = 0, t.whave = 0, t.wnext = 0, a(e)) : G } function l(e, t) { var i, o; return e && e.state ? (o = e.state, t < 0 ? (i = 0, t = -t) : (i = 1 + (t >> 4), t < 48 && (t &= 15)), t && (t < 8 || 15 < t) ? G : (null !== o.window && o .wbits !== t && (o.window = null), o.wrap = i, o.wbits = t, s(e))) : G } function u(e, t) { var i; return e ? (i = new n, (e.state = i).window = null, (i = l(e, t)) !== F && (e .state = null), i) : G } var j, z, U = !0; function W(e, t, i, o) { var r, e = e.state; return null === e.window && (e.wsize = 1 << e.wbits, e.wnext = 0, e.whave = 0, e .window = new M.Buf8(e.wsize)), o >= e.wsize ? (M.arraySet(e.window, t, i - e.wsize, e.wsize, 0), e.wnext = 0, e.whave = e.wsize) : (o < (r = e.wsize - e.wnext) && (r = o), M.arraySet(e.window, t, i - o, r, e.wnext), (o -= r) ? (M.arraySet(e.window, t, i - o, o, 0), e.wnext = o, e.whave = e .wsize) : (e.wnext += r, e.wnext === e.wsize && (e.wnext = 0), e.whave < e.wsize && (e.whave += r))), 0 } i.inflateReset = s, i.inflateReset2 = l, i.inflateResetKeep = a, i.inflateInit = function(e) { return u(e, 15) }, i.inflateInit2 = u, i.inflate = function(e, t) { var i, o, r, n, a, s, l, u, c, h, m, d, p, g, _, f, y, v, C, w, b, T, S, P, E = 0, x = new M.Buf8(4), I = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; if (!e || !e.state || !e.output || !e.input && 0 !== e.avail_in) return G; 12 === (i = e.state).mode && (i.mode = 13), a = e.next_out, r = e.output, l = e .avail_out, n = e.next_in, o = e.input, s = e.avail_in, u = i.hold, c = i .bits, h = s, m = l, T = F; e: for (;;) switch (i.mode) { case N: if (0 === i.wrap) { i.mode = 13; break } for (; c < 16;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } if (2 & i.wrap && 35615 === u) { x[i.check = 0] = 255 & u, x[1] = u >>> 8 & 255, i.check = R( i.check, x, 2, 0), c = u = 0, i.mode = 2; break } if (i.flags = 0, i.head && (i.head.done = !1), !(1 & i.wrap) || (((255 & u) << 8) + (u >> 8)) % 31) { e.msg = "incorrect header check", i.mode = 30; break } if (8 != (15 & u)) { e.msg = "unknown compression method", i.mode = 30; break } if (c -= 4, b = 8 + (15 & (u >>>= 4)), 0 === i.wbits) i.wbits = b; else if (b > i.wbits) { e.msg = "invalid window size", i.mode = 30; break } i.dmax = 1 << b, e.adler = i.check = 1, i.mode = 512 & u ? 10 : 12, c = u = 0; break; case 2: for (; c < 16;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } if (i.flags = u, 8 != (255 & i.flags)) { e.msg = "unknown compression method", i.mode = 30; break } if (57344 & i.flags) { e.msg = "unknown header flags set", i.mode = 30; break } i.head && (i.head.text = u >> 8 & 1), 512 & i.flags && (x[0] = 255 & u, x[1] = u >>> 8 & 255, i.check = R(i.check, x, 2, 0)), c = u = 0, i.mode = 3; case 3: for (; c < 32;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } i.head && (i.head.time = u), 512 & i.flags && (x[0] = 255 & u, x[1] = u >>> 8 & 255, x[2] = u >>> 16 & 255, x[3] = u >>> 24 & 255, i.check = R(i.check, x, 4, 0)), c = u = 0, i.mode = 4; case 4: for (; c < 16;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } i.head && (i.head.xflags = 255 & u, i.head.os = u >> 8), 512 & i .flags && (x[0] = 255 & u, x[1] = u >>> 8 & 255, i.check = R(i.check, x, 2, 0)), c = u = 0, i.mode = 5; case 5: if (1024 & i.flags) { for (; c < 16;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } i.length = u, i.head && (i.head.extra_len = u), 512 & i .flags && (x[0] = 255 & u, x[1] = u >>> 8 & 255, i .check = R(i.check, x, 2, 0)), c = u = 0 } else i.head && (i.head.extra = null); i.mode = 6; case 6: if (1024 & i.flags && ((d = s < (d = i.length) ? s : d) && (i .head && (b = i.head.extra_len - i.length, i.head .extra || (i.head.extra = new Array(i.head .extra_len)), M.arraySet(i.head.extra, o, n, d, b)), 512 & i.flags && (i.check = R(i .check, o, d, n)), s -= d, n += d, i.length -= d ), i.length)) break e; i.length = 0, i.mode = 7; case 7: if (2048 & i.flags) { if (0 === s) break e; for (d = 0; b = o[n + d++], i.head && b && i.length < 65536 && (i.head.name += String.fromCharCode(b)), b && d < s;); if (512 & i.flags && (i.check = R(i.check, o, d, n)), s -= d, n += d, b) break e } else i.head && (i.head.name = null); i.length = 0, i.mode = 8; case 8: if (4096 & i.flags) { if (0 === s) break e; for (d = 0; b = o[n + d++], i.head && b && i.length < 65536 && (i.head.comment += String.fromCharCode(b)), b && d < s;); if (512 & i.flags && (i.check = R(i.check, o, d, n)), s -= d, n += d, b) break e } else i.head && (i.head.comment = null); i.mode = 9; case 9: if (512 & i.flags) { for (; c < 16;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } if (u !== (65535 & i.check)) { e.msg = "header crc mismatch", i.mode = 30; break } c = u = 0 } i.head && (i.head.hcrc = i.flags >> 9 & 1, i.head.done = !0), e .adler = i.check = 0, i.mode = 12; break; case 10: for (; c < 32;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } e.adler = i.check = B(u), c = u = 0, i.mode = 11; case 11: if (0 === i.havedict) return e.next_out = a, e.avail_out = l, e .next_in = n, e.avail_in = s, i.hold = u, i.bits = c, 2; e.adler = i.check = 1, i.mode = 12; case 12: if (5 === t || 6 === t) break e; case 13: if (i.last) { u >>>= 7 & c, c -= 7 & c, i.mode = 27; break } for (; c < 3;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } switch (i.last = 1 & u, --c, 3 & (u >>>= 1)) { case 0: i.mode = 14; break; case 1: D = L = void 0; var D, L = i; if (U) { for (j = new M.Buf32(512), z = new M.Buf32(32), D = 0; D < 144;) L.lens[D++] = 8; for (; D < 256;) L.lens[D++] = 9; for (; D < 280;) L.lens[D++] = 7; for (; D < 288;) L.lens[D++] = 8; for (H(V, L.lens, 0, 288, j, 0, L.work, { bits: 9 }), D = 0; D < 32;) L.lens[D++] = 5; H(k, L.lens, 0, 32, z, 0, L.work, { bits: 5 }), U = !1 } if (L.lencode = j, L.lenbits = 9, L.distcode = z, L .distbits = 5, i.mode = 20, 6 !== t) break; u >>>= 2, c -= 2; break e; case 2: i.mode = 17; break; case 3: e.msg = "invalid block type", i.mode = 30 } u >>>= 2, c -= 2; break; case 14: for (u >>>= 7 & c, c -= 7 & c; c < 32;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } if ((65535 & u) != (u >>> 16 ^ 65535)) { e.msg = "invalid stored block lengths", i.mode = 30; break } if (i.length = 65535 & u, c = u = 0, i.mode = 15, 6 === t) break e; case 15: i.mode = 16; case 16: if (d = i.length) { if (0 === (d = l < (d = s < d ? s : d) ? l : d)) break e; M.arraySet(r, o, n, d, a), s -= d, n += d, l -= d, a += d, i .length -= d; break } i.mode = 12; break; case 17: for (; c < 14;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } if (i.nlen = 257 + (31 & u), u >>>= 5, c -= 5, i.ndist = 1 + ( 31 & u), u >>>= 5, c -= 5, i.ncode = 4 + (15 & u), u >>>= 4, c -= 4, 286 < i.nlen || 30 < i.ndist) { e.msg = "too many length or distance symbols", i.mode = 30; break } i.have = 0, i.mode = 18; case 18: for (; i.have < i.ncode;) { for (; c < 3;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } i.lens[I[i.have++]] = 7 & u, u >>>= 3, c -= 3 } for (; i.have < 19;) i.lens[I[i.have++]] = 0; if (i.lencode = i.lendyn, i.lenbits = 7, S = { bits: i.lenbits }, T = H(0, i.lens, 0, 19, i.lencode, 0, i.work, S), i .lenbits = S.bits, T) { e.msg = "invalid code lengths set", i.mode = 30; break } i.have = 0, i.mode = 19; case 19: for (; i.have < i.nlen + i.ndist;) { for (; f = (E = i.lencode[u & (1 << i.lenbits) - 1]) >>> 16 & 255, y = 65535 & E, !((_ = E >>> 24) <= c);) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } if (y < 16) u >>>= _, c -= _, i.lens[i.have++] = y; else { if (16 === y) { for (P = _ + 2; c < P;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } if (u >>>= _, c -= _, 0 === i.have) { e.msg = "invalid bit length repeat", i.mode = 30; break } b = i.lens[i.have - 1], d = 3 + (3 & u), u >>>= 2, c -= 2 } else if (17 === y) { for (P = _ + 3; c < P;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } b = 0, d = 3 + (7 & (u >>>= _)), u >>>= 3, c = c - _ - 3 } else { for (P = _ + 7; c < P;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } b = 0, d = 11 + (127 & (u >>>= _)), u >>>= 7, c = c - _ - 7 } if (i.have + d > i.nlen + i.ndist) { e.msg = "invalid bit length repeat", i.mode = 30; break } for (; d--;) i.lens[i.have++] = b } } if (30 === i.mode) break; if (0 === i.lens[256]) { e.msg = "invalid code -- missing end-of-block", i.mode = 30; break } if (i.lenbits = 9, S = { bits: i.lenbits }, T = H(V, i.lens, 0, i.nlen, i.lencode, 0, i.work, S), i .lenbits = S.bits, T) { e.msg = "invalid literal/lengths set", i.mode = 30; break } if (i.distbits = 6, i.distcode = i.distdyn, S = { bits: i.distbits }, T = H(k, i.lens, i.nlen, i.ndist, i.distcode, 0, i.work, S), i.distbits = S.bits, T) { e.msg = "invalid distances set", i.mode = 30; break } if (i.mode = 20, 6 === t) break e; case 20: i.mode = 21; case 21: if (6 <= s && 258 <= l) { e.next_out = a, e.avail_out = l, e.next_in = n, e.avail_in = s, i.hold = u, i.bits = c, O(e, m), a = e.next_out, r = e.output, l = e.avail_out, n = e.next_in, o = e.input, s = e.avail_in, u = i.hold, c = i.bits, 12 === i.mode && (i.back = -1); break } for (i.back = 0; f = (E = i.lencode[u & (1 << i.lenbits) - 1]) >>> 16 & 255, y = 65535 & E, !((_ = E >>> 24) <= c);) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } if (f && 0 == (240 & f)) { for (v = _, C = f, w = y; f = (E = i.lencode[w + ((u & (1 << v + C) - 1) >> v)]) >>> 16 & 255, y = 65535 & E, !( v + (_ = E >>> 24) <= c);) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } u >>>= v, c -= v, i.back += v } if (u >>>= _, c -= _, i.back += _, i.length = y, 0 === f) { i.mode = 26; break } if (32 & f) { i.back = -1, i.mode = 12; break } if (64 & f) { e.msg = "invalid literal/length code", i.mode = 30; break } i.extra = 15 & f, i.mode = 22; case 22: if (i.extra) { for (P = i.extra; c < P;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } i.length += u & (1 << i.extra) - 1, u >>>= i.extra, c -= i .extra, i.back += i.extra } i.was = i.length, i.mode = 23; case 23: for (; f = (E = i.distcode[u & (1 << i.distbits) - 1]) >>> 16 & 255, y = 65535 & E, !((_ = E >>> 24) <= c);) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } if (0 == (240 & f)) { for (v = _, C = f, w = y; f = (E = i.distcode[w + ((u & ( 1 << v + C) - 1) >> v)]) >>> 16 & 255, y = 65535 & E, !(v + (_ = E >>> 24) <= c);) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } u >>>= v, c -= v, i.back += v } if (u >>>= _, c -= _, i.back += _, 64 & f) { e.msg = "invalid distance code", i.mode = 30; break } i.offset = y, i.extra = 15 & f, i.mode = 24; case 24: if (i.extra) { for (P = i.extra; c < P;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } i.offset += u & (1 << i.extra) - 1, u >>>= i.extra, c -= i .extra, i.back += i.extra } if (i.offset > i.dmax) { e.msg = "invalid distance too far back", i.mode = 30; break } i.mode = 25; case 25: if (0 === l) break e; if (i.offset > (d = m - l)) { if ((d = i.offset - d) > i.whave && i.sane) { e.msg = "invalid distance too far back", i.mode = 30; break } p = d > i.wnext ? (d -= i.wnext, i.wsize - d) : i.wnext - d, d > i.length && (d = i.length), g = i.window } else g = r, p = a - i.offset, d = i.length; for (l -= d = l < d ? l : d, i.length -= d; r[a++] = g[p++], -- d;); 0 === i.length && (i.mode = 21); break; case 26: if (0 === l) break e; r[a++] = i.length, l--, i.mode = 21; break; case 27: if (i.wrap) { for (; c < 32;) { if (0 === s) break e; s--, u |= o[n++] << c, c += 8 } if (m -= l, e.total_out += m, i.total += m, m && (e.adler = i.check = (i.flags ? R : A)(i.check, r, m, a - m)), m = l, (i.flags ? u : B(u)) !== i.check) { e.msg = "incorrect data check", i.mode = 30; break } c = u = 0 } i.mode = 28; case 28: if (i.wrap && i.flags) { for (; c < 32;) { if (0 === s) break e; s--, u += o[n++] << c, c += 8 } if (u !== (4294967295 & i.total)) { e.msg = "incorrect length check", i.mode = 30; break } c = u = 0 } i.mode = 29; case 29: T = 1; break e; case 30: T = -3; break e; case 31: return -4; default: return G } return e.next_out = a, e.avail_out = l, e.next_in = n, e.avail_in = s, i.hold = u, i.bits = c, (i.wsize || m !== e.avail_out && i.mode < 30 && (i.mode < 27 || 4 !== t)) && W(e, e.output, e.next_out, m - e.avail_out), h -= e .avail_in, m -= e.avail_out, e.total_in += h, e.total_out += m, i.total += m, i.wrap && m && (e.adler = i.check = (i.flags ? R : A)(i.check, r, m, e .next_out - m)), e.data_type = i.bits + (i.last ? 64 : 0) + (12 === i .mode ? 128 : 0) + (20 === i.mode || 15 === i.mode ? 256 : 0), T = (0 == h && 0 === m || 4 === t) && T === F ? -5 : T }, i.inflateEnd = function(e) { if (!e || !e.state) return G; var t = e.state; return t.window && (t.window = null), e.state = null, F }, i.inflateGetHeader = function(e, t) { return !e || !e.state || 0 == (2 & (e = e.state).wrap) ? G : ((e.head = t) .done = !1, F) }, i.inflateSetDictionary = function(e, t) { var i, o = t.length; return !e || !e.state || 0 !== (i = e.state).wrap && 11 !== i.mode ? G : 11 === i.mode && A(1, t, o, 0) !== i.check ? -3 : W(e, t, o, o) ? (i.mode = 31, - 4) : (i.havedict = 1, F) }, i.inflateInfo = "pako inflate (from Nodeca project)" }, { "../utils/common": 1, "./adler32": 3, "./crc32": 5, "./inffast": 7, "./inftrees": 9 }], 9: [function(e, t, i) { var O = e("../utils/common"), H = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 ], V = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 ], k = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0 ], F = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64 ]; t.exports = function(e, t, i, o, r, n, a, s) { for (var l, u, c, h, m, d, p, g, _, f = s.bits, y = 0, v = 0, C = 0, w = 0, b = 0, T = 0, S = 0, P = 0, E = 0, x = 0, I = null, D = 0, L = new O.Buf16( 16), M = new O.Buf16(16), A = null, R = 0, y = 0; y <= 15; y++) L[ y] = 0; for (v = 0; v < o; v++) L[t[i + v]]++; for (b = f, w = 15; 1 <= w && 0 === L[w]; w--); if (w < b && (b = w), 0 === w) return r[n++] = 20971520, r[n++] = 20971520, s .bits = 1, 0; for (C = 1; C < w && 0 === L[C]; C++); for (b < C && (b = C), y = P = 1; y <= 15; y++) if ((P = (P <<= 1) - L[y]) < 0) return -1; if (0 < P && (0 === e || 1 !== w)) return -1; for (M[1] = 0, y = 1; y < 15; y++) M[y + 1] = M[y] + L[y]; for (v = 0; v < o; v++) 0 !== t[i + v] && (a[M[t[i + v]]++] = v); if (d = 0 === e ? (I = A = a, 19) : 1 === e ? (I = H, D -= 257, A = V, R -= 257, 256) : (I = k, A = F, -1), y = C, m = n, S = v = x = 0, c = -1, h = (E = 1 << (T = b)) - 1, 1 === e && 852 < E || 2 === e && 592 < E) return 1; for (;;) { for (_ = a[v] < d ? (g = 0, a[v]) : a[v] > d ? (g = A[R + a[v]], I[D + a[ v]]) : (g = 96, 0), l = 1 << (p = y - S), C = u = 1 << T; r[m + ( x >> S) + (u -= l)] = p << 24 | g << 16 | _ | 0, 0 !== u;); for (l = 1 << y - 1; x & l;) l >>= 1; if (x = 0 !== l ? (x & l - 1) + l : 0, v++, 0 == --L[y]) { if (y === w) break; y = t[i + a[v]] } if (b < y && (x & h) !== c) { for (m += C, P = 1 << (T = y - (S = 0 === S ? b : S)); T + S < w && !(( P -= L[T + S]) <= 0);) T++, P <<= 1; if (E += 1 << T, 1 === e && 852 < E || 2 === e && 592 < E) return 1; r[c = x & h] = b << 24 | T << 16 | m - n | 0 } } return 0 !== x && (r[m + x] = y - S << 24 | 64 << 16 | 0), s.bits = b, 0 } }, { "../utils/common": 1 }], 10: [function(e, t, i) { t.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" } }, {}], 11: [function(e, t, i) { t.exports = function() { this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this .output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0 } }, {}], "/lib/inflate.js": [function(e, t, i) { var h = e("./zlib/inflate"), m = e("./utils/common"), d = e("./utils/strings"), p = e("./zlib/constants"), o = e("./zlib/messages"), r = e("./zlib/zstream"), n = e("./zlib/gzheader"), g = Object.prototype.toString; function a(e) { if (!(this instanceof a)) return new a(e); this.options = m.assign({ chunkSize: 16384, windowBits: 0, to: "" }, e || {}); var t = this.options, e = (t.raw && 0 <= t.windowBits && t.windowBits < 16 && (t.windowBits = -t .windowBits, 0 === t.windowBits && (t.windowBits = -15)), !(0 <= t .windowBits && t.windowBits < 16) || e && e.windowBits || (t .windowBits += 32), 15 < t.windowBits && t.windowBits < 48 && 0 == (15 & t.windowBits) && (t.windowBits |= 15), this.err = 0, this.msg = "", this .ended = !1, this.chunks = [], this.strm = new r, this.strm.avail_out = 0, h .inflateInit2(this.strm, t.windowBits)); if (e !== p.Z_OK) throw new Error(o[e]); this.header = new n, h.inflateGetHeader(this.strm, this.header) } function s(e, t) { t = new a(t); if (t.push(e, !0), t.err) throw t.msg || o[t.err]; return t.result } a.prototype.push = function(e, t) { var i, o, r, n, a, s = this.strm, l = this.options.chunkSize, u = this.options.dictionary, c = !1; if (this.ended) return !1; o = t === ~~t ? t : !0 === t ? p.Z_FINISH : p.Z_NO_FLUSH, "string" == typeof e ? s.input = d.binstring2buf(e) : "[object ArrayBuffer]" === g.call(e) ? s .input = new Uint8Array(e) : s.input = e, s.next_in = 0, s.avail_in = s .input.length; do { if (0 === s.avail_out && (s.output = new m.Buf8(l), s.next_out = 0, s .avail_out = l), (i = h.inflate(s, p.Z_NO_FLUSH)) === p .Z_NEED_DICT && u && (a = "string" == typeof u ? d.string2buf(u) : "[object ArrayBuffer]" === g.call(u) ? new Uint8Array(u) : u, i = h .inflateSetDictionary(this.strm, a)), i === p.Z_BUF_ERROR && !0 === c && (i = p.Z_OK, c = !1), i !== p.Z_STREAM_END && i !== p.Z_OK) return this.onEnd(i), !(this.ended = !0) } while (!s.next_out || 0 !== s.avail_out && i !== p.Z_STREAM_END && (0 !== s .avail_in || o !== p.Z_FINISH && o !== p.Z_SYNC_FLUSH) || ("string" === this.options.to ? (a = d.utf8border(s.output, s.next_out), r = s .next_out - a, n = d.buf2string(s.output, a), s.next_out = r, s .avail_out = l - r, r && m.arraySet(s.output, s.output, a, r, 0), this.onData(n)) : this.onData(m.shrinkBuf(s.output, s.next_out))), 0 === s.avail_in && 0 === s.avail_out && (c = !0), (0 < s.avail_in || 0 === s.avail_out) && i !== p.Z_STREAM_END); return (o = i === p.Z_STREAM_END ? p.Z_FINISH : o) === p.Z_FINISH ? (i = h .inflateEnd(this.strm), this.onEnd(i), this.ended = !0, i === p.Z_OK) : o !== p.Z_SYNC_FLUSH || (this.onEnd(p.Z_OK), !(s.avail_out = 0)) }, a.prototype.onData = function(e) { this.chunks.push(e) }, a.prototype.onEnd = function(e) { e === p.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join( "") : this.result = m.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg }, i.Inflate = a, i.inflate = s, i.inflateRaw = function(e, t) { return (t = t || {}).raw = !0, s(e, t) }, i.ungzip = s }, { "./utils/common": 1, "./utils/strings": 2, "./zlib/constants": 4, "./zlib/gzheader": 6, "./zlib/inflate": 8, "./zlib/messages": 10, "./zlib/zstream": 11 }] }, {}, [])("/lib/inflate.js"); function Mu() {} let Au = { SV_Unkown: 0, SV_Standard: 1, SV_Compressed: 2 }; function Ru(e, t, i) { t = t.getUint32(i, !0), i += Uint32Array.BYTES_PER_ELEMENT, e = new Uint8Array(e, i, t); return { string: Cesium.getStringFromTypedArray(e), bytesOffset: i += t } } function Ou(t, i, o, e) { let r = {}, n = (r.rangeList = i.getFloat32(o, !0), o += Float32Array.BYTES_PER_ELEMENT, r.rangeMode = i.getUint16( o, !0), o += Uint16Array.BYTES_PER_ELEMENT, {}); n.x = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, n.y = i.getFloat64(o, !0), o += Float64Array .BYTES_PER_ELEMENT, n.z = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT; var a = i.getFloat64(o, !0), a = (o += Float64Array.BYTES_PER_ELEMENT, r.boundingSphere = { center: n, radius: a }, Ru(t, i, o)); let s = a.string; o = a.bytesOffset; var a = s.indexOf("Geometry"), l = (-1 !== a && (a = s.substring(a), s = s.replace(a, "")), r.childTile = s, r.geodes = [], i .getUint32(o, !0)); o += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < l; e++) o = function(t, i, o, e) { let r = {}, n = [], a = new Array(16); for (let e = 0; e < 16; e++) a[e] = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT; r.matrix = a, r.skeletonNames = n; var s = i.getUint32(o, !0); o += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < s; e++) { var l = Ru(t, i, o); n.push(l.string), o = l.bytesOffset } return e.push(r), o }(t, i, o, r.geodes); return e.push(r), o } function Hu(e, t, i, o) { var r = t.getUint32(i, !0); if (o.verticesCount = r, (i += Uint32Array.BYTES_PER_ELEMENT) <= 0) return i; var n = t.getUint16(i, !0), t = (i += Uint16Array.BYTES_PER_ELEMENT, t.getUint16(i, !0), n * Float32Array.BYTES_PER_ELEMENT), r = (i += Uint16Array.BYTES_PER_ELEMENT, r * n * Float32Array.BYTES_PER_ELEMENT), e = new Uint8Array(e, i, r); i += r; let a = o.vertexAttributes, s = o.attrLocation; return s.aPosition = a.length, a.push({ index: s.aPosition, typedArray: e, componentsPerAttribute: n, componentDatatype: Cesium.ComponentDatatype.FLOAT, offsetInBytes: 0, strideInBytes: t, normalize: !1 }), i } function Vu(e, t, i, o) { var r = t.getUint32(i, !0); if (i += Uint32Array.BYTES_PER_ELEMENT, r <= 0) return i; var n = t.getUint16(i, !0), t = (i += Uint16Array.BYTES_PER_ELEMENT, t.getUint16(i, !0)), r = (i += Uint16Array.BYTES_PER_ELEMENT, r * n * Float32Array.BYTES_PER_ELEMENT), e = new Uint8Array(e, i, r); i += r; let a = o.vertexAttributes, s = o.attrLocation; return s.aNormal = a.length, a.push({ index: s.aNormal, typedArray: e, componentsPerAttribute: n, componentDatatype: Cesium.ComponentDatatype.FLOAT, offsetInBytes: 0, strideInBytes: t, normalize: !1 }), i } function ku(t, i, o, e) { var r = i.getUint32(o, !0), n = (o += Uint32Array.BYTES_PER_ELEMENT, e.verticesCount); let a; if (0 < r) { i.getUint16(o, !0), o = (o += Uint16Array.BYTES_PER_ELEMENT) + 2 * Uint8Array.BYTES_PER_ELEMENT; i = r * Uint8Array.BYTES_PER_ELEMENT * 4; let e = new Uint8Array(t, o, i); a = e.slice(0, i), o += i } else { a = new Uint8Array(4 * n); for (let e = 0; e < n; e++) a[4 * e] = 255, a[4 * e + 1] = 255, a[4 * e + 2] = 255, a[4 * e + 3] = 255 } let s = e.vertexAttributes, l = e.attrLocation; return l.aColor = s.length, s.push({ index: l.aColor, typedArray: a, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.UNSIGNED_BYTE, offsetInBytes: 0, strideInBytes: 4, normalize: !0 }), e.vertexColor = a, o } function Fu(e, t, i, o) { var r = t.getUint32(i, !0); if (i += Uint32Array.BYTES_PER_ELEMENT, r <= 0) return i; t.getUint16(i, !0), i = (i += Uint16Array.BYTES_PER_ELEMENT) + 2 * Uint8Array.BYTES_PER_ELEMENT; t = r * Uint8Array.BYTES_PER_ELEMENT * 4, r = new Uint8Array(e, i, t); i += t; let n = o.vertexAttributes, a = o.attrLocation; return a.aSecondColor = n.length, n.push({ index: a.aSecondColor, typedArray: r, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.UNSIGNED_BYTE, offsetInBytes: 0, strideInBytes: 4, normalize: !0 }), i } function Gu(o, r, n, a) { var e = r.getUint16(n, !0); n = (n += Uint16Array.BYTES_PER_ELEMENT) + Uint16Array.BYTES_PER_ELEMENT; for (let i = 0; i < e; i++) { var s = r.getUint32(n, !0), l = (n += Uint32Array.BYTES_PER_ELEMENT, r.getUint16(n, !0)), s = (n += Uint16Array.BYTES_PER_ELEMENT, r.getUint16(n, !0), n += Uint16Array.BYTES_PER_ELEMENT, s * l * Float32Array.BYTES_PER_ELEMENT), u = new Uint8Array(o, n, s), s = (n += s, "aTexCoord" + i); let e = a.vertexAttributes, t = a.attrLocation; t[s] = e.length, e.push({ index: t[s], typedArray: u, componentsPerAttribute: l, componentDatatype: Cesium.ComponentDatatype.FLOAT, offsetInBytes: 0, strideInBytes: l * Float32Array.BYTES_PER_ELEMENT, normalize: !1 }) } return n } function Nu(i, t, o, r) { var n = t.getUint16(o, !0); o = (o += Uint16Array.BYTES_PER_ELEMENT) + Uint16Array.BYTES_PER_ELEMENT; let a = r.vertexAttributes, s = r.attrLocation; for (let e = 0; e < n; e++) { var l = t.getUint32(o, !0), u = (o += Uint32Array.BYTES_PER_ELEMENT, t.getUint16(o, !0)), c = (o += Uint16Array.BYTES_PER_ELEMENT, t.getUint16(o, !0), o += Uint16Array.BYTES_PER_ELEMENT, l * u * Float32Array.BYTES_PER_ELEMENT); if (17 === u || 29 === u) { let e = new Uint8Array(i, o, c); r.instanceCount = l, r.instanceMode = u, r.instanceBuffer = e, r.instanceIndex = 1; var h = e.slice(0, u * l * 4); r.vertexColorInstance = h; let t; 17 === u ? (t = 17 * Float32Array.BYTES_PER_ELEMENT, s.uv2 = a.length, a.push({ index: s.uv2, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 0, strideInBytes: t, instanceDivisor: 1 }), s.uv3 = a.length, a.push({ index: s.uv3, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 4 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv4 = a.length, a.push({ index: s.uv4, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 8 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv5 = a.length, a.push({ index: s.uv5, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 12 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv6 = a.length, a.push({ index: s.uv6, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.UNSIGNED_BYTE, normalize: !0, offsetInBytes: 16 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 })) : 29 === u && (t = 29 * Float32Array.BYTES_PER_ELEMENT, s.uv1 = a.length, a.push({ index: s.uv1, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 0, strideInBytes: t, instanceDivisor: 1, byteLength: c }), s.uv2 = a.length, a.push({ index: s.uv2, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 4 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv3 = a.length, a.push({ index: s.uv3, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 8 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv4 = a.length, a.push({ index: s.uv4, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 12 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv5 = a.length, a.push({ index: s.uv5, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 16 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv6 = a.length, a.push({ index: s.uv6, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 20 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv7 = a.length, a.push({ index: s.uv7, componentsPerAttribute: 3, componentDatatype: Cesium.ComponentDatatype.FLOAT, normalize: !1, offsetInBytes: 24 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv8 = a.length, a.push({ index: s.uv8, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.UNSIGNED_BYTE, normalize: !0, offsetInBytes: 27 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv9 = a.length, a.push({ index: s.uv9, componentsPerAttribute: 4, componentDatatype: Cesium.ComponentDatatype.UNSIGNED_BYTE, normalize: !0, offsetInBytes: 28 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 })) } else { var m = l * u; r.instanceBounds = new Float32Array(m); for (let e = 0; e < m; e++) r.instanceBounds[e] = t.getFloat32(o, !0) } o += c } return o } function Bu(e, t, i, o) { var r = t.getUint32(i, !0); return o.compressOptions = r, i += Uint32Array.BYTES_PER_ELEMENT, i = ((r & Du.SVC_Vertex) === Du .SVC_Vertex ? function(e, t, i, o) { var r = t.getUint32(i, !0); if (o.verticesCount = r, (i += Uint32Array.BYTES_PER_ELEMENT) <= 0) return i; var n = t.getUint16(i, !0), a = (i += Uint16Array.BYTES_PER_ELEMENT, t.getUint16(i, !0), n * Int16Array .BYTES_PER_ELEMENT), s = (i += Uint16Array.BYTES_PER_ELEMENT, t.getFloat32(i, !0)); i += Float32Array.BYTES_PER_ELEMENT; let l = {}, u = (l.x = t.getFloat32(i, !0), i += Float32Array.BYTES_PER_ELEMENT, l.y = t.getFloat32(i, ! 0), i += Float32Array.BYTES_PER_ELEMENT, l.z = t.getFloat32(i, !0), i += Float32Array.BYTES_PER_ELEMENT, l.w = t.getFloat32(i, !0), i += Float32Array .BYTES_PER_ELEMENT, o.vertCompressConstant = s, o.minVerticesValue = l, t = r * n * Int16Array.BYTES_PER_ELEMENT, s = new Uint8Array(e, i, t), i += t, o.vertexAttributes), c = o.attrLocation; return c.aPosition = u.length, u.push({ index: c.aPosition, typedArray: s, componentsPerAttribute: n, componentDatatype: Cesium.ComponentDatatype.SHORT, offsetInBytes: 0, strideInBytes: a, normalize: !1 }), i } : Hu)(e, t, i, o), i = Fu(e, t, i = ku(e, t, i = ((r & Du.SVC_Normal) === Du.SVC_Normal ? function(e, t, i, o) { var r = t.getUint32(i, !0); if (i += Uint32Array.BYTES_PER_ELEMENT, r <= 0) return i; t.getUint16(i, !0), i += Uint16Array.BYTES_PER_ELEMENT, t = t.getUint16(i, !0), i += Uint16Array.BYTES_PER_ELEMENT, r = 2 * r * Int16Array.BYTES_PER_ELEMENT, e = new Uint8Array(e, i, r), i += r; let n = o.vertexAttributes, a = o.attrLocation; return a.aNormal = n.length, n.push({ index: a.aNormal, typedArray: e, componentsPerAttribute: 2, componentDatatype: Cesium.ComponentDatatype.SHORT, offsetInBytes: 0, strideInBytes: t, normalize: !1 }), i } : Vu)(e, t, i, o), o), o), i = ((r & Du.SVC_TexutreCoord) === Du.SVC_TexutreCoord ? function(r, n, a, s) { s.texCoordCompressConstant = [], s.minTexCoordValue = []; var e = n.getUint16(a, !0); a = (a += Uint16Array.BYTES_PER_ELEMENT) + Uint16Array.BYTES_PER_ELEMENT; for (let o = 0; o < e; o++) { var l = n.getUint8(a, !0), u = (a = (a += Uint8Array.BYTES_PER_ELEMENT) + 3 * Uint8Array.BYTES_PER_ELEMENT, n .getUint32(a, !0)), c = (a += Uint32Array.BYTES_PER_ELEMENT, n.getUint16(a, !0)), h = (a += Uint16Array.BYTES_PER_ELEMENT, n.getUint16(a, !0), a += Uint16Array .BYTES_PER_ELEMENT, n.getFloat32(a, !0)); a += Float32Array.BYTES_PER_ELEMENT, s.texCoordCompressConstant.push(h); let e = {}; e.x = n.getFloat32(a, !0), a += Float32Array.BYTES_PER_ELEMENT, e.y = n.getFloat32(a, !0), a += Float32Array.BYTES_PER_ELEMENT, e.z = n.getFloat32(a, !0), a += Float32Array .BYTES_PER_ELEMENT, e.w = n.getFloat32(a, !0), a += Float32Array.BYTES_PER_ELEMENT, s .minTexCoordValue.push(e); var h = u * c * Int16Array.BYTES_PER_ELEMENT, m = new Uint8Array(r, a, h), d = (a += h) % 4, d = (0 != d && (a += 4 - d), "aTexCoord" + o); let t = s.vertexAttributes, i = s.attrLocation; i[d] = t.length, t.push({ index: i[d], typedArray: m, componentsPerAttribute: c, componentDatatype: Cesium.ComponentDatatype.SHORT, offsetInBytes: 0, strideInBytes: c * Int16Array.BYTES_PER_ELEMENT, normalize: !1 }), l && (h = u * Float32Array.BYTES_PER_ELEMENT, m = new Uint8Array(r, a, h), a += h, s .texCoordZMatrix = !0, d = "aTexCoordZ" + o, i[d] = t.length, t.push({ index: i[d], typedArray: m, componentsPerAttribute: 1, componentDatatype: Cesium.ComponentDatatype.FLOAT, offsetInBytes: 0, strideInBytes: Float32Array.BYTES_PER_ELEMENT, normalize: !1 })) } return a } : Gu)(e, t, i, o), (r & Du.SVC_TexutreCoordIsW) === Du.SVC_TexutreCoordIsW && (o.textureCoordIsW = ! 0), i = Nu(e, t, i, o) } function ju(t, i, o, r) { i.getUint32(o, !0), o += Uint32Array.BYTES_PER_ELEMENT; var n = i.getUint32(o, !0); o += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < n; e++) { var a = Ru(t, i, o), s = a.string, a = (o = a.bytesOffset) % 4, a = (0 != a && (o += 4 - a), i.getUint32(o, !0)), l = (o += Int32Array.BYTES_PER_ELEMENT, { vertexAttributes: [], attrLocation: {}, instanceCount: 0, instanceMode: 0, instanceIndex: -1 }), u = (a === Au.SV_Standard ? o = Nu(t, i, Gu(t, i, Fu(t, i, ku(t, i, Vu(t, i, Hu(t, i, o, u = l), u), u), u), u), u) : a === Au.SV_Compressed && (o = Bu(t, i, o, l)), []); o = function(o, t, r, n) { var i = t.getUint32(r, !0); r += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < i; e++) { let i = {}; var a = t.getUint32(r, !0), s = (r += Uint32Array.BYTES_PER_ELEMENT, t.getUint8(r, !0)), l = (r += Uint8Array.BYTES_PER_ELEMENT, t.getUint8(r, !0), r += Uint8Array .BYTES_PER_ELEMENT, t.getUint8(r, !0)); if (r = (r += Uint8Array.BYTES_PER_ELEMENT) + Uint8Array.BYTES_PER_ELEMENT, 0 < a) { let e = null, t; 1 === s || 3 === s ? (t = a * Uint32Array.BYTES_PER_ELEMENT, e = new Uint8Array(o, r, t)) : (t = a * Uint16Array.BYTES_PER_ELEMENT, e = new Uint8Array(o, r, t), a % 2 != 0 && (t += 2)), i.indicesTypedArray = e, r += t } i.indicesCount = a, i.indexType = s, i.primitiveType = l; var u = t.getUint32(r, !0); r += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < u; e++) { var c = Ru(o, t, r), h = c.string; r = c.bytesOffset, i.materialCode = h } 0 != r % 4 && (r += 4 - r % 4), n.push(i) } return r }(t, i, o, u), r[s] = { vertexPackage: l, arrIndexPackage: u } } var e = i.getUint32(o, !0); return o = (o += e) + Uint32Array.BYTES_PER_ELEMENT } function zu(e, t, i) { let o = e._gl, r = (this.id = t, this._size = i.imageBuffer.length, this._context = e, this._width = i.width, this ._height = i.height, this._texture = null, this._internalFormat = i.internalFormat, this._wrapS = Cesium.defaultValue(i.wrapS, Cesium.TextureWrap.CLAMP_TO_EDGE), this._wrapT = Cesium.defaultValue(i .wrapT, Cesium.TextureWrap.CLAMP_TO_EDGE), this.id = t, this._target = o.TEXTURE_2D, this ._texture = o.createTexture(), o.bindTexture(o.TEXTURE_2D, this._texture), 0), n = 0; var a = function(e, t, i, o) { let r = e.length, n = i, a = o, s = 0; for (;;) { var l = Cesium.PixelFormat.compressedTextureSizeInBytes(t, n, a); if (s += l, n >>= 1, a >>= 1, 0 == n && 0 == a) break; n = Math.max(n, 1), a = Math.max(a, 1) } return s === r }(i.imageBuffer, this._internalFormat, this._width, this._height); let s = this._width, l = this._height; do { var u = Cesium.PixelFormat.compressedTextureSizeInBytes(this._internalFormat, s, l), c = new Uint8Array(i.imageBuffer.buffer, i.imageBuffer.byteOffset + r, u); o.compressedTexImage2D(o.TEXTURE_2D, n++, this._internalFormat, s, l, 0, c), s = Math.max(s >> 1, 1), l = Math.max(l >> 1, 1), r += u } while (r < i.imageBuffer.length && a); 1 < n ? (o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR), o.texParameteri(o.TEXTURE_2D, o .TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_LINEAR)) : (o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)), o.texParameteri(o .TEXTURE_2D, o.TEXTURE_WRAP_S, this._wrapS), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, this ._wrapT), o.bindTexture(o.TEXTURE_2D, null) } function Uu() { this.ambientColor = new Cesium.Color, this.diffuseColor = new Cesium.Color, this.specularColor = new Cesium .Color(0, 0, 0, 0), this.shininess = 50, this.bTransparentSorting = !1, this.textures = [] } Mu.parseBuffer = function(e) { var t = 0; let i = { version: void 0, groupNode: void 0, geoPackage: {}, matrials: void 0, texturePackage: {} }, o = new DataView(e); i.version = o.getFloat32(0, !0), t += Float32Array.BYTES_PER_ELEMENT, o.getUint32(t, !0), t += Uint32Array.BYTES_PER_ELEMENT; a = e, a = new Uint8Array(e, t); var r, n, e = Lu.inflate(a).buffer, a = (t = 0, (o = new DataView(e)).getUint32(0, !0)), s = (t += Uint32Array.BYTES_PER_ELEMENT, t = function(t, i, o, e) { let r = {}; var n = [], a = (i.getUint32(o, !0), o += Uint32Array.BYTES_PER_ELEMENT, i.getUint32(o, !0)); o += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < a; e++) o = Ou(t, i, o, n); r.pageLods = n; var s = o % 4; return 0 != s && (o += 4 - s), e.groupNode = r, o }(e, o, t, i), t = ju(e, o, t, i.geoPackage), t = function(t, i, o, r) { i.getUint32(o, !0), o += Uint32Array.BYTES_PER_ELEMENT; var n = i.getUint32(o, !0); o += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < n; e++) { var a = Ru(t, i, o), s = a.string, a = (o = a.bytesOffset) % 4, a = (0 != a && (o += 4 - a), i.getUint32(o, !0), o += Uint32Array.BYTES_PER_ELEMENT, i.getUint32(o, !0)), l = (o += Uint32Array.BYTES_PER_ELEMENT, i.getUint32(o, !0)), u = (o += Uint32Array.BYTES_PER_ELEMENT, i.getUint32(o, !0)), c = (o += Uint32Array.BYTES_PER_ELEMENT, i.getUint32(o, !0)), h = (o += Uint32Array.BYTES_PER_ELEMENT, i.getUint32(o, !0)), m = (o += Uint32Array.BYTES_PER_ELEMENT, new Uint8Array(t, o, c)); o += c, r[s] = { id: s, width: a, height: l, compressType: u, nFormat: h, internalFormat: Cesium.PixelFormat.RGBA_DXT5, imageBuffer: m } } return o }(e, o, t, i.texturePackage), r = e, c = o, t = t, n = i, c = c.getUint32(t, !0), t += Uint32Array.BYTES_PER_ELEMENT, r = new Uint8Array(r, t, c), r = Cesium.getStringFromTypedArray( r), t += c, n.materials = JSON.parse(r), e), l = o, u = t, c = a, h = i.geoPackage; if (1 == (1 & c)) { l.getUint32(u, !0), u += Uint32Array.BYTES_PER_ELEMENT; var m = l.getUint32(u, !0); u += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < m; e++) { var d = Ru(s, l, u), p = d.string, g = (u = d.bytesOffset, l.getUint32(u, !0)); u += Uint32Array.BYTES_PER_ELEMENT; let i = {}; h[p].pickInfo = i; var _ = h[p].vertexPackage.instanceIndex; for (let e = 0; e < g; e++) { var f = l.getUint32(u, !0), y = (u += Uint32Array.BYTES_PER_ELEMENT, l.getUint32(u, !0)); u += Uint32Array.BYTES_PER_ELEMENT; let t = []; for (let e = 0; e < y; e++) { var v = l.getUint32(u, !0); u += Uint32Array.BYTES_PER_ELEMENT; let e = 1; - 1 === _ && (e = l.getUint32(u, !0), u += Uint32Array.BYTES_PER_ELEMENT), t .push({ vertexColorOffset: v, vertexColorCount: e }) } i[f] = t } } } return i }, zu.prototype.enable = function() { let e = this._context._gl; e.activeTexture(this._gl.TEXTURE0), e.bindTexture(this._target, this._texture) }, zu.prototype.disable = function() { let e = this._context._gl; e.bindTexture(this._target, null) }, zu.prototype.isDestroyed = function() { return !1 }, zu.prototype.destroy = function() { let e = this._context._gl; e.deleteTexture(this._texture), this._texture = null, this.id = 0, Cesium.destroyObject(this) }, Uu.prototype.isDestroyed = function() { return !1 }, Uu.prototype.destroy = function() { return destroyObject(this) }; var Wu, Yu = ` attribute vec4 aPosition; attribute vec4 aTexCoord0; #ifdef TexCoord2 attribute vec4 aTexCoord1; #endif varying vec4 vTexCoord; attribute vec4 aColor; varying vec4 vColor; void main() { vTexCoord.xy = aTexCoord0.xy; #ifdef TexCoord2 vTexCoord.zw = aTexCoord1.xy; #endif vColor = aColor; gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0); } `, Qu = ` uniform sampler2D uTexture; #ifdef TexCoord2 uniform sampler2D uTexture2; #endif uniform vec4 uDiffuseColor; uniform vec4 uAmbientColor; varying vec4 vColor; varying vec4 vTexCoord; void main() { vec4 color = vColor * texture2D(uTexture, vTexCoord.xy); #ifdef TexCoord2 color *= texture2D(uTexture2, vTexCoord.zw); #endif gl_FragColor = czm_gammaCorrect(color); } `; function qu() { this.context = void 0, this.model = void 0, this.index = void 0 } function Ju() { this.model = void 0, this.context = void 0, this.index = 0 } function Xu(e) { this.layer = e.layer, this.vertexPackage = e.vertexPackage, this.arrIndexPackage = e.arrIndexPackage, this .vertexBufferToCreate = new Cesium.Queue, this.indexBufferToCreate = new Cesium.Queue; let t, i; for (t = 0, i = this.vertexPackage.vertexAttributes.length; t < i; t++) this.vertexBufferToCreate.enqueue( t); for (t = 0, i = this.arrIndexPackage.length; t < i; t++) this.indexBufferToCreate.enqueue(t); this.boundingVolume = e.boundingVolume, this.material = e.material, this.modelMatrix = e.modelMatrix, this .shaderProgram = void 0, this.vertexArray = void 0, this.colorCommand = void 0, this.ready = !1 } qu.prototype.set = function(e, t, i) { this.context = e, this.model = t, this.index = i }, qu.prototype.execute = function() { var e = this.context, t = this.index, i = this.model.vertexPackage; let o = i.vertexAttributes[t]; if (!Cesium.defined(o)) throw new Cesium.DeveloperError("attribute is null"); if (-1 !== i.instanceIndex && !Cesium.defined(this.model._instanceBuffer)) { if (!Cesium.defined(i.instanceBuffer)) throw new Cesium.DeveloperError("instance buffer is null"); this.model.instanceBuffer = Cesium.Buffer.createVertexBuffer({ context: e, typedArray: i.instanceBuffer, usage: Cesium.BufferUsage.STATIC_DRAW }) } 1 === o.instanceDivisor ? o.vertexBuffer = this.model.instanceBuffer : Cesium.defined(o.vertexBuffer) || (o.vertexBuffer = Cesium.Buffer.createVertexBuffer({ context: e, typedArray: o.typedArray, usage: Cesium.BufferUsage.STATIC_DRAW }), o.typedArray = null, delete o.typedArray) }, Ju.prototype.set = function(e, t, i) { this.model = t, this.context = e, this.index = i }, Ju.prototype.execute = function() { var t = this.context; let i = this.model.arrIndexPackage[this.index]; var o = this.model.vertexPackage.verticesCount; if (!Cesium.defined(i)) throw new Cesium.DeveloperError("index package is null"); if (!Cesium.defined(i.indexBuffer)) { if (!Cesium.defined(i.indicesTypedArray)) throw new Cesium.DeveloperError("index buffer is null"); let e = Cesium.IndexDatatype.UNSIGNED_SHORT; (1 === i.indexType || o >= Cesium.Math.SIXTY_FOUR_KILOBYTES) && t.elementIndexUint && (e = Cesium .IndexDatatype.UNSIGNED_INT), i.indexBuffer = Cesium.Buffer.createIndexBuffer({ context: t, typedArray: i.indicesTypedArray, usage: Cesium.BufferUsage.STATIC_DRAW, indexDatatype: e }), i.indicesTypedArray = null, delete i.indicesTypedArray } }; let Ku = new qu, $u = new Ju; function Zu(e) { Xu.call(this, e) } Xu.prototype.createBuffers = function(t) { { var i = this, o = t, r = i.layer.context; let e = i.vertexBufferToCreate; for (; e.length;) { var n = e.peek(); if (Ku.set(r, i, n), !o.jobScheduler.execute(Ku, Cesium.JobType.BUFFER)) break; e.dequeue() } } { var a = this, s = t, l = a.layer.context; let e = a.indexBufferToCreate; for (; e.length;) { var u = e.peek(); if ($u.set(l, a, u), !s.jobScheduler.execute($u, Cesium.JobType.BUFFER)) break; e.dequeue() } return } }, Xu.prototype.createCommand = Cesium.DeveloperError.throwInstantiationError, Xu.prototype.update = Cesium .DeveloperError.throwInstantiationError, Xu.prototype.isDestroyed = Cesium.DeveloperError .throwInstantiationError, Xu.prototype.destroy = Cesium.DeveloperError.throwInstantiationError, (Zu .prototype = Object.create(Xu.prototype)).constructor = Xu, Zu.prototype.createCommand = function() { var e, t, i, o, r, n; Cesium.defined(this.colorCommand) || (e = this.layer.context, i = this.vertexPackage, o = this .arrIndexPackage, t = i.vertexAttributes, i = i.attrLocation, o.length < 1 || (o = o[0], r = this.material, this.shaderProgram = function(e, t, i) { let o = new Cesium.ShaderSource({ sources: [Yu] }), r = new Cesium.ShaderSource({ sources: [Qu] }); return Cesium.defined(t.aNormal) && (o.defines.push("VertexNormal"), r.defines.push( "VertexNormal")), 0 < i.textures.length && (o.defines.push("TexCoord"), r .defines.push("TexCoord")), 2 == i.textures.length && (o.defines.push( "TexCoord2"), r.defines.push("TexCoord2")), Cesium.ShaderProgram.fromCache({ context: e, vertexShaderSource: o, fragmentShaderSource: r, attributeLocations: t }) }(e, i, r), this.vertexArray = new Cesium.VertexArray({ context: e, attributes: t, indexBuffer: o.indexBuffer }), this.colorCommand = new Cesium.DrawCommand({ primitiveType: o.primitiveType, modelMatrix: this.modelMatrix, boundingVolume: Cesium.BoundingSphere.clone(this.boundingVolume), pickId: "vSecondColor", vertexArray: this.vertexArray, shaderProgram: this.shaderProgram, pass: r.bTransparentSorting ? Cesium.Pass.TRANSLUCENT : Cesium.Pass.CESIUM_3D_TILE, renderState: r.bTransparentSorting ? Cesium.RenderState.fromCache({ cull: { enabled: !0 }, depthTest: { enabled: !0, func: Cesium.DepthFunction.LESS_OR_EQUAL }, blending: Cesium.BlendingState.ALPHA_BLEND }) : Cesium.RenderState.fromCache({ cull: { enabled: !0 }, depthTest: { enabled: !0, func: Cesium.DepthFunction.LESS_OR_EQUAL } }) }), this.colorCommand.uniformMap = (n = r, { uTexture: function() { return n.textures[0] }, uTextureWidth: function() { return n.textures[0]._width }, uTexture2: function() { return n.textures[1] }, uTexture2Width: function() { return n.textures[1]._width }, uDiffuseColor: function() { return n.diffuseColor }, uAmbientColor: function() { return n.ambientColor } }), this.vertexPackage = null, this.arrIndexPackage = null, this.ready = !0)) }, Zu.prototype.update = function(e) { if (!this.ready) return this.createBuffers(e), void this.createCommand(e); e.commandList.push(this.colorCommand) }, Zu.prototype.isDestroyed = function() { return !1 }, Zu.prototype.destroy = function() { return this.shaderProgram = this.shaderProgram && !this.shaderProgram.isDestroyed() && this .shaderProgram.destroy(), this.vertexArray = this.vertexArray && !this.vertexArray.isDestroyed() && this.vertexArray.destroy(), this.colorCommand = void 0, this.vertexPackage = null, this .arrIndexPackage = null, Cesium.destroyObject(this) }; let ec = { OSGBFile: function(e) { return new Zu(e) }, OSGBCacheFile: function(e) { return new Zu(e) } }; function tc() {} function ic(o, r, n, e, a) { let s = {}; var l = e.geodes; for (let e = 0, t = l.length; e < t; e++) { var u = l[e], c = u.matrix, h = Cesium.Matrix4.multiply(o.modelMatrix, c, new Cesium.Matrix4); let i; Cesium.defined(a.boundingVolume) && (i = new Cesium.BoundingSphere(a.boundingVolume.sphere.center, a .boundingVolume.sphere.radius), Cesium.BoundingSphere.transform(i, o.modelMatrix, i)); var m = u.skeletonNames; for (let t = 0, e = m.length; t < e; t++) { var d = m[t], p = r.geoPackage[d], g = p.vertexPackage, _ = p.arrIndexPackage, p = p.pickInfo; let e; 0 < _.length && (e = n[_[0].materialCode]); var f = Cesium.defined(i) ? i : function(t, e) { var i = new Cesium.BoundingSphere; let o = new Cesium.Cartesian3; var r = t.vertexAttributes[0], n = r.componentsPerAttribute, a = Cesium.defined(t.nCompressOptions) && (t.nCompressOptions & Du.SVC_Vertex) === Du .SVC_Vertex; let s = 1, l, u, c = (u = a ? (s = t.vertCompressConstant, l = new Cesium.Cartesian3(t .minVerticesValue.x, t.minVerticesValue.y, t.minVerticesValue.z), new Uint16Array(r.typedArray.buffer, r.typedArray.byteOffset, r.typedArray .byteLength / 2)) : new Float32Array(r.typedArray.buffer, r.typedArray .byteOffset, r.typedArray.byteLength / 4), []); for (let e = 0; e < t.verticesCount; e++) Cesium.Cartesian3.fromArray(u, n * e, o), a && ( o = Cesium.Cartesian3.multiplyByScalar(o, s, o), o = Cesium.Cartesian3.add(o, l, o) ), c.push(Cesium.Cartesian3.clone(o)); return Cesium.BoundingSphere.fromPoints(c, i), Cesium.BoundingSphere.transform(i, e, i), c .length = 0, i }(g, h); s[d] = ec[o.fileType]({ layer: o, vertexPackage: g, arrIndexPackage: _, pickInfo: p, modelMatrix: h, boundingVolume: f, material: e }) } } if (!Cesium.defined(a.boundingVolume)) { let e = []; for (var t in s) s.hasOwnProperty(t) && e.push(s[t].boundingVolume); a.boundingVolume = Cesium.BoundingSphere.fromBoundingSpheres(e) } a.geoMap = s } function oc(e, t, i, o, r, n, a) { this.layer = e, this.parent = t, this.fileName = o, this.isLeafTile = Cesium.defaultValue(a, !1), this .boundingVolume = this.createBoundingVolume(i, e.modelMatrix); let s = Cesium.Resource.createIfNeeded(e._baseResource); if (Cesium.defined(t)) this.baseUri = t.baseUri; else { let e = new Cesium.Resource(o); this.baseUri = e.getBaseUri() } this.contentResource = s.getDerivedResource({ url: o }), this.serverKey = Cesium.RequestScheduler.getServerKey(this.contentResource.getUrlComponent()), this .request = void 0, this.cacheNode = void 0, this.distanceToCamera = 0, this.pixel = 0, this .visibilityPlaneMask = 0, this.visible = !1, this.children = [], this.lodRangeData = r, this .renderEntityMap = n, this.contentState = Iu.UNLOADED, this.readerable = !1, this.touchedFrame = 0, this .requestedFrame = 0, this.selectedFrame = 0, this.priority = 0 } tc.parse = function(e, t) { if (Cesium.defined(t)) { var o = e, r = t, n = function(o, r) { let n = {}; var a = r.materials.material; for (let e = 0, t = a.length; e < t; e++) { var s = a[e].material, l = s.id; let i = new Uu; n[l] = i; var l = s.ambient, l = (i.ambientColor = new Cesium.Color(l.r, l.g, l.b, l.a), s.diffuse), l = (i.diffuseColor = new Cesium.Color(l.r, l.g, l.b, l.a), s.specular), u = (i.specularColor = new Cesium.Color(l.r, l.g, l.b, l.a), i.shininess = s .shininess, i.bTransparentSorting = s.transparentsorting, s.textureunitstates), c = u.length; for (let t = 0; t < c; t++) { var h = u[t].textureunitstate, m = h.id, d = 0 === h.addressmode.u ? Cesium.TextureWrap.REPEAT : Cesium.TextureWrap .CLAMP_TO_EDGE, p = 0 === h.addressmode.v ? Cesium.TextureWrap.REPEAT : Cesium.TextureWrap .CLAMP_TO_EDGE; i.texMatrix = Cesium.Matrix4.unpack(h.texmodmatrix); let e = r.texturePackage[m]; Cesium.defined(e) && 0 < e.imageBuffer.byteLength && (e.wrapS = d, e.wrapT = p, h = new zu(o, m, e), i.textures.push(h)) } } return n }(e.context, t), a = r.groupNode; let i = []; for (let t = 0, e = a.pageLods.length; t < e; t++) { let e = {}; var s = a.pageLods[t], l = (e.rangeMode = s.rangeMode, e.rangeDataList = s.childTile, e.rangeList = s.rangeList, s .boundingSphere.center), u = s.boundingSphere.radius; "" !== e.rangeDataList ? e.boundingVolume = { sphere: { center: new Cesium.Cartesian3(l.x, l.y, l.z), radius: u } } : e.isLeafTile = !0, ic(o, r, n, s, e), i.push(e) } return i } }, Object.defineProperties(oc.prototype, { renderable: { get: function() { return Cesium.defined(this.renderEntityMap) } } }); let rc = new Cesium.Cartesian3; function nc(e) { return e.boundingVolume } function ac() { this._stack = [] } function sc(e, t) { return e.distanceToCamera - t.distanceToCamera } function lc(e, o, r) { for (; o.length;) { let i = o.pop(); if (i.visible) if (n = e, t = i, c = r, t.touchedFrame !== c.frameNumber && (n._cache.touch(t), t.touchedFrame = c .frameNumber), i.canTraverse()) { u = l = s = a = n = void 0; var n = i, a = o, s = r; let e, t = n.children; var l = t.length; for (e = 0; e < l; ++e) t[e].updateVisibility(s); for (t.sort(sc), e = 0; e < l; ++e) { var u = t[e]; u.visible && a.push(u) } } else t = e, c = i, n = r, c.renderable && (t._selectedTiles.push(c), c.selectedFrame = n .frameNumber), t = e, c = i, n = r, c.requestedFrame === n.frameNumber || c.contentState !== Iu.UNLOADED || c.isLeafTile || (t._requestTiles.push(c), c.requestedFrame = n.frameNumber) } var n, t, c } function uc() { this._list = new Cesium.DoublyLinkedList, this._sentinel = this._list.add(), this._trimTiles = !1 } function cc(e) { e = Cesium.defaultValue(e, Cesium.defaultValue.EMPTY_OBJECT), Cesium.Check.defined("options.url", e.url), Cesium.Check.defined("options.context", e.context), this.context = e.context, this._url = void 0, this ._basePath = void 0, this._baseResource = void 0, this.modelMatrix = void 0, this.fileType = void 0, this._position = void 0, this._rectangle = void 0, this._rootTiles = [], this._schuduler = new ac, this ._requestTiles = [], this._selectedTiles = [], this._cache = new uc, this._maximumMemoryUsage = -1, this ._totalMemoryUsageInBytes = 0, this._readyPromise = Cesium.when.defer(), this.loadConfig(e.url) } function hc(e, t) { return e.priority - t.priority } function mc(e, t) {} function dc(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this.item = { show: !0 }, this._option = void 0, this._primitive = void 0, this._Provider = void 0 } function pc(e) { this._viewer = e, Wu = e } function gc(e, t) { if (this._viewer = e, this._cesium = t, this._core = new f, !window.Hls) { let e = new se(!1); e.addJs(document.body, window.SmartEarthRootUrl + "Workers/hls.js") } } function _c(e, t) { if (this._viewer = e, this._cesium = t, this._core = new f, !Cesium.GeoWTFS) { let e = new se(!1); e.addJs(document.body, window.SmartEarthRootUrl + "Workers/cesiumTdt.js") } } function fc(e) { this._viewer = e, this._core = new f, this._tree = V } function yc(e) { this._viewer = e, this._core = new f } function q(e, t) { var h; this._viewer = e, this._cesium = t, this._core = new f, this._Label = new F(this._viewer, this._cesium), this._Circle = new H(this._viewer, this._cesium), this._Box = new R(this._viewer, this._cesium), this ._Cone = new B(this._viewer, this._cesium), this._Color = new m(this._viewer, this._cesium), this ._Polyline = new M(this._viewer, this._cesium), this._Rectangle = new O(this._viewer, this._cesium), this._Polygon = new A(this._viewer, this._cesium), this._ImageLabel = new Ll(this._viewer, this ._cesium), this._GeoJsonFeatureLayer = new C(this._viewer, this._cesium, this._ImageryProvidererid), this._Ellipsoid = new Zi(this._viewer, this._cesium), this._PointModel = new S(this._viewer, this ._cesium), this._wall = new Ml(this._viewer, this._cesium), this._Terrain = new nu(this._viewer, this._cesium), this._createdynamicObject = new G(this._viewer, this._cesium), this._GeometryCreator, this._ImageryLayer = new Ol(this._viewer, this._cesium), this._VolumeGeoJsonFeatureLayer = void 0, this ._PolygonVectorGeoJsonFeatureLayer = void 0, this._skyBox = new cu(this._viewer, this._cesium), this ._flowField = new hu(this._viewer, this._cesium), this._canvasField = new Zr(this._viewer, this ._cesium), this.VectorGeoJsonFeatureLayer = new b(this._viewer, this._cesium), this._straightArrow = new Q(this._viewer, this._cesium), this._SimpleGraphic = new P(this._viewer, this._cesium), this ._popupmessage = new tt(this._viewer, this._cesium), this.VectorImgFeatureLayer = new dc(this._viewer, this._cesium), this._TerrainModifier = new pc(this._viewer, this._cesium), t.Resource ._Implementations.createImageSGS || (h = new Jo({ workerPath: window.SmartEarthRootUrl + "/Workers/nullValueRemoveWorker.js" }), t.Resource._Implementations.createImageSGS = function(e, t, n) { var i, a, s = { r: 0, g: 0, b: 0, a: 255 }, l = (-1 < e.indexOf("nullvalue=") && (i = e.split("nullvalue=")[1].split("&")[0].split( "%2C"), s.r = i[0], s.g = i[1], s.b = i[2]), -1 < e.indexOf("nulltolerance=") && ( a = e.split("nulltolerance=")[1].split("&")[0]), new Image), u = document.createElement("canvas"), c = u.getContext("2d"); l.url = e, l.onload = function() { if (null != l.url && -1 != l.url.indexOf("nullvalue")) { delete l.url, u.width = l.width, u.height = l.height, c.drawImage(l, 0, 0), l .imageProcesses = []; for (var e = l.width / 8, t = l.height, i = 0; i < 8; i++) { var o = i * e, r = c.getImageData(o, 0, e, t).data; l.imageProcesses[i] = h.queueWorkItem({ nullValue: s, nullTolerance: a, canvasData: r, width: e, height: t, startX: o }) } Cesium.when.all(l.imageProcesses, function(e) { for (var t = 0; t < e.length; t++) { for (var i = c.createImageData(e[t].width, e[t].height), o = 0; o < e[t].canvasData.length; o++) i.data[o] = e[t].canvasData[o]; c.putImageData(i, e[t].startX, 0) } l.src = u.toDataURL(), n.resolve(l) }).otherwise(function(e) { console.log(e) }) } else n.resolve(l) }, l.onerror = function(e) { n.reject(e) }, t && (Cesium.TrustedServers.contains(e) ? l.crossOrigin = "use-credentials" : l .crossOrigin = ""), l.src = e }) } function vc(e, t) { this._viewer = e, this._cesium = t } function Cc(e, t) { this._viewer = e, this._cesium = t, this._current = new vc(this._viewer, this._cesium) } function wc(e, t) { this._viewer = e, this._cesium = t, this._Core = new f } function bc(e, t) { this._viewer = e, this._cesium = t } oc.prototype.createBoundingVolume = function(e, t) { return this.isLeafTile ? new Cesium.TileBoundingSphere(e.center, e.radius) : Cesium.defined(e.sphere) ? (i = e.sphere, o = t, r = Cesium.Cartesian3.clone(i.center), i = i.radius, r = Cesium.Matrix4 .multiplyByPoint(o, r, r), o = Cesium.Matrix4.getScale(o, rc), i *= Cesium.Cartesian3 .maximumComponent(o), new Cesium.TileBoundingSphere(r, i)) : Cesium.defined(e.box) ? (o = e.box, r = t, i = new Cesium.Cartesian3(o.min.x, o.min.y, o.min.z), Cesium.Matrix4.multiplyByPoint(r, i, i), o = new Cesium.Cartesian3(o.max.x, o.max.y, o.max.z), Cesium.Matrix4.multiplyByPoint( r, o, o), o = (i = Cesium.BoundingSphere.fromCornerPoints(i, o, new Cesium.BoundingSphere)) .center, i = i.radius, r = Cesium.Matrix4.getScale(r, rc), i *= Cesium.Cartesian3 .maximumComponent(r), new Cesium.TileBoundingSphere(o, i)) : void 0; var i, o, r }, oc.prototype.canTraverse = function() { return 0 !== this.children.length && !this.isLeafTile && (!Cesium.defined(this.lodRangeData) || this .pixel > this.lodRangeData) }, oc.prototype.getPixel = function(e) { var t = this.boundingVolume, i = t.radius, t = t.center, t = Cesium.Cartesian3.distance(e.camera.positionWC, t), o = e.context.drawingBufferHeight, e = .5 * e.camera.frustum._fovy; return .5 * o / Math.tan(e) * i / t }, oc.prototype.distanceToTile = function(e) { let t = nc(this); return t.distanceToCamera(e) }, oc.prototype.visibility = function(e, t) { var i = nc(this); return e.cullingVolume.computeVisibilityWithPlaneMask(i, t) }, oc.prototype.updateVisibility = function(e) { var t = this.parent, t = Cesium.defined(t) ? t.visibilityPlaneMask : Cesium.CullingVolume.MASK_INDETERMINATE; this.distanceToCamera = this.distanceToTile(e), this.pixel = this.getPixel(e), this .visibilityPlaneMask = this.visibility(e, t), this.visible = this.visibilityPlaneMask !== Cesium .CullingVolume.MASK_OUTSIDE }, oc.prototype.requestContent = function() { let u = this, e = (this.layer, this.contentResource.clone()), t = new Cesium.Request({ throttle: !0, throttleByServer: !0, type: Cesium.RequestType.TILES3D, priorityFunction: function() { return i.priority }, serverKey: (i = this).serverKey }); var i, o; this.request = t, e.request = t; let r = e.fetchArrayBuffer(); if (!Cesium.defined(r)) return !1; this.contentState = Iu.LOADING, this.contentReadyPromise = Cesium.when.defer(); o = this; let c = function(e) { o.contentState = Iu.FAILED, o.contentReadyPromise.reject(e) }; return r.then(function(e) { if (u.isDestroyed()) c(); else { var e = Mu.parseBuffer(e), t = tc.parse(u.layer, e), i = u, o = t, r = i.layer, n = o.length; for (let e = 0; e < n; e++) { var a = o[e], s = a.boundingVolume, l = a.rangeDataList, s = new oc(r, i, s, i.baseUri + l, a.rangeList, a.geoMap, a.isLeafTile); i.children.push(s), i.layer._cache.add(s) } u.selectedFrame = 0, u.contentState = Iu.READY, u.contentReadyPromise.resolve(e) } }).otherwise(function(e) { t.state === Cesium.RequestState.CANCELLED ? u.contentState = Iu.UNLOADED : c(e) }), !0 }, oc.prototype.update = function(e) { let t = this.renderEntityMap; for (var i in t) t.hasOwnProperty(i) && t[i].update(e) }, oc.prototype.free = function() { for (let t = 0, e = this.children.length; t < e; t++) { let e = this.children[t]; e.destroy() } this.children.length = 0, this.contentState = Iu.UNLOADED }, oc.prototype.isDestroyed = function() { return !1 }, oc.prototype.destroy = function() { for (var e in this.renderEntityMap) this.renderEntityMap.hasOwnProperty(e) && this.renderEntityMap[e] .destroy(); this.renderEntityMap = void 0; for (let t = 0, e = this.children.length; t < e; t++) { let e = this.children[t]; e.destroy() } return this.children.length = 0, Cesium.destroyObject(this) }, ac.prototype.scheduler = function(e, t) { e._requestTiles.length = 0, e._selectedTiles.length = 0; var i = this._stack, o = e, r = i, n = t; for (let t = r.length = 0, e = o._rootTiles.length; t < e; t++) { let e = o._rootTiles[t]; e.updateVisibility(n), e.visible && r.push(e) } lc(e, i, t) }, uc.prototype.reset = function() { this._list.splice(this._list.tail, this._sentinel) }, uc.prototype.touch = function(e) { e = e.cacheNode; Cesium.defined(e) && this._list.splice(this._sentinel, e) }, uc.prototype.add = function(e) { Cesium.defined(e.cacheNode) || (e.cacheNode = this._list.add(e)) }, uc.prototype.unloadTile = function(e, t, i) { var o = t.cacheNode; Cesium.defined(o) && (this._list.remove(o), t.cacheNode = void 0, i(e, t)) }, uc.prototype.unloadTiles = function(t, i) { var e = this._trimTiles, o = (this._trimTiles = !1, this._list), r = 1024 * t.maximumMemoryUsage * 1024, n = this._sentinel; let a = o.head; for (; a !== n && (t.totalMemoryUsageInBytes > r || e);) { let e = a.item; a = a.next, e.isDestroyed(), this.unloadTile(t, e, i) } }, uc.prototype.trim = function() { this._trimTiles = !0 }, Object.defineProperties(cc.prototype, { ready: { get: function() { return 0 < this._rootTiles.length } }, readyPromise: { get: function() { return this._readyPromise } }, rectangle: { get: function() { return this._rectangle } }, totalMemoryUsageInBytes: { get: function() { return this._totalMemoryUsageInBytes }, set: function(e) { this._totalMemoryUsageInBytes = e } }, maximumMemoryUsage: { get: function() { return this._maximumMemoryUsage }, set: function(e) { this._maximumMemoryUsage = e } } }), cc.prototype.loadConfig = function(e) { let a = this; Cesium.when(e).then(function(e) { let t = Cesium.Resource.createIfNeeded(e); return e = t.getBaseUri(!0), a._url = t.url, a._basePath = e, (a._baseResource = t) .fetchJson() }).then(function(i) { var e = i.extensions, e = (a.fileType = e["s3m:FileType"], i.position.x), t = i.position.y, o = i.position.z; a._position = Cesium.Cartesian3.fromDegrees(e, t, o), a.modelMatrix = Cesium.Transforms .eastNorthUpToFixedFrame(a._position), a._rectangle = Cesium.Rectangle.fromDegrees(i .geoBounds.left, i.geoBounds.bottom, i.geoBounds.right, i.geoBounds.top); for (let e = 0, t = i.tiles.length; e < t; e++) { var r = i.tiles[e].url, n = { box: i.tiles[e].boundingbox }, n = new oc(a, void 0, n, r); a._cache.add(n), a._rootTiles.push(n) } a._readyPromise.resolve(a) }).otherwise(function(e) { a._readyPromise.reject(e) }) }, cc.prototype.prePassesUpdate = function(e) { this.ready && e.newFrame && this._cache.reset() }, cc.prototype.update = function(e) { if (this.ready) { this._schuduler.scheduler(this, e); { var o = this; let i = o._requestTiles; var r = i.length; i.sort(hc); for (let t = 0; t < r; ++t) { let e = i[t]; e.requestContent() } } { o = this; var i = e; let t = o._selectedTiles; var n = t.length; for (let e = 0; e < n; e++) t[e].update(i) }(e = this)._cache.unloadTiles(e, mc) } }, dc.prototype.CreateVectorImageFeatureLayer = function(e, t, i, s, o, r, n) { var a = { url: "", queryParameters: { layer: "", style: "", tilematrixset: "EPSG:4326", Service: "WMTS", Request: "GetTile", Version: "1.0.0", Format: "image/png", TileMatrix: "EPSG:4326:", TileCol: "", TileRow: "" } }, l = (this._option = this._core.extend(a, t, !0), this._queryOption = i, this._core.extend(a, t, ! 0)), u = i, c = (null == t && console.log("options is required"), this), a = (this._Provider = new T(this._viewer, this._cesium), this._Provider.loadTile = function(e, i) { var o = i, r = e, n = u, e = c, a = this; if (i.state === Cesium.QuadtreeTileLoadState.START) { if (i.data = { lines: [], geometryPrimitive: void 0 }, !(i.level >= s.level_min && i.level < s.level_max && e.item.show)) return void(i .state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0); l.queryParameters.TileMatrix = l.queryParameters.tilematrixset + ":" + o.level, l .queryParameters.TileCol = o.x, l.queryParameters.TileRow = o.y, new Cesium .Resource(l).fetchImage().then(function(e) { var t = new Cesium.Rectangle(0, 0, 0, 0), t = (a._tilingScheme.tileXYToRectangle(o.x, o.y, o.level, t), new Cesium .GroundPrimitive({ geometryInstances: [{ geometry: new Cesium.RectangleGeometry({ rectangle: t }) }], appearance: new Cesium.Appearance({ material: new Cesium.Material({ fabric: { type: "Image", uniforms: { image: e } } }) }) })); t.cusResource = n, i.data.geometryPrimitive = t, i.state = Cesium .QuadtreeTileLoadState.LOADING, i.state === Cesium.QuadtreeTileLoadState .LOADING && (i.data.geometryPrimitive.update(r, []), i.state = Cesium .QuadtreeTileLoadState.DONE, i.renderable = !0) }, function(e) { console.log(e) }), i.state = Cesium.QuadtreeTileLoadState.LOADING, i.state = Cesium .QuadtreeTileLoadState.LOADING } }, this._primitive = new c._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider }), this._viewer.scene), i = (a.primitives.add(this._primitive), a.primitivesQuadTrees && a.primitivesQuadTrees.push(this ._primitive), r || this.setVisibility(!1), this._core.isnull(t.id) && (t.id = this._core .getuid()), this._core.isnull(e) && (e = "新建图层" + t.id), { id: t.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "rasterLayer", item: this, options: this._option, queryOptions: this._queryOption }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, dc.prototype.setTreeobj = function(e) { this.treeobj = e }, dc.prototype.setVisibility = function(e) { try { this._Provider && this._Provider.setStatus && this._Provider.setStatus(e) } catch (e) {} }, dc.prototype.deleteObject = function() { this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) {} }, pc.prototype.findDirectParent = function(e) { try { var t = []; if (e.width == Math.PI) return null; for (var i = 0; i < Wu.scene.globe._surface._tilesToRender.length; i++) { var o = Wu.scene.globe._surface._tilesToRender[i], r = o._rectangle; Cesium.Rectangle.intersection(r, e) && t.push(o) } return t } catch (e) {} return null }, pc.prototype.createTerrainModifier = function(e, t, i) { var o = t.length, o = new Array(o), r = (o.fill(i), Cesium.createGuid()), i = Date.now(), n = Cesium.Rectangle.fromCartesianArray(t), a = this.findDirectParent(n), s = (this._viewer.terrainProvider && void 0 === this._viewer.terrainProvider ._modifyTerrainObjects && (this._viewer.terrainProvider._modifyTerrainObjects = []), this ._viewer), e = { id: r, name: e, show: !0, rectangle: n, vertices: t, heights: o, timeStamp: i, remove: function() { if (s.terrainProvider && s.terrainProvider._modifyTerrainObjects) for (var e = s.terrainProvider._modifyTerrainObjects.length - 1; 0 <= e; e--) s .terrainProvider._modifyTerrainObjects[e].id == r && s.terrainProvider ._modifyTerrainObjects.splice(e, 1); if (a) try { for (e = 0; e < a.length; e++) try { a[e]._parent.freeResources() } catch (e) {} } catch (e) {} } }; if (this._viewer.terrainProvider._modifyTerrainObjects.push(e), a) try { for (var l = 0; l < a.length; l++) try { a[l]._parent.freeResources() } catch (e) {} } catch (e) {} return e }, gc.prototype.Video3D = function(e) { return this.sp = e.cameraPosition || void 0, this.ep = e.position || void 0, this.alpha = e.alpha || .7, this.horizonAngle = e.horizonAngle || 60, this.verticalAngle = e.verticalAngle || 30, this.angleZ = e.angleZ || 0, this.angle = new Cesium.Cartesian3(this.horizonAngle / 2, this.verticalAngle / 2, this.angleZ), this.near = e.near || 1, this.far = e.far || 30, this.offset = e.offset || .1, this.nearAndFar = new Cesium.Cartesian4(this.near, this.far, this.alpha, this.offset), this.video = e.video || void 0, this.videoType = e.type || "mp4", this.center = new Cesium.Cartesian3, this .eupp = new Cesium.Cartesian3, this.epp = new Cesium.Cartesian3, this.upp = this.setSpHeight(this .sp), this.useLine = Cesium.defaultValue(e.useLine, !0), this.controlPoint = null, this .addVideo(e.url), this }, gc.prototype.addVideo = function(e) { var t, i; this.video || (i = ``, $(this._viewer.container).append(i), this.video = document.getElementById(t), "hls" !== this .videoType || this.video.canPlayType("application/vnd.apple.mpegurl") ? this.video.src = e : Hls .isSupported() && ((i = new Hls).loadSource(e), i.attachMedia(this.video))), this.video .oncanplay = () => { this.init && this.init() } }, gc.prototype.setSpHeight = function(e, t = 5e3) { let i = Cesium.Cartographic.fromCartesian(e); return i.height += t, Cesium.Cartographic.toCartesian(i) }, gc.prototype.createLine = function(i, o, r) { if (this.line && (this._viewer.scene.primitives.remove(this.line), this.line = null), this.useLine) { this.controlPoint ? this.controlPoint.position = this.ep : this.controlPoint = this._viewer.entities .add({ position: this.ep, point: { pixelSize: 10, color: Cesium.Color.RED } }); var o = Cesium.Cartesian3.subtract(o, i, new Cesium.Cartesian3), r = (Cesium.Cartesian3.normalize(o, o), Cesium.Cartesian3.subtract(r, i, new Cesium .Cartesian3)), n = (Cesium.Cartesian3.normalize(r, r), Cesium.Cartesian3.cross(o, r, new Cesium.Cartesian3)), a = (Cesium.Cartesian3.normalize(n, n), Cesium.Cartesian3.cross(n, o, r), Cesium.Cartesian3 .normalize(r, r), new Cesium.Matrix4.fromArray([n.x, n.y, n.z, 0, r.x, r.y, r.z, 0, o.x, o .y, o.z, 0, i.x, i.y, i.z, 1 ])), n = -this.angleZ * Math.PI / 180, r = Math.cos(n), o = Math.sin(n), s = Cesium.Matrix4.fromArray([r, -o, 0, 0, o, r, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), n = this.nearAndFar.y, o = Math.tan(this.horizonAngle / 2 / 180 * Math.PI) * n, r = Math.tan(this.verticalAngle / 2 / 180 * Math.PI) * n; let e = [new Cesium.Cartesian3(-o, -r, n), new Cesium.Cartesian3(o, -r, n), new Cesium.Cartesian3(o, r, n), new Cesium.Cartesian3(-o, r, n)], t = []; var l, u = e.slice(); for (l in e) { Cesium.Matrix4.multiplyByPoint(s, e[l], e[l]), Cesium.Matrix4.multiplyByPoint(a, e[l], u[l]); var c = new Cesium.PolylineGeometry({ positions: [i, u[l]] }), c = new Cesium.GeometryInstance({ geometry: c }); t.push(c) } this.line = new Cesium.Primitive({ geometryInstances: t, appearance: new Cesium.PolylineMaterialAppearance({ translucent: !1, material: new Cesium.Material({ translucent: !1, fabric: { type: "Color", uniforms: { color: Cesium.Color.RED } } }) }), asynchronous: !1 }), this._viewer.scene.primitives.add(this.line) } }, gc.prototype.init = function() { if (!this.post || !this.texture) { if (this.video && this.video.readyState === this.video.HAVE_ENOUGH_DATA && this.video.play(), !(this .upp instanceof Cesium.Cartesian3)) throw new Error("计算上方向错误"); this.createLine(this.sp, this.ep, this.upp); const t = this.video, i = this; let e = this._viewer.scene.context.uniformState; this.texture = new Cesium.Texture({ context: this._viewer.scene.context, source: t, width: 1, height: 1 }), this.post = new Cesium.PostProcessStage({ uniforms: { cen: function() { return Cesium.Matrix4.multiplyByPoint(e.view3D, i.sp, i.center) }, ep: function() { return Cesium.Matrix4.multiplyByPoint(e.view3D, i.ep, i.epp) }, eupp: function() { return Cesium.Matrix4.multiplyByPoint(e.view3D, i.upp, i.eupp) }, video: function() { return t && 2 <= t.readyState && i.texture.copyFrom({ source: t }), i.texture }, angle: function() { return i.angle }, nearAndFar: function() { return i.nearAndFar } }, fragmentShader: this.getFS1() + this.getFS2() + ` uniform sampler2D colorTexture; uniform sampler2D depthTexture; varying vec2 v_textureCoordinates; uniform vec3 cen; uniform vec3 ep; uniform vec3 eupp; uniform vec3 angle; uniform vec4 nearAndFar; uniform sampler2D video; mat4 computeMat(){ vec3 dir = normalize( ep - cen ); vec3 up = normalize( eupp - cen);//vec3( 0. ,0. , 1.); vec3 right = cross(dir , up); right = normalize(right); up = cross(right , dir); up = normalize(up); return mat4( right.x,right.y,right.z,0., up.x,up.y,up.z,0., dir.x,dir.y,dir.z,0., cen.x,cen.y,cen.z,1. ); // return mat4( // right.x ,up.x ,dir.x , cen.x, // right.y ,up.y ,dir.y , cen.y, // right.z ,up.z ,dir.z , cen.z, // 0. ,0.,0.,1. // ); } mat3 computeMat3(float an){ float sa = sin(an); float ca = cos(an); return mat3( ca , -sa ,0., sa , ca , 0., 0.,0.,1. ); } void setNormalColor(vec3 p , vec4 oc){ if( p.z < nearAndFar.x || p.z > nearAndFar.y){ gl_FragColor = oc; return; } mat3 rm = computeMat3( radians( angle.z ) ); p = rm * p; vec3 n = p.xyz; vec3 zn = vec3(0.,0.,1.); float dist = dot( n , zn); float dx = p.x ; float xangle = tan(radians( angle.x )); float yangle = tan(radians( angle.y )); float tanx = p.x / dist; float tany = p.y / dist; if( (tanx > -xangle && tanx< xangle) &&(tany > -yangle && tany < yangle)){ // gl_FragColor = vec4(1.); // return; float r = (tanx + xangle) / (2. * xangle); float g = (tany + yangle) / (2. * yangle); vec4 col = texture2D( video , vec2( r , g)); float f1 = 1.; float v1 = nearAndFar.w ;//羽化距离 float v2 = 1. - v1; if(r < v1){ f1 = r / v1; } if(r > v2){ f1 = (1. - r) / v1; } float f2 = 1.; if(g < v1){ f2 = g / v1; } if(g > v2){ f2 = (1. - g) / v1; } float f12 = f1 * f2; // float ff = f12; float ff = smoothstep( 0. , 1. , f12 ); ff *= nearAndFar.z; // ff = pow(ff , 0.5); gl_FragColor = mix(oc , col , ff); // gl_FragColor = mix(oc , vec4(1.) , 0.5); }else{ gl_FragColor = oc; } } void main(){ vec2 uv = v_textureCoordinates; float depth = getDepth(texture2D( depthTexture , uv)); vec4 oc = texture2D(colorTexture , uv); vec4 ec = toEye( uv , depth); ec /= ec.w; vec3 snor = normalize( ep - cen); vec3 pd = ec.xyz - cen; float dd = length(pd); vec3 n = normalize(ec.xyz - cen); float d = dot(n , snor); mat4 localMat = computeMat(); vec4 p = inverse_mat4(localMat) * ec; p/=p.w; // setColor1( p.xyz , oc); setNormalColor( p.xyz , oc); } ` }), this._viewer.scene.postProcessStages.add(this.post) } }, gc.prototype.update = function(e) { var t = e.horizonAngle, i = e.verticalAngle, o = e.angleZ, t = (isNaN(t) || "number" != typeof t || (this.horizonAngle = t, this.angle.x = t / 2), isNaN(i) || "number" != typeof i || (this.verticalAngle = i, this.angle.y = i / 2), isNaN(o) || "number" != typeof o || (this.angleZ = this.angle.z = o), e.startPos), i = (t && t instanceof Cesium.Cartesian3 && (this.sp.x = t.x, this.sp.y = t.y, this.sp.z = t.z), e .endPos), o = (i && i instanceof Cesium.Cartesian3 && (this.ep.x = i.x, this.ep.y = i.y, this.ep.z = i.z), e .near), t = e.far, i = e.offset, r = e.alpha; o && !isNaN(o) && "number" == typeof o && (this.nearAndFar.x = o), t && !isNaN(t) && "number" == typeof t && (this.nearAndFar.y = t), i && !isNaN(i) && "number" == typeof i && (this.nearAndFar.w = i), r && !isNaN(r) && "number" == typeof r && (this.nearAndFar.z = r), void 0 !== e.useLine && ( this.useLine = e.useLine), this.createLine(this.sp, this.ep, this.upp) }, gc.prototype.destroy = function() { for (var e in this.post && (this._viewer.scene.postProcessStages.remove(this.post), this.post.destroy(), this.post = void 0), this.texture && (this.texture.destroy(), this.texture = void 0), this .video && this.video.remove(), this.line && (this._viewer.scene.primitives.remove(this.line), this.line = null), this.controlPoint && this._viewer.entities.remove(this.controlPoint), this) delete this[e] }, gc.prototype.getFS1 = function() { return "vec4 toEye(in vec2 uv, in float depth){\r\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\r\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\r\n posInCamera =posInCamera / posInCamera.w;\r\n return posInCamera;\r\n}\r\nfloat getDepth(in vec4 depth){\r\n float z_window = czm_unpackDepth(depth);\r\n z_window = czm_reverseLogDepth(z_window);\r\n float n_range = czm_depthRange.near;\r\n float f_range = czm_depthRange.far;\r\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\r\n}\r\n" }, gc.prototype.getFS2 = function() { return ` mat4 inverse_mat4(mat4 m) { float Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; float Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; float Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; float Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; float Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; float Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; float Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; float Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; float Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; float Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; float Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; float Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; float Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; float Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; float Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; float Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; float Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; float Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; const vec4 SignA = vec4( 1.0, -1.0, 1.0, -1.0); const vec4 SignB = vec4(-1.0, 1.0, -1.0, 1.0); vec4 Fac0 = vec4(Coef00, Coef00, Coef02, Coef03); vec4 Fac1 = vec4(Coef04, Coef04, Coef06, Coef07); vec4 Fac2 = vec4(Coef08, Coef08, Coef10, Coef11); vec4 Fac3 = vec4(Coef12, Coef12, Coef14, Coef15); vec4 Fac4 = vec4(Coef16, Coef16, Coef18, Coef19); vec4 Fac5 = vec4(Coef20, Coef20, Coef22, Coef23); vec4 Vec0 = vec4(m[1][0], m[0][0], m[0][0], m[0][0]); vec4 Vec1 = vec4(m[1][1], m[0][1], m[0][1], m[0][1]); vec4 Vec2 = vec4(m[1][2], m[0][2], m[0][2], m[0][2]); vec4 Vec3 = vec4(m[1][3], m[0][3], m[0][3], m[0][3]); vec4 Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2); vec4 Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4); vec4 Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5); vec4 Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5); mat4 Inverse = mat4(Inv0, Inv1, Inv2, Inv3); vec4 Row0 = vec4(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]); float Determinant = dot(m[0], Row0); Inverse /= Determinant; return Inverse; } ` }, gc.prototype.changeHorizonAngle = function(e) { this.update({ horizonAngle: parseFloat(e) }) }, gc.prototype.changeVerticalAngle = function(e) { this.update({ verticalAngle: parseFloat(e) }) }, gc.prototype.changeRotateAngle = function(e) { this.update({ angleZ: parseFloat(e) }) }, _c.prototype.GeoWTFS = function(e) { var t = (e = e || {}).token || "c53eb074c3fcba5ac86103d4d711bbe8", i = e.url || "https://t{s}.tianditu.gov.cn/", o = { viewer: this._viewer, subdomains: ["0", "1", "2", "3", "4", "5", "6", "7"], metadata: { boundBox: { minX: -180, minY: -90, maxX: 180, maxY: 90 }, minLevel: 1, maxLevel: 20 }, aotuCollide: !0, collisionPadding: [5, 10, 8, 5], serverFirstStyle: !0, labelGraphics: { font: "28px sans-serif", fontSize: 28, fillColor: Cesium.Color.WHITE, scale: .5, outlineColor: Cesium.Color.BLACK, outlineWidth: 5, style: Cesium.LabelStyle.FILL_AND_OUTLINE, showBackground: !1, backgroundColor: Cesium.Color.RED, backgroundPadding: new Cesium.Cartesian2(10, 10), horizontalOrigin: Cesium.HorizontalOrigin.LEFT, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, eyeOffset: Cesium.Cartesian3.ZERO, pixelOffset: new Cesium.Cartesian2(0, 8), heightReference: 1, disableDepthTestDistance: Number.POSITIVE_INFINITY }, billboardGraphics: { horizontalOrigin: Cesium.HorizontalOrigin.RIGHT, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, eyeOffset: Cesium.Cartesian3.ZERO, pixelOffset: Cesium.Cartesian2.ZERO, alignedAxis: Cesium.Cartesian3.ZERO, color: Cesium.Color.WHITE, rotation: 0, scale: 1, width: 18, height: 18, heightReference: 1, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, o = (e = this._core.extend(o, e, !0), new Cesium.GeoWTFS(e)); return o.getTileUrl = function() { return i + "mapservice/GetTiles?lxys={z},{x},{y}&tk=" + t }, o.getIcoUrl = function() { return i + "mapservice/GetIcon?id={id}&tk=" + t }, o.initTDT([{ x: 6, y: 1, level: 2, boundBox: { minX: 90, minY: 0, maxX: 135, maxY: 45 } }, { x: 7, y: 1, level: 2, boundBox: { minX: 135, minY: 0, maxX: 180, maxY: 45 } }, { x: 6, y: 0, level: 2, boundBox: { minX: 90, minY: 45, maxX: 135, maxY: 90 } }, { x: 7, y: 0, level: 2, boundBox: { minX: 135, minY: 45, maxX: 180, maxY: 90 } }, { x: 5, y: 1, level: 2, boundBox: { minX: 45, minY: 0, maxX: 90, maxY: 45 } }, { x: 4, y: 1, level: 2, boundBox: { minX: 0, minY: 0, maxX: 45, maxY: 45 } }, { x: 5, y: 0, level: 2, boundBox: { minX: 45, minY: 45, maxX: 90, maxY: 90 } }, { x: 4, y: 0, level: 2, boundBox: { minX: 0, minY: 45, maxX: 45, maxY: 90 } }, { x: 6, y: 2, level: 2, boundBox: { minX: 90, minY: -45, maxX: 135, maxY: 0 } }, { x: 6, y: 3, level: 2, boundBox: { minX: 90, minY: -90, maxX: 135, maxY: -45 } }, { x: 7, y: 2, level: 2, boundBox: { minX: 135, minY: -45, maxX: 180, maxY: 0 } }, { x: 5, y: 2, level: 2, boundBox: { minX: 45, minY: -45, maxX: 90, maxY: 0 } }, { x: 4, y: 2, level: 2, boundBox: { minX: 0, minY: -45, maxX: 45, maxY: 0 } }, { x: 3, y: 1, level: 2, boundBox: { minX: -45, minY: 0, maxX: 0, maxY: 45 } }, { x: 3, y: 0, level: 2, boundBox: { minX: -45, minY: 45, maxX: 0, maxY: 90 } }, { x: 2, y: 0, level: 2, boundBox: { minX: -90, minY: 45, maxX: -45, maxY: 90 } }, { x: 0, y: 1, level: 2, boundBox: { minX: -180, minY: 0, maxX: -135, maxY: 45 } }, { x: 1, y: 0, level: 2, boundBox: { minX: -135, minY: 45, maxX: -90, maxY: 90 } }, { x: 0, y: 0, level: 2, boundBox: { minX: -180, minY: 45, maxX: -135, maxY: 90 } }]), o }, fc.prototype.createPolygonLayer = function(e = {}) { let o = { color: e.color || "rgba(135,206,235,0.6)", image: e.image || window.SmartEarthRootUrl + D.water, height: e.height, extrudedHeight: e.extrudedHeight, frequency: e.frequency || 1e3, speed: e.speed || 10, amplitude: e.amplitude || 10, near: e.near, far: e.far, id: e.id || this._core.getuid() }, t = (Cesium.Color.fromCssColorString(o.color), Cesium.GeoJsonDataSource.load(e.url)), r = new Cesium.PrimitiveCollection; t.then(e => { var t = e.entities.values; for (let e = 0; e < t.length; e++) { var i = t[e]; this.addPolygon(r, i, o) } }), this.item = this._viewer.scene.primitives.add(r); e = { id: o.id, name: "新建水面图层", pId: 0, type: "polygonLayer", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, fc.prototype.addPolygon = async function(e, t, i) { var o = Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, r = Cesium.Color.fromCssColorString(i.color), o = new Cesium.PolygonGeometry({ polygonHierarchy: t.polygon.hierarchy.getValue(), extrudedHeight: i.extrudedHeight, height: i.height, vertexFormat: o }), o = new Cesium.GeometryInstance({ geometry: o, id: t, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(r), distanceDisplayCondition: new Cesium .DistanceDisplayConditionGeometryInstanceAttribute(i.near, i.far) } }); let n; t = new(n = i.height || i.extrudedHeight ? Cesium.Primitive : Cesium.GroundPrimitive)({ geometryInstances: o, appearance: new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { type: "Water", uniforms: { baseWaterColor: r, blendColor: r, normalMap: i.image, frequency: i.frequency, animationSpeed: i.speed / 1e3, amplitude: i.amplitude } } }) }), classificationType: i.classificationType }); e.add(t) }, fc.prototype.setTreeobj = function(e) { this.treeobj = e }, fc.prototype.deleteObject = function() { try { this._viewer.scene.primitives.remove(this.item) } catch (e) { console.log(e) } }, fc.prototype.setVisibility = function(e) { this.item && (this.item.show = e) }, yc.prototype.create = function(e, t = {}) { this.grid = this._core.defaultValue(t.grid, !0); let f = t.center, y = t.scale || 1; return this._core.getJSON(e, n => { var a = Math.max(...n.mData) * y, s = n.mHorPointsNum, l = n.mVerPointsNum; if (f = n.mCenterPoint && n.mCenterPoint.length ? n.mCenterPoint : f) { var u = new Float64Array(3 * n.mData.length), c = 0, h = new Float32Array(2 * n.mData.length), m = 0, d = new Uint16Array(s * (l - 1) * 2 * 3), p = 0; let r = 0; for (let i = n.mHStartAngle, o = 0; i < n.mHEndAngle; i += n.mHStep, o++) for (let e = n.mVStartAngle, t = 0; e <= n.mVEndAngle; e += n.mVStep, t++) { var g = n.mData[r++] * y, _ = this._core.getPositionFromHPR(f, g, i, e), _ = Cesium.Cartesian3.fromDegrees(_.lon, _.lat, _.height); u[c++] = _.x, u[c++] = _.y, u[c++] = _.z, h[m++] = (o + 1) / s, h[m++] = Math.pow(g / a, 3), 0 !== o && 0 !== t && (d[p++] = (o - 1) * l + (t - 1), d[p++] = (o - 1) * l + t, d[p++] = o * l + t - 1, d[p++] = ( o - 1) * l + t, d[p++] = o * l + t, d[p++] = o * l + t - 1, o === s - 1 && (d[p++] = t - 1, d[p++] = t, d[p++] = o * l + t - 1, d[p++] = t, d[p++] = o * l + t, d[p++] = o * l + t - 1)) } this.addGeometry({ positions: u, st: h, indexs: d, minColor: t.minColor, maxColor: t.maxColor }, t.flyTo) } else console.log("缺少场强中心坐标") }), this }, yc.prototype.addGeometry = function(e, t) { var i = new Cesium.Geometry({ attributes: { position: new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: e.positions }), st: new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: e.st }) }, indices: e.indexs, primitiveType: this.grid ? Cesium.PrimitiveType.LINES : Cesium.PrimitiveType.TRIANGLES, boundingSphere: Cesium.BoundingSphere.fromVertices(e.positions) }), o = new Cesium.GeometryInstance({ geometry: i }); this.item = new Cesium.Primitive({ geometryInstances: o, appearance: new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { uniforms: { color1: Cesium.Color.fromCssColorString(e.minColor || "#ff0000"), color2: Cesium.Color.fromCssColorString(e.maxColor || "#00ff00") }, source: this.getShader() } }) }), asynchronous: !1 }), this._viewer.scene.primitives.add(this.item), t && this._viewer.camera.flyToBoundingSphere(i .boundingSphere) }, yc.prototype.setVisibility = function(e) { this.item && (this.item.show = e) }, yc.prototype.deleteObject = function() { this._viewer.scene.primitives.remove(this.item) }, yc.prototype.getShader = function() { return "uniform vec4 color1;\n uniform vec4 color2;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n material.diffuse = color1.rgb * (1.0 - st.y) + color2.rgb * st.y; \n material.alpha = color1.a * (1.0 - st.y) + color2.a * st.y;\n return material;\n }\n " }, q.prototype.create3DTilesets = function(e, t, i, o, r, n, a) { e = this._D3Tileset.create3DTilesets(e, t, i, o, r, n, a); return this._D3Tilesets || (this._D3Tilesets = [], this._3DTilesets = []), this._D3Tilesets.push(e .item), e }, q.prototype.set3DTilesetsAlpha = function(t) { this._D3Tilesets && this._D3Tilesets.forEach(e => { e.style = 0 == t ? new Cesium.Cesium3DTileStyle({ show: !1 }) : 1 == t ? new Cesium.Cesium3DTileStyle({ show: !0 }) : new Cesium.Cesium3DTileStyle({ color: `color('rgba(255,255,255,${t})')` }) }) }, q.prototype.createTerrainModifier = function(e, t, i) { return this._TerrainModifier.createTerrainModifier(e, t, i) }, q.prototype.createS3MLayer = function(e, t, i) { let o = new cc({ context: t._context, url: e }); return t.primitives.add(o), o.readyPromise.then(function() { i && i() }).otherwise(function(e) { console.log(e) }), o }, q.prototype.createWaterPolygonLayer = function(e = {}) { let t = new fc(this._viewer); return t.createPolygonLayer(e) }, q.prototype.createCloudMap = function(e, t, i, o) { return new A(this._viewer, this._cesium).createCloudMap(e, t, i, o) }, q.prototype.addVideoPolygon = function(e, t) { return new A(this._viewer, this._cesium).addVideoPolygon(e, t) }, q.prototype.addVideoBox = function(e, t) { return new A(this._viewer, this._cesium).addVideoBox(e, t) }, q.prototype.CZML = function(e, t, i) { let o = new Tu(this._viewer, this._cesium); return o.addCZML(e, t, i) }, q.prototype.addHeatMap = function(e, t) { let i = new Su(this._viewer, this._cesium); return i.addHeatMap(e, t) }, q.prototype.militaryPlotting = function(e, t, i, o) { var r = this._straightArrow, n = null; let a, s; i ? s = "function" == typeof i ? (a = {}, i) : (a = i, o) : a = {}; var l = e => { r.MilitaryStandardObj.length && !r.editHandler ? r.edit(r.openEdit, r.editOption) : !r .MilitaryStandardObj.length && r.editHandler && r.edit(!1), s && s(e) }; switch (e) { case "StraightArrow": n = r.createStraightArrow(t, a, l); break; case "SwallowtailArrow": n = r.createSwallowtailArrow(t, a, l); break; case "PincerArrow": n = r.createPincerArrow(t, a, l); break; case "AttackArrow": n = r.createAttackArrow(t, a, l); break; case "GatheringPlace": n = r.createHandlerPolygon(t, a, l); break; case "RoundedRectangle": n = r.createRoundedRectangle(t, a, l); break; case "Sector": n = r.createSector(t, a, l); break; case "Bow": n = r.createBow(t, a, l); break; case "Bezierline": n = r.createBezierline(a, l); break; case "BezierArrow": n = r.createBezierArrow(a, l) } return n }, q.prototype.MilitaryCopy = function(e) { return this._straightArrow.copyJb(e) }, q.prototype.NightMode = function(e) { let t = this._viewer; var i = t.imageryLayers.length; let o, r; r = e ? o = .15 : o = 1; for (let e = 0; e < i; e++) t.imageryLayers.get(e).brightness = o; this._D3Tilesets && this._D3Tilesets.forEach(e => { e.imageBasedLightingFactor.x = r, e.imageBasedLightingFactor.y = r }), t.scene.skyAtmosphere.show = !e }, q.prototype.SaveMilitaryStandard = function() { this._straightArrow.save() }, q.prototype.OpenMilitaryStandard = function(e) { this._straightArrow.open(e) }, q.prototype.ClearMilitaryStandard = function() { this._straightArrow.clear() }, q.prototype.getEntityById = function(e) { return this._straightArrow.getEntityById(e) }, q.prototype.startModify = function(e) { this._straightArrow.edit(e) }, q.prototype.createSimpleGraphic = function(e, t, i) { let o = this._SimpleGraphic; return o.createSimpleGraphic(e, t, i) }, q.prototype.addSimpleGraphic = function(e, t, i) { let o = this._SimpleGraphic; return o.addSimpleGraphic(e, t, i) }, q.prototype.GeoWTFS = function(e) { return this._TdtLabel || (this._TdtLabel = new _c(this._viewer, this._cesium)), this._TdtLabel .GeoWTFS(e) }, q.prototype.Video3D = function(e) { let t = new gc(this._viewer, this._cesium); return t.Video3D(e) }, q.prototype.createGeoJsonFeatureLayerProviderOptimization = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .VolumeVectorGeoJsonFeatureLayerOptimization(e, t, i, o, r, n) }, q.prototype.createGeoJsonFeatureLayerProviderGisOptimization = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .VolumeVectorGeoJsonFeatureLayerGisOptimization(e, t, i, o, r, n) }, q.prototype.VolumeVectorGeoJsonFeatureLayerGis = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .VolumeVectorGeoJsonFeatureLayerGis(e, t, i, o, r, n) }, q.prototype.PointVectorGeoJsonFeatureLayerGis = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .PointVectorGeoJsonFeatureLayerGis(e, t, i, o, r, n) }, q.prototype.PolylineVectorGeoJsonFeatureLayerGis = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .PolylineVectorGeoJsonFeatureLayerGis(e, t, i, o, r, n) }, q.prototype.createGeoJsonFeatureLayerProviderClassOptimization = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .VolumeVectorGeoJsonFeatureLayerClassOptimization(e, t, i, o, r, n) }, q.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .VolumeVectorGeoJsonFeatureLayerOptimization1(e, t, i, o, r, n) }, q.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimizationtest = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVolumeVectorGeoJsonFeatureLayerDthOptimization(e, t, i, o, r, n) }, q.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest(e, t, i, o, r, n) }, q.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .VolumeVectorGeoJsonFeatureLayerOptimizationtest(e, t, i, o, r, n) }, q.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVolumeVectorGeoJsonFeatureLayerJCDthOptimization(e, t, i, o, r, n) }, q.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp(e, t, i, o, r, n) }, q.prototype.createHistogramVectorGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createHistogramVectorGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createLaycolorVectorGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createLaycolorVectorGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createVector3DTilesFeatureLayer = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVector3DTilesFeatureLayer(e, t, i, o, r, n) }, q.prototype.createVector3DTilesFeatureLayerRelease = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVector3DTilesFeatureLayerRelease(e, t, i, o, r, n) }, q.prototype.createGeojsonImage = function(e) { return new b(this._viewer, this._cesium).createGeojsonImage(e) }, q.prototype.createGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a.VectorGeoJsonFeatureLayer( e, t, i, o, r, n) }, q.prototype.createGeojsonFeatureLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a.createGeojsonFeatureLayer( e, t, i, o, r, n) }, q.prototype.createGeojsonKmlFeatureLayer = function(e, t, i, o, r) { var n = new C(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, n .createGeojsonKmlFeatureLayer(e, t, i, o, r) }, q.prototype.sfsterrainprovider = function(e, t, i, o, r) { var n = new nu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, n.createSFSTerrain(e, t, i, o, r) }, q.prototype.createWMTSTerrain = function(e, t, i, o, r) { var n = new nu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, n.createWMTSTerrain(e, t, i, o, r) }, q.prototype.sfsterrainprovider71 = function(e, t, i, o, r) { var n = new nu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, n.createSFSTerrain71(e, t, i, o, r) }, q.prototype.createTerrain = function(e, t, i, o, r) { var n = new nu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, n.createTerrain(e, t, i, o, r) }, q.prototype.createTerrainLayer = function(e, t, i, o, r, n) { var a = new nu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, a.createTerrainLayer(e, t, i, o, r, n) }, q.prototype.createArcGISTerrain = function(e, t, i, o, r) { var n = new nu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, n.createArcGISTerrain(e, t, i, o, r) }, q.prototype.createCesiumTerrain = function(e, t, i, o) { var r = new nu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, r.createCesiumTerrain(e, t, i, o) }, q.prototype.createDynamicObject = function(e, t, i) { return this._createdynamicObject.Start(e, t, i) }, q.prototype.addmodle = function(e) { return this._createdynamicObject.addmodle(e) }, q.prototype.createSatelliteTrail = function(e) { let t = new Pu(this._viewer, this._cesium); return t.createSatelliteTrail(e) }, q.prototype.executePauseFly3DPaths = function() { return this._createdynamicObject.executePauseFly3DPaths() }, q.prototype.executePlayForwardFly3DPaths = function() { return this._createdynamicObject.executePlayForwardFly3DPaths() }, q.prototype.executePlayReverseFly3DPaths = function() { return this._createdynamicObject.executePlayReverseFly3DPaths() }, q.prototype.executeSignout = function() { return this._createdynamicObject.executeSignout() }, q.prototype.createLabel = function(e, t, i, o, r) { var n = new F(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n.createLabel(e, t, i, o, r) }, q.prototype.createPosition = function(e, t, i) { return new Dl(this._viewer, this._cesium).createPosition(e, t, i) }, q.prototype.createLocation = function(e, t, i) { return this._Point.createLocation(e, t, i) }, q.prototype.createPoint = function(e, t, i, o, r, n) { return this._Point.createPoint(e, t, i, o, r, n) }, q.prototype.createLonlat = function(e) { return this._Point.createLonlat(e) }, q.prototype.createDivPoint = function(e, t, i) { let o = new Ze(this._viewer); return o.createDivPoint(e, t, i) }, q.prototype.createRichTextPoint = function(e, t, i, o) { return this._Point.createRichTextPoint(e, t, i, o) }, q.prototype.SkyBox = function(e, t) { return this._skyBox.SkyBox(e, t) }, q.prototype.setSpaceBackground = function(e) { return this._skyBox.setSpaceBackground(e) }, q.prototype.createWindField = function(e, t) { return this._flowField.createWindField(e, t) }, q.prototype.createField = function(e, t) { return this._canvasField.createField(e, t) }, q.prototype.createRoad = function(e = {}) { let t = new fu(this._viewer); return t.createRoad(e) }, q.prototype.createTrailLinePath = function(e, t, i) { return this._trailLine.createPath(e, t, i) }, q.prototype.createFlyingLine = function(e, t) { return this._trailLine.createFlyingLine(e, t) }, q.prototype.createTrailLineWall = function(e, t) { return this._trailLine.createWall(e, t) }, q.prototype.createTrailLine = function(e, t) { return this._trailLine.createLine(e, t) }, q.prototype.createModel = function(e, t, i, o, r, n) { return new S(this._viewer, this._cesium).createModel(e, t, i, o, r, n) }, q.prototype.createModelEditable = function(e, t, i, o, r, n) { return new S(this._viewer, this._cesium).createModelEditable(e, t, i, o, r, n) }, q.prototype.createPointModel = function(e, t) { return this._PointModel.createPointModel(e, t) }, q.prototype.executePolyline = function(e) { return new M(this._viewer, this._cesium).executePolyline(e) }, q.prototype.executePolygon = function(e) { return new A(this._viewer, this._cesium).executePolygon(e) }, q.prototype.executeWall = function(e, t) { return new Ml(this._viewer, this._cesium).executeWall(e, t) }, q.prototype.createWall = function(e, t, i, o) { return new Ml(this._viewer, this._cesium).createWall(e, t, i, o) }, q.prototype.executePolyline1 = function(e) { return new M(this._viewer, this._cesium).executePolyline1(method) }, q.prototype.createPolylineVolume = function(e, t, i, o, r) { return new Il(this._viewer, this._cesium).createPolylineVolume(e, t, i, o, r) }, q.prototype.createCorridor = function(e, t, i, o) { return new tn(this._viewer, this._cesium).createCorridor(e, t, i, o) }, q.prototype.addViewCone = function(e) { let t = new xu(this._viewer, this._cesium); return t.addViewCone(e) }, q.prototype.createViewCone = function(e, t) { let i = new xu(this._viewer, this._cesium); return i.createViewCone(e, t) }, q.prototype.createModifyMesh = function(e, t, i, o, r) { return this.createModelClipping(o, { type: "polygon", isInner: !0, positions: t }) }, q.prototype.createModelClipping = function(e, t) { return new bu(this._viewer, this._cesium).addClipping(e, t) }, q.prototype.createModelModifier = function(i, o, r, n) { let a = []; return this._D3Tilesets && this._D3Tilesets.forEach((e, t) => { e = this.createModifyMesh(i, o, r, e, n); a.push(e) }), { remove: () => { a.forEach((e, t) => { e.remove() }), a = [] } } }, q.prototype.createPopupMessage = function(e) { return new tt(this._viewer, this._cesium).createPopupMessage(e) }, q.prototype.createMeasurement = function(e) { return new tt(this._viewer, this._cesium).createMeasurement(e) }, q.prototype.createPlotting = function(e) { return new tt(this._viewer, this._cesium).createPlotting(e) }, q.prototype.createPopupProp = function(e, t) { return this._popupmessage.createPopupProp(e, t) }, q.prototype.createModelLibrary = function(e) { return this._popupmessage.createModelLibrary(e) }, q.prototype.createHawkeye = function(e, t) { return new vu(this._viewer, this._cesium).createHawkeye(e, t) }, q.prototype.createGeoJsonFeatureLayer = function(e, t, i, o, r) { var n = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n.createGeoJsonFeatureLayer( e, t, i, o, r) }, q.prototype.createBillboardGeoJsonFeature = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createBillboardGeoJsonFeature(e, t, i, o, r, n) }, q.prototype.createBillboardPointGeoJsonFeatureLayer = function(e, t, i, o, r) { var n = new at(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n .createBillboardPointGeoJsonFeatureLayer(e, t, i, o, r) }, q.prototype.createKmlLayer = function(e, t, i) { return new Cu(this._viewer, this._cesium).createKmlLayer(e, t, i) }, q.prototype.addKmlLayer = function(e, t, i, o) { return new Cu(this._viewer, this._cesium).addKmlLayer(e, t, i, o) }, q.prototype.createVolumeVectorGeoJsonFeatureLayerArcgis = function(e, t, i, o, r) { var n = new jt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n .createVolumeVectorGeoJsonFeatureLayer(e, t, i, o, r) }, q.prototype.createBillboardGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new at(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createBillboardGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createPointGeojsonFeatureLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPointGeojsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createModelGeojsonFeatureLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createModelGeojsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createCirclePointGeoJsonFeatureLayer = function(e, t, i, o, r) { var n = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n .createCirclePointGeoJsonFeatureLayer(e, t, i, o, r) }, q.prototype.createModelPointGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createModelPointGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createPrimitivLabelPointGeoJsonFeatureLayer = function(e, t, i, o, r) { var n = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n .createLabelPointGeoJsonFeatureLayer(e, t, i, o, r) }, q.prototype.createLabelPointGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createLabelPointGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createSXTLabelGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createSXTLabelGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createCustomCallbackGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n, a) { var s = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, s .createCustomCallbackGeoJsonFeatureLayerProvider(e, t, i, o, r, a, n) }, q.prototype.createLabelPolymerizationGeoJsonFeatureLayer = function(e, t, i, o, r) { var n = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n .createLabelPolymerizationGeoJsonFeatureLayer(e, t, i, o, r) }, q.prototype.createPointPolymerizationGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPointPolymerizationGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createLabelpolymerizationGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createLabelpolymerizationGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createLabelpolymerizationGeoJsonFeatureLayers = function(e, t, i, o, r, n) { var a = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createLabelpolymerizationGeoJsonFeatureLayers(e, t, i, o, r, n) }, q.prototype.createStreetscapeGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createStreetscapeGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createPrimitiveLabelGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createLabelGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createLabelImageGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createLabelImageGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createLabelImageGeoJsonFeatureLayerProvider1 = function(e, t, i, o, r, n) { var a = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createLabelImageGeoJsonFeatureLayerProvider1(e, t, i, o, r, n) }, q.prototype.createLabelRichtextGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new w(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createLabelRichtextGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createModelGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createModelGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createPointGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new b(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPointGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createArcGisImageryLayer = function(e, t, i, o, r, n) { var a = new Ol(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, a.createArcGisImageryLayer( e, t, i, o, r, n) }, q.prototype.createImageryLayerGrid = function(e) { return new Ol(this._viewer, this._cesium).createImageryLayerGrid(e) }, q.prototype.createWebMapServerImageLayer = function(e, t, i, o, r, n) { var a = new Ol(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, a .createWebMapServerImageLayer(e, t, i, o, r, n) }, q.prototype.createWebMapTileServerImageLayer = function(e, t, i, o, r, n) { var a = new Ol(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, a .createWebMapTileServerImageLayer(e, t, i, o, r, n) }, q.prototype.createUrlTemplateImageryProvider = function(e, t, i, o, r, n) { var a = new Ol(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, a .createUrlTemplateImageryProvider(e, t, i, o, r, n) }, q.prototype.createCirclePointGeoJsonFeatureLayer = function(e, t, i, o, r) { var n = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n .createCirclePointGeoJsonFeatureLayer(e, t, i, o, r) }, q.prototype.createPolylineGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPolylineGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createPrimitivePolylineGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new pt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPolylineGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createPrimitiveGroundPolylineGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new pt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createGroundPolylineGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.exectPointModel = function(e, t, i, o, r, n) { var a = new S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a.exectPointModel(e, t, i, o, r, n) }, q.prototype.createPolygonModel = function(e, t, i, o, r, n) { var a = new S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a.createPolygonModel(e, t, i, o, r, n) }, q.prototype.modelMove = function() { return new S(this._viewer, this._cesium).modelMove() }, q.prototype.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new pt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPolylineVectorGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel = function(e, t, i, o, r, n) { var a = new pt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPolylineVectorGeoJsonFeatureLayerProviderModel(e, t, i, o, r, n) }, q.prototype.createpolylineVolumeGeojsonFeatureLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createpolylineVolumeGeojsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createpolylineVolumeGeojsonPrimitiveLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createpolylineVolumeGeojsonPrimitiveLayer(e, t, i, o, r, n) }, q.prototype.createVolumeGeoJsonFeatureLayer = function(e, t, i, o, r) { var n = new au(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n .createVolumeGeoJsonFeatureLayer(e, t, i, o, r) }, q.prototype.createVolumeGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new au(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVolumeGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createVolumeVectorGeoJsonFeatureLayerOptimizations = function(e, t, i, o, r, n) { var a = new au(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVolumeVectorGeoJsonFeatureLayerOptimization(e, t, i, o, r, n) }, q.prototype.createVolumeVectorGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new au(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVolumeVectorGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createPolygonVectorGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new lu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVolumeVectorGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization = function(e, t, i, o, r, n) { var a = new lu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVolumeVectorGeoJsonFeatureLayerOptimization(e, t, i, o, r, n) }, q.prototype.createVolumeVectorGeoJsonFeatureLayersd = function(e, t, i, o, r, n) { var a = new lu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVolumeVectorGeoJsonFeatureLayersd(e, t, i, o, r, n) }, q.prototype.createWallGeoFeatureLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a.createWallGeoFeatureLayer( e, t, i, o, r, n) }, q.prototype.createWallPrimitiveGeoFeatureLayer = function(e, t, i, o, r, n) { var a = new Ut(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createWallPrimitiveGeoFeatureLayer(e, t, i, o, r, n) }, q.prototype.createWallGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new Ut(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createWallGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createImageryProvider = function(e, t, i, o, r, n, a) { var s = new Ol(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, s.createImageryProvider(e, t, i, o, r, n, a) }, q.prototype.createCacheImageryProvider = function(e, t, i, o, r, n) { var a = new Ol(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, a .createCacheImageryProvider(e, t, i, o, r, n) }, q.prototype.createterrainProvider = function(e, t, i, o) { return this._TerrainProvider.createterrainProvider(e, t, i, o) }, q.prototype.createPolylineImageryProviderer = function(e, t, i, o) { return this._ImageryLayer.createPolylineImageryProviderer(e, t, i, o) }, q.prototype.createMVTWithStyle = function(e, t, i, o) { return this._ImageryLayer.createMVTWithStyle(e, t, i, o) }, q.prototype.createPolygonGeoJsonFeatureLayer = function(e, t, i, o, r, n) { var a = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPolygonGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createPolygonGeoJsonFeatureLayer1 = function(e, t, i, o, r) { var n = new gt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n .createPolygonGeoJsonFeatureLayer(e, t, i, o, r) }, q.prototype.createPolygonVectorGeoJsonFeatureLayerProvider = function(e, t, i, o, r, n) { var a = new gt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPolygonVectorGeoJsonFeatureLayerProvider(e, t, i, o, r, n) }, q.prototype.createVolumeVectorGeoJsonFeatureLayerDth = function(e, t, i, o, r, n) { var a = new lu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createVolumeVectorGeoJsonFeatureLayerDth(e, t, i, o, r, n) }, q.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel = function(e, t, i, o, r, n) { var a = new gt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPolygonVectorGeoJsonFeatureLayerProviderModel(e, t, i, o, r, n) }, q.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls = function(e, t, i, o, r, n) { var a = new gt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPolygonVectorGeoJsonFeatureLayerProviderls(e, t, i, o, r, n) }, q.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd = function(e, t, i, o, r, n) { var a = new gt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createPolygonVectorGeoJsonFeatureLayerProviderlsd(e, t, i, o, r, n) }, q.prototype.createArcgisPolygonVectorGeoJsonFeatureLayerProviderls = function(e, t, i, o, r, n) { var a = new gt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a .createArcgisPolygonVectorGeoJsonFeatureLayerProviderls(e, t, i, o, r, n) }, q.prototype.createPolygonVectorFeatureLayerProvider = function(e, t, i, o, r) { var n = new gt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n .createPolygonVectorFeatureLayerProvider(e, t, i, o, r) }, q.prototype.createPolygonVectorMonomerFeatureLayerProvider = function(e, t, i, o, r) { var n = new gt(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n .createPolygonVectorMonomerFeatureLayerProvider(e, t, i, o, r) }, q.prototype.createPolygonMapGeoJsonFeatureLayer = function(e, t, i, o, r, n) { return this._MapGeoJsonFeatureLayer.createPolygonMapGeoJsonFeatureLayer(e, t, i, o, r, n) }, q.prototype.createGeoJsonDataSource = function(e, t, i, o, r) { var n = new C(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n.createGeoJsonDataSource(e, t, i, o, r) }, q.prototype.DeleteObject = function(e) { if (this._core.isnull(e._viewer)) console.log("obj is null"); else for (var t in e.deleteObject(), e) delete e[t] }, q.prototype.createCircle = function(e, t, i, o) { return new H(this._viewer, this._cesium).createCircle(e, t, i, o) }, q.prototype.CreateRectangle = function(e, t, i, o, r) { return new O(this._viewer, this._cesium).CreateRectangle(e, t, i, o, r) }, q.prototype.createBox = function(e, t, i, o) { return (t = new R(this._viewer, this._cesium)).createBox(e, t, i, o) }, q.prototype.createBillboardbatch = function(e) { return new Ar(this._viewer, this._cesium).createBillboardbatch(e) }, q.prototype.createCone = function(e, t, i, o) { return new B(this._viewer, this._cesium).createCone(e, t, i, o) }, q.prototype.createRectangularSensor = function(e, t, i, o) { return new B(this._viewer, this._cesium).createRectangularSensor(e, t, i, o) }, q.prototype.createRadarMaskScan = function(e, t, i, o) { return new B(this._viewer, this._cesium).createRadarMaskScan(e, t, i, o) }, q.prototype.ConicSensor = function(e, t, i) { return new en(this._viewer).create(e, t, i) }, q.prototype.FieldIntensity = function(e, t) { return new yc(this._viewer).create(e, t) }, q.prototype.createRadarMask = function(e, t, i, o) { return new B(this._viewer, this._cesium).createRadarMask(e, t, i, o) }, q.prototype.createConeRadar = function(e, t) { return new B(this._viewer, this._cesium).createConeRadar(e, t) }, q.prototype.createColor = function(e, t, i, o) { return new m(this._viewer, this._cesium).createColor(e, t, i, o) }, q.prototype.createPolyline = function(e, t, i, o, r) { var n = new M(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n.createPolyline(e, t, i, this._core.isnull(o) ? 0 : o, r) }, q.prototype.createLink = function(e, t, i) { return new M(this._viewer, this._cesium).createLink(e, t, i) }, q.prototype.createLinkPro = function(e, t, i) { return new M(this._viewer, this._cesium).createLinkPro(e, t, i) }, q.prototype.createLandingLine = function(e, t = {}) { return new M(this._viewer, this._cesium).createLandingLine(e, t) }, q.prototype.createLinkPros = function(e) { return new M(this._viewer, this._cesium).createLinkPros(e) }, q.prototype.createPathLayer = function(e) { return this._trailLine.createPathLayer(e) }, q.prototype.createTrailWallLayer = function(e) { return this._trailLine.createWallLayer(e) }, q.prototype.createPolygon = function(e, t, i, o, r) { var n = new A(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n.createPolygon(e, t, i, o, r) }, q.prototype.createSector = function(e, t, i, o, r) { return new A(this._viewer, this._cesium).createSector(e, t, i, o, r) }, q.prototype.executeEllipsoid = function(e, t, i, o) { t = new Zi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, t.createEllipsoid(e, t, i, o) }, q.prototype.createImageLabel = function(e, t, i, o) { var r = new Ll(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, r.createImageLabel(e, t, i, o) }, q.prototype.toHtmlColor = function(e) { return this._Color.toHtmlColor(e) }, q.prototype.CreateLabel = function(e, t, i, o, r, n) { var a = new F(this._viewer, this._cesium); return this._core.isnull(r) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (r = V.selectedItem.id), r = this._core.isnull(r) ? 0 : r, a.CreateLabel(e, t, i, o, r, n) }, q.prototype.CreateImageLabel = function(e, t, i, o, r) { var n = new Ll(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n.CreateImageLabel(e, t, i, o, r) }, q.prototype.createImage = function(e, t, i, o, r) { var n = new Ll(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n.CreateImageLabel(e, t, i, o, r) }, q.prototype.CreatePolyline = function(e, t, i, o, r) { var n = new M(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, n.CreatePolyline(e, t, i, o, r) }, q.prototype.CreateCircle = function(e, t, i, o, r, n) { var a = new H(this._viewer, this._cesium); return this._core.isnull(r) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (r = V.selectedItem.id), r = this._core.isnull(r) ? 0 : r, a.CreateCircle(e, t, i, o, r, n) }, q.prototype.CreateEllipse = function(e, t, i, o, r, n, a, s) { var l = new H(this._viewer, this._cesium); return this._core.isnull(a) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (a = V.selectedItem.id), a = this._core.isnull(a) ? 0 : a, l.CreateEllipse(e, t, i, o, r, n, a, s) }, q.prototype.CreateBox = function(e, t, i, o, r, n, a, s) { var l = new R(this._viewer, this._cesium); return this._core.isnull(a) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (a = V.selectedItem.id), a = this._core.isnull(a) ? 0 : a, l.CreateBox(e, t, i, o, r, n, a, s) }, q.prototype.CreatePosition = function(e, t, i, o, r, n, a, s) { return new Dl(this._viewer, this._cesium).CreatePosition(e, t, i, o, r, n, a, s) }, q.prototype.createColor = function(e, t, i, o) { return new m(this._viewer, this._cesium).CreateColor(e, t, i, o) }, q.prototype.CreateCone = function(e, t, i, o, r, n, a, s) { var l = new B(this._viewer, this._cesium); return this._core.isnull(a) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (a = V.selectedItem.id), a = this._core.isnull(a) ? 0 : a, l.CreateCone(e, t, i, o, r, n, a, s) }, q.prototype.CreateCylinder = function(e, t, i, o, r, n, a, s) { var l = new B(this._viewer, this._cesium); return this._core.isnull(a) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (a = V.selectedItem.id), a = this._core.isnull(a) ? 0 : a, l.CreateCylinder(e, t, i, o, r, n, a, s) }, q.prototype.CreateSphere = function(e, t, i, o, r, n, a, s) { var l = new Zi(this._viewer, this._cesium); return this._core.isnull(a) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem .type && (a = V.selectedItem.id), a = this._core.isnull(a) ? 0 : a, l.CreateSphere(e, t, i, o, r, n, a, s) }, q.prototype.createPointOptimization = function(e, t) { return new k(this._viewer, this._cesium).createPointOptimization(e, t) }, q.prototype.createRectangleOptimization = function(e, t) { return new O(this._viewer, this._cesium).createRectangleOptimization(e, t) }, q.prototype.createCircleOptimization = function(e, t) { return new H(this._viewer, this._cesium).createCircleOptimization(e, t) }, q.prototype.createCylinderOptimization = function(e, t) { return new B(this._viewer, this._cesium).createCylinderOptimization(e, t) }, q.prototype.createPointOptimization = function(e, t) { return new k(this._viewer, this._cesium).createPointOptimization(e, t) }, q.prototype.CreatePolygonEdit = function() { return this._core.EntityEdit(this._viewer, this._cesium) }, q.prototype.CreateVectorImageFeatureLayer = function(e, t, i, o, r, n, a) { return this.VectorImgFeatureLayer.CreateVectorImageFeatureLayer(e, t, i, o, r, n, a) }, q.prototype.createVolumetricMeasureTool = function() { return new yu(this._viewer, this._cesium) }, Object.defineProperties(q.prototype, { SimpleGraphic: { get: function() { return this._SimpleGraphic } }, GeoJsonFeatureLayer: { get: function() { return this._GeoJsonFeatureLayer } }, MilitaryPlotting: { get: function() { return this._straightArrow } }, _D3Tileset: { get: function() { return new I(this._viewer, this._cesium) } } }), Object.defineProperties(q.prototype, { _trailLine: { get: function() { return new _u(this._viewer, this._cesium) } } }), Object.defineProperties(q.prototype, { _Point: { get: function() { return new k(this._viewer, this._cesium) } }, GeometryCreator: { CreateLinearRingGeometry: function(e) { return {} } } }), vc.prototype.currentTime = function(e) { return "" != e && null != e && (e = new Date(e), e = this.this._cesium.JulianDate.fromDate(e), this ._viewer.clock.currentTime = e.clone()), this }, vc.prototype.currentTimeFaster = function() { return this._viewer.animation.viewModel.faster(), this }, vc.prototype.currentTimeSlower = function() { return this._viewer.animation.viewModel.slower(), this }, vc.prototype.currentplayForwardViewModel = function() { return this._viewer.animation.viewModel.playForwardViewModel.command(), this }, vc.prototype.currentplayReverseViewModel = function() { return this._viewer.animation.viewModel.playReverseViewModel.command(), this }, vc.prototype.currentpauseViewModel = function() { return this._viewer.animation.viewModel.pauseViewModel.command(), this }, Cc.prototype.currentTime = function(e) { return new vc(this._viewer, this._cesium).currentTime(e) }, Cc.prototype.currentTimeFaster = function() { return new vc(this._viewer, this._cesium).currentTimeFaster() }, Cc.prototype.currentTimeSlower = function() { return new vc(this._viewer, this._cesium).currentTimeSlower() }, Cc.prototype.currentplayForwardViewModel = function() { return new vc(this._viewer, this._cesium).currentplayForwardViewModel() }, Cc.prototype.currentplayReverseViewModel = function() { return new vc(this._viewer, this._cesium).currentplayReverseViewModel() }, Cc.prototype.currentpauseViewModel = function() { return new vc(this._viewer, this._cesium).currentpauseViewModel() }, wc.prototype.AttachEvent = function(e, o) { var t, i, r = this._viewer, n = this._Core, n = this._Core; return e === fo.L_Click ? (t = this._viewer.scene, (i = new this._cesium.ScreenSpaceEventHandler(t .canvas)).setInputAction(function(e) { var t = r.scene.pickPosition(e.position); let i; t && (i = n.toDegrees(t)), "function" == typeof o && o(e, i) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), i) : e === fo.L_DBL_Click ? (t = this._viewer .scene, (i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function( e) { var t = r.scene.pickPosition(e.position); let i; t && (i = n.toDegrees(t)), "function" == typeof o && o(e, i) }, this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), i) : e === fo.L_Down ? (t = this ._viewer.scene, (i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction( function(e) { var t = r.scene.pickPosition(e.position); let i; t && (i = n.toDegrees(t)), "function" == typeof o && o(e, i) }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), i) : e === fo.L_Up ? (t = this._viewer .scene, (i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function( e) { var t = r.scene.pickPosition(e.position); let i; t && (i = n.toDegrees(t)), "function" == typeof o && o(e, i) }, this._cesium.ScreenSpaceEventType.LEFT_UP), i) : e === fo.M_Click ? (t = this._viewer .scene, (i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function( e) { var t = r.scene.pickPosition(e.position); let i; t && (i = n.toDegrees(t)), "function" == typeof o && o(e, i) }, this._cesium.ScreenSpaceEventType.MIDDLE_CLICK), i) : e === fo.M_Down ? (t = this._viewer .scene, (i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function( e) { var t = r.scene.pickPosition(e.position); let i; t && (i = n.toDegrees(t)), "function" == typeof o && o(e, i) }, this._cesium.ScreenSpaceEventType.MIDDLE_DOWN), i) : e === fo.M_Up ? (t = this._viewer .scene, (i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function( e) { var t = r.scene.pickPosition(e.position); let i; t && (i = n.toDegrees(t)), "function" == typeof o && o(e, i) }, this._cesium.ScreenSpaceEventType.MIDDLE_UP), i) : e === fo.R_Click ? (t = this._viewer .scene, (i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function( e) { var t = r.scene.pickPosition(e.position); let i; t && (i = n.toDegrees(t)), "function" == typeof o && o(e, i) }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), i) : e === fo.R_Down ? (t = this._viewer .scene, (i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function( e) { var t = r.scene.pickPosition(e.position); let i; t && (i = n.toDegrees(t)), "function" == typeof o && o(e, i) }, this._cesium.ScreenSpaceEventType.RIGHT_DOWN), i) : e === fo.R_Up ? (t = this._viewer .scene, (i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function( e) { var t = r.scene.pickPosition(e.position); let i; t && (i = n.toDegrees(t)), "function" == typeof o && o(e, i) }, this._cesium.ScreenSpaceEventType.RIGHT_UP), i) : e === fo.Wheel ? (t = this._viewer .scene, (i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function( e) { "function" == typeof o && o(e) }, this._cesium.ScreenSpaceEventType.WHEEL), i) : e === fo.Move ? (t = this._viewer.scene, ( i = new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e) { "function" == typeof o && o(e) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), i) : void 0 }, wc.prototype.AttachOnLButtonDblClkEvent = function(i) { var e = this._viewer.scene, o = this._viewer, r = this._Core, e = new this._cesium.ScreenSpaceEventHandler(e.canvas); return e.setInputAction(function(e) { e = o.scene.pickPosition(e.position); let t; e && (t = r.toDegrees(e)), "function" == typeof i && i(click, t) }, this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), e }, wc.prototype.AttachOnLButtonDownEvent = function(i) { var o = this._viewer, r = this._Core, e = this._viewer.scene, e = new this._cesium.ScreenSpaceEventHandler(e.canvas); return e.setInputAction(function(e) { e = o.scene.pickPosition(e.position); let t; e && (t = r.toDegrees(e)), "function" == typeof i && i(click, t) }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), e }, wc.prototype.AttachOnLButtonUpEvent = function(i) { var o = this._viewer, r = this._Core, e = this._viewer.scene, e = new this._cesium.ScreenSpaceEventHandler(e.canvas); return e.setInputAction(function(e) { e = o.scene.pickPosition(e.position); let t; e && (t = r.toDegrees(e)), "function" == typeof i && i(click, t) }, this._cesium.ScreenSpaceEventType.LEFT_UP), e }, wc.prototype.AttachOnMButtonDblClkEvent = function(i) { var o = this._viewer, r = this._Core, e = this._viewer.scene, e = new this._cesium.ScreenSpaceEventHandler(e.canvas); return e.setInputAction(function(e) { e = o.scene.pickPosition(e.position); let t; e && (t = r.toDegrees(e)), "function" == typeof i && i(click, t) }, this._cesium.ScreenSpaceEventType.MIDDLE_CLICK), e }, wc.prototype.AttachOnMButtonDownEvent = function(i) { var o = this._viewer, r = this._Core, e = this._viewer.scene, e = new this._cesium.ScreenSpaceEventHandler(e.canvas); return e.setInputAction(function(e) { e = o.scene.pickPosition(e.position); let t; e && (t = r.toDegrees(e)), "function" == typeof i && i(click, t) }, this._cesium.ScreenSpaceEventType.MIDDLE_DOWN), e }, wc.prototype.AttachOnMButtonUpEvent = function(i) { var o = this._viewer, r = this._Core, e = this._viewer.scene, e = new this._cesium.ScreenSpaceEventHandler(e.canvas); return e.setInputAction(function(e) { e = o.scene.pickPosition(e.position); let t; e && (t = r.toDegrees(e)), "function" == typeof i && i(click, t) }, this._cesium.ScreenSpaceEventType.MIDDLE_UP), e }, wc.prototype.AttachOnMouseWheelEvent = function(t) { var e = this._viewer.scene, e = new this._cesium.ScreenSpaceEventHandler(e.canvas); return e.setInputAction(function(e) { "function" == typeof t && t(e) }, this._cesium.ScreenSpaceEventType.WHEEL), e }, wc.prototype.AttachOnFrameEvent = function(t) { var e = this._viewer.scene, e = new this._cesium.ScreenSpaceEventHandler(e.canvas); return e.setInputAction(function(e) { "function" == typeof t && t(e) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), e }, wc.prototype.AttachOnRButtonDownEvent = function(i) { var o = this._viewer, r = this._Core, e = this._viewer.scene, e = new this._cesium.ScreenSpaceEventHandler(e.canvas); return e.setInputAction(function(e) { e = o.scene.pickPosition(e.position); let t; e && (t = r.toDegrees(e)), "function" == typeof i && i(click, t) }, this._cesium.ScreenSpaceEventType.RIGHT_DOWN), e }, wc.prototype.AttachOnRButtonUpEvent = function(i) { var o = this._viewer, r = this._Core, e = this._viewer.scene, e = new this._cesium.ScreenSpaceEventHandler(e.canvas); return e.setInputAction(function(e) { e = o.scene.pickPosition(e.position); let t; e && (t = r.toDegrees(e)), "function" == typeof i && i(click, t) }, this._cesium.ScreenSpaceEventType.RIGHT_UP), e }, wc.prototype.AttachCameraChangeEvent = function(e) { return this._viewer.scene.camera.percentageChanged = 1e-6, this._viewer.scene.camera.changed .addEventListener(e), e }, wc.prototype.CameraMoveEndEvent = function(e) { var t = this._viewer, i = !1; function o() { i = !0 } function r() { i && (e && e(), t.scene.camera.moveStart.removeEventListener(o), t.scene.camera.moveEnd .removeEventListener(r)) } setTimeout(function() { t.scene.camera.moveStart.addEventListener(o), t.scene.camera.moveEnd.addEventListener(r) }, 0) }, bc.prototype.DetachEvent = function(e, t) { t === fo.L_Click ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_CLICK) : t === fo .L_DBL_Click ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK) : t === fo.L_Down ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOWN) : t === fo.L_Up ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_UP) : t === fo .M_Click ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_CLICK) : t === fo .M_Down ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_DOWN) : t === fo .M_Up ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_UP) : t === fo .R_Click ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_CLICK) : t === fo .R_Down ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_DOWN) : t === fo .R_Up ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_UP) : t === fo.Wheel ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.WHEEL) : t === fo.Move ? e && e .removeInputAction(this._cesium.ScreenSpaceEventType.MOUSE_MOVE) : e && e.destroy() }, bc.prototype.DetachEventAll = function(e) { e && e.destroy() }, bc.prototype.RemoNormalCesiumLeftDoubleClick = function() { this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium .ScreenSpaceEventType.LEFT_DOUBLE_CLICK) }, bc.prototype.DetachCameraChangeEvent = function(e) { this._viewer.scene.camera.percentageChanged = .5, this._viewer.scene.camera.changed .removeEventListener(e) }; let Tc = "undefined" != typeof window ? window : "undefined" != typeof self ? self : {}, Sc = document.currentScript && document.currentScript.src; if (!Sc) try { throw Error("获取当前文件路径") } catch (e) { e.fileName ? Sc = e.fileName : e.stack ? Sc = (e.stack.match(/at\s+(.*?):\d+:\d+/) || ["", ""])[1] : e .sourceURL && (Sc = e.sourceURL) } let Pc = (Sc = -1 < Sc.indexOf("(") ? Sc.split("(")[1] : Sc).indexOf("SmartEarth.js"); Pc < 0 && (Pc = Sc.indexOf("SmartEarth.min.js")); let Ec, xc = (Ec = Pc < 0 ? (Pc = Sc.indexOf("Source/Main"), Sc.substring(0, Pc) + "Build/") : Sc.substring(0, Pc), document.getElementsByTagName("link")), Ic = !1; for (let e = 0; e < xc.length; e++) - 1 !== xc[e].href.indexOf("smartearth.css") && (Ic = !0); if (!Ic) { let e = document.createElement("link"); e.rel = "stylesheet", e.type = "text/css", e.href = Ec + "Workers/css/smartearth.css", document.head .appendChild(e) } Tc.SmartEarthRootUrl = Ec; let Dc = new se(!1); try { Tc.$ || Dc.addJs(document.body, Ec + "Workers/jquery-2.0.3.js"), Tc.layer || Dc.addJs(document.body, Ec + "Workers/layui/lay/modules/layer.js"), Tc.layuiLayer = Tc.layer, Tc.Cesium_turf || (Dc.addJs( document.body, Ec + "Workers/turf.min.js"), Tc.Cesium_turf = Tc.turf), Dc.addJs(document.body, Ec + "Workers/polyfill.min.js") } catch (e) {} function Lc(e, t) { this._viewer = e, this._cesium = t } function Mc(e, t) { this._viewer = e, this._cesium = t } function Ac(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Rc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Oc(e, t) { this._viewer = e, this._cesium = t } function Hc(e, t) { this._viewer = e, this._cesium = t } function Vc(e, t) { this._viewer = e, this._cesium = t } function kc(e, t) { this._viewer = e, this._cesium = t, this._zoomIn = new Lc(this._viewer, this._cesium), this._zoomOut = new Mc(this._viewer, this._cesium), this._flyTo = new dt(this._viewer, this._cesium, this._tree), this ._flyToObj = new Ac(this._viewer, this._cesium), this._jumpTo = new Rc(this._viewer, this._cesium, this ._tree), this._northfinger = new Oc(this._viewer, this._cesium), this._Stop = new Vc(this._viewer, this._cesium) } function Fc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Gc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Nc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Bc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function jc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function zc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Uc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } Tc.SmartEarthPopupData = {}, Tc.logSmartEarthLog = () => { var e = Tc.SmartEarth && Tc.SmartEarth.VERSION, t = Tc.SmartEarth && Tc.SmartEarth.COMPILETIME, i = Tc.Cesium && Tc.Cesium.VERSION; setTimeout(console.log.bind(console, ` %c %c 版 本 号:${e} Cesium版本:${i} 编译时间:${t} 授权信息:内部测试版本。 版权声明: SmartEarthSDK版权完全属于【合肥泰瑞数创科技有限公司】 在线示例:http://183.162.245.49:82/05sdkdemo-pro 接口文档:http://183.162.245.49:82/05sdkdemo-pro/static/api `, `font-size:50px;background:rgba(34,34,34,0.5) url('${Ec}Workers/image/logo.png')`, "color:#018aff;font-size:13px;font-family:微软雅黑"), 0) }, Lc.prototype.zoomIn = function() { var e = .6 * Math.ceil(this._viewer.camera.positionCartographic.height); return this._viewer.camera.zoomIn(e) }, Mc.prototype.zoomOut = function() { var e = .6 * Math.ceil(this._viewer.camera.positionCartographic.height); return this._viewer.camera.zoomOut(e) }, Ac.prototype.flyToObj = function(e) { if (e && null != e.west && null != e.west) this._viewer.camera.flyTo({ destination: this._cesium.Rectangle.fromDegrees(e.west, e.south, e.east, e.north) }); else { if (e && e.item && null != e.item.id && null != e.item.id) { var t = V.getSourceById(this._tree, e.item.id); try { var i = this._viewer.scene.primitives.get(t.id); this._viewer.flyTo(i) } catch (e) {} } var o, r, n, a, s; e && e.item ? e.item.entities ? this._viewer.flyTo(e.item) : e.item._primitives && e.item ._primitives.length ? 0 < (t = y.filter(e.item._primitives, function(e) { return null == e.geometryInstances })).length && (null != t[0]._boundingSpheres ? this._viewer.camera.flyToBoundingSphere(t[0] ._boundingSpheres[0]) : null != t[0]._primitive && null != t[0]._primitive && null != t[ 0]._primitive._boundingSpheres[0] && null != t[0]._primitive._boundingSpheres[0] ? this ._viewer.camera.flyToBoundingSphere(t[0]._primitive._boundingSpheres[0]) : null != t[0] ._labels && 0 < t[0]._labels.length ? (o = t[0]._labels[0].position, r = this._cesium .Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this ._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.flyTo({ destination: s })) : null != t[0]._pointPrimitives && 0 < t[0]._pointPrimitives.length ? (o = t[0] ._pointPrimitives[0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this ._cesium.Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.flyTo({ destination: s })) : null != t[0]._billboards && 0 < t[0]._billboards.length && (o = t[0]._billboards[ 0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium.Math .toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium .Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.flyTo({ destination: s }))) : e.item._primitives && e.item._primitives._boundingSpheres ? e.item._primitives ._boundingSpheres.length && this._viewer.camera.flyToBoundingSphere(e.item._primitives ._boundingSpheres[0]) : e.item._boundingSpheres && 0 < e.item._boundingSpheres.length ? this ._viewer.camera.flyToBoundingSphere(e.item._boundingSpheres[0]) : e.item._boundingVolumes && e .item._boundingVolumes.length ? (o = e.item._boundingVolumes[0].center, r = this._cesium .Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this ._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 5e3), this._viewer.camera.flyTo({ destination: s })) : e.item.boundingSphere ? this._viewer.camera.flyToBoundingSphere(e.item .boundingSphere) : this._viewer.flyTo(e.item) : e && (e.boundingSphere ? this._viewer.camera .flyToBoundingSphere(e.boundingSphere) : this._viewer.flyTo(e)) } }, Rc.prototype.jumpTo = function(e) { if (e && null != e.west && null != e.west) this._viewer.camera.setView({ destination: this._cesium.Rectangle.fromDegrees(e.west, e.south, e.east, e.north) }); else if (e && void 0 !== e.destination) this._viewer.camera.setView({ destination: e.destination, orientation: e.orientation }); else { if (e && e.item && null != e.item.id && null != e.item.id) { var t = V.getSourceById(this._tree, e.item.id); try { var i = this._viewer.scene.primitives.get(t.id); this._viewer.zoomTo(i) } catch (e) {} } var o, r, n, a, s; e && e.item ? e.item.entities ? this._viewer.zoomTo(e.item) : e.item._primitives && e.item ._primitives.length ? 0 < (t = y.filter(e.item._primitives, function(e) { return null == e.geometryInstances })).length && (null != t[0]._boundingSpheres ? this._viewer.camera.viewBoundingSphere(t[0] ._boundingSpheres[0]) : null != t[0]._labels && 0 < t[0]._labels.length ? (o = t[0] ._labels[0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium .Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this ._cesium.Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.setView({ destination: s })) : null != t[0]._pointPrimitives && 0 < t[0]._pointPrimitives.length ? (o = t[0] ._pointPrimitives[0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this ._cesium.Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.setView({ destination: s })) : null != t[0]._billboards && 0 < t[0]._billboards.length && (o = t[0]._billboards[ 0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium.Math .toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium .Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.setView({ destination: s }))) : e.item._primitives && e.item._primitives._boundingSpheres ? e.item._primitives ._boundingSpheres.length && this._viewer.camera.viewBoundingSphere(e.item._primitives ._boundingSpheres[0]) : e.item._boundingSpheres && 0 < e.item._boundingSpheres.length ? this ._viewer.camera.viewBoundingSphere(e.item._boundingSpheres[0]) : e.item._boundingVolumes && e .item._boundingVolumes.length ? (o = e.item._boundingVolumes[0].center, r = this._cesium .Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this ._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 5e3), this._viewer.camera.setView({ destination: s })) : this._viewer.zoomTo(e.item) : e && this._viewer.zoomTo(e) } }, Oc.prototype.northfinger = function() { this._viewer.camera.setView({ destination: this._viewer.camera._destination, orientation: { pitch: this._viewer.camera._pitch, roll: 0 } }) }, Hc.prototype.setPosition = function(e, t, i) { Math.abs(e) <= 180 && Math.abs(t) <= 90 ? this._viewer.camera.setView({ destination: this._cesium.Cartesian3.fromDegrees(e, t, i) }) : this._viewer.camera.setView({ destination: { x: e, y: t, z: i } }) }, Vc.prototype.Stop = function() { this._viewer.scene.camera.cancelFlight() }, kc.prototype.getPosition = function() { return this._getPosition || (this._getPosition = new et(this._viewer, this._cesium)), this._getPosition .getPosition() }, kc.prototype.getMousePosition = function(e, t, i, o, r) { return this._getPosition || (this._getPosition = new et(this._viewer, this._cesium)), this._getPosition .getMousePosition(e, t, i, o, r) }, kc.prototype.getDegrees = function() { return this._getPosition || (this._getPosition = new et(this._viewer, this._cesium)), this._getPosition .getDegrees() }, kc.prototype.getMouseDegrees = function(e, t, i, o, r) { return this._getPosition || (this._getPosition = new et(this._viewer, this._cesium)), this._getPosition .getMouseDegrees(e, t, i, o, r) }, kc.prototype.setPosition = function(e, t, i) { return this._setPosition || (this._setPosition = new Hc(this._viewer, this._cesium)), this._setPosition .setPosition(e, t, i) }, kc.prototype.zoomIn = function() { return this._zoomIn.zoomIn() }, kc.prototype.zoomOut = function() { return this._zoomOut.zoomOut() }, kc.prototype.flyTo = function(e, t) { return this._flyTo.flyTo(e, t) }, kc.prototype.flyToObj = function(e) { this._flyToObj.flyToObj(e) }, kc.prototype.jumpTo = function(e) { return this._jumpTo.jumpTo(e) }, kc.prototype.northfinger = function() { this._northfinger.northfinger() }, kc.prototype.flyToPosition = function(e, t, i) { this._flyTo.flyToPosition(e, t, i) }, kc.prototype.flyToPointsInterest = function(e, t) { this._flyTo.flyToPointsInterest(e, t) }, kc.prototype.Stop = function() { this._Stop.Stop() }, Fc.prototype.deleteItem = function(e) { V.delete(e, this._viewer, this._cesium) }, Fc.prototype.testTreeSource = function() { console.log(this._tree) }, Gc.prototype.findItem = function(e) { for (var t = "", i = y.clone(this._tree), o = e.split("\\"), r = 0; r < o.length; r++) if (i = V.getSourceByName(i, o[r]), r == o.length - 1) { if (i) { t = i.id; break } t = "" } else { if (!i) { t = "", i = null; break } i = i.children } return t }, Nc.prototype.getItemName = function(e) { e = V.getSourceById(this._tree, e); return e ? e.name : "" }, Bc.prototype.getVisibility = function(e) { e = V.getSourceById(this._tree, e); if (e) return e.item.getVisibility() }, jc.prototype.setVisibility = function(e, t) { V.setVisibility(e, t, this._viewer, this._cesium) }, zc.prototype.rename = function(e, t) { var i = V.getSourceById(this._tree, e), i = (i && (i.name = t), V.getTempSourceById(e)); i && (i.name = t) }, Uc.prototype.getNextItem = function(e, t) {}; var Wc = Object.freeze({ none: -1, point: 0, polyline: 1, polygon: 2, label: 3, imageLabel: 4, position: 5, imageLayer: 6, dynamicObject: 7, D3titles: 8, box: 9, circle: 10, cone: 11, pointfeaturelayer: 12, polylinefeaturelayer: 13, polygonfeaturelayer: 14, pointmodel: 15, rectangle: 16, ellipsoid: 17, wall: 18, polylinevolume: 19 }); function Yc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource(), this._treeSource = V.Source, this ._treeTemp = V.getTempSource(), this._tree1 = V, this._core = new f } function Qc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function qc(e, t) { this._viewer = e, this._cesium = t } function J(e, t, i) { this._viewer = e, this._cesium = t, this._tree = V.Source, this._createGroup = new it(this._viewer, this ._cesium, this._tree), this._deleteItem = new Fc(this._viewer, this._cesium, this._tree), this ._findItem = new Gc(this._viewer, this._cesium, this._tree), this._getItemName = new Nc(this._viewer, this._cesium, this._tree), this._getVisibility = new Bc(this._viewer, this._cesium, this._tree), this._setVisibility = new jc(this._viewer, this._cesium, this._tree), this._renameGroup = new zc(this ._viewer, this._cesium, this._tree), this._getNextItem = new Uc(this._viewer, this._cesium, this ._tree), this._isGroup = new Qc(this._viewer, this._cesium, this._tree), this._creator = new q(this ._viewer, this._cesium), this._getObject = new Yc(this._viewer, this._cesium), this._exportTree = new qc(this._viewer, this._cesium), this._core = new f, this.InitTree(i, 0), this .InitRootImageLayerAndTerrainlayer() } Yc.prototype.getObject = function(e) { var t = y.clone(this._tree), t = V.getSourceById(t, e); if (t) return t.item; t = y.clone(V.PointSelectSource), t = V.getPointSelectSourceById(t, e); return t ? t.item : void 0 }, Yc.prototype.getTreeItem = function(e) { var t = y.clone(this._tree), t = V.getSourceById(t, e); if (t) return t; for (var i = this._viewer.dataSources, o = 0; o < i.length; o++) { var r, n, a, s, l, u = i.get(o).entities.getById(e); if (u) { if (u.point && (null == u.point.show || u.point.show._value)) return (s = new k(this._viewer, this._cesium)).setItem(u), l = { id: this._core.getuid(), name: "", pId: 0, type: "point", item: s }, V.pusPointSelectSource(l), l; if (u.label && (null == u.label.show || u.label.show._value)) return (s = new F(this._viewer, this._cesium)).setItem(u), l = { id: this._core.getuid(), name: "", pId: 0, type: "label", item: s }, V.pusPointSelectSource(l), l; if (u.box && (null == u.box.show || u.box.show._value)) return (r = new R(this._viewer, this ._cesium)).setItem(u), l = { id: this._core.getuid(), name: "", pId: 0, type: "box", item: r }, V.pusPointSelectSource(l), l; if (u.model && (null == u.model.show || u.model.show._value)) return (s = new model(this ._viewer, this._cesium)).setItem(u), l = { id: this._core.getuid(), name: "", pId: 0, type: "model", item: s }, V.pusPointSelectSource(l), l; if (u.wall && (null == u.wall.show || u.wall.show._value)) return (r = new Ml(this._viewer, this ._cesium)).setItem(u), l = { id: this._core.getuid(), name: "", pId: 0, type: "wall", item: r }, V.pusPointSelectSource(l), l; if (u.polyline) return (n = new M(this._viewer, this._cesium)).setItem(u), l = { id: this._core.getuid(), name: "", pId: 0, type: "polyline", item: n }, V.pusPointSelectSource(l), l; if (u.polygon) return (n = new A(this._viewer, this._cesium)).setItem(u), l = { id: this._core.getuid(), name: "", pId: 0, type: "polygon", item: n }, V.pusPointSelectSource(l), l; if (u.rectangle) return (a = new O(this._viewer, this._cesium)).setItem(u), l = { id: this._core.getuid(), name: "", pId: 0, type: "rectangle", item: a }, V.pusPointSelectSource(l), l; if (u.billboard && (null == u.billboard.show || u.billboard.show._value)) return (s = new Ll( this._viewer, this._cesium)).setItem(u), l = { id: this._core.getuid(), name: "", pId: 0, type: "billboard", item: s }, V.pusPointSelectSource(l), l } } }, Yc.prototype.updateItemId = function(e, t) { var i = this._treeSource, o = V.getSourceById(i, e); if (o && (o.id = t, "group" == o.type && o.children && 0 < o.children.length)) for (var r = 0; r < o.children.length; r++) o.children[r].pId = t; i = this._treeTemp, o = V.getSourceById(i, e); if (o && (o.id = t, "group" == o.type && o.children && 0 < o.children.length)) for (r = 0; r < o.children.length; r++) o.children[r].pId = t }, Yc.prototype.unifiedProject = function(e, t) { for (var i = 0; i < t.length; i++) t[i].id = e[i].id, t[i].pId = t[i].pId, t[i].children && 0 < t[i] .children.length && this.unifiedProject(e[i].children, t[i].children) }, Yc.prototype.insertProjectTree = function(e, t, i, o, r) { var n, a, s, l = !0; return this._core.isnull(t) && (t = this._core.getuid()), l = 0 != r, Wc.none == i || Wc.position == i ? (s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "unknown", item: null }, V.insertGroupId(s, e)) : Wc.imageLayer == i ? (s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, checked: l, type: "unknown", item: null }, V.insertGroupId(s, e)) : Wc.dynamicObject == i ? (s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "unknown", item: null }, V.insertGroupId(s, e)) : Wc.point == i ? ((n = new k(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "point", item: n }, n.setTreeobj(s), V.insertGroupId(s, e)) : Wc.polyline == i ? ((r = new M(this._viewer, this ._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "polyline", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Wc.rectangle == i ? ((r = new O(this._viewer, this ._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "rectangle", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Wc.ellipsoid == i ? ((r = new Zi(this._viewer, this ._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "ellipsoid", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Wc.polygon == i ? (r = new A(this._viewer, this ._cesium), o._entity ? (r.setItem(o._entity), r._points = o._points) : r.setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "polygon", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Wc.wall == i ? ((r = new Ml(this._viewer, this ._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "wall", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Wc.polylinevolume == i ? ((r = new Il(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "polylinevolume", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Wc.pointmodel == i ? ((r = new S(this._viewer, this ._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "pointmodel", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Wc.label == i ? ((n = new F(this._viewer, this ._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "label", item: n }, n.setTreeobj(s), V.insertGroupId(s, e)) : Wc.imageLabel == i ? ((n = new Ll(this._viewer, this ._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, checked: l, type: "billboard", item: n }, n.setTreeobj(s), V.insertGroupId(s, e)) : Wc.D3titles == i ? ((r = new I(this._viewer, this ._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "3DTilesets", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Wc.box == i ? ((l = new R(this._viewer, this._cesium)) .setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "box", item: l }, l.setTreeobj(s), V.insertGroupId(s, e)) : Wc.circle == i ? ((n = new H(this._viewer, this ._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "circle", item: n }, n.setTreeobj(s), V.insertGroupId(s, e)) : Wc.cone == i ? ((r = new B(this._viewer, this._cesium)) .setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "cylinder", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Wc.pointfeaturelayer == i ? ((a = new C(this ._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "pointLayer", item: a }, V.insertGroupId(s, e)) : Wc.pointfeaturelayer == i ? ((a = new C(this._viewer, this._cesium)) .setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "polylineLayer", item: a }, V.insertGroupId(s, e)) : Wc.polygonfeaturelayer == i && ((a = new C(this._viewer, this ._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "polygonLayer", item: a }, V.insertGroupId(s, e)), s }, Qc.prototype.isGroup = function(e) { var t = y.clone(this._tree), t = V.getSourceById(t, e); return !(!t || "group" != t.type) }, qc.prototype.exportMethod = function(e) { for (var t, i = [], o = 0; o < e.length; o++) "function" == typeof e[o].item.export && (t = e[o].item .export(), i.push(t), e[o].children && e[o].children.length && (t = this.exportMethod(e[o] .children), i.push(t))); return i }, qc.prototype.export = function() { return this.exportMethod(V.Source) }, J.prototype.export = function() { var e = this._exportTree.export(), t = new Blob([JSON.stringify(e)], { type: "" }); return this._core.saveAs(t, "tree.json"), e }, J.prototype.createGroup = function(e, t, i) { return this._createGroup = new it(this._viewer, this._cesium), this._createGroup.createGroup(e, t, i) }, J.prototype.changeGroup = function(e, t) { this._createGroup.changeGroup(e, t) }, J.prototype.starttemporaryItem = function() { return this._createGroup.starttemporaryItem() }, J.prototype.pushtemporaryItem = function(e) { this._createGroup.pushtemporaryItem(e) }, J.prototype.pushStateItem = function(e) { this._createGroup.pushStateItem(e) }, J.prototype.endtemporaryItem = function() { this._createGroup.endtemporaryItem() }, J.prototype.deleteItem = function(e) { return this._deleteItem.deleteItem(e) }, J.prototype.findItem = function(e) { return this._findItem.findItem(e) }, J.prototype.getItemName = function(e) { return this._getItemName.getItemName(e) }, J.prototype.getObject = function(e) { return this._getObject.getObject(e) }, J.prototype.getTreeItem = function(e) { return this._getObject.getTreeItem(e) }, J.prototype.updateItemId = function(e, t) { return this._getObject.updateItemId(e, t) }, J.prototype.getVisibility = function(e) { return this._getVisibility.getVisibility(e) }, J.prototype.setVisibility = function(e, t) { return this._setVisibility.setVisibility(e, t) }, J.prototype.rename = function(e, t) { return this._renameGroup.rename(e, t) }, J.prototype.getNextItem = function(e, t) { return this._getNextItem.getNextItem(e) }, J.prototype.isGroup = function(e) { return this._isGroup.isGroup(e) }, Object.defineProperties(J.prototype, { exitsObjectType: { get: function() { return Wc } } }), J.prototype.insertProjectTree = function(e, t, i, o, r, n) { return this._core.isnull(e) && !this._core.isnull(this._tree.selectedItem) && "group" == this._tree .selectedItem.type && (e = this._tree.selectedItem.id), e = this._core.isnull(e) ? 0 : e, this._core .isnull(t) || (e = this.createGroup(t, !0, e)), this._getObject.insertProjectTree(e, i, o, r, n) }, J.prototype.exitsGroup = function(e, t) { return V.exitsGroup(e, t) }, J.prototype.getTreeSource = function() { var e = y.cloneDeep(V.getSource()); return V.removeItem(e) }, J.prototype.unifiedProject = function(e, t) { this._getObject.unifiedProject(e, t) }, J.prototype.clearn = function() { V.clearn() }, Object.defineProperties(J.prototype, { Source: { get: function() { return V.TempSource } } }), Object.defineProperties(J.prototype, { currentObj: { get: function() { return V.currentObj } } }), J.prototype.InitTree = function(e, t) { if (e && e.length) for (var i = 0; i < e.length; i++) { var o = e[i]; switch (o.type) { case "group": var r = this.createGroup(o.name, t); o.children && o.children.length && this.InitTree(o.children, r); break; case "label": this._creator.createLabel(o.position, o.text, o.option, t, o.description); break; case "imgLabel": this._creator.createImageLabel(o.position, o.imageLabel, t, o.description); break; case "polygon": this._creator.createPolygon(o.geometry, o.lineColor, o.altitudeType, t, o.description); break; case "polyline": this._creator.createPolyline(o.geometry, o.lineColor, o.altitudeType, t, o.description); break; case "box": this._creator.createBox(o.position, o.box, o.name, t, o.description); break; case "circle": this._creator.createCircle(o.position, o.circle, o.name, t, o.description); break; case "cone": this._creator.createCone(o.position, o.cylinder, o.name, o.description) } } }, J.prototype.InitRootImageLayerAndTerrainlayer = function() {}, Object.defineProperties(J.prototype, { selectedItem: { get: function() { return V.selectedItem }, set: function(e) { V.selectedItem = e } } }); var Jc = setTimeout(() => { Jc = void 0, logSmartEarthLog && logSmartEarthLog() }, 1e4); function Xc(e, t, i = {}, o, r) { this._core = new f, this._cesium = t || Cesium, Jc && (clearTimeout(Jc), Jc = void 0, logSmartEarthLog && logSmartEarthLog()), Cesium.Ion.defaultAccessToken = i.defaultAccessToken || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwYWRlZDhiNi1hZTljLTQ4MWItYjdjNS0xYTkyMjk2YzdlOTQiLCJpZCI6NjcxNTksImlhdCI6MTYzMTU4NDY2NX0.l2kHF0uC2pTgJYwzQGpEBj6HCCdbYfRThEbXajcXOI8"; var a = { toolbar: !1, baseLayerPicker: !1, shadows: !1, skyAtmosphere: new this._cesium.SkyAtmosphere, terrainShadows: this._cesium.ShadowMode.ENABLED, shouldAnimate: !0, animation: !0, fullscreenButton: !1, geocoder: !1, homeButton: !1, infoBox: !1, selectionIndicator: !1, timeline: !1, navigationHelpButton: !1, imageryProviderViewModels: [], terrainProviderViewModels: [], contextOptions: { webgl: { preserveDrawingBuffer: !0 }, failIfMajorPerformanceCaveat: !1 }, navigation: !0, disableRightClickMenu: !0 }; if ("string" == typeof i ? a.imageryProvider = new this._cesium.SingleTileImageryProvider({ url: i }) : (i.url && (a.imageryProvider = new this._cesium.SingleTileImageryProvider({ url: i.url })), this._core.extend(a, i, !0)), a.baseLayerPicker) { let t = this.getAllImageryView(); if (a.basemaps) a.basemaps.forEach(e => { a.imageryProviderViewModels.push(t[e]) }); else for (var n in t) a.imageryProviderViewModels.push(t[n]) } else a.imageryProvider || (a.imageryProvider = new Cesium.ArcGisMapServerImageryProvider({ name: "ArcGisMapServer", url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" })); t = { destination: this._cesium.Cartesian3.fromDegrees(i.x || 110, i.y || 32, i.z || 8e6), orientation: { heading: this._cesium.Math.toRadians(this._core.defaultValue(i.heading, 0)), pitch: this._cesium.Math.toRadians(this._core.defaultValue(i.pitch, -90)), roll: this._cesium.Math.toRadians(this._core.defaultValue(i.roll, 0)) }, duration: i.duration || .5 }; if (i.removeGlobe && (a.skyBox = !1, a.skyAtmosphere = !1, a.contextOptions = { failIfMajorPerformanceCaveat: !1, webgl: { alpha: !0, preserveDrawingBuffer: !0 } }), this._Viewer = new this._cesium.Viewer(e, a), this._Viewer.scene, this._tree = o, this._Viewer.scene .globe.baseColor = this._cesium.Color.WHITE, this._Viewer.shadowMap.size = 2048, this._Viewer ._cesiumWidget._creditContainer.style.display = "none", this._Viewer.terrainShadows = this._cesium .ShadowMode.RECEIVE_ONLY, this._AttachEvent = void 0, this._DetachEvent = void 0, this._Analysis = void 0, this._Navigate = void 0, this._Creator = void 0, this._Command = void 0, this._ProjectTree = void 0, this._Coordinate = void 0, this._VectorTileProvider = void 0, this.toolbar = i.toolbar, i .removeGlobe ? (this._Viewer.imageryLayers.removeAll(), this._Viewer.shadows = !1, this._Viewer.scene .fog.enabled = !1, this._Viewer.scene.globe.show = !1, this._Viewer.scene.backgroundColor = Cesium .Color.fromCssColorString("rgba(0,0,0,0)"), this._Viewer.scene.light = new Cesium.DirectionalLight({ direction: new Cesium.Cartesian3(.35492591601301104, -.8909182691839401, - .2833588392420772), intensity: 10 }), i.backgroundImage && (this._Viewer.container.style.backgroundImage = "url(" + i .backgroundImage + ")")) : this._Viewer.scene.globe.depthTestAgainstTerrain = !0, this.Navigate .flyToPointsInterest(t, r), this._Viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this ._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this._Viewer.extend(Cesium .viewerCesiumInspectorMixin), a.maxViewHeight && (this._Viewer.scene.screenSpaceCameraController .maximumZoomDistance = a.maxViewHeight), a.minViewHeight || a.maxViewPitch) { this.minViewHeight = a.minViewHeight, this.maxViewPitch = a.maxViewPitch && Cesium.Math.toRadians(a .maxViewPitch); let r = 0, n = this._Viewer.scene, t = !1; if (this.maxViewPitch) { let e = new Cesium.ScreenSpaceEventHandler(this._Viewer.scene.canvas); e.setInputAction(() => { t = !0 }, Cesium.ScreenSpaceEventType.MIDDLE_DOWN), e.setInputAction(() => { t = !1 }, this._cesium.ScreenSpaceEventType.MIDDLE_UP), e.setInputAction(() => { t = !0 }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), e.setInputAction(() => { t = !1 }, this._cesium.ScreenSpaceEventType.RIGHT_UP) } this._Viewer.scene.preRender.addEventListener(() => { let i = this._Viewer.camera; if (i && i.positionCartographic) { if (this.maxViewPitch) { let e = i.pitch; t && e > this.maxViewPitch ? (e = this.maxViewPitch, i.setView({ destination: this.oldPosition || i.position.clone(), orientation: { heading: i.heading, pitch: e, roll: 0 } })) : this.oldPosition = i.position.clone() } if (this.minViewHeight) { var o = n.globe.getHeight(i.positionCartographic); r = o || r; let e, t; o = i.positionCartographic.height - r, o = (t = this._Viewer.scene.globe .translucency.enabled || this._Analysis && (this._Analysis ._UndergroundMode && this._Analysis._UndergroundMode .isUndergroundMode || this._Analysis._StreetView && this._Analysis ._StreetView.isStreetView) ? (e = i.positionCartographic.height < -200, -200) : (e = o < this.minViewHeight, r + this.minViewHeight), i.pitch < 0 ? i.pitch : 0); e ? i.setView({ destination: this.oldPosition || this._cesium.Cartesian3.fromRadians(i .positionCartographic.longitude, i.positionCartographic .latitude, t), orientation: { heading: i.heading, pitch: o, roll: 0 } }) : this.oldPosition = i.position.clone() } } }) } if (Object.defineProperties(Cesium.Model.prototype, { _cachedGltf: { configurable: !0, set: function(e) { var a, t, s; this._vtxf_cachedGltf = e, this._vtxf_cachedGltf && this._vtxf_cachedGltf._gltf && ( a = this._vtxf_cachedGltf._gltf).extensionsUsed && a.extensionsRequired && ( e = a.extensionsUsed.indexOf("KHR_technique_webgl"), t = a .extensionsRequired.indexOf("KHR_technique_webgl"), -1 !== e && (a .extensionsRequired.splice(t, 1, "KHR_techniques_webgl"), a .extensionsUsed.splice(e, 1, "KHR_techniques_webgl"), a.extensions = a .extensions || {}, a.extensions.KHR_techniques_webgl = {}, a.extensions .KHR_techniques_webgl.programs = a.programs, a.extensions .KHR_techniques_webgl.shaders = a.shaders, a.extensions .KHR_techniques_webgl.techniques = a.techniques, s = a.extensions .KHR_techniques_webgl.techniques, a.materials.forEach(function(e, t) { a.materials[t].extensions.KHR_technique_webgl.values = a .materials[t].values, a.materials[t].extensions .KHR_techniques_webgl = a.materials[t].extensions .KHR_technique_webgl; var i, o = a.materials[t].extensions.KHR_techniques_webgl; for (i in o.values) { var r, n = s[o.technique].uniforms; for (r in n) if (n[r] === i) { o.values[r] = o.values[i], delete o.values[i]; break } } }), s.forEach(function(e) { for (var t in e.attributes) { var i = e.attributes[t]; e.attributes[t] = e.parameters[i] } for (var o in e.uniforms) { i = e.uniforms[o]; e.uniforms[o] = e.parameters[i] } }))) }, get: function() { return this._vtxf_cachedGltf } } }), Cesium.Resource && (Cesium.loadText = Cesium.Resource.fetchText, Cesium.loadJson = Cesium.Resource .fetchJson, Cesium.loadBlob = Cesium.Resource.fetchBlob, Cesium.loadArrayBuffer = Cesium.Resource .fetchArrayBuffer, Cesium.loadImage = Cesium.Resource.fetchImage), Cesium.isArray || (Cesium .isArray = Array.isArray), a.navigation) { if (!Cesium.viewerCesiumNavigationMixin) { let e = new se(!1); e.addJs(document.body, window.SmartEarthRootUrl + "Workers/viewerCesiumNavigationMixin.js") } e = { defaultResetView: Cesium.Rectangle.fromDegrees(80, 22, 130, 50), enableCompass: !0, enableZoomControls: !0, enableDistanceLegend: !0, enableCompassOuterRing: !0 }; this._Viewer.extend(Cesium.viewerCesiumNavigationMixin, i.navigationOption || e) } a.disableRightClickMenu && (document.oncontextmenu = function() { return !1 }); o = this._Viewer; if (o.cesiumWidget._supportsImageRenderingPixelated && window && window.devicePixelRatio) { for (var s = window.devicePixelRatio; 2 <= s;) s /= 2; o.resolutionScale = s } o.scene.postProcessStages.fxaa.enabled = !0, this._Viewer.scene.light = new Cesium.DirectionalLight({ direction: new Cesium.Cartesian3(.35492591601301104, -.8909182691839401, -.2833588392420772), intensity: 10 }); var c = this; function h(t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(u(t, i), function(e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise } function l(e, t) { for (var i = e.tilingScheme, o = i.positionToTileXY(t, 0), e = c._Viewer.scene.globe._surface .tileProvider.quadtree._levelZeroTiles, r = e[0].x == o.x && e[0].y == o.y ? e[0] : e[1], n = 1; n < 22; n++) { var a = function(e, t) { for (var i = 0; i < e.children.length; i++) if (e.children[i].state >= Cesium.QuadtreeTileLoadState.DONE && (null != e.children[i] .data.terrainData._mesh || null != e.children[i].data.terrainData._buffer) && e .children[i].x == t.x && e.children[i].y == t.y) return e.children[i] }(r, o = i.positionToTileXY(t, n)); if (null == a) break; r = a } return r } function m(e) { var t; for ($.grep(c._Viewer.scene.primitives._primitives, function(e) { return e instanceof Cesium.Cesium3DTileset }), t = 0; t < e.length; ++t) { var i = e[t], o = i instanceof Cesium.Cartographic, r = o ? i : Cesium.Cartographic.fromCartesian(i); r.height = c.G, o || (o = Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude, r.latitude, r .height ])[0], i.z = o.z) } return e } function u(e, t) { for (var i = 0; i < t.length; ++i) { var o = t[i], r = l(e, o); o.height = r.data.terrainData.interpolateHeight(r.rectangle, o.longitude, o.latitude) } return t } function d(e) { this.value = new Float32Array([e]) } c.G = 65535, d.fromZBias = function(e) { if (Cesium.defined(e)) return new d(e); throw new DeveloperError("zbias is required.") }, d.toValue = function(e, t) { if (Cesium.defined(e)) return Cesium.defined(t) ? color.toBytes(t) : new Float32Array(e); throw new DeveloperError("zbias is required.") }, d.equals = function(e, t) { return e === t || Cesium.defined(e) && Cesium.defined(t) && e.value[0] === t.value[0] }, d.defaultBias = function() { return d.fromZBias(15e-6) }, this._cesium.ZBiasGeometryInstanceAttribute = d, this._cesium.SampleRenderedDataFlags = { TERRAIN: 2, MESH: 4, FLOOR: 8 }, this._cesium.DynamicEyeOffset = function(e) { return void 0 === e && (e = 0), new Cesium.Cartesian3(.001234321, 0, e) }, this._cesium.sampleRenderedData = function(r, e) { var t, i = 2, o = 4, n = 8, a = (null == e && (e = i | o), Cesium.when.defer()), s = [], l = (i < e ? r.forEach(function(e) { s.push(Cesium.Cartographic.fromRadians(e.longitude, e.latitude, e.height)) }) : s = r, []), u = (e & i && l.push(h(c._Viewer.terrainProvider, r)), 0 < (e & n)); return e & (o | n) && l.push((i = s, Cesium.Check.defined("positions", i), t = Cesium.when.defer(), Cesium.when(m(i), function(e) { t.resolve(e) }), t.promise)), Cesium.when.all(l).then(function(e) { if (1 < l.length) for (var t = 0; t < r.length; t++) { var i = e[0][t], o = e[1][t]; o.height != c.G && (i.height < o.height || u) && (i.height = o.height) } a.resolve(e[0]) }), a.promise }, this._cesium.sampleRenderedMesh = function(e, t) { Cesium.Check.defined("positions", e); var i = Cesium.when.defer(); return Cesium.when(m(e), function(e) { i.resolve(e) }), i.promise }, this._cesium.sampleRenderedTerrain = function(t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(u(t, i), function(e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise }, this._cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo = function() { var e, t = this.getRenderedLevelInfo(), i = 0; for (e in t) i < Number(e) && (i = Number(e)); return { bestLevel: i, count: t[i] } }, this._cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo = function() { var t = []; return this._tilesToRender.forEach(function(e) { null == t[e.level] && (t[e.level] = 0), t[e.level]++ }), t } } function Kc(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } Xc.prototype.getAllImageryView = function() { return { arcgis_img: new Cesium.ProviderViewModel({ name: "ArcGIS影像", tooltip: "ArcGIS影像", iconUrl: window.SmartEarthRootUrl + "Workers/image/baseLayer/arcgis_img.png", creationFunction: () => new Cesium.ArcGisMapServerImageryProvider({ url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" }) }), arcgis_dark: new Cesium.ProviderViewModel({ name: "蓝色底图", tooltip: "蓝色底图", iconUrl: window.SmartEarthRootUrl + "Workers/image/baseLayer/arcgis_dark.png", creationFunction: () => new Cesium.ArcGisMapServerImageryProvider({ url: "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer", enablePickFeatures: !1, usePreCachedTilesIfAvailable: !1, tilingScheme: this.Core.getOffsetTilingScheme() }) }) } }, Object.defineProperties(Xc.prototype, { Analysis: { get: function() { return null == this._Analysis && (this._Analysis = new L(this._Viewer, this._cesium)), this._Analysis } }, Navigate: { get: function() { return null == this._Navigate && (this._Navigate = new kc(this._Viewer, this._cesium, this._tree)), this._Navigate } }, Creator: { get: function() { return null == this._Creator && (this._Creator = new q(this._Viewer, this._cesium)), this._Creator } }, Core: { get: function() { return null == this._Core && (this._Core = new f), this._Core } }, Command: { get: function() { return null == this._Command && (this._Command = new _o(this._Viewer, this._cesium)), this._Command } }, ProjectTree: { get: function() { return null == this._ProjectTree && (this._ProjectTree = new J(this._Viewer, this ._cesium, this._tree)), this._ProjectTree } }, tree: { get: function() { return this._tree } }, Viewer: { get: function() { return this._Viewer } }, toolbar: { get: function() { return "block" === this._Viewer._toolbar.style.display }, set: function(e) { this._Viewer._toolbar.style.display = e ? "block" : "none" } }, wireframe: { get: function() { return this._Viewer.cesiumInspector.viewModel.wireframe }, set: function(e) { this._Viewer.cesiumInspector.viewModel.wireframe = e } }, tileCoordinates: { get: function() { return this._Viewer.cesiumInspector.viewModel.tileCoordinates }, set: function(e) { this._Viewer.cesiumInspector.viewModel.tileCoordinates = e } } }), Xc.prototype.navControl = function(e, t) { t = t ? "" : "none"; this._Viewer.cesiumNavigation && ("all" === e ? this._Viewer.cesiumNavigation.container.style.display = t : "nav" === e ? this._Viewer.cesiumNavigation.navigationDiv.style.display = t : this._Viewer .cesiumNavigation.distanceLegendDiv.style.display = t) }, Xc.prototype.CreateWfs = function(e, t, i, o, r, n, a, s, l) { return new U(e, t, i, o, r, n, a, s, l) }, Xc.prototype.AttachEvent = function(e, t) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachEvent(e, t) }, Xc.prototype.RemoNormalCesiumLeftDoubleClick = function() { return null == this._DetachEvent && (this._DetachEvent = new bc(this._Viewer, this._cesium)), this ._DetachEvent.RemoNormalCesiumLeftDoubleClick() }, Xc.prototype.AttachOnLButtonDblClkEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachOnLButtonDblClkEvent(e) }, Xc.prototype.AttachOnLButtonDownEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachOnLButtonDownEvent(e) }, Xc.prototype.AttachOnLButtonUpEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachOnLButtonUpEvent(e) }, Xc.prototype.AttachOnMButtonDblClkEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachOnMButtonDblClkEvent(e) }, Xc.prototype.AttachOnMButtonDownEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachOnMButtonDownEvent(e) }, Xc.prototype.AttachOnMButtonUpEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachOnMButtonUpEvent(e) }, Xc.prototype.AttachOnMouseWheelEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachOnMouseWheelEvent(e) }, Xc.prototype.AttachOnFrameEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachOnFrameEvent(e) }, Xc.prototype.AttachOnRButtonDownEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachOnRButtonDownEvent(e) }, Xc.prototype.AttachOnRButtonUpEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachOnRButtonUpEvent(e) }, Xc.prototype.AttachCameraChangeEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.AttachCameraChangeEvent(e) }, Xc.prototype.CameraMoveEndEvent = function(e) { return null == this._AttachEvent && (this._AttachEvent = new wc(this._Viewer, this._cesium)), this ._AttachEvent.CameraMoveEndEvent(e) }, Xc.prototype.DetachEvent = function(e, t) { return null == this._DetachEvent && (this._DetachEvent = new bc(this._Viewer, this._cesium)), this ._DetachEvent.DetachEvent(e, t) }, Xc.prototype.DetachEventAll = function(e) { return null == this._DetachEvent && (this._DetachEvent = new bc(this._Viewer, this._cesium)), this ._DetachEvent.DetachEventAll(e) }, Xc.prototype.DetachCameraChangeEvent = function(e) { return null == this._DetachEvent && (this._DetachEvent = new bc(this._Viewer, this._cesium)), this ._DetachEvent.DetachCameraChangeEvent(e) }, Kc.prototype.deleteItem = function(e) {}; var $c = function(e, t) { if (Array.isArray(e)) return e; if (Symbol.iterator in Object(e)) { var i = t, o = [], r = !0, t = !1, n = void 0; try { for (var a, s = e[Symbol.iterator](); !(r = (a = s.next()).done) && (o.push(a.value), !i || o .length !== i); r = !0); } catch (e) { t = !0, n = e } finally { try { !r && s.return && s.return() } finally { if (t) throw n } } return o } throw new TypeError("Invalid attempt to destructure non-iterable instance") }, Zc = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; function eh(e) { if (Array.isArray(e)) { for (var t = 0, i = Array(e.length); t < e.length; t++) i[t] = e[t]; return i } return Array.from(e) } function th(e, t, i) { this._viewer = e, this._cesium = t, this._viewer = null, this._Cesium = i.Cesium, this._url = i.url, this ._urlParams = i.urlParams, this._urlTemplate = this._url + "?" + this._serialize(this._urlParams), this ._rectangle = i.rectangle, this._maximumLevel = i.maximumLevel || 19, this._minimumLevel = i .minimumLevel || 1, this._tilingScheme = i.tilingScheme || new this._Cesium.GeographicTilingScheme, this ._tileRangeByLevel = {}, this._moveEndTimestamp = null, this._isRemoved = !1, this._isCameraMoving = !1, this._propertyToBeFiltered = null, this._valuesToBeFiltered = null, this._primitiveByTile = {}, this ._tileKeys = [], this._lowerLevelLimit = i.lowerLevelLimit || 1, this._upperLevelLimit = i .upperLevelLimit || null, this._cameraMoveEndHandler = this._cameraMoveEndHandler.bind(this), this ._cameraMoveStartHandler = this._cameraMoveStartHandler.bind(this), this.heightById = {}; for (var o = this._radianToDegree(this._rectangle.west), r = this._radianToDegree(this._rectangle.south), n = this._radianToDegree(this._rectangle.east), a = this._radianToDegree(this._rectangle.north), s = this._minimumLevel; s <= this._maximumLevel; s++) { var l = this._lonLatToTileInWGS84([o, r], s), u = this._lonLatToTileInWGS84([n, a], s), c = Math.min(l[0], u[0]), h = Math.max(l[0], u[0]), m = Math.min(l[1], u[1]), l = Math.max(l[1], u[1]); this._tileRangeByLevel[s] = { minCol: m, maxCol: l, minRow: c, maxRow: h } } this._tileRangeByLevel[0] = { minCol: 0, maxCol: 0, minRow: 0, maxRow: 0 }, this._primitiveCollection = new this._Cesium.PrimitiveCollection, this._stop = !1 } function ih() { this._quadtree = void 0, this._tilingScheme = new Cesium.GeographicTilingScheme, this._errorEvent = new Cesium.Event, this._loadTileEvent = new Cesium.Event, this._levelZeroMaximumError = Cesium .TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid, 128, this._tilingScheme.getNumberOfXTilesAtLevel(0)), this._tileCache = [], this ._primitivesWaitingToBeAddedToTheScene = [], this._pauseStreaming = !1, this._numTilesInLevel = [], this .STREAM_SPEED_IMIDIATE = 0, this.STREAM_SPEED_FAST = 1, this.STREAM_SPEED_NORMAL = 2, this .STREAM_SPEED_SLOW = 3, this._streamSpeed = this.STREAM_SPEED_NORMAL } function oh(e, i) { $.each(e._primitives, function(e, t) { if (t instanceof Cesium.BillboardCollection) return e = ch.indexOf(t = t), t._parentCollection ._primitiveOld = i, -1 !== e ? (viewer.scene.primitives.remove(ch[e]._parentCollection), ch[e] = t) : ch.push(t), !1 }) } function rh(e, t) { viewer.scene.primitives.remove(t), e._onDestroyTilePrimitive = function() { viewer.scene.primitives.remove(t), this._onDestroyTilePrimitive = void 0 } } function nh(e, t, i) { Cesium.when.all(e, function() { viewer.scene.primitives.remove(i) }), t._onDestroyTilePrimitive = function() { viewer.scene.primitives.remove(i), this._onDestroyTilePrimitive = void 0 } } function ah(e, t) { nh($.map(e._primitives, function(e) { return e.readyPromise }), e, t) } function sh(e, t) { nh($.map(e._primitives[0]._primitives, function(e) { return e.readyPromise }), e, t) } function lh(e, t) { viewer.scene.primitives.remove(t) } function uh(e, t) { nh([e.readyPromise], e, t) } th.prototype._serialize = function(e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : Zc(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))): i .push(o(t) + "=" + o(e[t])) } return i.join("&") }, th.prototype._fetch = function(r) { var n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; return new Promise(function(t, i) { var o = new XMLHttpRequest; if (o.open(n.method || "GET", r), n.headers) for (var e in n.headers) o.setRequestHeader(e, n.headers[e]); o.onload = function() { if (4 === o.readyState && 200 === o.status) try { var e = JSON.parse(o.responseText); t(e) } catch (e) { i(new Error("INVALID RESPONSE")) } }, o.onerror = function(e) { i(e) }, o.onloadend = function(e) { 200 !== e.target.status && i(new Error("[" + e.target.status + "]request failed: " + r)) }, o.send(n.body || null) }) }, th.prototype._lonLatToTileInWGS84 = function(e, t) { var e = $c(e, 2), i = e[0], e = e[1]; return [Math.floor(Math.pow(2, t) * (90 - e) / 180), Math.floor(Math.pow(2, t) * (180 + i) / 180)] }, th.prototype._radianToDegree = function(e) { return e / Math.PI * 180 }, th.prototype._isTileInRange = function(e) { try { var t = this._tileRangeByLevel[e.level], i = t.minCol, o = t.maxCol, r = t.minRow, n = t.maxRow; return e.x >= i && e.x <= o && e.y >= r && e.y <= n } catch (e) { return !1 } }, th.prototype._cameraMoveStartHandler = function() { this._isCameraMoving = !0 }, th.prototype._loadTile = function(e) { var r = [], n = new this._Cesium.ColorGeometryInstanceAttribute(.75, .75, .75, 1), a = this; return e.features.forEach(function(e) { if (a._propertyToBeFiltered && Array.isArray(a._valuesToBeFiltered)) { var t = e.properties[a._propertyToBeFiltered]; if (a._valuesToBeFiltered.includes(t)) return } var o, t = e.geometry.type; "Polygon" === t || "MultiPolygon" === t ? (o = [], a.heightById[e.properties.house_id] = e .properties.height, e.geometry.coordinates.forEach(function(e, i) { o.push([]), e.forEach(function(e) { var t; 2 < e.length ? e.forEach(function(e) { var t; 2 <= e.length && (t = o[i]).push.apply(t, eh(e)) }) : (t = o[i]).push.apply(t, eh(e)) }); var e = new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3 .fromDegreesArray(o[i])), t = a._Cesium.BoundingSphere.fromPoints(e.positions).center, t = a._viewer.scene.globe.getHeight(a._Cesium.Cartographic .fromCartesian(t)) || 0, e = new a._Cesium.PolygonGeometry({ polygonHierarchy: e, height: t, vertexFormat: a._Cesium.PerInstanceColorAppearance .VERTEX_FORMAT, extrudedHeight: 1e3 }), t = new a._Cesium.GeometryInstance({ geometry: e, attributes: { color: n } }); r.push(t) })) : console.warn('GeoJSONVectorTileProvider: geometry type "' + e.geometry.type + '" detected, but is not going to be rendered') }), new this._Cesium.Primitive({ allowPicking: !1, appearance: new this._Cesium.PerInstanceColorAppearance({ translucent: !1 }), geometryInstances: r }) }, th.prototype._cameraMoveEndHandler = function() { var i, o, e, t, r, n, a, s, l; this._stop || (i = this, o = Date.now(), t = (e = this._viewer.scene.globe._surface._tilesToRender).map( function(e) { return e.level }), r = Math.min.apply(Math, eh(t)), (n = Math.max.apply(Math, eh(t))) < this ._lowerLevelLimit && (i._tileKeys = [], i._removeObsoletePrimitives(i._primitiveByTile, []), e = []), this._upperLevelLimit && r > this._upperLevelLimit && (i._tileKeys = [], i ._removeObsoletePrimitives(i._primitiveByTile, []), e = []), (e = 2 < n - r ? e.filter( function(e) { return e.level >= n - 2 }) : e).sort(function(e, t) { return -(e.level - t.level) }), e = e.filter(function(e) { return i._isTileInRange(e) }), this._upperLevelLimit && (e = this._refineTiles(e, this._upperLevelLimit)), this ._isCameraMoving = !1, this._moveEndTimestamp = o, a = [], l = s = 0, e.forEach(function(e) { var t = "z" + e.level + "x" + e.x + "y" + e.y; a.push(t), i._tileKeys.push(t), i._primitiveByTile[t] || (e = i._urlTemplate.replace( window.encodeURIComponent("{x}"), e.x).replace(window.encodeURIComponent( "{y}"), e.y).replace(window.encodeURIComponent("{z}"), e.level), s++, i ._fetch(e).then(function(e) { if (i._isRemoved) throw new Error("DISCARD"); if (i._isCameraMoving) throw new Error("DISCARD"); if (o !== i._moveEndTimestamp) throw new Error("DISCARD"); e = i._loadTile(e); i._primitiveCollection.add(e), i._primitiveByTile[t] = e, s <= ++l && (i ._tileKeys = a, i._removeObsoletePrimitives(i._primitiveByTile, a)) }).catch(function(e) { s <= ++l && (i._tileKeys = a, i._removeObsoletePrimitives(i ._primitiveByTile, a)), e.message })) })) }, th.prototype._refineTiles = function(e, s) { var l = [], u = []; return e.forEach(function(e) { var t = "Z" + e.level + "X" + e.x + "Y" + e.y; if (e.level < s - 1) u.includes(t) || (l.push(e), u.push(t)); else if (e.level === s - 1) for (var i = 0; i < 2; i++) for (var o = 0; o < 2; o++) { var r = "Z" + (e.level + 1) + "X" + (2 * e.x + i) + "Y" + (2 * e.y + o); u.includes(r) || (l.push({ x: 2 * e.x + i, y: 2 * e.y + o, level: e.level + 1 }), u.push(r)) } else { var n, a = e.level - s; 0 == a ? u.includes(t) || (l.push(e), u.push(t)) : (t = 2 * a, a = Math.floor(e .x / t), t = Math.floor(e.y / t), u.includes(n = "Z" + s + "X" + a + "Y" + t) || (l.push({ x: a, y: t, level: s }), u.push(n))) } }), l }, th.prototype._removeObsoletePrimitives = function(e, t) { var i, o = []; for (i in 0 < t.length && (o = t), e) o.includes(i) || this._primitiveCollection.remove(e[i]) && delete e[i] }, th.prototype.addTo = function(e) { this._viewer = e, this._viewer.scene.primitives.add(this._primitiveCollection), this._isRemoved = !1, this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler), this._viewer.camera .moveStart.addEventListener(this._cameraMoveStartHandler), this._cameraMoveEndHandler() }, th.prototype.remove = function() { if (this._viewer) { for (var e in this._primitiveByTile) this._viewer.scene.primitives.remove(this._primitiveByTile[e]); this._primitiveByTile = {}, this._viewer.camera.moveEnd.removeEventListener(this ._cameraMoveEndHandler), this._viewer.camera.moveStart.removeEventListener(this ._cameraMoveStartHandler), this._viewer = null, this._isRemoved = !0 } }, th.prototype.setStatus = function(e) { this._stop = e }, th.prototype.isRemoved = function() { return this._isRemoved }, th.prototype.filterBy = function(e, t, i) { this._propertyToBeFiltered = e, this._valuesToBeFiltered = t }, th.prototype.removeFilter = function() { this._propertyToBeFiltered = null, this._valuesToBeFiltered = null }, Object.defineProperties(ih.prototype, { quadtree: { get: function() { return this._quadtree }, set: function(e) { this._quadtree = e } }, ready: { get: function() { return !0 } }, tilingScheme: { get: function() { return this._tilingScheme } }, errorEvent: { get: function() { return this._errorEvent } }, loadTileEvent: { get: function() { return this._loadTileEvent } }, pauseStreaming: { get: function() { return this._pauseStreaming }, set: function(e) { this._pauseStreaming = e } }, streamSpeed: { get: function() { return this._streamSpeed }, set: function(e) { this._streamSpeed = e } }, bestLevelAvailable: { get: function() { for (var e = 0, t = 0; t < 22; t++) null != this._numTilesInLevel[t] && 0 < this ._numTilesInLevel[t] && e < t && (e = t); return e } } }), ih.prototype.streamSpeedFactor = function() { switch (this._streamSpeed) { case this.STREAM_SPEED_FAST: return 1; case this.STREAM_SPEED_NORMAL: return 3; case this.STREAM_SPEED_SLOW: return 20; default: return 3 } }; var ch = [], hh = 0, mh = !(ih.prototype.onPreFrame = function(e, t) { if (hh++, !this._pauseStreaming) { if (this._streamSpeed == this.STREAM_SPEED_IMIDIATE) for (; 0 < this._primitivesWaitingToBeAddedToTheScene.length;) { var i = this._primitivesWaitingToBeAddedToTheScene.pop(); e.primitives.add(i) } else 0 < this._primitivesWaitingToBeAddedToTheScene.length && hh % this .streamSpeedFactor() == 0 && ((i = this._primitivesWaitingToBeAddedToTheScene.pop()) ._instanceIds && 100 < i._instanceIds.length && this.streamSpeed === this .STREAM_SPEED_FAST && (this.streamSpeed = this.STREAM_SPEED_NORMAL), e.primitives .add(i)); $.each(ch, function(e, t) { t.ready && viewer.scene.primitives.remove(t._parentCollection._primitiveOld) }) } }), dh = (ih.prototype.initialize = function(e) { mh || (viewer.scene.preRender.addEventListener(this.onPreFrame, this), mh = !0) }, ih.prototype.beginUpdate = function(e) { this.quadtree.beginFrame(e) }, ih.prototype.endUpdate = function(e) { var t = this; e.afterRender.push(function() { t.quadtree.endFrame(e) }) }, ih.prototype.updateForPick = function(e) {}, ih.prototype.getLevelMaximumGeometricError = function( e) { return this._levelZeroMaximumError / (1 << e) * this._quadtree.maximumScreenSpaceError }, Math.PI, ih.prototype.placeHolder = function(e, t) { t = t || Cesium.Color.fromBytes(0, 255, 0, 255); t = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleOutlineGeometry({ rectangle: e.rectangle, height: viewer.camera.positionCartographic.height - .99 * TerraExplorer.internal.Navigate.HeightAboveGround }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(t) } }), appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }) }); e.data.primitive.add(t) }, ih.prototype.loadTile = function(e, t) { var i = this; null == this._numTilesInLevel[t._level] && (this._numTilesInLevel[t._level] = 0), this ._numTilesInLevel[t._level]++, t.state === Cesium.QuadtreeTileLoadState.START && (t.data = { primitive: new Cesium.PrimitiveCollection, wfsLayerData: [], id: Cesium.createGuid(), freeResources: function() { if (i._tileCache[t.data.id] && i._numTilesInLevel[t._level]--, i ._numTilesInLevel[t._level] < 0 && (i._numTilesInLevel[t._level] = 0), Cesium.defined(this.wfsLayerData)) { for (var e in this.wfsLayerData) Cesium.defined(this.wfsLayerData[e]) && this.wfsLayerData[e].freeResources(); this.wfsLayerData = void 0 } Cesium.defined(this.primitive) && (this.primitive.destroy(), this.primitive = void 0), delete i._tileCache[t.data.id] } }, this._tileCache[t.data.id] = t, Math.abs(6371e3 * (t.rectangle.south - t.rectangle .north)), t.data.boundingSphere3D = Cesium.BoundingSphere.fromRectangle3D(t.rectangle), t.data.boundingSphere2D = Cesium.BoundingSphere.fromRectangle2D(t.rectangle, e .mapProjection), t.rectangle.west, t.rectangle.south, t.rectangle.east, t.rectangle .north, this.loadTileEvent.raiseEvent(t), t.state = Cesium.QuadtreeTileLoadState.DONE, t .renderable = !0) }, ih.prototype.getTile = function(e) { return this._tileCache[e] }, ih.prototype.getAllTiles = function() { var e, t = []; for (e in this._tileCache) t.push(this._tileCache[e]); return t }, ih.prototype.computeTileVisibility = function(e, t, i) { var o = this.computeDistanceToTile(e, t); return e._distance = o, t.fog.enabled && 9 < e._level && 1 <= Cesium.Math.fog(o, t.fog.density) ? Cesium.Visibility.NONE : (o = t.mode === Cesium.SceneMode.SCENE3D ? e.data.boundingSphere3D : e .data.boundingSphere2D, t.cullingVolume.computeVisibility(o)) }, ih.prototype.showTileThisFrame = function(e, t) { e.data.primitive.update(t) }, ih.prototype.computeDistanceToTile = function(e, t) { var i = new Cesium.Cartesian3, e = t.mode === Cesium.SceneMode.SCENE3D ? e.data.boundingSphere3D : e.data.boundingSphere2D, e = Cesium.Cartesian3.subtract(e.center, t.camera.positionWC, i), t = Cesium.Cartesian3.magnitude(e); return Math.max(1, t - TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition) }, ih.prototype.isDestroyed = function() { return !1 }, ih.prototype.destroy = function() { return Cesium.destroyObject(this) }, ih.prototype.getInstance = function(t) { var i; return 0 == Cesium.defined(t.TileManager) && (t.TileManager = new e, i = new Cesium .QuadtreePrimitive({ tileProvider: t.TileManager, maximumScreenSpaceError: 2 }), t.scene.primitives.add(i)), t.TileManager }, ih.prototype.addToScene = function(e) { this._primitivesWaitingToBeAddedToTheScene.push(e) }, ih.prototype.removeFromScene = function(e) { var t = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); - 1 != t ? (this ._primitivesWaitingToBeAddedToTheScene[t].destroy(), this ._primitivesWaitingToBeAddedToTheScene.splice(t, 1)) : viewer.scene.primitives.remove(e) }, ih.prototype.replaceInScene = function(e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); if (-1 != i) this._primitivesWaitingToBeAddedToTheScene[i] = t; else switch (e.ID != t.ID && console.log( "TileManager.replaceInScene Warning: new primitive has a different ID than old primitive" ), null != e._replacmentPrimitive && viewer.scene.primitives.remove(e ._replacmentPrimitive), e._replacmentPrimitive = t, viewer.scene.primitives.add(t), t.ID .split(":")[0]) { case "billboards": oh(t, e); break; case "labels": rh(t, e); break; case "polygons": ah(t, e); break; case "models": sh(t, e); break; case "polylines": uh(t, e); break; case "points": lh(0, e); break; default: console.log("Error updating layer"), viewer.scene.primitives.remove(e) } }, { billboards: oh, labels: rh, polygons: ah, models: sh, polylines: uh, points: lh }); ih.prototype.replaceInSceneNew = function(e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); - 1 != i ? this ._primitivesWaitingToBeAddedToTheScene[i] = t : (e.ID !== t.ID && console.log( "TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"), this.addToScene(t), i = t.ID.split(":")[0], (i = dh[i]) ? i(t, e) : (console.log( "Error updating layer"), viewer.scene.primitives.remove(e))) }; o.Analysis = L, o.Angle = te, o.ArcgisNVectorTileProvider = th, o.AttachEvent = wc, o.BaiduImageryProvider = Dr, o.Bearing = ee, o.Billboard = Ar, o.Box = R, o.BoxGeoJsonFeatureLayer = Rr, o.BufferAnalysis = zi, o .CIMServerTool = ue, o.COMPILETIME = "2022.3.28", o.CZML = Tu, o.CanvasField = Zr, o.Cartesian3_to_WGS84 = function(e) { return e = Cesium.Cartographic.fromCartesian(e), { lat: Cesium.Math.toDegrees(e.latitude), lon: Cesium.Math.toDegrees(e.longitude), height: e.height } }, o.Cdcl = X, o.CesiumHeatmap = vo, o.CesiumHeatmapGL = yo, o.CesiumRenderPass = Bi, o.Circle = H, o .Color = m, o.CombineEcharts = le, o.Command = _o, o.Cone = B, o.ConicSensor = en, o.ContentState = Iu, o .CoordTransform = ge, o.Core = f, o.Corridor = tn, o.CreateWfsFeatureLayer = xl, o.Creator = q, o.Current = vc, o.DDSTexture = zu, o.DateTime = Cc, o.DetachEvent = bc, o.DivPoint = Ze, o.EdgeStage = ji, o .ElevationContour = ye, o.ElevationTool = xo, o.Ellipsoid = Zi, o.EntityCreator = sr, o.EventType = fo, o .FieldIntensity = yc, o.FlowField = hu, o.GeoJSONVectorTileProvider = v, o.GeoJSONVectorTileProvider1 = st, o.GeoJSONVectorTileProviderPolymerization = Fl, o.GeoJsonFeatureLayer = C, o.Gettreeid = function(e, t) { for (var i = "", o = V.getSource(), r = 0; r < o.length; r++) e == o[r].name && o[r].pId == t && (i = o[ r].id); return i }, o.GmlParser = Vo, o.Hawkeye = vu, o.Heatmap = Su, o.Highvolume = Xi, o.ImageLabel = Ll, o.ImageryLayer = Ol, o.JBAlgorithm = j, o.KmlLayer = Cu, o.Label = F, o.LabelGeoJsonFeatureLayer = Gl, o .LabelGeoJsonFeatureLayercopy = w, o.LonLatProjection = lt, o.MaterialPass = Uu, o.MilitaryStandard = Q, o .Mjcl = ie, o.ModelClipping = bu, o.ModelEdit = $e, o.ModifyMesh = wu, o.Navigate = kc, o.Particle = mi, o .Point = k, o.PointFly = Qi, o.PointModel = S, o.Polygon = A, o.PolygonGeoJsonFeatureLayer = gt, o .PolygonVectorGeoJsonFeatureLayer = lu, o.PolygonVectorTileLayerArcgis = jt, o.Polyline = M, o .PolylineGeoJsonFeatureLayer = pt, o.PolylineTrailLinkMaterial = ne, o.PolylineVolume = Il, o.PopupMessage = tt, o.ProjectTree = J, o.Recorder = ce, o.Rectangle = O, o.RenderEntity = Xu, o.Road = fu, o .S3MCacheFileRenderEntity = Zu, o.S3MCompressType = Te, o.S3MContentFactory = ec, o.S3MContentParser = tc, o .S3MCreateIndexJob = Ju, o.S3MCreateVertexJob = qu, o.S3MLayerCache = uc, o.S3MLayerScheduler = ac, o .S3MPixelFormat = Me, o.S3MTile = oc, o.S3MTilesFS = Qu, o.S3MTilesLayer = cc, o.S3MTilesVS = Yu, o .S3ModelParser = Mu, o.SE3DTileset = I, o.SFSTerrainProvider = Jl, o.SFSTerrainProvider7_2_3 = Wl, o .SGWorld = Xc, o.SatelliteTrail = Pu, o.Scan = Ii, o.Scan_PostProcessStage = Ki, o.Scopefieldvision = $i, o .Screenshot = Yi, o.ShadowsAnalysis = Wi, o.SightLine = Yt, o.SimpleGraphic = P, o.SimpleSqlParser = Xo, o .Skip = se, o.SkyBox = cu, o.SkylineAnalysis = ki, o.Stop = Vc, o.StreamerPath = pu, o.StreamerWall = gu, o .StreetView = gi, o.SunshineAnalysis = qi, o.TdtLabel = _c, o.Terrain = nu, o.TerrainExcavation = Ui, o .TerrainModifier = pc, o.TileManager = ih, o.TileManager1 = ko, o.TrailLine = _u, o.UndergroundMode = di, o .VERSION = "2.0.0", o.VectorCesiumTerrainProvider = Kl, o.VectorGeoJsonFeatureLayer = b, o .VectorImgFeatureLayer = dc, o.VectorTileProvider = T, o.VertexCompressOption = Du, o.Video = gc, o .ViewCone = xu, o.Viewshed = Vi, o.VolumeGeoJsonFeatureLayer = au, o.VolumetricMeasure = yu, o.WFSTool = Ir, o.WGS84_to_Cartesian3 = function(e) { return Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height) }, o.WMTSTerrain = ru, o.WallGeoFeatureLayer = Ut, o.WaterGeoJsonFeatureLayer = fc, o.WfsLayer = U, o .WorkerPool = Jo, o.billboardGeoJsonFeatureLayer = at, o.clone = function e(t, i) { if (null === t || "object" != typeof t) return t; i = ae(i, !1); var o, r, n = new t.constructor; for (o in t) t.hasOwnProperty(o) && (r = t[o], i && (r = e(r, i)), n[o] = r); return n }, o.configData = D, o.createGroup = it, o.createTerrainProfile = ve, o.curtaincontrast = qt, o.decode = Eo, o.defaultValue = ae, o.deleteItem = Fc, o.demolition = Ji, o.depthTestAgainstTerrain = Di, o.dynamicObject = G, o.execute = go, o.expandGroup = Kc, o.export = qc, o.findItem = Gc, o.flyTo = dt, o.flyToObj = Ac, o .getExitsObjectType = Wc, o.getItemName = Nc, o.getNextItem = Uc, o.getObject = Yc, o.getPosition = et, o .getVisibility = Bc, o.indoormode = Zt, o.isGroup = Qc, o.jumpTo = Rc, o.lineOfSight = Ke, o.lodash = y, o .main = Tc, o.measureTerrainArea = oe, o.measureTerrainHeight = Z, o.measureTerrainPerimeter = K, o .measureTerrainkPerimeter = re, o.northfinger = Oc, o.pako_inflate = Lu, o.pbf_dev = ft, o.position = Dl, o .renameGroup = zc, o.setPosition = Hc, o.setVisibility = jc, o.tdtwmtsimageprovider = Ho, o .terrainExaggeration = Qt, o.treeSource = V, o.vectortile = Nt, o.wall = Ml, o.weather = hi, o.zoomIn = Lc, o.zoomOut = Mc, Object.defineProperty(o, "__esModule", { value: !0 }) });