From 9faddc67bb5692c6e238b5b606a8c564faf78e95 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 01 三月 2023 16:29:57 +0800 Subject: [PATCH] 1 --- /dev/null | 112246 ----------------------------------------------------------- 1 files changed, 0 insertions(+), 112,246 deletions(-) diff --git "a/public/SmartEarthSDK/SmartEarth.min - \345\211\257\346\234\254.js" "b/public/SmartEarthSDK/SmartEarth.min - \345\211\257\346\234\254.js" deleted file mode 100644 index 6eb5ece..0000000 --- "a/public/SmartEarthSDK/SmartEarth.min - \345\211\257\346\234\254.js" +++ /dev/null @@ -1,112246 +0,0 @@ -/** - * - * SmartEarthSDK 鍩轰簬Cesium鐨勪笁缁磜eb寮�鍙� - * @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"; - var I = Object.freeze({ - testModel: "Workers/Model/xiaoche.glb", - 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", - mark1: "Workers/image/mark1.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", - effectCircle: "Workers/image/circle.png", - scanCircle: "Workers/image/scan.png", - particles: "Workers/image/particles.png", - trafficLight: { - l_go: "Workers/image/trafficLights/l-go.png", - l_wait: "Workers/image/trafficLights/l-wait.png", - l_stop: "Workers/image/trafficLights/l-stop.png", - l_null: "Workers/image/trafficLights/l-null.png", - go: "Workers/image/trafficLights/go.png", - wait: "Workers/image/trafficLights/wait.png", - stop: "Workers/image/trafficLights/stop.png", - null: "Workers/image/trafficLights/null.png", - r_go: "Workers/image/trafficLights/r-go.png", - r_wait: "Workers/image/trafficLights/r-wait.png", - r_stop: "Workers/image/trafficLights/r-stop.png", - r_null: "Workers/image/trafficLights/r-null.png", - bg: "Workers/image/trafficLights/bg.png", - }, - }); - function X(e, t) { - return null != e ? e : t; - } - var Z = - "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nif(twoColor){\nif(st.s<time){\nmaterial.alpha = color1.a;\nmaterial.diffuse = color1.rgb;\n}else{\nmaterial.alpha = color2.a;\nmaterial.diffuse = color2.rgb;\n}\n}else if(lightSpot){\nif(st.s<time){\nmaterial.alpha = pow(st.s / time, 20.0);\nif(material.alpha<alpha){\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else{\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}\n}else{\nvec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\nmaterial.alpha = colorImage.a * color.a;\nmaterial.diffuse = (colorImage.rgb + color.rgb) / 2.0;\n}\nreturn material;\n}\n", - ee = - "uniform vec4 color;\nuniform vec4 color1;\nuniform vec4 color2;\nuniform vec4 lightSpotColor;\nuniform sampler2D image;\nuniform bool twoColor;\nuniform bool lightSpot;\nuniform float alpha;\nuniform float intervalTime;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat time = fract(czm_frameNumber / (60.0 * intervalTime));\nif(twoColor){\nif(st.s < time){\nmaterial.alpha = color1.a;\nmaterial.diffuse = color1.rgb;\n}else{\nmaterial.alpha = color2.a;\nmaterial.diffuse = color2.rgb;\n}\n}else if(lightSpot){\nif(st.s<time){\nmaterial.alpha = pow(st.s / time, 20.0);\nif(material.alpha<alpha){\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else{\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}\n}else{\nvec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\nmaterial.alpha = colorImage.a * color.a;\nmaterial.diffuse = (colorImage.rgb + color.rgb)/2.0;\n}\nreturn material;\n}\n"; - function te(e, t, i) { - Cesium.PolylineTrailLinkMaterialProperty || - ((Cesium.PolylineTrailLinkMaterialProperty = te), - (Cesium.Material.PolylineTrailLinkType = "PolylineTrailLink"), - (Cesium.Material.PolylineTrailLinkImage = - window.SmartEarthRootUrl + I.TrailLine), - (Cesium.Material.PolylineTrailLinkSource = Z), - Cesium.Material._materialCache.addMaterial( - Cesium.Material.PolylineTrailLinkType, - { - fabric: { - type: Cesium.Material.PolylineTrailLinkType, - uniforms: { - color: new Cesium.Color(1, 0, 0, 0.5), - color1: new Cesium.Color(0, 1, 0, 0.5), - color2: new Cesium.Color(1, 0, 0, 0.5), - image: Cesium.Material.PolylineTrailLinkImage, - twoColor: !1, - lightSpot: !1, - lightSpotColor: new Cesium.Color(1, 1, 1, 0.5), - alpha: 0.3, - time: 0, - }, - source: Cesium.Material.PolylineTrailLinkSource, - }, - translucent: function (e) { - return !0; - }, - } - )), - Cesium.Material, - (this._definitionChanged = new Cesium.Event()), - (this._color = void 0), - (this._colorSubscription = void 0), - (this.color = Cesium.Color.fromCssColorString(e || "#ffffff")), - (this._Line = t || Cesium.Material.PolylineTrailLinkImage), - (this.duration = i || 3e3), - (this.alpha = 0.3), - (this._time = new Date().getTime()), - "object" == typeof this._Line && - (this._Line.LightSpot - ? (this._Line.color = Cesium.Color.fromCssColorString( - this._Line.color - )) - : ((this._Line.color1 = Cesium.Color.fromCssColorString( - this._Line.color1 - )), - (this._Line.color2 = Cesium.Color.fromCssColorString( - this._Line.color2 - )))), - (this.isConstant = !1), - (this.definitionChanged = this._definitionChanged), - (this.color = Cesium.createPropertyDescriptor("color")); - } - function ie(e) { - return new Cesium.Material({ - fabric: { - uniforms: { - color: X(e.color, new Cesium.Color(1, 0, 0, 0.5)), - color1: X(e.color1, new Cesium.Color(0, 1, 0, 0.5)), - color2: X(e.color2, new Cesium.Color(1, 0, 0, 0.5)), - image: X(e.image, window.SmartEarthRootUrl + I.TrailLine), - twoColor: X(e.twoColor, !1), - lightSpot: X(e.lightSpot, !1), - lightSpotColor: X(e.lightSpotColor, new Cesium.Color(1, 1, 1, 0.5)), - alpha: X(e.alpha, 0.3), - intervalTime: X(e.time, 3e3) / 1e3, - }, - source: ee, - }, - }); - } - function oe(e = !0) { - this.async = e; - } - function re(e) { - if (((this._mapContainer = e), !window.echarts)) { - let e = new oe(!1); - e.addJs(window.SmartEarthRootUrl + "Workers/echarts.min.js"); - } - this.Init(e); - } - function ne(e) { - this.serverUrl = e; - } - function ae(e, t) { - (this.mediaOutputPath = e || "test.mp4"), (this.videoBPS = t || 512e4); - } - (te.prototype.getType = function (e) { - return "PolylineTrailLink"; - }), - (te.prototype.setScale = function (e) { - this.scale = e; - }), - (te.prototype.getValue = function (e, t) { - return ( - ((t = Cesium.defined(t) ? t : {}).color = - Cesium.Property.getValueOrClonedDefault( - this._color, - e, - Cesium.Color.WHITE, - t.color - )), - "object" == typeof this._Line - ? this._Line.LightSpot - ? ((t.lightSpot = !0), (t.lightSpotColor = this._Line.color)) - : ((t.color1 = this._Line.color1), - (t.color2 = this._Line.color2), - (t.twoColor = !0)) - : (t.image = this._Line), - void 0 !== this.scale - ? (t.time = this.scale) - : (t.time = - ((new Date().getTime() - this._time) % this.duration) / - this.duration), - (t.alpha = this.alpha), - t - ); - }), - (te.prototype.equals = function (e) { - return ( - this === e || - (e instanceof te && Cesium.Property.equals(this._color, e._color)) - ); - }), - (oe.prototype.getXmlHttpRequest = function () { - return window.XMLHttpRequest - ? new XMLHttpRequest() - : window.ActiveXObject - ? new ActiveXObject("MsXml2.XmlHttp") - : void 0; - }), - (oe.prototype.includeJsText = function (e, t) { - var i; - null != e && - (((i = document.createElement("script")).type = "text/javascript"), - (i.text = t), - e.appendChild(i)); - }), - (oe.prototype.includeJsSrc = function (e, t) { - var i; - null != e && - (((i = document.createElement("script")).type = "text/javascript"), - (i.src = t), - e.appendChild(i)); - }), - (oe.prototype.addJs = function (e) { - var t = this.getXmlHttpRequest(), - i = this; - (t.onreadystatechange = function () { - 4 === t.readyState && - (200 === t.status || 304 === t.status - ? i.includeJsSrc(document.body || document.head, e) - : console.log( - "XML request error: " + t.statusText + " (" + t.status + ")" - )); - }), - t.open("GET", e, i.async), - t.send(null), - 404 === t.status - ? console.log(e + " is not found") - : i.includeJsText(document.body || document.head, t.responseText); - }), - (re.prototype.setOption = function (e, t) { - return ( - this._echartsContainer && t && this.clear(), - this._overlay || (this._overlay = this._createChartOverlay()), - this._overlay.setOption(e), - this - ); - }), - (re.prototype._createChartOverlay = function () { - var e = this._mapContainer.scene, - t = - (e.canvas.setAttribute("tabIndex", 0), document.createElement("div")); - return ( - (t.style.position = "absolute"), - (t.style.top = "0px"), - (t.style.left = "0px"), - (t.style.width = e.canvas.width + "px"), - (t.style.height = e.canvas.height + "px"), - (t.style.pointerEvents = "none"), - t.setAttribute("id", "smartearth-cesium-echarts"), - t.setAttribute("class", "echartMap"), - this._mapContainer.container.appendChild(t), - (this._echartsContainer = t), - echarts.init(t) - ); - }), - (re.prototype.deleteObject = re.prototype.clear = - function () { - this._echartsContainer && - (this._mapContainer.container.removeChild(this._echartsContainer), - (this._echartsContainer = null)), - this._overlay && (this._overlay.dispose(), (this._overlay = null)); - }), - (re.prototype.updateOverlay = function (e) { - this._overlay && this._overlay.setOption(e); - }), - (re.prototype.getMap = function () { - return this._mapContainer; - }), - (re.prototype.getOverlay = function () { - return this._overlay; - }), - (re.prototype.show = function () { - document.getElementById(this._id).style.visibility = "visible"; - }), - (re.prototype.hide = function () { - document.getElementById(this._id).style.visibility = "hidden"; - }), - (re.prototype.Init = function (u) { - function r(e) { - if (o[e]) return o[e].exports; - var t = (o[e] = { i: e, l: !1, exports: {} }); - return i[e].call(t.exports, t, t.exports, r), (t.l = !0), t.exports; - } - var i, o; - (i = [ - function (e, t, i) { - e.exports = i(1); - }, - function (e, t, i) { - echarts ? i(2).load() : console.error("missing echarts lib"); - }, - function (e, t, i) { - function o(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); - } - } - i.r(t); - (n = [ - { - key: "create", - value: function (e, t) { - var i; - e.eachComponent("GLMap", function (e) { - (i = new s(u, t)).setMapOffset(e.__mapOffset || [0, 0]), - (e.coordinateSystem = i); - }), - e.eachSeries(function (e) { - "GLMap" === e.get("coordinateSystem") && - (e.coordinateSystem = i); - }); - }, - }, - { - key: "dimensions", - get: function () { - return ["lng", "lat"]; - }, - }, - ]), - o((r = s).prototype, [ - { - key: "setMapOffset", - value: function (e) { - return (this._mapOffset = e), this; - }, - }, - { - key: "getViewer", - value: function () { - return this._viewer; - }, - }, - { - key: "dataToPoint", - value: function (e) { - if (this._viewer && this._viewer.scene) { - var t = this._viewer.scene, - e = Cesium.Cartesian3.fromDegrees(e[0], e[1]); - if (!e) return [0, 0]; - if ( - t.mode === Cesium.SceneMode.SCENE3D && - Cesium.Cartesian3.angleBetween(t.camera.position, e) > - 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) { - if (!(this 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)); - }), - (ne.prototype.getSceneList = function (t) { - $.ajax({ - url: this.serverUrl + "/scene/sceneList", - type: "get", - success: function (e) { - t && "function" == typeof t && e && t(JSON.parse(e)); - }, - }); - }), - (ne.prototype.query = function (e, t) { - var i = e.database, - e = { - type: X(e.type, "building"), - id: e.id, - returnGeometry: X(e.returnGeometry, !0), - returnChildren: X(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); - }, - }); - }), - (ae.prototype.startRecord = function () { - navigator.mediaDevices - .getDisplayMedia({ video: !0, audio: !0 }) - .then((e) => { - this.createRecorder(e); - }) - .catch((e) => { - this.getUserMediaError(e); - }); - }), - (ae.prototype.getUserMediaError = function (e) { - console.log("mediaError", e); - }), - (ae.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); - }); - }), - (ae.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(); - }), - (ae.prototype.stopRecord = function () { - this.recorder.stop(); - }); - const se = 52.35987755982988, - le = 3.141592653589793, - ue = 6378245, - ce = 0.006693421622965943, - he = { - BD09ToGCJ02(e, t) { - var e = +e - 0.0065, - t = +t - 0.006, - i = Math.sqrt(e * e + t * t) - 2e-5 * Math.sin(t * se), - t = Math.atan2(t, e) - 3e-6 * Math.cos(e * se); - 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 * se), - t = Math.atan2(t, e) + 3e-6 * Math.cos(e * se); - return [i * Math.cos(t) + 0.0065, i * Math.sin(t) + 0.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) * le, - o = Math.sin(t), - o = 1 - ce * o * o, - r = Math.sqrt(o); - return [ - (180 * i) / ((ue / r) * Math.cos(t) * le), - (180 * e) / (((ue * (1 - ce)) / (o * r)) * le), - ]; - }, - transformLng(e, t) { - t = - 300 + - (e = +e) + - 2 * (t = +t) + - 0.1 * e * e + - 0.1 * e * t + - 0.1 * Math.sqrt(Math.abs(e)); - return ( - (t += - (2 * (20 * Math.sin(6 * e * le) + 20 * Math.sin(2 * e * le))) / 3) + - (2 * (20 * Math.sin(e * le) + 40 * Math.sin((e / 3) * le))) / 3 + - (2 * - (150 * Math.sin((e / 12) * le) + 300 * Math.sin((e / 30) * le))) / - 3 - ); - }, - transformLat(e, t) { - var i = - 2 * (e = +e) - - 100 + - 3 * (t = +t) + - 0.2 * t * t + - 0.1 * e * t + - 0.2 * Math.sqrt(Math.abs(e)); - return ( - (i += - (2 * (20 * Math.sin(6 * e * le) + 20 * Math.sin(2 * e * le))) / 3) + - (2 * (20 * Math.sin(t * le) + 40 * Math.sin((t / 3) * le))) / 3 + - (2 * - (160 * Math.sin((t / 12) * le) + 320 * Math.sin((t * le) / 30))) / - 3 - ); - }, - out_of_china(e, t) { - return ( - (t = +t), !(73.66 < (e = +e) && e < 135.05 && 3.86 < t && t < 53.55) - ); - }, - }; - function me(e, t, i) { - if (e && t) { - "#" !== e[0] && (e = this.colorHex(e)), - "#" !== t[0] && (t = this.colorHex(t)); - for ( - var e = this.colorRgb(e), - o = e[0], - r = e[1], - n = e[2], - e = this.colorRgb(t), - a = (e[0] - o) / i, - s = (e[1] - r) / i, - l = (e[2] - n) / i, - u = [], - c = 0; - c < i; - c++ - ) { - var h = this.colorHex( - "rgb(" + - parseInt(a * c + o) + - "," + - parseInt(s * c + r) + - "," + - parseInt(l * c + n) + - ")" - ); - u.push(h); - } - return u; - } - return this; - } - function de(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 = []); - } - (me.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; - }), - (me.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; - } - }), - Object.defineProperties(de.prototype, { - errorEvent: { - get: function () { - return this.errorEvent; - }, - }, - poolSize: { - get: function () { - return this._poolSize; - }, - }, - }), - (de.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 - ); - }), - (de.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); - }), - (de.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); - }), - (de.prototype.onWorkerError = function (e) { - console.log(e); - }); - let pe = new Map(); - function ge(i) { - if ( - ((i = (i = (i = i.replaceAll("//", "/")).replace( - "http:/", - "http://" - )).replace("https:/", "https://")), - pe.has(i)) - ) - return pe.get(i); - { - let e = new de({ - workerPath: SmartEarthRootUrl + "Workers/xhrworker.js", - }), - t = e.queueWorkItem({ type: "get", url: i }); - return ( - t.then((e) => { - (e.xmlObj = fe(e.xmlText)), t.resolve(e); - }), - pe.set(i, t), - t - ); - } - } - function fe(t) { - let i = {}; - if (document.all) { - let e = new ActiveXObject("Microsoft.XMLDOM"); - e.loadXML(t), (i = e); - } else i = new DOMParser().parseFromString(t, "text/xml"); - return i; - } - function _e(e) { - return e - ? 3 == (e = "string" == typeof e ? fe(e) : e).nodeType || 4 == e.nodeType - ? e.nodeValue - : (function r(n) { - try { - let o = {}; - if (0 < n.children.length) - for (let i = 0; i < n.children.length; i++) { - let e = n.children.item(i), - t = e.nodeName; - if (((t = (t = t.split(":"))[1] || t[0]), void 0 === o[t])) - o[t] = r(e); - else { - if (void 0 === o[t].push) { - let e = o[t]; - (o[t] = []), o[t].push(e); - } - o[t].push(r(e)); - } - } - else { - if (n.attributes && n.attributes.length && !n.textContent) { - let i = {}; - for (let e = 0, t; e < n.attributes.length; e++) - (t = n.attributes[e]).split - ? ((t = t.split("=")), (i[t[0]] = t[1])) - : (i[t.name] = t.textContent); - return i; - } - o = n.textContent; - } - return o; - } catch (e) { - console.log(e.message); - } - })(9 == e.nodeType ? e.documentElement : e) - : {}; - } - var Ce = Object.freeze({ - UNLOADED: 0, - LOADING: 1, - PARSING: 2, - READY: 3, - FAILED: 4, - }), - ye = (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), - f = l.dmax, - _ = l.wsize, - C = l.whave, - y = l.wnext, - v = l.window, - w = l.hold, - b = l.bits, - T = l.lencode, - E = l.distcode, - S = (1 << l.lenbits) - 1, - P = (1 << l.distbits) - 1; - e: do { - for ( - b < 15 && - ((w += c[u++] << b), - (b += 8), - (w += c[u++] << b), - (b += 8)), - i = T[w & S]; - ; - - ) { - 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 = E[w & P]; - ; - - ) { - if ( - ((w >>>= o = i >>> 24), - (b -= o), - !(16 & (o = (i >>> 16) & 255))) - ) { - if (0 == (64 & o)) { - i = E[(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))), - f < (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 (C < (o = n - o) && l.sane) { - (e.msg = "invalid distance too far back"), - (l.mode = 30); - break e; - } - if (((s = v), (a = 0) === y)) { - if (((a += _ - o), o < r)) { - for (r -= o; (d[m++] = v[a++]), --o; ); - (a = m - n), (s = d); - } - } else if (y < o) { - if (((a += _ + y - o), (o -= y) < r)) { - for (r -= o; (d[m++] = v[a++]), --o; ); - if (((a = 0), y < r)) { - for (r -= o = y; (d[m++] = v[a++]), --o; ); - (a = m - n), (s = d); - } - } - } else if (((a += y - o), o < r)) { - for (r -= o; (d[m++] = v[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 L = e("../utils/common"), - M = e("./adler32"), - R = e("./crc32"), - O = e("./inffast"), - B = e("./inftrees"), - F = 1, - H = 2, - V = 0, - G = -2, - k = 1, - o = 852, - r = 592; - function N(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 L.Buf16(320)), - (this.work = new L.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 = k), - (t.last = 0), - (t.havedict = 0), - (t.dmax = 32768), - (t.head = null), - (t.hold = 0), - (t.bits = 0), - (t.lencode = t.lendyn = new L.Buf32(o)), - (t.distcode = t.distdyn = new L.Buf32(r)), - (t.sane = 1), - (t.back = -1), - V) - : 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)) !== V && (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 L.Buf8(e.wsize))), - o >= e.wsize - ? (L.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), - L.arraySet(e.window, t, i - o, r, e.wnext), - (o -= r) - ? (L.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, - _, - C, - y, - v, - w, - b, - T, - E, - S, - P = 0, - x = new L.Buf8(4), - D = [ - 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 = V); - e: for (;;) - switch (i.mode) { - case k: - 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)), - L.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 = N(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: - I = A = void 0; - var I, - A = i; - if (U) { - for ( - j = new L.Buf32(512), z = new L.Buf32(32), I = 0; - I < 144; - - ) - A.lens[I++] = 8; - for (; I < 256; ) A.lens[I++] = 9; - for (; I < 280; ) A.lens[I++] = 7; - for (; I < 288; ) A.lens[I++] = 8; - for ( - B(F, A.lens, 0, 288, j, 0, A.work, { bits: 9 }), - I = 0; - I < 32; - - ) - A.lens[I++] = 5; - B(H, A.lens, 0, 32, z, 0, A.work, { bits: 5 }), - (U = !1); - } - if ( - ((A.lencode = j), - (A.lenbits = 9), - (A.distcode = z), - (A.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; - L.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[D[i.have++]] = 7 & u), (u >>>= 3), (c -= 3); - } - for (; i.have < 19; ) i.lens[D[i.have++]] = 0; - if ( - ((i.lencode = i.lendyn), - (i.lenbits = 7), - (E = { bits: i.lenbits }), - (T = B(0, i.lens, 0, 19, i.lencode, 0, i.work, E)), - (i.lenbits = E.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 ( - ; - (_ = - ((P = i.lencode[u & ((1 << i.lenbits) - 1)]) >>> - 16) & - 255), - (C = 65535 & P), - !((f = P >>> 24) <= c); - - ) { - if (0 === s) break e; - s--, (u += o[n++] << c), (c += 8); - } - if (C < 16) - (u >>>= f), (c -= f), (i.lens[i.have++] = C); - else { - if (16 === C) { - for (S = f + 2; c < S; ) { - if (0 === s) break e; - s--, (u += o[n++] << c), (c += 8); - } - if (((u >>>= f), (c -= f), 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 === C) { - for (S = f + 3; c < S; ) { - if (0 === s) break e; - s--, (u += o[n++] << c), (c += 8); - } - (b = 0), - (d = 3 + (7 & (u >>>= f))), - (u >>>= 3), - (c = c - f - 3); - } else { - for (S = f + 7; c < S; ) { - if (0 === s) break e; - s--, (u += o[n++] << c), (c += 8); - } - (b = 0), - (d = 11 + (127 & (u >>>= f))), - (u >>>= 7), - (c = c - f - 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), - (E = { bits: i.lenbits }), - (T = B(F, i.lens, 0, i.nlen, i.lencode, 0, i.work, E)), - (i.lenbits = E.bits), - T) - ) { - (e.msg = "invalid literal/lengths set"), (i.mode = 30); - break; - } - if ( - ((i.distbits = 6), - (i.distcode = i.distdyn), - (E = { bits: i.distbits }), - (T = B( - H, - i.lens, - i.nlen, - i.ndist, - i.distcode, - 0, - i.work, - E - )), - (i.distbits = E.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; - (_ = - ((P = i.lencode[u & ((1 << i.lenbits) - 1)]) >>> 16) & - 255), - (C = 65535 & P), - !((f = P >>> 24) <= c); - - ) { - if (0 === s) break e; - s--, (u += o[n++] << c), (c += 8); - } - if (_ && 0 == (240 & _)) { - for ( - y = f, v = _, w = C; - (_ = - ((P = - i.lencode[ - w + ((u & ((1 << (y + v)) - 1)) >> y) - ]) >>> - 16) & - 255), - (C = 65535 & P), - !(y + (f = P >>> 24) <= c); - - ) { - if (0 === s) break e; - s--, (u += o[n++] << c), (c += 8); - } - (u >>>= y), (c -= y), (i.back += y); - } - if ( - ((u >>>= f), - (c -= f), - (i.back += f), - (i.length = C), - 0 === _) - ) { - i.mode = 26; - break; - } - if (32 & _) { - (i.back = -1), (i.mode = 12); - break; - } - if (64 & _) { - (e.msg = "invalid literal/length code"), (i.mode = 30); - break; - } - (i.extra = 15 & _), (i.mode = 22); - case 22: - if (i.extra) { - for (S = i.extra; c < S; ) { - 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 ( - ; - (_ = - ((P = i.distcode[u & ((1 << i.distbits) - 1)]) >>> - 16) & - 255), - (C = 65535 & P), - !((f = P >>> 24) <= c); - - ) { - if (0 === s) break e; - s--, (u += o[n++] << c), (c += 8); - } - if (0 == (240 & _)) { - for ( - y = f, v = _, w = C; - (_ = - ((P = - i.distcode[ - w + ((u & ((1 << (y + v)) - 1)) >> y) - ]) >>> - 16) & - 255), - (C = 65535 & P), - !(y + (f = P >>> 24) <= c); - - ) { - if (0 === s) break e; - s--, (u += o[n++] << c), (c += 8); - } - (u >>>= y), (c -= y), (i.back += y); - } - if (((u >>>= f), (c -= f), (i.back += f), 64 & _)) { - (e.msg = "invalid distance code"), (i.mode = 30); - break; - } - (i.offset = C), (i.extra = 15 & _), (i.mode = 24); - case 24: - if (i.extra) { - for (S = i.extra; c < S; ) { - 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 : M)(i.check, r, m, a - m)), - (m = l), - (i.flags ? u : N(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 : M)(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 === V ? -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), V; - }), - (i.inflateGetHeader = function (e, t) { - return !e || !e.state || 0 == (2 & (e = e.state).wrap) - ? G - : (((e.head = t).done = !1), V); - }), - (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 && M(1, t, o, 0) !== i.check - ? -3 - : W(e, t, o, o) - ? ((i.mode = 31), -4) - : ((i.havedict = 1), V); - }), - (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"), - B = [ - 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, - ], - F = [ - 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, - ], - H = [ - 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, - ], - V = [ - 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, - C = 0, - y = 0, - v = 0, - w = 0, - b = 0, - T = 0, - E = 0, - S = 0, - P = 0, - x = 0, - D = null, - I = 0, - A = new O.Buf16(16), - L = new O.Buf16(16), - M = null, - R = 0, - C = 0; - C <= 15; - C++ - ) - A[C] = 0; - for (y = 0; y < o; y++) A[t[i + y]]++; - for (b = _, w = 15; 1 <= w && 0 === A[w]; w--); - if ((w < b && (b = w), 0 === w)) - return ( - (r[n++] = 20971520), (r[n++] = 20971520), (s.bits = 1), 0 - ); - for (v = 1; v < w && 0 === A[v]; v++); - for (b < v && (b = v), C = S = 1; C <= 15; C++) - if ((S = (S <<= 1) - A[C]) < 0) return -1; - if (0 < S && (0 === e || 1 !== w)) return -1; - for (L[1] = 0, C = 1; C < 15; C++) L[C + 1] = L[C] + A[C]; - for (y = 0; y < o; y++) 0 !== t[i + y] && (a[L[t[i + y]]++] = y); - if ( - ((d = - 0 === e - ? ((D = M = a), 19) - : 1 === e - ? ((D = B), (I -= 257), (M = F), (R -= 257), 256) - : ((D = H), (M = V), -1)), - (C = v), - (m = n), - (E = y = x = 0), - (c = -1), - (h = (P = 1 << (T = b)) - 1), - (1 === e && 852 < P) || (2 === e && 592 < P)) - ) - return 1; - for (;;) { - for ( - f = - a[y] < d - ? ((g = 0), a[y]) - : a[y] > d - ? ((g = M[R + a[y]]), D[I + a[y]]) - : ((g = 96), 0), - l = 1 << (p = C - E), - v = u = 1 << T; - (r[m + (x >> E) + (u -= l)] = (p << 24) | (g << 16) | f | 0), - 0 !== u; - - ); - for (l = 1 << (C - 1); x & l; ) l >>= 1; - if (((x = 0 !== l ? (x & (l - 1)) + l : 0), y++, 0 == --A[C])) { - if (C === w) break; - C = t[i + a[y]]; - } - if (b < C && (x & h) !== c) { - for ( - m += v, S = 1 << (T = C - (E = 0 === E ? b : E)); - T + E < w && !((S -= A[T + E]) <= 0); - - ) - T++, (S <<= 1); - if ( - ((P += 1 << T), - (1 === e && 852 < P) || (2 === e && 592 < P)) - ) - return 1; - r[(c = x & h)] = (b << 24) | (T << 16) | (m - n) | 0; - } - } - return ( - 0 !== x && (r[m + x] = ((C - E) << 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"), - ve = 1, - we = 2, - be = 4; - function Te(e, t, i, o) { - var e = e | (t << 8), - t = (e >> 11) & 31, - r = (e >> 5) & 63, - n = 31 & e; - return ( - (i[o + 0] = (t << 3) | (t >> 2)), - (i[o + 1] = (r << 2) | (r >> 4)), - (i[o + 2] = (n << 3) | (n >> 2)), - (i[o + 3] = 255), - e - ); - } - function Ee(e, t, i, o) { - for ( - var r = 0, - n = e, - a = t, - s = i + (r = 0 != (o & (we | be)) ? 8 : r), - l = 0 != (o & ve), - u = new Uint8Array(16), - c = Te(a[s + 0], a[s + 1], u, 0), - h = Te(a[s + 2], a[s + 3], u, 4), - m = 0; - m < 3; - m++ - ) { - var d = u[m], - p = u[4 + m]; - l && c <= h - ? ((u[8 + m] = (d + p) / 2), (u[12 + m] = 0)) - : ((u[8 + m] = (2 * d + p) / 3), (u[12 + m] = (d + 2 * p) / 3)); - } - (u[11] = 255), (u[15] = l && c <= h ? 0 : 255); - for (var g = new Uint8Array(16), m = 0; m < 4; ++m) { - var f = a[s + 4 + m]; - (g[4 * m + 0] = 3 & f), - (g[4 * m + 1] = (f >> 2) & 3), - (g[4 * m + 2] = (f >> 4) & 3), - (g[4 * m + 3] = (f >> 6) & 3); - } - for (m = 0; m < 16; ++m) - for (var _ = 4 * g[m], C = 0; C < 4; ++C) n[4 * m + C] = u[_ + C]; - if (0 != (o & we)) - for (var y = e, v = i, w = 0; w < 8; ++w) { - var b = bytes[v + w], - T = 15 & b, - b = 240 & b; - (y[8 * w + 3] = T | (T << 4)), (y[8 * w + 7] = b | (b >> 4)); - } - else if (0 != (o & be)) { - var E = e, - S = t, - P = S[(L = i) + 0], - x = S[L + 1], - D = new Uint8Array(8); - if ((D[0] = P) <= (D[1] = x)) { - for (var I = 1; I < 5; ++I) D[1 + I] = ((5 - I) * P + I * x) / 5; - (D[6] = 0), (D[7] = 255); - } else for (I = 1; I < 7; ++I) D[1 + I] = ((7 - I) * P + I * x) / 7; - for (var A = new Uint8Array(16), L = L + 2, M = 0, I = 0; I < 2; ++I) { - for (var R = 0, O = 0; O < 3; ++O) R |= S[L++] << (8 * O); - for (O = 0; O < 8; ++O) A[M++] = (R >> (3 * O)) & 7; - } - for (I = 0; I < 16; ++I) E[4 * I + 3] = D[A[I]]; - } - } - function Se(e) {} - Se.decode = function (e, t, i, o, r) { - if (null != e && null != o && 0 != i && 0 != t) { - var n = 0; - if ((n = 11 < r || 5 === r ? be : 32 | ve) & ve && 32 & n) - for ( - var a, - s, - l, - u, - c, - h, - m, - r = e, - d = t, - p = i, - g = o, - f = new Uint16Array(4), - _ = r, - C = d / 4, - y = p / 4, - v = 0; - v < y; - v++ - ) - for (var w = 0; w < C; w++) - (f[0] = g[(a = 4 * ((y - v) * C + w))]), - (f[1] = g[1 + a]), - (s = 31 & f[0]), - (l = 2016 & f[0]), - (u = 63488 & f[0]), - (c = 31 & f[1]), - (h = 2016 & f[1]), - (m = 63488 & f[1]), - (f[2] = - ((5 * s + 3 * c) >> 3) | - (((5 * l + 3 * h) >> 3) & 2016) | - (((5 * u + 3 * m) >> 3) & 63488)), - (f[3] = - ((5 * c + 3 * s) >> 3) | - (((5 * h + 3 * l) >> 3) & 2016) | - (((5 * m + 3 * u) >> 3) & 63488)), - (c = g[2 + a]), - (_[(s = 4 * v * d + 4 * w)] = f[3 & c]), - (_[1 + s] = f[(c >> 2) & 3]), - (_[2 + s] = f[(c >> 4) & 3]), - (_[3 + s] = f[(c >> 6) & 3]), - (_[(s += d)] = f[(c >> 8) & 3]), - (_[s + 1] = f[(c >> 10) & 3]), - (_[s + 2] = f[(c >> 12) & 3]), - (_[s + 3] = f[c >> 14]), - (c = g[3 + a]), - (_[(s += d)] = f[3 & c]), - (_[s + 1] = f[(c >> 2) & 3]), - (_[s + 2] = f[(c >> 4) & 3]), - (_[s + 3] = f[(c >> 6) & 3]), - (_[(s += d)] = f[(c >> 8) & 3]), - (_[s + 1] = f[(c >> 10) & 3]), - (_[s + 2] = f[(c >> 12) & 3]), - (_[s + 3] = f[c >> 14]); - else - for ( - var b = e, - T = t, - E = i, - F = o, - S = n, - H = 0 != (S & ve) ? 8 : 16, - P = 0, - x = 0; - x < E; - x += 4 - ) - for (var D = 0; D < T; D += 4) { - for ( - var I = new Uint8Array(64), A = (Ee(I, F, P, S), 0), L = 0; - L < 4; - ++L - ) - for (var M = 0; M < 4; ++M) { - var R = D + M, - O = x + L; - if (R < T && O < E) - for (var V = 4 * (T * (E - O) + R), B = 0; B < 4; ++B) - b[V++] = I[A++]; - else A += 4; - } - P += H; - } - } - }; - var Pe = (function () { - var e = new Uint8Array([ - 0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 3, 2, 0, 0, 5, 3, 1, - 0, 1, 12, 1, 0, 10, 22, 2, 12, 0, 65, 0, 65, 0, 65, 0, 252, 10, 0, 0, - 11, 7, 0, 65, 0, 253, 15, 26, 11, - ]), - n = new Uint8Array([ - 32, 0, 65, 2, 1, 106, 34, 33, 3, 128, 11, 4, 13, 64, 6, 253, 10, 7, 15, - 116, 127, 5, 8, 12, 40, 16, 19, 54, 20, 9, 27, 255, 113, 17, 42, 67, 24, - 23, 146, 148, 18, 14, 22, 45, 70, 69, 56, 114, 101, 21, 25, 63, 75, 136, - 108, 28, 118, 29, 73, 115, - ]); - if ("object" != typeof WebAssembly) return { supported: !1 }; - var h, - t = - "B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLLVE9wEEEVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+x8yQDBK/qMEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uC/wfBgGOCJDAOCJD6eHdAICEFHLCBHQDNINAQAE9PMEAdAEAQ9rAQAdFAE6eHKDNDNADtMBAKCSFGOC9wgHXAOCL4CIFCD4HMAWCJDFHpCBHSALHZINDNARAZ9rAM9PMBCBHLXIKAZAMFHLDNAXtMBCBHhCBHIINDNARAL9rCk9PMBCBHLXVKAWCJ/CBFAIFHODNDNDNDNDNAZAICO4FrBBAhCOg4CIgpLBEDIBKAO9CB83IBAOCWF9CB83IBXIKAOALrBLALrBBGoCO4GaAaCIsGae86BBAOCEFALCLFAaFGarBBAoCL4CIgGcAcCIsGce86BBAOCDFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCIFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCLFAaAoFGarBBALrBEGoCO4GcAcCIsGce86BBAOCVFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCOFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCRFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCWFAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOCdFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCQFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCKFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCXFAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOCMFAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOCpFAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCSFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAOALrBWALrBBGoCL4GaAaCSsGae86BBAOCEFALCWFAaFGarBBAoCSgGoAoCSsGoe86BBAOCDFAaAoFGorBBALrBEGaCL4GcAcCSsGce86BBAOCIFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCLFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOCVFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCOFAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOCRFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCWFAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOCdFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCQFAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOCKFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCXFAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOCMFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCpFAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCSFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAOAL8pBB83BBAOCWFALCWF8pBB83BBALCZFHLKAhCDFHhAICZFGIAX6MBKKDNALMBCBHLXIKDNAKtMBAWASFrBBHhCBHOApHIINAIAWCJ/CBFAOFrBBGZCE4CBAZCEg9r7AhFGh86BBAIADFHIAOCEFGOAK9HMBKKApCEFHpALHZASCEFGSAD9HMBKKABAQAD2FAWCJDFAKAD2Z1JJJB8aAWAWCJDFAKCUFAD2FADZ1JJJB8aKAKCBALeAQFHQALMBKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/EBF8kJJJJBAOK+OoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJEZ+JJJJB8aAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK+lVOEUE99DUD99EUD99DNDNADCL9HMBAEtMEINDNDNjBBBzjBBB+/ABCDFGD8sBB+yAB8sBBGI+yGL+L+TABCEFGV8sBBGO+yGR+L+TGWjBBBB9gGdeAWjBB/+9CAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI86BBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD86BBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD86BBABCLFHBAECUFGEMBXDKKAEtMBINDNDNjBBBzjBBB+/ABCLFGD8uEB+yAB8uEBGI+yGL+L+TABCDFGV8uEBGO+yGR+L+TGWjBBBB9gGdeAWjB/+fsAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI87EBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD87EBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD87EBABCWFHBAECUFGEMBKKK/SILIUI99IUE99DNAEtMBCBHIABHLINDNDNj/zL81zALCOF8uEBGVCIv+y+VGOAL8uEB+ynGRjB/+fsnjBBBzjBBB+/ARjBBBB9gemGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKALCLF8uEBHQALCDF8uEBHKABAVCEFCIgAIvCETFAd87EBDNDNAOAK+ynGWjB/+fsnjBBBzjBBB+/AWjBBBB9gemGX+LjBBB9P9dtMBAX+oHKXEKCJJJJ94HKKABAVCDFCIgAIvCETFAK87EBDNDNAOAQ+ynGOjB/+fsnjBBBzjBBB+/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK6BDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCk91ClTCJJJ/8IF++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB", - e = - (WebAssembly.validate(e) && - (t = - "B9h79tEBBBE5V9gBB9gVUUUUUEU9gIUUUB9gDUUB9gEUEUIMXBBEBEEDIDIDLLVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBWl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBQL79iv9rBKQ/j6XLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK1HLSUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uC/wfBgGOCJDAOCJD6eHWAICEFHOCBHdDNINAdAE9PMEAWAEAd9rAdAWFAE6eHQDNDNADtMBAQCSFGLC9wgGKCI2HXAKCETHMALCL4CIFCD4HpCBHSINAOHZCBHhDNINDNARAZ9rAp9PMBCBHOXVKAVCJ/CBFAhAK2FHoAZApFHOCBHIDNAKC/AB6MBARAO9rC/gB6MBCBHLINAoALFHIDNDNDNDNDNAZALCO4FrBBGaCIgpLBEDIBKAICBPhPKLBXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLBAOCZFHOKDNDNDNDNDNAaCD4CIgpLBEDIBKAICBPhPKLZXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLZAOCZFHOKDNDNDNDNDNAaCL4CIgpLBEDIBKAICBPhPKLAXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLAAOCZFHOKDNDNDNDNDNAaCO4pLBEDIBKAICBPhPKL8wXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCLFAlPqBFAaC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCWFAlPqBFAaC+Q+YJJBFrBBFHOXEKAIAOPBBBPKL8wAOCZFHOKALC/ABFHIALCJEFAK0MEAIHLARAO9rC/fB0MBKKDNAIAK9PMBAICI4HLINDNARAO9rCk9PMBCBHOXRKAoAIFHaDNDNDNDNDNAZAICO4FrBBALCOg4CIgpLBEDIBKAaCBPhPKLBXIKAaAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAaAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAaAOPBBBPKLBAOCZFHOKALCDFHLAICZFGIAK6MBKKDNAOtMBAOHZAhCEFGhCLsMDXEKKCBHOXIKDNAKtMBAVCJDFASFHIAVASFPBDBHlCBHaINAIAVCJ/CBFAaFGLPBLBGxCEP9tAxCEPSGcP9OP9hP9RGxALAKFPBLBGkCEP9tAkAcP9OP9hP9RGkPMBZEhDoIaLcVxOqRlGyALAMFPBLBG8aCEP9tA8aAcP9OP9hP9RG8aALAXFPBLBGeCEP9tAeAcP9OP9hP9RGePMBZEhDoIaLcVxOqRlG3PMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIAlP9uGlPeBbDBAIADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAyA3PMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWkdyQ8aKeX3M5p8eS8fGxA8aAePMWkdyQ8aKeX3M5p8eS8fGkPMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFHIAaCZFGaAK6MBKKASCLFGSAD6MBKKABAdAD2FAVCJDFAQAD2/8QBBAVAVCJDFAQCUFAD2FAD/8QBBKAQCBAOeAdFHdAOMBKC9+HOXEKCBC99ARAO9rADCAADCA0eseHOKAVCJ/KBF8kJJJJBAOKWBZ+BJJJBK+KoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJE/8KBAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK/xVDIUO978jJJJJBCA9rGI8kJJJJBDNDNADCL9HMBDNAEC98gGLtMBABHDCBHVINADADPBBBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKBBADCZFHDAVCLFGVAL6MBKKALAE9PMEAIAECIgGVCDTGDvCBCZAD9r/8KBAIABALCDTFGLAD/8QBBDNAVtMBAIAIPBLBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKLBKALAIAD/8QBBXEKABAEC98gGDZ+HJJJBADAE9PMBAIAECIgGLCITGVFCBCAAV9r/8KBAIABADCITFGDAV/8QBBAIALZ+HJJJBADAIAV/8QBBKAICAF8kJJJJBK+yIDDUR97DNAEtMBCBHDINABCZFGIAIPBBBGLCBPhGVCJJ98P3ECJJ98P3IGOP9OABPBBBGRALPMLVORXMpScxql358e8fCffEPhP9OP/6EARALPMBEDIWdQKZhoaky8aeGLCZP+sEP/6EGWP/gEALCZP+rECZP+sEP/6EGdP/gEP/kEP/lEGLjB/+fsPaAdALAVP+2EGVAdCJJJJ94PhGQP9OP9RP/kEGdAdP/mEALALP/mEAWAVAWAQP9OP9RP/kEGLALP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGVP/kECZP+rEAdAWP/mEAVP/kECffIPhP9OP9QGdALAWP/mEAVP/kECUPSCBPlDCBPlICBPlOCBPlRCBPlQCBPlKCBPlpCBPlSP9OGLPMWdkyQK8aeXM35pS8e8fP9QPKBBABARAOP9OAdALPMBEZhDIoaLVcxORqlP9QPKBBABCAFHBADCLFGDAE6MBKKK94EIU8jJJJJBCA9rGI8kJJJJBABAEC98gGLZ+JJJJBDNALAE9PMBAIAECIgGVCITGEFCBCAAE9r/8KBAIABALCITFGBAE/8QBBAIAVZ+JJJJBABAIAE/8QBBKAICAF8kJJJJBK/hILDUE97EUV978jJJJJBCZ9rHDDNAEtMBCBHIINADABPBBBGLABCZFGVPBBBGOPMLVORXMpScxql358e8fGRCZP+sEGWCLP+rEPKLBABjBBJzPaj/zL81zPaAWCIPhP9QP/6EP/nEGWALAOPMBEDIWdQKZhoaky8aeGLCZP+rECZP+sEP/6EP/mEGOAOP/mEAWALCZP+sEP/6EP/mEGdAdP/mEAWARCZP+rECZP+sEP/6EP/mEGRARP/mEP/kEP/kEP/lECBPhP+4EP/jEjB/+fsPaGWP/mEjBBN0PaGLP/kECffIPhGQP9OAdAWP/mEALP/kECZP+rEP9QGdARAWP/mEALP/kECZP+rEAOAWP/mEALP/kEAQP9OP9QGWPMBEZhDIoaLVcxORqlGLP5BADPBLBPeB+t+J83IBABCWFALP5EADPBLBPeE+t+J83IBAVAdAWPMWdkyQK8aeXM35pS8e8fGWP5BADPBLBPeD+t+J83IBABCkFAWP5EADPBLBPeI+t+J83IBABCAFHBAICLFGIAE6MBKKK/3EDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB"), - WebAssembly.instantiate( - (function (e) { - for (var t = new Uint8Array(e.length), i = 0; i < e.length; ++i) { - var o = e.charCodeAt(i); - t[i] = - 96 < o - ? o - 71 - : 64 < o - ? o - 65 - : 47 < o - ? o + 4 - : 46 < o - ? 63 - : 62; - } - for (var r = 0, i = 0; i < e.length; ++i) - t[r++] = t[i] < 60 ? n[t[i]] : 64 * (t[i] - 60) + t[++i]; - return t.buffer.slice(0, r); - })(t), - {} - ).then(function (e) { - (h = e.instance).exports.__wasm_call_ctors(); - })); - function a(e, t, i, o, r, n) { - var a = h.exports.sbrk, - s = (i + 3) & -4, - l = a(s * o), - u = a(r.length), - c = new Uint8Array(h.exports.memory.buffer), - e = (c.set(r, u), e(l, i, o, u, r.length)); - if ( - (0 == e && n && n(l, s, o), - t.set(c.subarray(l, l + i * o)), - a(l - a(0)), - 0 != e) - ) - throw new Error("Malformed buffer data: " + e); - } - var s = { - 0: "", - 1: "meshopt_decodeFilterOct", - 2: "meshopt_decodeFilterQuat", - 3: "meshopt_decodeFilterExp", - NONE: "", - OCTAHEDRAL: "meshopt_decodeFilterOct", - QUATERNION: "meshopt_decodeFilterQuat", - EXPONENTIAL: "meshopt_decodeFilterExp", - }, - l = { - 0: "meshopt_decodeVertexBuffer", - 1: "meshopt_decodeIndexBuffer", - 2: "meshopt_decodeIndexSequence", - ATTRIBUTES: "meshopt_decodeVertexBuffer", - TRIANGLES: "meshopt_decodeIndexBuffer", - INDICES: "meshopt_decodeIndexSequence", - }; - return { - ready: e, - supported: !0, - decodeVertexBuffer: function (e, t, i, o, r) { - a(h.exports.meshopt_decodeVertexBuffer, e, t, i, o, h.exports[s[r]]); - }, - decodeIndexBuffer: function (e, t, i, o) { - a(h.exports.meshopt_decodeIndexBuffer, e, t, i, o); - }, - decodeIndexSequence: function (e, t, i, o) { - a(h.exports.meshopt_decodeIndexSequence, e, t, i, o); - }, - decodeGltfBuffer: function (e, t, i, o, r, n) { - a(h.exports[l[r]], e, t, i, o, h.exports[s[n]]); - }, - }; - })(); - function xe() {} - (xe.s3tc = !0), (xe.pvrtc = !1), (xe.etc1 = !1); - const De = { - SV_Unkown: 0, - SV_Standard: 1, - SV_Compressed: 2, - SV_DracoCompressed: 3, - }, - Ie = { Standard: 0, Draco: 1, MeshOpt: 2 }, - Ae = { - 0: Uint32Array.BYTES_PER_ELEMENT, - 1: Float32Array.BYTES_PER_ELEMENT, - 2: Float64Array.BYTES_PER_ELEMENT, - }, - Le = { - 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, - CRN_DXT5: 26, - STANDARD_CRN: 27, - }, - Me = { - SVC_Vertex: 1, - SVC_Normal: 2, - SVC_VertexColor: 4, - SVC_SecondColor: 8, - SVC_TexutreCoord: 16, - SVC_TexutreCoordIsW: 32, - }, - Re = { - Invalid: 0, - Position: 1, - PositionW: 2, - Normal: 4, - Tangent: 8, - FirstTexcoord: 16, - SecondTexcoord: 32, - Color: 64, - SecondColor: 128, - Custom0: 512, - Custom1: 1024, - }; - function Oe(e, t, i) { - i = e.byteLength; - return (e = e.subarray(0, 0 + i)), new TextDecoder("utf-8").decode(e); - } - function Be(e, t, i) { - (t = t.getUint32(i, !0)), - (i += Uint32Array.BYTES_PER_ELEMENT), - (e = new Uint8Array(e, i, t)); - return { string: Oe(e), bytesOffset: (i += t), length: t }; - } - function Fe(t, i, o, e, r) { - let n = {}, - a = - ((n.rangeList = i.getFloat32(o, !0)), - (o += Float32Array.BYTES_PER_ELEMENT), - (n.rangeMode = i.getUint16(o, !0)), - (o += Uint16Array.BYTES_PER_ELEMENT), - {}); - (a.x = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (a.y = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (a.z = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT); - var s = i.getFloat64(o, !0); - if ( - ((o += Float64Array.BYTES_PER_ELEMENT), - (n.boundingSphere = { center: a, radius: s }), - 3 === r) - ) { - const c = {}, - h = - ((c.x = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (c.y = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (c.z = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - {}), - m = - ((h.x = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (h.y = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (h.z = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - {}), - d = - ((m.x = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (m.y = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (m.z = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - {}); - (d.x = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (d.y = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (d.z = i.getFloat64(o, !0)), - (o += Float64Array.BYTES_PER_ELEMENT), - (n.obb = { xExtent: h, yExtent: m, zExtent: d, obbCenter: c }); - } - s = Be(t, i, o); - let l = s.string; - o = s.bytesOffset; - var s = l.indexOf("Geometry"), - u = - (-1 !== s && ((s = l.substring(s)), (l = l.replace(s, ""))), - (n.childTile = l), - (n.geodes = []), - i.getUint32(o, !0)); - o += Uint32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < u; 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 = Be(t, i, o); - n.push(l.string), (o = l.bytesOffset); - } - return e.push(r), o; - })(t, i, o, n.geodes); - return e.push(n), (o = 3 === r ? Be(t, i, o).bytesOffset : o); - } - function He(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: 5126, - offsetInBytes: 0, - strideInBytes: t, - normalize: !1, - }), - i - ); - } - function Ve(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: 5126, - offsetInBytes: 0, - strideInBytes: t, - normalize: !1, - }), - i - ); - } - function Ge(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: 5121, - offsetInBytes: 0, - strideInBytes: 4, - normalize: !0, - }), - (e.vertexColor = a), - o - ); - } - function ke(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: 5121, - offsetInBytes: 0, - strideInBytes: 4, - normalize: !0, - }), - i - ); - } - function Ne(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: 5126, - offsetInBytes: 0, - strideInBytes: l * Float32Array.BYTES_PER_ELEMENT, - normalize: !1, - }); - } - return n; - } - function je(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: 5126, - normalize: !1, - offsetInBytes: 0, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.uv3 = a.length), - a.push({ - index: s.uv3, - componentsPerAttribute: 4, - componentDatatype: 5126, - normalize: !1, - offsetInBytes: 4 * Float32Array.BYTES_PER_ELEMENT, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.uv4 = a.length), - a.push({ - index: s.uv4, - componentsPerAttribute: 4, - componentDatatype: 5126, - normalize: !1, - offsetInBytes: 8 * Float32Array.BYTES_PER_ELEMENT, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.secondary_colour = a.length), - a.push({ - index: s.secondary_colour, - componentsPerAttribute: 4, - componentDatatype: 5126, - normalize: !1, - offsetInBytes: 12 * Float32Array.BYTES_PER_ELEMENT, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.uv6 = a.length), - a.push({ - index: s.uv6, - componentsPerAttribute: 4, - componentDatatype: 5121, - 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: 5126, - normalize: !1, - offsetInBytes: 0, - strideInBytes: t, - instanceDivisor: 1, - byteLength: c, - }), - (s.uv2 = a.length), - a.push({ - index: s.uv2, - componentsPerAttribute: 4, - componentDatatype: 5126, - normalize: !1, - offsetInBytes: 4 * Float32Array.BYTES_PER_ELEMENT, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.uv3 = a.length), - a.push({ - index: s.uv3, - componentsPerAttribute: 4, - componentDatatype: 5126, - normalize: !1, - offsetInBytes: 8 * Float32Array.BYTES_PER_ELEMENT, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.uv4 = a.length), - a.push({ - index: s.uv4, - componentsPerAttribute: 4, - componentDatatype: 5126, - normalize: !1, - offsetInBytes: 12 * Float32Array.BYTES_PER_ELEMENT, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.uv5 = a.length), - a.push({ - index: s.uv5, - componentsPerAttribute: 4, - componentDatatype: 5126, - normalize: !1, - offsetInBytes: 16 * Float32Array.BYTES_PER_ELEMENT, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.uv6 = a.length), - a.push({ - index: s.uv6, - componentsPerAttribute: 4, - componentDatatype: 5126, - normalize: !1, - offsetInBytes: 20 * Float32Array.BYTES_PER_ELEMENT, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.uv7 = a.length), - a.push({ - index: s.uv7, - componentsPerAttribute: 3, - componentDatatype: 5126, - normalize: !1, - offsetInBytes: 24 * Float32Array.BYTES_PER_ELEMENT, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.secondary_colour = a.length), - a.push({ - index: s.secondary_colour, - componentsPerAttribute: 4, - componentDatatype: 5121, - normalize: !0, - offsetInBytes: 27 * Float32Array.BYTES_PER_ELEMENT, - strideInBytes: t, - instanceDivisor: 1, - }), - (s.uv9 = a.length), - a.push({ - index: s.uv9, - componentsPerAttribute: 4, - componentDatatype: 5121, - 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 + e * Float32Array.BYTES_PER_ELEMENT, - !0 - ); - } - o += c; - } - return o; - } - function ze(t, i, o, r, n) { - if ( - (3 === n && (i.getUint32(o, !0), (o += Uint32Array.BYTES_PER_ELEMENT)), - (o = Ge(t, i, (o = Ve(t, i, (o = He(t, i, o, r)), r)), r)), - (o = je(t, i, (o = Ne(t, i, (o = 3 !== n ? ke(t, i, o, r) : o), r)), r)), - 3 === n) - ) { - (n = Be( - t, - i, - (o = (function (t, i, o, r) { - var n = i.getUint32(o, !0); - o += Uint32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < n; e++) { - var a = i.getUint32(o, !0), - s = ((o += Uint32Array.BYTES_PER_ELEMENT), i.getUint16(o, !0)), - l = ((o += Uint16Array.BYTES_PER_ELEMENT), i.getUint16(o, !0)), - a = ((o += Uint16Array.BYTES_PER_ELEMENT), a * s * Ae[l]), - l = new Uint8Array(t, o, a); - o += a; - const u = r.vertexAttributes, - c = r.attrLocation; - a = "aCustom" + e; - (c[a] = u.length), - u.push({ - index: c[a], - typedArray: l, - componentsPerAttribute: s, - componentDatatype: 5126, - offsetInBytes: 0, - strideInBytes: 0, - normalize: !1, - }); - } - return o; - })(t, i, o, r)) - )), - (t = - ((o = n.bytesOffset), - (r.customVertexAttribute = JSON.parse(n.string)), - "aCustom" + r.customVertexAttribute.TextureCoordMatrix)), - (n = "aCustom" + r.customVertexAttribute.VertexWeight); - void 0 !== r.attrLocation[t] && - ((r.attrLocation.aTextureCoordMatrix = r.attrLocation[t]), - delete r.attrLocation[t]), - void 0 !== r.attrLocation[n] && - ((r.attrLocation.aVertexWeight = r.attrLocation[n]), - delete r.attrLocation[n]); - let e = o % 4; - o = (function (e, t) { - var i = e.getUint32(t, !0); - if (((t += Uint32Array.BYTES_PER_ELEMENT), i <= 0)) return t; - var o = e.getUint16(t, !0), - e = - ((t += Uint16Array.BYTES_PER_ELEMENT), - e.getUint16(t, !0), - (t += Uint16Array.BYTES_PER_ELEMENT), - i * o * Float32Array.BYTES_PER_ELEMENT); - return (t += e); - })(i, (o += e = e && 4 - e)); - } - return o; - } - function Ue(i, o, n, a) { - var s = o.getUint32(n, !0), - r = - ((n += Uint32Array.BYTES_PER_ELEMENT), - (a.compressOptions = s), - o.getUint32(n, !0)); - (n += Uint32Array.BYTES_PER_ELEMENT), - (a.minVerticesValue = { x: 0, y: 0, z: 0, w: 0 }), - (a.minTexCoordValue = [ - { x: 0, y: 0 }, - { x: 0, y: 0 }, - ]), - (a.texCoordCompressConstant = [ - { x: 0, y: 0, z: 0 }, - { x: 0, y: 0, z: 0 }, - ]); - for (let t = 0; t < r; t++) { - var l = o.getUint32(n, !0), - u = - ((n += Uint32Array.BYTES_PER_ELEMENT), - (a.vertCompressConstant = o.getFloat32(n, !0)), - (n += Float32Array.BYTES_PER_ELEMENT), - (a.minVerticesValue.x = o.getFloat64(n, !0)), - (n += Float64Array.BYTES_PER_ELEMENT), - (a.minVerticesValue.y = o.getFloat64(n, !0)), - (n += Float64Array.BYTES_PER_ELEMENT), - (a.minVerticesValue.z = o.getFloat64(n, !0)), - (n += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(n, !0)), - c = ((n += Float64Array.BYTES_PER_ELEMENT), o.getFloat64(n, !0)), - h = ((n += Float64Array.BYTES_PER_ELEMENT), o.getFloat64(n, !0)), - m = ((n += Float64Array.BYTES_PER_ELEMENT), o.getFloat64(n, !0)), - d = ((n += Float64Array.BYTES_PER_ELEMENT), o.getFloat64(n, !0)), - p = ((n += Float64Array.BYTES_PER_ELEMENT), o.getFloat64(n, !0)), - g = ((n += Float64Array.BYTES_PER_ELEMENT), o.getFloat64(n, !0)), - f = ((n += Float64Array.BYTES_PER_ELEMENT), o.getFloat64(n, !0)), - _ = - ((n += Float64Array.BYTES_PER_ELEMENT), - (a.minTexCoordValue[0].x = h), - (a.minTexCoordValue[0].y = m), - (a.minTexCoordValue[1].x = g), - (a.minTexCoordValue[1].y = f), - (a.texCoordCompressConstant[0].x = u), - (a.texCoordCompressConstant[0].y = c), - (a.texCoordCompressConstant[1].x = d), - (a.texCoordCompressConstant[1].y = p), - o.getInt32(n, !0)); - n += Int32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < _; e++) { - var C = o.getInt32(n, !0); - n += Int32Array.BYTES_PER_ELEMENT; - let r = 0; - (C !== Re.Custom0 && C !== Re.Custom1) || - ((r = o.getInt32(n, !0)), (n += Int32Array.BYTES_PER_ELEMENT)); - var y = o.getInt32(n, !0), - v = ((n += Int32Array.BYTES_PER_ELEMENT), new Uint8Array(i, n, y)); - let e = (n += Uint8Array.BYTES_PER_ELEMENT * y) % 4; - n += e = e && 4 - e; - { - w = void 0; - b = void 0; - T = void 0; - y = void 0; - E = void 0; - S = void 0; - var w = l; - var b = C; - var T = r; - y = v; - var E = a; - var S = s; - let e = 0, - t; - const P = E.vertexAttributes, - x = E.attrLocation; - switch (b) { - case Re.Normal: - case Re.FirstTexcoord: - case Re.SecondTexcoord: - (e = 2 * Uint16Array.BYTES_PER_ELEMENT), - 0 != (16 & S) || - (b !== Re.FirstTexcoord && b !== Re.SecondTexcoord) || - (e = 2 * Float32Array.BYTES_PER_ELEMENT), - (t = new Uint8Array(w * e)); - break; - case Re.Color: - case Re.SecondColor: - (e = 4 * Uint8Array.BYTES_PER_ELEMENT), - (t = new Uint8Array(4 * w)); - break; - case Re.Custom0: - case Re.Custom1: - (e = Float32Array.BYTES_PER_ELEMENT * T), - (t = new Uint8Array(w * T * 4)); - break; - default: - (e = 4 * Uint16Array.BYTES_PER_ELEMENT), - (t = new Uint8Array(w * e)); - } - Pe.decodeVertexBuffer(t, w, e, y, y.length); - let i, o; - switch (b) { - case Re.Position: - (x.aPosition = P.length), - P.push({ - index: x.aPosition, - typedArray: new Uint16Array(t.buffer, 0, t.length / 2), - componentsPerAttribute: 4, - componentDatatype: 5122, - offsetInBytes: 0, - strideInBytes: 0, - normalize: !1, - }), - (E.verticesCount = w); - break; - case Re.Normal: - (x.aNormal = P.length), - P.push({ - index: x.aNormal, - typedArray: new Int16Array(t.buffer, 0, t.length / 2), - componentsPerAttribute: 2, - componentDatatype: 5122, - offsetInBytes: 0, - strideInBytes: 0, - normalize: !1, - }); - break; - case Re.FirstTexcoord: - (i = - 0 == (16 & S) - ? ((o = 5126), new Float32Array(t.buffer, 0, t.length / 4)) - : ((o = 5122), new Uint16Array(t.buffer, 0, t.length / 2))), - (x.aTexCoord0 = P.length), - P.push({ - index: x.aTexCoord0, - typedArray: i, - componentsPerAttribute: 2, - componentDatatype: o, - offsetInBytes: 0, - strideInBytes: 0, - normalize: !1, - }); - break; - case Re.SecondTexcoord: - (i = - 0 == (16 & S) - ? ((o = 5126), new Float32Array(t.buffer, 0, t.length / 4)) - : ((o = 5122), new Uint16Array(t.buffer, 0, t.length / 2))), - (x.aTexCoord1 = P.length), - P.push({ - index: x.aTexCoord1, - typedArray: i, - componentsPerAttribute: 2, - componentDatatype: o, - offsetInBytes: 0, - strideInBytes: 0, - normalize: !1, - }); - break; - case Re.Color: - (x.aColor = P.length), - P.push({ - index: x.aColor, - typedArray: t, - componentsPerAttribute: 4, - componentDatatype: 5121, - offsetInBytes: 0, - strideInBytes: 0, - normalize: !0, - }); - break; - case Re.SecondColor: - (x.aSecondColor = P.length), - P.push({ - index: x.aSecondColor, - typedArray: t, - componentsPerAttribute: 4, - componentDatatype: 5120, - offsetInBytes: 0, - strideInBytes: 0, - normalize: !1, - }); - break; - case Re.Custom0: - (x.aCustom0 = P.length), - P.push({ - index: x.aCustom0, - typedArray: new Float32Array(t.buffer, 0, t.length / 4), - componentsPerAttribute: T, - componentDatatype: 5126, - offsetInBytes: 0, - strideInBytes: 0, - normalize: !1, - }); - break; - case Re.Custom1: - (x.aCustom1 = P.length), - P.push({ - index: x.aCustom1, - typedArray: new Float32Array(t.buffer, 0, t.length / 4), - componentsPerAttribute: T, - componentDatatype: 5126, - offsetInBytes: 0, - strideInBytes: 0, - normalize: !1, - }); - } - } - } - (h = Be(i, o, n)), - (m = - ((n = h.bytesOffset), - (a.customVertexAttribute = JSON.parse(h.string)), - "aCustom" + a.customVertexAttribute.TextureCoordMatrix)), - (g = "aCustom" + a.customVertexAttribute.VertexWeight); - void 0 !== a.attrLocation[m] && - ((a.attrLocation.aTextureCoordMatrix = a.attrLocation[m]), - t === r - 1 && delete a.attrLocation[m]), - void 0 !== a.attrLocation[g] && - ((a.attrLocation.aVertexWeight = a.attrLocation[g]), - t === r - 1 && delete a.attrLocation[g]); - let e = n % 4; - n += e = e && 4 - e; - } - return n; - } - function We(e, t, i, o) { - var r = t.getUint32(i, !0); - return ( - (o.compressOptions = r), - (i += Uint32Array.BYTES_PER_ELEMENT), - (i = ( - (r & Me.SVC_Vertex) === Me.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: 5122, - offsetInBytes: 0, - strideInBytes: a, - normalize: !1, - }), - i - ); - } - : He - )(e, t, i, o)), - (i = ke( - e, - t, - (i = Ge( - e, - t, - (i = ( - (r & Me.SVC_Normal) === Me.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: 5122, - offsetInBytes: 0, - strideInBytes: t, - normalize: !1, - }), - i - ); - } - : Ve - )(e, t, i, o)), - o - )), - o - )), - (i = ( - (r & Me.SVC_TexutreCoord) === Me.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: 5122, - 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: 5126, - offsetInBytes: 0, - strideInBytes: Float32Array.BYTES_PER_ELEMENT, - normalize: !1, - })); - } - return a; - } - : Ne - )(e, t, i, o)), - (r & Me.SVC_TexutreCoordIsW) === Me.SVC_TexutreCoordIsW && - (o.textureCoordIsW = !0), - (i = je(e, t, i, o)) - ); - } - function Ye(i, o, r, n, a) { - o.getUint32(r, !0), (r += Uint32Array.BYTES_PER_ELEMENT); - var t = o.getUint32(r, !0); - r += Uint32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < t; e++) { - 3 === a && (o.getUint32(r, !0), (r += Uint32Array.BYTES_PER_ELEMENT)); - var s = Be(i, o, r), - l = s.string, - s = ((r = s.bytesOffset), s.length % 4); - 0 != s && (r += 4 - s); - let e = o.getUint32(r, !0); - if (((r += Int32Array.BYTES_PER_ELEMENT), 3 === a)) - switch (e) { - case Ie.Standard: - e = De.SV_Standard; - break; - case Ie.Draco: - e = De.SV_DracoCompressed; - break; - case Ie.MeshOpt: - e = De.SV_Compressed; - } - var s = { - vertexAttributes: [], - attrLocation: {}, - instanceCount: 0, - instanceMode: 0, - instanceIndex: -1, - }, - u = - (e === De.SV_Standard - ? (r = ze(i, o, r, s, a)) - : e === De.SV_Compressed && 3 === a - ? (r = Ue(i, o, r, s)) - : e === De.SV_Compressed && (r = We(i, o, r, s)), - []); - r = - e === De.SV_Compressed && 3 === a - ? (function (o, r, n, a) { - var t = r.getInt32(n, !0); - n += Int32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < t; e++) { - const d = {}; - var s = r.getInt32(n, !0); - if (((n += Int32Array.BYTES_PER_ELEMENT), !(s < 1))) { - var l = r.getInt8(n, !0), - u = - ((n += Int8Array.BYTES_PER_ELEMENT), - r.getInt8(n, !0), - (n += Int8Array.BYTES_PER_ELEMENT), - r.getInt8(n, !0)), - c = - ((n += Int8Array.BYTES_PER_ELEMENT), - r.getInt8(n, !0), - (n += Int8Array.BYTES_PER_ELEMENT), - r.getInt32(n, !0)); - n += Int32Array.BYTES_PER_ELEMENT; - let e, - t = - (13 !== u - ? ((e = new Uint8Array(o, n, c)), - (n += Uint8Array.BYTES_PER_ELEMENT * c)) - : ((e = new Uint32Array(o, n, c)), - (n += Uint32Array.BYTES_PER_ELEMENT * c)), - n % 4); - n += t = t && 4 - t; - let i; - 13 !== u - ? ((i = new Uint8Array(s * Uint32Array.BYTES_PER_ELEMENT)), - Pe.decodeIndexBuffer( - i, - s, - Uint32Array.BYTES_PER_ELEMENT, - e - )) - : (i = e); - var h = r.getInt32(n, !0); - n += Int32Array.BYTES_PER_ELEMENT; - const p = new ( - 0 === (d.indexType = l) ? Uint16Array : Uint32Array - )(s); - d.indicesCount = s; - c = new Uint32Array(i.buffer, i.byteOffset, i.byteLength / 4); - p.set(c, 0), (d.indicesTypedArray = p), (d.primitiveType = u); - for (let e = 0; e < h; e++) { - var m = Be(o, r, n); - (n = m.bytesOffset), (d.materialCode = m.string); - } - a.push(d), (n += t = (t = n % 4) && 4 - t); - } - } - return n; - })(i, o, r, u) - : (function (o, t, r, n, a) { - var i = t.getUint32(r, !0); - r += Uint32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < i; e++) { - let i = {}; - 3 === a && - (t.getUint32(r, !0), (r += Uint32Array.BYTES_PER_ELEMENT)); - var s = t.getUint32(r, !0), - l = ((r += Uint32Array.BYTES_PER_ELEMENT), t.getUint8(r, !0)), - u = - ((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 < s) - ) { - let e = null, - t; - 1 === l || 3 === l - ? ((t = s * Uint32Array.BYTES_PER_ELEMENT), - (e = new Uint8Array(o, r, t))) - : ((t = s * Uint16Array.BYTES_PER_ELEMENT), - (e = new Uint8Array(o, r, t)), - s % 2 != 0 && (t += 2)), - (i.indicesTypedArray = e), - (r += t); - } - (i.indicesCount = s), (i.indexType = l), (i.primitiveType = u); - var c = t.getUint32(r, !0); - r += Uint32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < c; e++) { - var h = Be(o, t, r), - m = h.string; - (r = h.bytesOffset), (i.materialCode = m); - } - 0 != r % 4 && (r += 4 - (r % 4)), n.push(i); - } - return r; - })(i, o, r, u, a); - let t = void 0; - 2 === u.length && - 13 === u[1].primitiveType && - 3 <= u[1].indicesCount && - (t = S3MEdgeProcessor.createEdgeDataByIndices(s, u[1])), - (n[l] = { vertexPackage: s, arrIndexPackage: u, edgeGeometry: t }), - 3 === a && - (o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT), - o.getFloat64(r, !0), - (r += Float64Array.BYTES_PER_ELEMENT)); - } - return (r = - 3 !== a ? (r += o.getUint32(r, !0)) + Uint32Array.BYTES_PER_ELEMENT : r); - } - let Je = { red: 0, green: 0, blue: 0, alpha: 0 }; - function Ke(e, t, i) { - let o = e.vertexAttributes, - r = e.attrLocation; - e = o.length; - (r[1 === i ? "instanceId" : "batchId"] = e), - o.push({ - index: e, - typedArray: t, - componentsPerAttribute: 1, - componentDatatype: 5126, - offsetInBytes: 0, - strideInBytes: 0, - instanceDivisor: i, - }); - } - xe.parseBuffer = function (e) { - let t = 0, - i = { - version: void 0, - groupNode: void 0, - geoPackage: {}, - matrials: void 0, - texturePackage: {}, - }, - o = new DataView(e); - (i.version = o.getFloat32(t, !0)), - (t += Float32Array.BYTES_PER_ELEMENT), - 2 <= i.version && - (o.getUint32(t, !0), (t += Uint32Array.BYTES_PER_ELEMENT)), - 3 <= i.version && - (o.getUint32(t, !0), (t += Uint32Array.BYTES_PER_ELEMENT)), - o.getUint32(t, !0), - (t += Uint32Array.BYTES_PER_ELEMENT); - (r = e), (s = t), (r = new Uint8Array(e, s)); - var r, - n, - a, - e = ye.inflate(r).buffer, - s = ((o = new DataView(e)), (t = 0), o.getUint32(t, !0)), - l = - ((t += Uint32Array.BYTES_PER_ELEMENT), - (t = (function (t, i, o, r) { - let e = {}; - 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 = Fe(t, i, o, n, r.version); - e.pageLods = n; - var s = o % 4; - return 0 != s && (o += 4 - s), (r.groupNode = e), o; - })(e, o, t, i)), - (t = Ye(e, o, t, i.geoPackage, i.version)), - (t = (function (o, r, n, a) { - r.getUint32(n, !0), (n += Uint32Array.BYTES_PER_ELEMENT); - var t = r.getUint32(n, !0); - n += Uint32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < t; e++) { - var s = Be(o, r, n), - l = s.string, - s = ((n = s.bytesOffset), s.length % 4), - s = - (0 != s && (n += 4 - s), - r.getUint32(n, !0), - (n += Uint32Array.BYTES_PER_ELEMENT), - r.getUint32(n, !0)), - u = ((n += Uint32Array.BYTES_PER_ELEMENT), r.getUint32(n, !0)); - n += Uint32Array.BYTES_PER_ELEMENT; - let e = r.getUint32(n, !0); - n += Uint32Array.BYTES_PER_ELEMENT; - var c = r.getUint32(n, !0), - h = ((n += Uint32Array.BYTES_PER_ELEMENT), r.getUint32(n, !0)); - n += Uint32Array.BYTES_PER_ELEMENT; - let t = new Uint8Array(o, n, c), - i = ((n += c), h === Le.RGB || h === Le.BGR ? 33776 : 33779); - 22 === e && (i = 36196), - xe.s3tc || - (33776 !== i && 33779 !== i) || - ((c = new Uint8Array(s * u * 4)), - Se.decode(c, s, u, t, h), - (t = c), - (e = 0), - (i = h === Le.RGB || h === Le.RGB ? 273 : 4369)), - (a[l] = { - id: l, - width: s, - height: u, - compressType: e, - nFormat: h, - internalFormat: i, - arrayBufferView: t, - }); - } - return n; - })(e, o, t, i.texturePackage)), - (t = - ((r = e), - (h = o), - (n = t), - (a = i), - (h = h.getUint32(n, !0)), - (n += Uint32Array.BYTES_PER_ELEMENT), - (r = Oe((r = new Uint8Array(r, n, h)))), - (n += h), - (a.materials = JSON.parse(r)), - n)), - e), - u = o, - c = t, - h = s, - m = i.geoPackage, - d = i.version; - if ( - (3 === d && - ((h = u.getUint32(c, !0)), (c += Uint32Array.BYTES_PER_ELEMENT)), - 1 == (1 & h)) - ) { - u.getUint32(c, !0), (c += Uint32Array.BYTES_PER_ELEMENT); - var p = u.getUint32(c, !0); - c += Uint32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < p; e++) { - var g = Be(l, u, c), - f = g.string, - _ = ((c = g.bytesOffset), u.getUint32(c, !0)); - c += Uint32Array.BYTES_PER_ELEMENT; - let r = {}; - if (((m[f].pickInfo = r), -1 == m[f].vertexPackage.instanceIndex)) { - let o = new Float32Array(m[f].vertexPackage.verticesCount); - for (let i = 0; i < _; i++) { - var C = u.getUint32(c, !0), - y = ((c += Uint32Array.BYTES_PER_ELEMENT), u.getUint32(c, !0)); - c += Uint32Array.BYTES_PER_ELEMENT; - let t = []; - for (let e = 0; e < y; e++) { - var v = u.getUint32(c, !0), - w = ((c += Uint32Array.BYTES_PER_ELEMENT), u.getUint32(c, !0)); - (c += Uint32Array.BYTES_PER_ELEMENT), - o.fill(i, v, v + w), - t.push({ - vertexColorOffset: v, - vertexColorCount: w, - batchId: i, - }); - } - r[C] = t; - } - Ke(m[f].vertexPackage, o, void 0); - } else { - var b = m[f].vertexPackage.instanceCount, - T = m[f].vertexPackage.instanceBuffer, - E = m[f].vertexPackage.instanceMode; - let t = new Float32Array(b), - i = []; - for (let e = 0; e < _; e++) { - var S = u.getUint32(c, !0), - P = - (i.push(S), - (c += Uint32Array.BYTES_PER_ELEMENT), - u.getUint32(c, !0)); - c += Uint32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < P; e++) - u.getUint32(c, !0), - (c += Uint32Array.BYTES_PER_ELEMENT), - 3 === d && - (u.getUint32(c, !0), (c += Uint32Array.BYTES_PER_ELEMENT)); - } - var x = 17 === E ? 16 : 28; - x *= Float32Array.BYTES_PER_ELEMENT; - for (let e = 0; e < b; e++) { - var D = (t[e] = e) * E * Float32Array.BYTES_PER_ELEMENT + x, - D = - (Cesium.Color.unpack(T, D, Je), - 2 === d ? i[e] : Je.red + 256 * Je.green + 65536 * Je.blue); - void 0 === r[D] && - (r[D] = { - vertexColorCount: 1, - instanceIds: [], - vertexColorOffset: e, - }), - r[D].instanceIds.push(e); - } - Ke(m[f].vertexPackage, t, 1); - } - } - } - return i; - }; - function Qe(e, t, i) { - var o = e._gl; - (this.contextId = e.id), - (this.textureId = t), - (this.layerId = i.layerId), - (this.rootName = i.rootName), - (this.context = e), - (this.width = i.width), - (this.height = i.height), - (this.compressType = i.compressType), - (this.internalFormat = i.internalFormat), - (this.pixelFormat = i.pixelFormat), - (this.arrayBufferView = i.arrayBufferView), - (this.wrapS = Cesium.defaultValue( - i.wrapS, - Cesium.TextureWrap.CLAMP_TO_EDGE - )), - (this.wrapT = Cesium.defaultValue( - i.wrapT, - Cesium.TextureWrap.CLAMP_TO_EDGE - )), - (this._target = o.TEXTURE_2D), - (this._texture = void 0), - (this.refCount = 1), - this.arrayBufferView && this.init(); - } - function qe() { - (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.texMatrix = Cesium.Matrix4.clone( - Cesium.Matrix4.IDENTITY, - new Cesium.Matrix4() - )), - (this.textures = []); - } - (Qe.prototype.init = function () { - let e = this.context._gl; - this._texture || (this._texture = e.createTexture()), - e.bindTexture(e.TEXTURE_2D, this._texture); - var t = this.internalFormat; - (6410 !== t && 4369 !== t) || e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !0); - let i = 0, - o = 0, - r = this.width, - n = this.height; - 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; - })(this.arrayBufferView, t, r, n); - do { - var s = Cesium.PixelFormat.compressedTextureSizeInBytes(t, r, n), - l = new Uint8Array( - this.arrayBufferView.buffer, - this.arrayBufferView.byteOffset + o, - s - ); - 4369 === t - ? e.texImage2D( - e.TEXTURE_2D, - i++, - e.RGBA, - r, - n, - 0, - e.RGBA, - e.UNSIGNED_BYTE, - l - ) - : e.compressedTexImage2D(e.TEXTURE_2D, i++, t, r, n, 0, l), - (r = Math.max(r >> 1, 1)), - (n = Math.max(n >> 1, 1)), - (o += s); - } while (o < this.arrayBufferView.byteLength && a); - 1 < i - ? (e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), - e.texParameteri( - e.TEXTURE_2D, - e.TEXTURE_MIN_FILTER, - e.LINEAR_MIPMAP_LINEAR - )) - : (e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), - e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR)), - e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, this.wrapS), - e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, this.wrapT), - e.texParameteri( - this._target, - this.context._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, - 1 - ), - e.bindTexture(e.TEXTURE_2D, null), - (this.arrayBufferView = void 0), - (this.ready = !0); - }), - (Qe.prototype.isDestroyed = function () { - return !1; - }), - (Qe.prototype.destroy = function () { - let e = this.context._gl; - e.deleteTexture(this._texture), - (this._texture = null), - (this.id = 0), - Cesium.destroyObject(this); - }), - (qe.prototype.isDestroyed = function () { - return !1; - }), - (qe.prototype.destroy = function () { - var e = this.textures.length; - for (let t = 0; t < e; t++) { - let e = this.textures[t]; - e.destroy(); - } - return ( - (this.textures.length = 0), - (this.ambientColor = void 0), - (this.diffuseColor = void 0), - (this.specularColor = void 0), - Cesium.destroyObject(this) - ); - }); - var Xe = - "attribute vec4 aPosition;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef VertexNormal\nattribute vec3 aNormal;\n#endif\n#ifdef Instance\nattribute float instanceId;\n#else\nattribute float batchId;\n#endif\n#ifdef USE_VertexWeight\nattribute float aVertexWeight;\n#endif\n#ifdef USE_TextureCoordMatrix\nattribute vec2 aTextureCoordMatrix;\n#endif\n#ifdef TexCoord\nattribute vec4 aTexCoord0;\nvarying vec4 vTexCoord;\nuniform mat4 uTexMatrix;\n#ifdef COMPUTE_TEXCOORD\nuniform float uTexture0Width;\nvarying vec4 vTexMatrix;\nvarying vec4 vTexCoordTransform;\nvarying vec2 vIsRGBA;\n#endif\n#endif\n#ifdef TexCoord2\nattribute vec4 aTexCoord1;\nuniform float uTexture1Width;\nvarying vec4 vTexMatrix2;\n#endif\n#ifdef InstanceBim\nattribute vec4 uv2;\nattribute vec4 uv3;\nattribute vec4 uv4;\nattribute vec4 secondary_colour;\nattribute vec4 uv6;\n#endif\n#ifdef InstancePipe\nattribute vec4 uv1;\nattribute vec4 uv2;\nattribute vec4 uv3;\nattribute vec4 uv4;\nattribute vec4 uv5;\nattribute vec4 uv6;\nattribute vec4 uv7;\nattribute vec4 secondary_colour;\nattribute vec4 uv9;\n#endif\nuniform vec4 uFillForeColor;\nuniform vec4 uSelectedColor;\nvarying vec4 vSecondColor;\nvarying vec4 vPositionMC;\nvarying vec3 vPositionEC;\n#ifdef VertexNormal\nvarying vec3 vNormalEC;\n#endif\nvarying vec4 vColor;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT4 = 1.0 / 16.0;\nconst float SHIFT_LEFT4 = 16.0;\nvoid getTextureMatrixFromZValue(in float nZ, inout float XTran, inout float YTran, inout float scale, inout float isRGBA)\n{\nif(nZ <= 0.0)\n{\nreturn;\n}\nfloat nDel8 = floor(nZ * SHIFT_RIGHT8);\nfloat nDel16 = floor(nDel8 * SHIFT_RIGHT8);\nfloat nDel20 = floor(nDel16 * SHIFT_RIGHT4);\nisRGBA = floor(nDel20);\nYTran = nZ - nDel8 * SHIFT_LEFT8;\nXTran = nDel8 - nDel16 * SHIFT_LEFT8;\nfloat nLevel = nDel16 - nDel20 * SHIFT_LEFT4;\nscale = 1.0 / pow(2.0, nLevel);\n}\nvoid operation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor)\n{\nfloat right_2 = operationType.x * 0.5;\nfloat right_4 = right_2 * 0.5;\nfloat right_8 = right_4 * 0.5;\nfloat right_16 = right_8 * 0.5;\nfloat isSetColor = fract(right_2);\nif(isSetColor > 0.1)\n{\nvertexColor *= color;\n}\nfloat isPicked = fract(floor(right_2)* 0.5);\nif(isPicked > 0.1)\n{\nvertexColor *= selectedColor;\n}\nfloat isHide = fract(floor(right_4)* 0.5);\nif(isHide > 0.1)\n{\nvertexColor.a = 0.0;\n}\n}\n#ifdef COMPRESS_TEXCOORD\n#ifdef TexCoord\nuniform vec2 decode_texCoord0_min;\n#endif\n#ifdef TexCoord2\nuniform vec2 decode_texCoord1_min;\n#endif\n#ifdef MeshOPT_Compress\nuniform vec3 decode_texCoord0_vNormConstant;\nuniform vec3 decode_texCoord1_vNormConstant;\n#else\nuniform float decode_texCoord0_normConstant;\nuniform float decode_texCoord1_normConstant;\n#endif\n#endif\n#ifdef COMPRESS_VERTEX\nuniform vec4 decode_position_min;\nuniform float decode_position_normConstant;\n#endif\n#ifdef COMPRESS_NORMAL\nuniform float normal_rangeConstant;\n#endif\nvoid main()\n{\n#ifdef COMPRESS_VERTEX\nvec4 vertexPos = vec4(1.0);\nvertexPos = decode_position_min + vec4(aPosition.xyz, 1.0) * decode_position_normConstant;\n#else\nvec4 vertexPos = aPosition;\n#endif\n#ifdef TexCoord\n#ifdef COMPRESS_TEXCOORD\n#ifdef MeshOPT_Compress\nvec2 texCoord0;\ntexCoord0.x = aTexCoord0.x * decode_texCoord0_vNormConstant.x;\ntexCoord0.y = aTexCoord0.y * decode_texCoord0_vNormConstant.y;\nvTexCoord.xy = decode_texCoord0_min + texCoord0.xy;\n#else\nvTexCoord.xy = decode_texCoord0_min.xy + aTexCoord0.xy * decode_texCoord0_normConstant;\n#endif\n#else\nvTexCoord.xy = aTexCoord0.xy;\n#endif\n#ifdef COMPUTE_TEXCOORD\nvTexMatrix = vec4(0.0,0.0,1.0,0.0);\nvIsRGBA.x = 0.0;\nvTexCoordTransform.x = aTexCoord0.z;\n#ifdef USE_TextureCoordMatrix\nvTexCoordTransform.x = aTextureCoordMatrix.x;\n#endif\nif(vTexCoordTransform.x < -90000.0)\n{\nvTexMatrix.z = -1.0;\n}\ngetTextureMatrixFromZValue(floor(vTexCoordTransform.x), vTexMatrix.x, vTexMatrix.y, vTexMatrix.z, vIsRGBA.x);\nvTexMatrix.w = log2(uTexture0Width * vTexMatrix.z);\n#endif\n#endif\n#ifdef TexCoord2\n#ifdef COMPRESS_TEXCOORD\n#ifdef MeshOPT_Compress\nvec2 texCoord1;\ntexCoord1.x = aTexCoord1.x * decode_texCoord1_vNormConstant.x;\ntexCoord1.y = aTexCoord1.y * decode_texCoord1_vNormConstant.y;\nvTexCoord.zw = decode_texCoord1_min + texCoord1.xy;\n#else\nvTexCoord.zw = decode_texCoord1_min.xy + aTexCoord1.xy * decode_texCoord1_normConstant;\n#endif\n#else\nvTexCoord.zw = aTexCoord1.xy;\n#endif\nvTexMatrix2 = vec4(0.0,0.0,1.0,0.0);\nvIsRGBA.y = 0.0;\nvTexCoordTransform.y = aTexCoord1.z;\n#ifdef USE_TextureCoordMatrix\nvTexCoordTransform.y = aTextureCoordMatrix.y;\n#endif\nif(vTexCoordTransform.y < -90000.0)\n{\nvTexMatrix2.z = -1.0;\n}\ngetTextureMatrixFromZValue(floor(vTexCoordTransform.y), vTexMatrix2.x, vTexMatrix2.y, vTexMatrix2.z, vIsRGBA.y);\nvTexMatrix2.w = log2(uTexture1Width * vTexMatrix.z);\n#endif\nvec4 vertexColor = uFillForeColor;\n#ifdef VertexColor\nvertexColor *= aColor;\n#endif\n#ifdef VertexNormal\nvec3 normal = aNormal;\n#ifdef COMPRESS_NORMAL\n#ifdef MeshOPT_Compress\nnormal.x = aNormal.x / 127.0;\nnormal.y = aNormal.y / 127.0;\nnormal.z = 1.0 - abs(normal.x) - abs(normal.y);\nnormal = normalize(normal);\n#else\nnormal = czm_octDecode(aNormal.xy, normal_rangeConstant).zxy;\n#endif\n#endif\n#endif\n#ifdef InstanceBim\nmat4 worldMatrix;\nworldMatrix[0] = uv2;\nworldMatrix[1] = uv3;\nworldMatrix[2] = uv4;\nworldMatrix[3] = vec4(0, 0, 0, 1);\nvertexPos = vec4(vertexPos.xyz,1.0) * worldMatrix;\nvertexColor *= secondary_colour;\n#endif\n#ifdef InstancePipe\nmat4 worldMatrix;\nmat4 worldMatrix0;\nmat4 worldMatrix1;\nvec4 worldPos0;\nvec4 worldPos1;\nworldMatrix0[0] = uv1;\nworldMatrix0[1] = uv2;\nworldMatrix0[2] = uv3;\nworldMatrix0[3] = vec4( 0.0, 0.0, 0.0, 1.0 );\nworldMatrix1[0] = uv4;\nworldMatrix1[1] = uv5;\nworldMatrix1[2] = uv6;\nworldMatrix1[3] = vec4( 0.0, 0.0, 0.0, 1.0 );\nvec4 realVertex = vec4(vertexPos.xyz, 1.0);\nrealVertex.x = realVertex.x * uv7.z;\nworldPos0 = realVertex * worldMatrix0;\nworldPos1 = realVertex * worldMatrix1;\nvertexColor *= secondary_colour;\n#ifdef TexCoord\nif(aTexCoord0.y > 0.5)\n{\nvec4 tex4Vec = uTexMatrix * vec4(uv7.y, aTexCoord0.x, 0.0, 1.0);\nvTexCoord.xy = tex4Vec.xy;\nvertexPos = worldPos1;\nworldMatrix = worldMatrix1;\n}\nelse\n{\nvec4 tex4Vec = uTexMatrix * vec4(uv7.x, aTexCoord0.x, 0.0, 1.0);\nvTexCoord.xy = tex4Vec.xy;\nvertexPos = worldPos0;\nworldMatrix = worldMatrix0;\n}\n#endif\n#ifdef VertexNormal\nnormal.x = normal.x * uv7.z;\n#endif\n#endif\n#ifdef Instance\nfloat index = instanceId;\n#else\nfloat index = batchId;\n#endif\nvec4 operationType = batchTable_operation(index);\noperation(operationType, vec4(1.0), uSelectedColor, vertexColor);\nvSecondColor = batchTable_pickColor(index);\nvec4 positionMC = vec4(vertexPos.xyz, 1.0);\nvColor = vertexColor;\n#ifdef VertexNormal\nvNormalEC = czm_normal * normal;\n#endif\nvPositionMC = positionMC;\nvPositionEC = (czm_modelView * positionMC).xyz;\ngl_Position = czm_modelViewProjection * vec4(vertexPos.xyz, 1.0);\n}\n", - Ze = - "#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nuniform vec4 uDiffuseColor;\n#ifdef TexCoord\nvarying vec4 vTexCoord;\n#ifdef COMPUTE_TEXCOORD\nuniform sampler2D uTexture;\nuniform float uTexture0Width;\nvarying vec4 vTexCoordTransform;\nvarying vec4 vTexMatrix;\nvarying vec2 vIsRGBA;\n#endif\n#endif\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying vec4 vPositionMC;\nvarying vec3 vPositionEC;\n#ifdef VertexNormal\nvarying vec3 vNormalEC;\n#endif\n#ifdef TexCoord2\nuniform sampler2D uTexture2;\nuniform float uTexture1Width;\nvarying vec4 vTexMatrix2;\n#endif\n#ifdef COMPUTE_TEXCOORD\nvoid calculateMipLevel(in vec2 inTexCoord, in float vecTile, in float fMaxMip, inout float mipLevel)\n{\nvec2 dx = dFdx(inTexCoord * vecTile);\nvec2 dy = dFdy(inTexCoord * vecTile);\nfloat dotX = dot(dx, dx);\nfloat dotY = dot(dy, dy);\nfloat dMax = max(dotX, dotY);\nfloat dMin = min(dotX, dotY);\nfloat offset = (dMax - dMin) / (dMax + dMin);\noffset = clamp(offset, 0.0, 1.0);\nfloat d = dMax * (1.0 - offset) + dMin * offset;\nmipLevel = 0.5 * log2(d);\nmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\nvoid calculateTexCoord(in vec3 inTexCoord, in float scale, in float XTran, in float YTran, in float fTile, in float mipLevel, inout vec2 outTexCoord)\n{\nif(inTexCoord.z < -9000.0)\n{\noutTexCoord = inTexCoord.xy;\n}\nelse\n{\nvec2 fTexCoord = fract(inTexCoord.xy);\nfloat offset = 1.0 * pow(2.0, mipLevel) / fTile;\nfTexCoord = clamp(fTexCoord, offset, 1.0 - offset);\noutTexCoord.x = (fTexCoord.x + XTran) * scale;\noutTexCoord.y = (fTexCoord.y + YTran) * scale;\n}\n}\nvec4 getTexColorForS3M(sampler2D curTexture, vec3 oriTexCoord, float texTileWidth, float fMaxMipLev, float fTexCoordScale, vec2 vecTexCoordTranslate, float isRGBA)\n{\nvec4 color = vec4(1.0);\nfloat mipLevel = 0.0;\n#ifdef GL_OES_standard_derivatives\ncalculateMipLevel(oriTexCoord.xy, texTileWidth, fMaxMipLev, mipLevel);\n#endif\nvec2 realTexCoord;\ncalculateTexCoord(oriTexCoord, fTexCoordScale, vecTexCoordTranslate.x, vecTexCoordTranslate.y, texTileWidth, mipLevel, realTexCoord);\nif(isRGBA > 0.5)\n{\nvec2 rgbTexCoord;\nrgbTexCoord.x = (realTexCoord.x + vecTexCoordTranslate.x * fTexCoordScale) * 0.5;\nrgbTexCoord.y = (realTexCoord.y + vecTexCoordTranslate.y * fTexCoordScale) * 0.5;\ncolor = texture2D(curTexture, rgbTexCoord.xy, -10.0);\nvec2 vecAlphaTexCoord;\nvecAlphaTexCoord.x = rgbTexCoord.x;\nvecAlphaTexCoord.y = rgbTexCoord.y + fTexCoordScale * 0.5;\ncolor.a = texture2D(curTexture, vecAlphaTexCoord.xy, -10.0).r;\n}\nelse\n{\nif(oriTexCoord.z < -9000.0)\n{\ncolor = texture2D(curTexture, realTexCoord.xy);\n}\nelse\n{\n#ifdef GL_EXT_shader_texture_lod\ncolor = texture2DLodEXT(curTexture, realTexCoord.xy, mipLevel);\n#else\ncolor = texture2D(curTexture, realTexCoord.xy, mipLevel);\n#endif\n}\n}\nreturn color;\n}\nvec4 getTextureColor()\n{\nif(vTexMatrix.z < 0.0)\n{\nreturn vec4(1.0);\n}\nfloat texTileWidth0 = vTexMatrix.z * uTexture0Width;\nvec3 realTexCoord = vec3(vTexCoord.xy, vTexCoordTransform.x);\nvec4 FColor = getTexColorForS3M(uTexture, realTexCoord, texTileWidth0, vTexMatrix.w, vTexMatrix.z, vTexMatrix.xy, vIsRGBA.x);\n#ifdef TexCoord2\nfloat texTileWidth1 = vTexMatrix2.z * uTexture1Width;\nrealTexCoord = vec3(vTexCoord.zw, vTexCoordTransform.y);\nvec4 SColor = getTexColorForS3M(uTexture2, realTexCoord, texTileWidth1, vTexMatrix2.w, vTexMatrix2.z, vTexMatrix2.xy, vIsRGBA.y);\nSColor.r = clamp(SColor.r, 0.0, 1.0);\nSColor.g = clamp(SColor.g, 0.0, 1.0);\nSColor.b = clamp(SColor.b, 0.0, 1.0);\nreturn FColor * SColor;\n#else\nreturn FColor;\n#endif\n}\n#endif\nvec4 SRGBtoLINEAR4(vec4 srgbIn)\n{\n#ifndef HDR\nvec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\nreturn vec4(linearOut, srgbIn.a);\n#else\nreturn srgbIn;\n#endif\n}\nvec3 LINEARtoSRGB(vec3 linearIn)\n{\n#ifndef HDR\nreturn pow(linearIn, vec3(1.0/2.2));\n#else\nreturn linearIn;\n#endif\n}\nvec3 applyTonemapping(vec3 linearIn)\n{\n#ifndef HDR\nreturn czm_acesTonemapping(linearIn);\n#else\nreturn linearIn;\n#endif\n}\nvec3 computeNormal(in vec3 oriVertex)\n{\nvec3 normal = cross(vec3(dFdx(oriVertex.x), dFdx(oriVertex.y), dFdx(oriVertex.z)), vec3(dFdy(oriVertex.x), dFdy(oriVertex.y), dFdy(oriVertex.z)));\nnormal = normalize(normal);\nreturn normal;\n}\nvoid main()\n{\nif(vColor.a < 0.1)\n{\ndiscard;\n}\nvec4 baseColorWithAlpha = vColor;\n#ifdef COMPUTE_TEXCOORD\nbaseColorWithAlpha *= SRGBtoLINEAR4(getTextureColor());\n#endif\nif(baseColorWithAlpha.a < 0.1)\n{\ndiscard;\n}\nvec3 normal = vec3(0.0);\n#ifdef VertexNormal\nnormal = normalize(vNormalEC);\n#endif\nnormal = length(normal) > 0.1 ? normal : computeNormal(vPositionMC.xyz);\nvec3 color = baseColorWithAlpha.rgb;\nvec3 dirVectorEC = normalize(czm_lightDirectionEC);\nfloat dotProduct = dot( normal, dirVectorEC );\nfloat dirDiffuseWeight = max( dotProduct, 0.0 );\ndirDiffuseWeight = dirDiffuseWeight * 0.5 + 0.5;\ncolor += color * uDiffuseColor.rgb * dirDiffuseWeight;\n#ifdef TexCoord\ncolor = LINEARtoSRGB(color);\n#endif\ngl_FragColor = vec4(color, baseColorWithAlpha.a);\n}\n"; - function $e() { - (this.context = void 0), (this.model = void 0), (this.index = void 0); - } - function et() { - (this.model = void 0), (this.context = void 0), (this.index = 0); - } - ($e.prototype.set = function (e, t, i) { - (this.context = e), (this.model = t), (this.index = i); - }), - ($e.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 || Cesium.defined(o.typedArray) - ? 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) - : (o.vertexBuffer = this.model.instanceBuffer); - }), - (et.prototype.set = function (e, t, i) { - (this.model = t), (this.context = e), (this.index = i); - }), - (et.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), - Cesium.defined(i.indexBuffer) || - (i.indexBuffer = Cesium.Buffer.createIndexBuffer({ - context: t, - typedArray: i.indicesTypedArray, - usage: Cesium.BufferUsage.STATIC_DRAW, - indexDatatype: e, - })), - (i.indicesTypedArray = null), - delete i.indicesTypedArray; - } - }); - var tt = Object.freeze({ - VertexNormal: "VertexNormal", - VertexColor: "VertexColor", - TexCoord: "TexCoord", - TexCoord2: "TexCoord2", - Instance: "Instance", - COMPRESS_VERTEX: "COMPRESS_VERTEX", - COMPRESS_NORMAL: "COMPRESS_NORMAL", - COMPRESS_COLOR: "COMPRESS_COLOR", - COMPRESS_TEXCOORD: "COMPRESS_TEXCOORD", - UseLineColor: "USE_LINECOLOR", - InstanceBim: "InstanceBim", - InstancePipe: "InstancePipe", - COMPUTE_TEXCOORD: "COMPUTE_TEXCOORD", - }), - it = Object.freeze({ - SVC_Vertex: 1, - SVC_Normal: 2, - SVC_VertexColor: 4, - SVC_SecondColor: 8, - SVC_TexutreCoord: 16, - SVC_TexutreCoordIsW: 32, - }), - ot = Object.freeze({ BIM: 17, PIPELINE: 29 }); - function rt() { - (this.model = void 0), (this.context = void 0); - } - function nt(e) { - (this.layer = e.layer), - (this.vertexPackage = e.vertexPackage), - (this.arrIndexPackage = e.arrIndexPackage), - (this.vertexBufferToCreate = new Cesium.Queue()), - (this.indexBufferToCreate = new Cesium.Queue()), - (this.shaderProgramToCreate = 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.shaderProgramToCreate.enqueue(0), - (this.boundingVolume = e.boundingVolume), - (this.material = Cesium.defaultValue(e.material, new qe())), - (this.geoName = e.geoName), - (this.modelMatrix = e.modelMatrix), - (this.geoMatrix = e.geoMatrix), - (this.invGeoMatrix = Cesium.Matrix4.inverse( - this.geoMatrix, - new Cesium.Matrix4() - )), - (this.instanceCount = e.vertexPackage.instanceCount), - (this.attributeLocations = e.vertexPackage.attrLocation), - (this.shaderProgram = void 0), - (this.vertexArray = void 0), - (this.colorCommand = void 0), - (this.pickInfo = Cesium.defaultValue(e.pickInfo, {})), - (this.selectionInfoMap = new Cesium.AssociativeArray()), - (this.batchTable = void 0), - (this.batchTableDirty = !1), - (this.idsOperationMap = new Cesium.AssociativeArray()), - (this.pickColorIdentifier = "vSecondColor"), - this.createBoundingBoxForInstance(), - (this.ready = !1); - } - (rt.prototype.set = function (e, t) { - (this.model = t), (this.context = e); - }), - (rt.prototype.execute = function () { - const e = this.context, - t = this.model; - var i = t.layer, - o = t.vs, - r = t.fs, - n = t.attributeLocations, - a = t.material, - s = t.vertexPackage, - o = t.batchTable ? t.batchTable.getVertexShaderCallback()(o) : o; - void 0 === e.texturelod && - (e.texturelod = Cesium.defaultValue( - (function (t, i) { - var o = i.length; - for (let e = 0; e < o; ++e) { - var r = t.getExtension(i[e]); - if (r) return r; - } - })(e._gl, ["EXT_shader_texture_lod"]), - !1 - )); - let l = new Cesium.ShaderSource({ sources: [o] }), - u = new Cesium.ShaderSource({ sources: [r] }); - Cesium.defined(n.aNormal) && - (l.defines.push(tt.VertexNormal), u.defines.push(tt.VertexNormal)), - Cesium.defined(n.aColor) && l.defines.push(tt.VertexColor), - a && - 0 < a.textures.length && - (l.defines.push(tt.COMPUTE_TEXCOORD), - u.defines.push(tt.COMPUTE_TEXCOORD)), - a && - 2 === a.textures.length && - (l.defines.push(tt.TexCoord2), u.defines.push(tt.TexCoord2)), - Cesium.defined(n.aTexCoord0) && - (l.defines.push("TexCoord"), u.defines.push("TexCoord")), - -1 < s.instanceIndex && l.defines.push(tt.Instance), - s.instanceMode === ot.BIM && l.defines.push(tt.InstanceBim), - s.instanceMode === ot.PIPELINE && l.defines.push(tt.InstancePipe), - Cesium.defined(s.compressOptions) && - (((o = s.compressOptions) & it.SVC_Vertex) === it.SVC_Vertex && - l.defines.push(tt.COMPRESS_VERTEX), - (o & it.SVC_Normal) === it.SVC_Normal && - l.defines.push(tt.COMPRESS_NORMAL), - (o & it.SVC_VertexColor) === it.SVC_VertexColor && - l.defines.push(tt.COMPRESS_COLOR), - (o & it.SVC_TexutreCoord) === it.SVC_TexutreCoord && - l.defines.push(tt.COMPRESS_TEXCOORD)), - Cesium.defined(t.arrIndexPackage) && - 0 < t.arrIndexPackage.length && - 2 === t.arrIndexPackage[0].primitiveType && - u.defines.push(tt.UseLineColor), - Cesium.defined(s.customVertexAttribute) && - Cesium.defined(s.customVertexAttribute.TextureCoordMatrix) && - l.defines.push("USE_TextureCoordMatrix"), - Cesium.defined(s.customVertexAttribute) && - Cesium.defined(s.customVertexAttribute.VertexWeight) && - l.defines.push("USE_VertexWeight"), - "MESHOPT" === i._vertexCompressionType && - l.defines.push("MeshOPT_Compress"), - (t.shaderProgram = Cesium.ShaderProgram.fromCache({ - context: e, - vertexShaderSource: l, - fragmentShaderSource: u, - attributeLocations: n, - })); - }); - const at = new $e(), - st = new et(), - lt = new rt(); - function ut(e) { - nt.call(this, e), (this.vs = Xe), (this.fs = Ze), (this.useLineColor = !1); - } - (nt.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 ( - (at.set(r, i, n), !o.jobScheduler.execute(at, 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 ( - (st.set(l, a, u), !s.jobScheduler.execute(st, Cesium.JobType.BUFFER)) - ) - break; - e.dequeue(); - } - return; - } - }), - (nt.prototype.createShaderProgram = function (t) { - { - var i = this, - o = t, - r = i.layer.context; - let e = i.shaderProgramToCreate; - for ( - ; - e.length && - (e.peek(), - lt.set(r, i), - o.jobScheduler.execute(lt, Cesium.JobType.PROGRAM)); - - ) - e.dequeue(); - return; - } - }), - (nt.prototype.createBatchTable = function (e) { - var t = this; - if (!Cesium.defined(t.batchTable) && t.pickInfo) { - var i = t.layer.context; - let e = []; - e.push( - { - functionName: "batchTable_operation", - componentDatatype: Cesium.ComponentDatatype.UNSIGNED_BYTE, - componentsPerAttribute: 4, - }, - { - functionName: "batchTable_pickColor", - componentDatatype: Cesium.ComponentDatatype.UNSIGNED_BYTE, - componentsPerAttribute: 4, - normalize: !0, - } - ); - var o = t.pickInfo, - o = Object.keys(o), - o = 0 < t.instanceCount ? t.instanceCount : o.length; - t.batchTable = new Cesium.BatchTable(i, e, o); - } - }), - (nt.prototype.createBoundingBoxForInstance = function () { - var e, - t, - i = new Cesium.Cartesian3(); - const o = this.vertexPackage; - Cesium.defined(o) && - -1 !== o.instanceIndex && - Cesium.defined(o.instanceBounds) && - ((e = o.instanceBounds), - (t = new Cesium.Cartesian3(e[0], e[1], e[2])), - (e = new Cesium.Cartesian3(e[3], e[4], e[5])), - (e = Cesium.Cartesian3.lerp(t, e, 0.5, i)), - (i = Cesium.Cartesian3.distance(e, t)), - (t = new Cesium.Cartesian3()), - Cesium.Matrix4.multiplyByPoint(this.modelMatrix, e, t), - (this.boundingVolume.center = t), - (this.boundingVolume.radius = i), - (o.instanceBounds = void 0)); - }), - (nt.prototype.initLayerSetting = function (e) { - 0 < Object.keys(e._objsOperationList).length && - this.updateObjsOperation(e._objsOperationList); - }), - (nt.prototype.createPickIds = function () { - let r = new Cesium.Cartesian4(); - var n = this.layer; - const a = n.context, - t = this.pickInfo; - if (Cesium.defined(t)) { - for (var s in t) - t.hasOwnProperty(s) && this.selectionInfoMap.set(s, t[s]); - let i = this.batchTable, - o = this.selectionInfoMap, - e = o._hash; - for (var l in e) - if (e.hasOwnProperty(l)) { - var u = o.get(l); - let e; - var l = (e = Cesium.defined(e) - ? e - : a.createPickId({ primitive: n, id: l })).color; - (r.x = Cesium.Color.floatToByte(l.red)), - (r.y = Cesium.Color.floatToByte(l.green)), - (r.z = Cesium.Color.floatToByte(l.blue)), - (r.w = Cesium.Color.floatToByte(l.alpha)); - let t = u.instanceIds; - 0 < this.instanceCount - ? t.map(function (e) { - i.setBatchedAttribute(e, 1, r); - }) - : ((l = u[0].batchId), i.setBatchedAttribute(l, 1, r)); - } - this.pickInfo = void 0; - } - }), - (nt.prototype.updateBatchTableAttributes = function () { - let i = this; - var o = this.idsOperationMap; - for (let e = 0, t = o.length; e < t; e++) { - let t = o.values[e]; - t.dirty && - ((t.dirty = !1), - 0 < this.instanceCount - ? Array.isArray(t.instanceIds) && - t.instanceIds.map(function (e) { - i.batchTable.setBatchedAttribute(e, 0, t.operationValue); - }) - : Cesium.defined(t.batchId) && - this.batchTable.setBatchedAttribute( - t.batchId, - 0, - t.operationValue - )); - } - }), - (nt.prototype.updateObjsOperation = function (e) { - if (this.ready && !(this.selectionInfoMap.length < 1)) { - let t = this.selectionInfoMap._hash; - for (var i in t) - if (t.hasOwnProperty(i)) { - var o = e[i]; - if (Cesium.defined(o)) { - var r = t[i][0], - n = r.batchId, - r = r.instanceIds; - let e = this.idsOperationMap.get(i); - ((e = Cesium.defined(e) - ? e - : { - batchId: n, - instanceIds: r, - operationValue: new Cesium.Cartesian4(), - dirty: !0, - }).dirty = !0), - (e.operationValue.x = (1 & e.operationValue.x) | o), - this.idsOperationMap.set(i, e), - (this.batchTableDirty = !0); - } - } - } - }), - ((ut.prototype = Object.create(nt.prototype)).constructor = nt), - (ut.prototype.createCommand = function () { - if ( - !Cesium.defined(this.colorCommand) && - 0 === this.vertexBufferToCreate.length && - 0 === this.indexBufferToCreate.length && - 0 === this.shaderProgramToCreate.length - ) { - var i = this.layer, - o = i.context, - r = this.vertexPackage, - n = this.arrIndexPackage, - a = r.vertexAttributes; - if (!(n.length < 1)) { - var n = n[0], - s = this.material; - this.vertexArray = new Cesium.VertexArray({ - context: o, - attributes: a, - indexBuffer: n.indexBuffer, - }); - let e = Cesium.PrimitiveType.TRIANGLES; - switch (n.primitiveType) { - case 1: - e = Cesium.PrimitiveType.POINTS; - break; - case 2: - e = Cesium.PrimitiveType.LINES; - break; - case 4: - e = Cesium.PrimitiveType.TRIANGLES; - } - (this.useLineColor = e === Cesium.PrimitiveType.LINES), - (this.colorCommand = new Cesium.DrawCommand({ - primitiveType: e, - modelMatrix: this.modelMatrix, - boundingVolume: Cesium.BoundingSphere.clone(this.boundingVolume), - pickId: this.pickColorIdentifier, - vertexArray: this.vertexArray, - shaderProgram: this.shaderProgram, - pass: s.bTransparentSorting - ? Cesium.Pass.TRANSLUCENT - : Cesium.Pass.OPAQUE, - renderState: s.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: !1 }, - depthTest: { - enabled: !0, - func: Cesium.DepthFunction.LESS_OR_EQUAL, - }, - blending: Cesium.BlendingState.ALPHA_BLEND, - }), - instanceCount: r.instanceCount, - })); - let t = (function (e, t, i) { - const o = { - uGeoMatrix: function () { - return i.geoMatrix; - }, - uTexMatrix: function () { - return e.texMatrix; - }, - uFillForeColor: function () { - return i.useLineColor - ? t.style3D.lineColor - : t.style3D.fillForeColor; - }, - uInverseGeoMatrix: function () { - return i.invGeoMatrix; - }, - uTexture: function () { - return e.textures[0]; - }, - uTexture2: function () { - return e.textures[1]; - }, - uTexture0Width: function () { - return e.textures[0].width; - }, - uTexture1Width: function () { - return e.textures[1].width; - }, - uDiffuseColor: function () { - return e.diffuseColor; - }, - uSelectedColor: function () { - return t._selectedColor; - }, - }, - r = i.vertexPackage; - var n = r.compressOptions; - return ( - (n & it.SVC_Vertex) === it.SVC_Vertex && - ((o.decode_position_min = function () { - return r.minVerticesValue; - }), - (o.decode_position_normConstant = function () { - return r.vertCompressConstant; - })), - (n & it.SVC_Normal) === it.SVC_Normal && - (o.normal_rangeConstant = function () { - return r.normalRangeConstant; - }), - (n & it.SVC_TexutreCoord) === it.SVC_TexutreCoord && - (0 < r.texCoordCompressConstant.length && - ((o.decode_texCoord0_min = function () { - return r.minTexCoordValue[0]; - }), - (o.decode_texCoord0_normConstant = function () { - return r.texCoordCompressConstant[0]; - }), - (o.decode_texCoord0_vNormConstant = function () { - return r.texCoordCompressConstant[0]; - })), - 1 < r.texCoordCompressConstant.length && - ((o.decode_texCoord1_min = function () { - return r.minTexCoordValue[1]; - }), - (o.decode_texCoord1_normConstant = function () { - return r.texCoordCompressConstant[1]; - }), - (o.decode_texCoord1_vNormConstant = function () { - return r.texCoordCompressConstant[1]; - })), - 2 < r.texCoordCompressConstant.length && - ((o.decode_texCoord2_min = function () { - return r.minTexCoordValue[2]; - }), - (o.decode_texCoord2_normConstant = function () { - return r.texCoordCompressConstant[2]; - })), - 3 < r.texCoordCompressConstant.length && - ((o.decode_texCoord3_min = function () { - return r.minTexCoordValue[3]; - }), - (o.decode_texCoord3_normConstant = function () { - return r.texCoordCompressConstant[3]; - })), - 4 < r.texCoordCompressConstant.length && - ((o.decode_texCoord4_min = function () { - return r.minTexCoordValue[4]; - }), - (o.decode_texCoord4_normConstant = function () { - return r.texCoordCompressConstant[4]; - })), - 5 < r.texCoordCompressConstant.length && - ((o.decode_texCoord5_min = function () { - return r.minTexCoordValue[5]; - }), - (o.decode_texCoord5_normConstant = function () { - return r.texCoordCompressConstant[5]; - })), - 6 < r.texCoordCompressConstant.length && - ((o.decode_texCoord6_min = function () { - return r.minTexCoordValue[6]; - }), - (o.decode_texCoord6_normConstant = function () { - return r.texCoordCompressConstant[6]; - })), - 7 < r.texCoordCompressConstant.length && - ((o.decode_texCoord7_min = function () { - return r.minTexCoordValue[7]; - }), - (o.decode_texCoord7_normConstant = function () { - return r.texCoordCompressConstant[7]; - }))), - o - ); - })(s, i, this); - this.batchTable && (t = this.batchTable.getUniformMapCallback()(t)), - (this.colorCommand.uniformMap = t), - (this.vertexPackage = void 0), - (this.arrIndexPackage = void 0), - (this.vs = void 0), - (this.fs = void 0), - (this.ready = !0); - } - } - }), - (ut.prototype.update = function (e, t) { - if (!this.ready) - return ( - this.createBatchTable(e), - this.createPickIds(), - this.createBuffers(e), - this.createShaderProgram(e), - this.createCommand(e), - void this.initLayerSetting(t) - ); - this.batchTableDirty && - (this.updateBatchTableAttributes(), (this.batchTableDirty = !1)), - this.batchTable && this.batchTable.update(e), - e.commandList.push(this.colorCommand); - }), - (ut.prototype.isDestroyed = function () { - return !1; - }), - (ut.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.material = - this.material && - !this.material.isDestroyed() && - this.material.destroy()), - (this.batchTable = - this.batchTable && - !this.batchTable.isDestroyed() && - this.batchTable.destroy()), - (this.colorCommand = void 0), - (this.vertexPackage = null), - (this.arrIndexPackage = null), - (this.modelMatrix = void 0), - (this.pickInfo = void 0), - (this.selectionInfoMap = void 0), - (this.vs = void 0), - (this.fs = void 0), - Cesium.destroyObject(this) - ); - }); - var ct = - "attribute vec4 aPosition;\nattribute vec4 aColor;\n#ifdef TexCoord\nattribute vec4 aTexCoord0;\nuniform float uTexture0Width;\nvarying vec4 vTexCoord;\nvarying vec4 vTexMatrix;\nvarying vec4 vTexCoordTransform;\n#endif\n#ifdef VertexColor\nvarying vec4 vColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT4 = 1.0 / 16.0;\nconst float SHIFT_LEFT4 = 16.0;\nvoid getTextureMatrixFromZValue(in float nZ, inout float XTran, inout float YTran, inout float scale)\n{\nif(nZ <= 0.0)\n{\nreturn;\n}\nfloat nDel8 = floor(nZ * SHIFT_RIGHT8);\nfloat nDel16 = floor(nDel8 * SHIFT_RIGHT8);\nfloat nDel20 = floor(nDel16 * SHIFT_RIGHT4);\nYTran = nZ - nDel8 * SHIFT_LEFT8;\nXTran = nDel8 - nDel16 * SHIFT_LEFT8;\nfloat nLevel = nDel16 - nDel20 * SHIFT_LEFT4;\nscale = 1.0 / pow(2.0, nLevel);\n}\nvoid main()\n{\n#ifdef TexCoord\nvTexCoord.xy = aTexCoord0.xy;\nvTexMatrix = vec4(0.0,0.0,1.0,0.0);\nvTexCoordTransform.x = aTexCoord0.z;\nif(vTexCoordTransform.x < -90000.0)\n{\nvTexMatrix.z = -1.0;\n}\ngetTextureMatrixFromZValue(floor(vTexCoordTransform.x), vTexMatrix.x, vTexMatrix.y, vTexMatrix.z);\nvTexMatrix.w = log2(uTexture0Width * vTexMatrix.z);\n#endif\nvec4 vertexPos = aPosition;\n#ifdef VertexColor\nvColor = aColor;\n#endif\ngl_Position = czm_modelViewProjection * vec4(vertexPos.xyz, 1.0);\n}\n", - ht = - "#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#ifdef TexCoord\nuniform sampler2D uTexture;\nuniform float uTexture0Width;\nvarying vec4 vTexCoord;\nvarying vec4 vTexCoordTransform;\nvarying vec4 vTexMatrix;\n#endif\n#ifdef VertexColor\nvarying vec4 vColor;\n#endif\n#ifdef TexCoord\nvoid calculateMipLevel(in vec2 inTexCoord, in float vecTile, in float fMaxMip, inout float mipLevel)\n{\nvec2 dx = dFdx(inTexCoord * vecTile);\nvec2 dy = dFdy(inTexCoord * vecTile);\nfloat dotX = dot(dx, dx);\nfloat dotY = dot(dy, dy);\nfloat dMax = max(dotX, dotY);\nfloat dMin = min(dotX, dotY);\nfloat offset = (dMax - dMin) / (dMax + dMin);\noffset = clamp(offset, 0.0, 1.0);\nfloat d = dMax * (1.0 - offset) + dMin * offset;\nmipLevel = 0.5 * log2(d);\nmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\nvoid calculateTexCoord(in vec3 inTexCoord, in float scale, in float XTran, in float YTran, in float fTile, in float mipLevel, inout vec2 outTexCoord)\n{\nif(inTexCoord.z < -9000.0)\n{\noutTexCoord = inTexCoord.xy;\n}\nelse\n{\nvec2 fTexCoord = fract(inTexCoord.xy);\nfloat offset = 1.0 * pow(2.0, mipLevel) / fTile;\nfTexCoord = clamp(fTexCoord, offset, 1.0 - offset);\noutTexCoord.x = (fTexCoord.x + XTran) * scale;\noutTexCoord.y = (fTexCoord.y + YTran) * scale;\n}\n}\nvec4 getTexColorForS3M(sampler2D curTexture, vec3 oriTexCoord, float texTileWidth, float fMaxMipLev, float fTexCoordScale, vec2 vecTexCoordTranslate)\n{\nvec4 color = vec4(1.0);\nfloat mipLevel = 0.0;\n#ifdef GL_OES_standard_derivatives\ncalculateMipLevel(oriTexCoord.xy, texTileWidth, fMaxMipLev, mipLevel);\n#endif\nvec2 realTexCoord;\ncalculateTexCoord(oriTexCoord, fTexCoordScale, vecTexCoordTranslate.x, vecTexCoordTranslate.y, texTileWidth, mipLevel, realTexCoord);\nif(oriTexCoord.z < -9000.0)\n{\ncolor = texture2D(curTexture, realTexCoord.xy);\n}\nelse\n{\n#ifdef GL_EXT_shader_texture_lod\ncolor = texture2DLodEXT(curTexture, realTexCoord.xy, mipLevel);\n#else\ncolor = texture2D(curTexture, realTexCoord.xy, mipLevel);\n#endif\n}\nreturn color;\n}\nvec4 getTextureColor()\n{\nif(vTexMatrix.z < 0.0)\n{\nreturn vec4(1.0);\n}\nfloat texTileWidth0 = vTexMatrix.z * uTexture0Width;\nvec3 realTexCoord = vec3(vTexCoord.xy, vTexCoordTransform.x);\nreturn getTexColorForS3M(uTexture, realTexCoord, texTileWidth0, vTexMatrix.w, vTexMatrix.z, vTexMatrix.xy);\n}\n#endif\nvoid main()\n{\nvec4 baseColorWithAlpha = vec4(1.0);\n#ifdef VertexColor\nvec4 baseColorWithAlpha = vColor;\n#endif\n#ifdef TexCoord\nbaseColorWithAlpha *= getTextureColor();\n#endif\ngl_FragColor = baseColorWithAlpha;\n}\n"; - function mt(e) { - nt.call(this, e), (this.vs = ct), (this.fs = ht); - } - ((mt.prototype = Object.create(nt.prototype)).constructor = nt), - (mt.prototype.createCommand = function () { - var e, t, i, o, r, n, a; - Cesium.defined(this.colorCommand) || - 0 !== this.vertexBufferToCreate.length || - 0 !== this.indexBufferToCreate.length || - 0 !== this.shaderProgramToCreate.length || - ((e = this.layer.context), - (t = this.vertexPackage), - (o = this.arrIndexPackage), - (i = t.vertexAttributes), - o.length < 1 || - ((o = o[0]), - (r = this.material), - (this.vertexArray = new Cesium.VertexArray({ - context: e, - attributes: i, - indexBuffer: o.indexBuffer, - })), - (this.colorCommand = new Cesium.DrawCommand({ - primitiveType: o.primitiveType, - modelMatrix: this.modelMatrix, - boundingVolume: Cesium.BoundingSphere.clone(this.boundingVolume), - vertexArray: this.vertexArray, - shaderProgram: this.shaderProgram, - pass: r.bTransparentSorting - ? Cesium.Pass.TRANSLUCENT - : Cesium.Pass.OPAQUE, - renderState: Cesium.RenderState.fromCache({ - cull: { enabled: !0 }, - depthTest: { - enabled: !0, - func: Cesium.DepthFunction.LESS_OR_EQUAL, - }, - blending: Cesium.BlendingState.ALPHA_BLEND, - }), - instanceCount: t.instanceCount, - })), - (this.colorCommand.uniformMap = - ((n = r), - (a = this), - { - uGeoMatrix: function () { - return a.geoMatrix; - }, - uInverseGeoMatrix: function () { - return a.invGeoMatrix; - }, - uTexture: function () { - return n.textures[0]; - }, - uTexture0Width: function () { - return n.textures[0].width; - }, - })), - (this.vertexPackage = void 0), - (this.arrIndexPackage = void 0), - (this.vs = void 0), - (this.fs = void 0), - (this.ready = !0))); - }), - (mt.prototype.update = function (e, t) { - if (!this.ready) - return ( - this.createBuffers(e), - this.createShaderProgram(e), - this.createCommand(e), - void this.initLayerSetting(t) - ); - e.commandList.push(this.colorCommand); - }), - (mt.prototype.isDestroyed = function () { - return !1; - }), - (mt.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.material = - this.material && - !this.material.isDestroyed() && - this.material.destroy()), - (this.colorCommand = void 0), - (this.vertexPackage = null), - (this.arrIndexPackage = null), - (this.modelMatrix = void 0), - (this.pickInfo = void 0), - (this.selectionInfoMap = void 0), - (this.vs = void 0), - (this.fs = void 0), - Cesium.destroyObject(this) - ); - }); - let dt = { - OSGBFile: function (e) { - return new mt(e); - }, - OSGBCacheFile: function (e) { - return new ut(e); - }, - }; - function pt() {} - function gt(a, e) { - if (-1 < a.instanceIndex) { - var s = a; - var l = new Cesium.Cartesian3(); - let e = new Cesium.BoundingSphere(); - if (((s = s.instanceBounds), !Cesium.defined(s))) return e; - var u = new Cesium.Cartesian3(s[0], s[1], s[2]), - s = new Cesium.Carteisan3(s[3], s[4], s[5]), - s = new Cesium.Cartesian3.lerp(u, s, 0.5, l), - l = new Cesium.Cartesian3.distance(s, u); - return (e.center = s), (e.radius = l), e; - } - { - var c = a; - u = e; - s = new Cesium.BoundingSphere(); - let t = new Cesium.Cartesian3(); - var l = c.vertexAttributes[0], - h = l.componentsPerAttribute, - m = - Cesium.defined(c.compressOptions) && - (c.compressOptions & it.SVC_Vertex) === it.SVC_Vertex; - let i = 1, - o, - r, - n = - ((r = m - ? ((i = c.vertCompressConstant), - (o = new Cesium.Cartesian3( - c.minVerticesValue.x, - c.minVerticesValue.y, - c.minVerticesValue.z - )), - new Uint16Array( - l.typedArray.buffer, - l.typedArray.byteOffset, - l.typedArray.byteLength / 2 - )) - : new Float32Array( - l.typedArray.buffer, - l.typedArray.byteOffset, - l.typedArray.byteLength / 4 - )), - []); - for (let e = 0; e < c.verticesCount; e++) - Cesium.Cartesian3.fromArray(r, h * e, t), - m && - ((t = Cesium.Cartesian3.multiplyByScalar(t, i, t)), - (t = Cesium.Cartesian3.add(t, o, t))), - n.push(Cesium.Cartesian3.clone(t)); - return ( - Cesium.BoundingSphere.fromPoints(n, s), - Cesium.BoundingSphere.transform(s, u, s), - (n.length = 0), - s - ); - return; - } - } - function ft(o, r, n) { - var i = r.groupNode; - let a = []; - for (let t = 0, e = i.pageLods.length; t < e; t++) { - let e = {}; - var s, - l = i.pageLods[t]; - (e.rangeMode = l.rangeMode), - (e.rangeDataList = l.childTile), - (e.rangeList = l.rangeList), - l.obb - ? (e.boundingVolume = { - box: { - center: l.obb.obbCenter, - xExtent: l.obb.xExtent, - yExtent: l.obb.yExtent, - zExtent: l.obb.zExtent, - }, - }) - : ((m = l.boundingSphere.center), - (s = l.boundingSphere.radius), - "" !== e.rangeDataList - ? (e.boundingVolume = { - sphere: { - center: new Cesium.Cartesian3(m.x, m.y, m.z), - radius: s, - }, - }) - : (e.isLeafTile = !0)); - { - u = void 0; - c = void 0; - h = void 0; - m = void 0; - d = void 0; - p = void 0; - g = void 0; - w = void 0; - b = void 0; - T = void 0; - C = void 0; - f = void 0; - y = void 0; - _ = void 0; - C = void 0; - v = void 0; - y = void 0; - E = void 0; - S = void 0; - P = void 0; - x = void 0; - D = void 0; - I = void 0; - A = void 0; - L = void 0; - var u = o; - var c = r; - var h = n; - var m = l; - var d = e; - var p = new Cesium.Matrix3(); - let i = {}; - var g = m.geodes; - for (let t = 0, e = g.length; t < e; t++) { - var f, - _, - C, - y, - v, - w = g[t], - b = w.matrix, - T = Cesium.Matrix4.multiply(u.modelMatrix, b, new Cesium.Matrix4()); - let e; - Cesium.defined(d.boundingVolume) && - (d.boundingVolume.sphere - ? ((e = new Cesium.BoundingSphere( - d.boundingVolume.sphere.center, - d.boundingVolume.sphere.radius - )), - Cesium.BoundingSphere.transform(e, u.modelMatrix, e)) - : d.boundingVolume.box && - ((C = d.boundingVolume.box), - (f = new Cesium.Cartesian3(C.center.x, C.center.y, C.center.z)), - (y = new Cesium.Cartesian4( - C.xExtent.x, - C.xExtent.y, - C.xExtent.z, - 0 - )), - (_ = new Cesium.Cartesian4( - C.yExtent.x, - C.yExtent.y, - C.yExtent.z, - 0 - )), - (C = new Cesium.Cartesian4( - C.zExtent.x, - C.zExtent.y, - C.zExtent.z, - 0 - )), - (v = new Cesium.Matrix3()), - Cesium.Matrix3.setColumn(v, 0, y, v), - Cesium.Matrix3.setColumn(v, 1, _, v), - Cesium.Matrix3.setColumn(v, 2, C, v), - (f = Cesium.Matrix4.multiplyByPoint(u.modelMatrix, f, f)), - (y = Cesium.Matrix4.getMatrix3(u.modelMatrix, p)), - (v = Cesium.Matrix3.multiply(y, v, v)), - (e = new Cesium.OrientedBoundingBox(f, v)))); - var E = w.skeletonNames; - for (let t = 0, e = E.length; t < e; t++) { - var S = E[t], - P = c.geoPackage[S], - x = P.vertexPackage, - D = P.arrIndexPackage, - I = P.pickInfo; - let e; - 0 < D.length && (e = h[D[0].materialCode]); - var A = gt(x, T); - i[S] = dt[u.fileType]({ - layer: u, - vertexPackage: x, - arrIndexPackage: D, - pickInfo: I, - modelMatrix: T, - geoMatrix: b, - boundingVolume: A, - material: e, - edgeGeometry: P.edgeGeometry, - geoName: S, - }); - } - } - if (!(Object.keys(i).length < 1)) { - if (!Cesium.defined(d.boundingVolume)) { - let e = []; - for (var L in i) i.hasOwnProperty(L) && e.push(i[L].boundingVolume); - d.boundingVolume = { - sphere: Cesium.BoundingSphere.fromBoundingSpheres(e), - }; - } - d.geoMap = i; - } - } - Cesium.defined(e.geoMap) && a.push(e); - } - return a; - } - pt.parse = function (e, t, i) { - if (Cesium.defined(t)) - return ft( - e, - t, - (function (o, r, n) { - let a = {}; - var s = r.materials.material; - for (let e = 0, t = s.length; e < t; e++) { - var l = s[e].material, - u = l.id; - let i = new qe(); - a[u] = i; - var u = l.ambient, - u = - ((i.ambientColor = new Cesium.Color(u.r, u.g, u.b, u.a)), - l.diffuse), - u = - ((i.diffuseColor = new Cesium.Color(u.r, u.g, u.b, u.a)), - l.specular), - c = - ((i.specularColor = new Cesium.Color(u.r, u.g, u.b, u.a)), - (i.shininess = l.shininess), - (i.bTransparentSorting = l.transparentsorting), - l.textureunitstates), - h = c.length; - for (let e = 0; e < h; e++) { - var m = c[e].textureunitstate, - d = m.id, - p = - 0 === m.addressmode.u - ? Cesium.TextureWrap.REPEAT - : Cesium.TextureWrap.CLAMP_TO_EDGE, - g = - 0 === m.addressmode.v - ? Cesium.TextureWrap.REPEAT - : Cesium.TextureWrap.CLAMP_TO_EDGE; - i.texMatrix = Cesium.Matrix4.unpack(m.texmodmatrix); - let t = r.texturePackage[d]; - if (Cesium.defined(t) && 0 < t.arrayBufferView.byteLength) { - (t.wrapS = p), (t.wrapT = g); - m = n.fileName + d; - let e = o.textureCache.getTexture(m); - Cesium.defined(e) || - (Cesium.PixelFormat.isCompressedFormat(t.internalFormat) - ? (e = new Qe(o, d, t)) - : ((d = - Cesium.Math.isPowerOfTwo(t.width) && - Cesium.Math.isPowerOfTwo(t.height)), - (e = new Cesium.Texture({ - context: o, - source: { - width: t.width, - height: t.height, - arrayBufferView: t.arrayBufferView, - }, - sampler: new Cesium.Sampler({ - minificationFilter: d - ? o._gl.LINEAR_MIPMAP_LINEAR - : o._gl.LINEAR, - wrapS: p, - wrapT: g, - }), - })), - d && e.generateMipmap(Cesium.MipmapHint.NICEST)), - o.textureCache.addTexture(m, e)), - i.textures.push(e); - } - } - } - return a; - })(e.context, t, i) - ); - }; - var _t = Object.freeze({ Distance: 0, Pixel: 1, GeometryError: 2 }); - function Ct(e, t, i, o, r, n) { - (this.layer = e), (this.parent = t); - var a = o.replace(/\\/g, "/"); - (this.fileExtension = Cesium.getExtensionFromUri(o)), - (this.relativePath = (function (e, t) { - e = e.replace(/\+/g, "%2B"); - let i = t._basePath, - o = -1 < t._basePath.indexOf("realspace"); - if (!o) return e; - var t = i.replace(/(.*realspace)/, ""), - r = i.replace(/\/rest\/realspace/g, "").replace(t, ""); - return ( - r + - "/rest/realspace" + - t + - "data/path/" + - e.replace(/^\.*/, "").replace(/^\//, "").replace(/\/$/, "") - ); - })(a, e)), - (this.relativePath = this.relativePath.replace( - "data/path/data/path", - "data/path" - )), - (this.fileName = o), - (this.isLeafTile = 0 === r), - (this.isRootTile = !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(a); - this.baseUri = e.getBaseUri(); - } - (this.contentResource = s.getDerivedResource({ url: this.relativePath })), - (this.serverKey = Cesium.RequestScheduler.getServerKey( - this.contentResource.getUrlComponent() - )), - (this.request = void 0), - (this.cacheNode = void 0), - (this.distanceToCamera = 0), - (this.centerZDepth = 0), - (this.pixel = 0), - (this.depth = t ? t.depth + 1 : 0), - (this.visibilityPlaneMask = 0), - (this.visible = !1), - (this.children = []), - (this.renderEntities = []), - (this.lodRangeData = Cesium.defaultValue(r, 16)), - (this.lodRangeMode = Cesium.defaultValue(n, _t.Pixel)), - (this.contentState = this.isLeafTile ? Ce.READY : Ce.UNLOADED), - (this.touchedFrame = 0), - (this.requestedFrame = 0), - (this.processFrame = 0), - (this.selectedFrame = 0), - (this.updatedVisibilityFrame = 0), - (this.foveatedFactor = 0), - (this.priority = 0), - ((this.priorityHolder = this).wasMinPriorityChild = !1), - (this.shouldSelect = !1), - (this.selected = !1), - (this.finalResolution = !0), - (this.refines = !1); - } - function yt(e) { - return e.boundingVolume; - } - function vt(e, t, i) { - e._cache.add(t), - (xe.s3tc = e.context.s3tc), - (xe.pvrtc = e.context.pvrtc), - (xe.etc1 = e.context.etc1); - i = xe.parseBuffer(i); - if (!i) - return (t.contentState = Ce.FAILED), void t.contentReadyPromise.reject(); - e = pt.parse(e, i, t); - { - var a = t, - s = e; - let i = a.layer; - var l = s.length; - let o = Number.MAX_VALUE, - r = 0, - n = _t.Pixel; - for (let t = 0; t < l; t++) { - var u, - c = s[t], - h = c.boundingVolume, - m = c.rangeDataList, - m = a.baseUri + m, - d = c.rangeList, - p = c.rangeMode; - let e = c.geoMap; - for (u in (0 !== d && - ((c = new Ct(i, a, h, m, d, p)), a.children.push(c), i._cache.add(c)), - e)) - e.hasOwnProperty(u) && a.renderEntities.push(e[u]); - (o = Math.min(o, d)), (r = Math.max(r, d)), (n = p); - } - a.isRootTile && - ((a.lodRangeData = n === _t.Pixel ? o / 2 : 2 * r), - (a.lodRangeMode = n)); - } - (t.selectedFrame = 0), - (t.contentState = Ce.READY), - t.contentReadyPromise.resolve(i); - } - function wt(e, t, i) { - return Math.max(Cesium.Math.normalize(e, t, i) - Cesium.Math.EPSILON7, 0); - } - function bt(e, t, i) { - e *= Math.pow(10, t); - return parseInt(e) * Math.pow(10, i); - } - function Tt() { - this._stack = []; - } - function Et(e, t) { - return 0 === t.distanceToCamera && 0 === e.distanceToCamera - ? t.centerZDepth - e.centerZDepth - : t.distanceToCamera - e.distanceToCamera; - } - function St(e, t, i) { - t.requestedFrame !== i.frameNumber && - t.contentState === Ce.UNLOADED && - (e._requestTiles.push(t), (t.requestedFrame = i.frameNumber)); - } - function Pt(e, t, i) { - t.processFrame === i.frameNumber || - t.contentState !== Ce.READY || - t.renderable || - ((t.processFrame = i.frameNumber), e._processTiles.push(t)); - } - function xt(e, t, i) { - t.touchedFrame !== i.frameNumber && - (e._cache.touch(t), (t.touchedFrame = i.frameNumber)); - } - function Dt(e, t, i) { - var o, r; - (o = o = t), - (e = e = e), - (r = r = i).updatedVisibilityFrame !== e.frameNumber && - ((r.updatedVisibilityFrame = e.frameNumber), r.updateVisibility(e, o)), - (i.wasMinPriorityChild = !1), - (i.priorityHolder = i), - (r = i), - ((e = t)._maximumPriority.distance = Math.max( - r.distanceToCamera, - e._maximumPriority.distance - )), - (e._minimumPriority.distance = Math.min( - r.distanceToCamera, - e._minimumPriority.distance - )), - (e._maximumPriority.depth = Math.max(r.depth, e._maximumPriority.depth)), - (e._minimumPriority.depth = Math.min(r.depth, e._minimumPriority.depth)), - (e._maximumPriority.foveatedFactor = Math.max( - r.foveatedFactor, - e._maximumPriority.foveatedFactor - )), - (e._minimumPriority.foveatedFactor = Math.min( - r.foveatedFactor, - e._minimumPriority.foveatedFactor - )), - (e._maximumPriority.pixel = Math.max(r.pixel, e._maximumPriority.pixel)), - (e._minimumPriority.pixel = Math.min(r.pixel, e._minimumPriority.pixel)), - (i.shouldSelect = !1), - (i.selected = !1); - } - function It(i, o, r) { - for (; o.length; ) { - let e = o.pop(); - var n = e.parent, - n = !Cesium.defined(n) || n.refines; - let t = !1; - a = i; - a = - !(t = - 0 !== (s = e).children.length && - (s.lodRangeMode === _t.Pixel - ? s.pixel / a.lodRangeScale > s.lodRangeData - : s.lodRangeMode === _t.GeometryError - ? 16 < s.geometryError - : s.distanceToCamera * a.lodRangeScale < s.lodRangeData) - ? (function (e, i, t, o) { - let r, - n = i.children; - var a = n.length; - for (r = 0; r < a; ++r) Dt(o, e, n[r]); - n.sort(Et); - let s = !0, - l = !1, - u = -1, - c = Number.MAX_VALUE; - for (r = 0; r < a; ++r) { - var h = n[r], - h = - (h.foveatedFactor < c && - ((u = r), (c = h.foveatedFactor)), - h.visible - ? (t.push(h), (l = !0)) - : (St(e, h, o), xt(e, h, o), Pt(e, h, o)), - h.renderable); - s = s && h; - } - if ((l || (s = !1), -1 !== u)) { - let e = n[u], - t = - ((e.wasMinPriorityChild = !0), - (i.wasMinPriorityChild || i.isRootTile) && - c <= i.priorityHolder.foveatedFactor - ? i.priorityHolder - : i); - for ( - t.foveatedFactor = Math.min( - e.foveatedFactor, - t.foveatedFactor - ), - t.distanceToCamera = Math.min( - e.distanceToCamera, - t.distanceToCamera - ), - r = 0; - r < a; - ++r - ) { - let e = n[r]; - e.priorityHolder = t; - } - } - return s; - })(i, e, o, r) && n - : t) && n; - St(i, e, r), - Pt(i, e, r), - a && - ((s = i), - (n = e), - (a = r), - n.selectedFrame !== a.frameNumber && - n.renderable && - (s._selectedTiles.push(n), (n.selectedFrame = a.frameNumber))), - xt(i, e, r), - (e.refines = t); - } - var a, s; - } - function At() { - (this._list = new Cesium.DoublyLinkedList()), - (this._sentinel = this._list.add()), - (this._trimTiles = !1); - } - Object.defineProperties(Ct.prototype, { - renderable: { - get: function () { - var t = this.renderEntities, - i = t.length; - if (0 === i) return !1; - for (let e = 0; e < i; e++) if (!t[e].ready) return !1; - return !0; - }, - }, - }), - (Ct.prototype.createBoundingVolume = function (e, t) { - if (Cesium.defined(e.sphere)) - return ( - (s = e.sphere), - (l = t), - (u = new Cesium.Cartesian3()), - (c = Cesium.Cartesian3.clone(s.center)), - (s = s.radius), - (c = Cesium.Matrix4.multiplyByPoint(l, c, c)), - (l = Cesium.Matrix4.getScale(l, u)), - (s *= Cesium.Cartesian3.maximumComponent(l)), - new Cesium.TileBoundingSphere(c, s) - ); - if (Cesium.defined(e.box)) { - (u = e.box), - (l = t), - (c = new Cesium.Matrix3()), - (s = new Cesium.Cartesian3()); - if (Cesium.defined(u.center)) - return ( - (n = new Cesium.Cartesian3(u.center.x, u.center.y, u.center.z)), - (r = new Cesium.Cartesian4( - u.xExtent.x, - u.xExtent.y, - u.xExtent.z, - 0 - )), - (i = new Cesium.Cartesian4( - u.yExtent.x, - u.yExtent.y, - u.yExtent.z, - 0 - )), - (o = new Cesium.Cartesian4( - u.zExtent.x, - u.zExtent.y, - u.zExtent.z, - 0 - )), - (a = new Cesium.Matrix3()), - Cesium.Matrix3.setColumn(a, 0, r, a), - Cesium.Matrix3.setColumn(a, 1, i, a), - Cesium.Matrix3.setColumn(a, 2, o, a), - (n = Cesium.Matrix4.multiplyByPoint(l, n, n)), - (r = Cesium.Matrix4.getMatrix3(l, c)), - (a = Cesium.Matrix3.multiply(r, a, a)), - new Cesium.TileOrientedBoundingBox(n, a) - ); - var i = new Cesium.Cartesian3(u.min.x, u.min.y, u.min.z), - o = - (Cesium.Matrix4.multiplyByPoint(l, i, i), - new Cesium.Cartesian3(u.max.x, u.max.y, u.max.z)), - r = - (Cesium.Matrix4.multiplyByPoint(l, o, o), - (c = Cesium.BoundingSphere.fromCornerPoints( - i, - o, - new Cesium.BoundingSphere() - )).center), - n = c.radius, - a = Cesium.Matrix4.getScale(l, s); - return ( - (n *= Cesium.Cartesian3.maximumComponent(a)), - new Cesium.TileBoundingSphere(r, n) - ); - } - var s, l, u, c; - }), - (Ct.prototype.canTraverse = function () { - return ( - 0 !== this.children.length && - !this.isLeafTile && - (!Cesium.defined(this.lodRangeData) || this.pixel > this.lodRangeData) - ); - }), - (Ct.prototype.getPixel = function (e) { - var t = this.boundingVolume.boundingSphere, - i = t.radius, - t = t.center, - t = Cesium.Cartesian3.distance(e.camera.positionWC, t), - o = e.context.drawingBufferHeight, - e = 0.5 * e.camera.frustum._fovy; - return (((0.5 * o) / Math.tan(e)) * i) / t; - }), - (Ct.prototype.getGeometryError = function (e) { - var t = e.camera, - i = this.layer.context.drawingBufferHeight; - return ( - (this.lodRangeData * i) / - (this.boundingVolume.distanceToCamera(e) * t.frustum.sseDenominator) - ); - }), - (Ct.prototype.distanceToTile = function (e) { - let t = yt(this); - return t.distanceToCamera(e); - }), - (Ct.prototype.distanceToTileCenter = function (e) { - var t = new Cesium.Cartesian3(), - i = yt(this).boundingVolume, - i = Cesium.Cartesian3.subtract(i.center, e.camera.positionWC, t); - return Cesium.Cartesian3.dot(e.camera.directionWC, i); - }), - (Ct.prototype.visibility = function (e, t) { - var i = yt(this); - return e.cullingVolume.computeVisibilityWithPlaneMask(i, t); - }), - (Ct.prototype.updateVisibility = function (e, t) { - var i, - o, - r, - n = this.parent, - n = Cesium.defined(n) - ? n.visibilityPlaneMask - : Cesium.CullingVolume.MASK_INDETERMINATE; - (this.distanceToCamera = this.distanceToTile(e)), - (this.centerZDepth = this.distanceToTileCenter(e)), - (this.pixel = this.getPixel(e)), - (this.geometryError = this.getGeometryError(e)), - (this.visibilityPlaneMask = this.visibility(e, n)), - (this.visible = - this.visibilityPlaneMask !== Cesium.CullingVolume.MASK_OUTSIDE && - this.distanceToCamera >= t.visibleDistanceMin && - this.distanceToCamera <= t.visibleDistanceMax), - (this.priorityDeferred = - ((n = this), - (t = e), - (e = new Cesium.Cartesian3()), - (t = t.camera), - (i = n.boundingVolume.boundingSphere), - (o = i.radius), - (r = Cesium.Cartesian3.multiplyByScalar( - t.directionWC, - n.centerZDepth, - e - )), - (r = Cesium.Cartesian3.add(t.positionWC, r, e)), - (r = Cesium.Cartesian3.subtract(r, i.center, e)), - void (o < Cesium.Cartesian3.magnitude(r) - ? ((r = Cesium.Cartesian3.normalize(r, e)), - (r = Cesium.Cartesian3.multiplyByScalar(r, o, e)), - (o = Cesium.Cartesian3.add(i.center, r, e)), - (i = Cesium.Cartesian3.subtract(o, t.positionWC, e)), - (r = Cesium.Cartesian3.normalize(i, e)), - (n.foveatedFactor = - 1 - Math.abs(Cesium.Cartesian3.dot(t.directionWC, r)))) - : (n.foveatedFactor = 0)))); - }), - (Ct.prototype.requestContent = function () { - let t = this, - i = this.layer, - e = this.contentResource.clone(), - o = new Cesium.Request({ - throttle: !0, - throttleByServer: !0, - type: Cesium.RequestType.TILES3D, - priorityFunction: function () { - return r.priority; - }, - serverKey: (r = this).serverKey, - }); - var r, n; - (this.request = o), (e.request = o); - let a = e.fetchArrayBuffer(); - if (!Cesium.defined(a)) return !1; - (this.contentState = Ce.LOADING), - (this.contentReadyPromise = Cesium.when.defer()); - n = this; - let s = function (e) { - (n.contentState = Ce.FAILED), - n.contentReadyPromise && n.contentReadyPromise.reject(e); - }; - return ( - a - .then(function (e) { - t.isDestroyed() ? s() : vt(i, t, e); - }) - .catch(function (e) { - o.state === Cesium.RequestState.CANCELLED - ? (t.contentState = Ce.UNLOADED) - : s(e); - }), - !0 - ); - }), - (Ct.prototype.updatePriority = function (e, t) { - var i = e._minimumPriority, - e = e._maximumPriority, - o = bt( - wt(this.foveatedFactor, i.foveatedFactor, e.foveatedFactor), - 4, - 4 - ), - r = bt(1 - wt(this.pixel, i.pixel, e.pixel), 4, 8), - i = wt(this.distanceToCamera, i.distance, e.distance), - e = bt(i, 4, 0); - this.priority = o + r + e; - }), - (Ct.prototype.update = function (i, o) { - for (let e = 0, t = this.renderEntities.length; e < t; e++) - this.renderEntities[e].update(i, o); - }), - (Ct.prototype.free = function () { - (this.contentState = Ce.UNLOADED), - (this.request = void 0), - (this.cacheNode = void 0), - (this.priorityHolder = void 0), - (this.contentReadyPromise = void 0), - (this.priorityHolder = void 0); - for (let e = 0, t = this.renderEntities.length; e < t; e++) - this.renderEntities[e].destroy(); - (this.renderEntities.length = 0), (this.children.length = 0); - }), - (Ct.prototype.isDestroyed = function () { - return !1; - }), - (Ct.prototype.destroy = function () { - return this.free(), Cesium.destroyObject(this); - }), - (Tt.prototype.schedule = function (e, i) { - var t = this._stack, - o = e, - r = t, - n = i; - for (let e = (r.length = 0), t = o._rootTiles.length; e < t; e++) { - var a = o._rootTiles[e]; - Dt(n, o, a), a.visible && r.push(a); - } - It(e, t, i); - { - var s = e, - l = i; - let t = s._requestTiles; - var u = t.length; - for (let e = 0; e < u; ++e) t[e].updatePriority(s, l); - return; - } - }), - (At.prototype.reset = function () { - this._list.splice(this._list.tail, this._sentinel); - }), - (At.prototype.touch = function (e) { - e = e.cacheNode; - Cesium.defined(e) && this._list.splice(this._sentinel, e); - }), - (At.prototype.add = function (e) { - Cesium.defined(e.cacheNode) || (e.cacheNode = this._list.add(e)); - }), - (At.prototype.unloadTile = function (e, t, i) { - var o = t.cacheNode; - Cesium.defined(o) && - (this._list.remove(o), (t.cacheNode = void 0), i(e, t)); - }), - (At.prototype.unloadTiles = function (e, t) { - var i = this._trimTiles, - o = ((this._trimTiles = !1), this._list), - r = 1024 * e.maximumMemoryUsage * 1024, - n = this._sentinel; - let a = o.head; - for (; a && a !== n && (e.totalMemoryUsageInBytes > r || i); ) { - var s = a.item; - (a = a.next), this.unloadTile(e, s, t); - } - }), - (At.prototype.trim = function () { - this._trimTiles = !0; - }); - var Lt = Object.freeze({ - RESET: 0, - SetColor: 1, - SELECTED: 2, - HIDE: 4, - OFFSET: 8, - CLIP: 16, - BLOOM: 32, - ALL: 255, - }); - function Mt() { - (this._fillForeColor = new Cesium.Color()), - (this._lineColor = new Cesium.Color()), - (this._lineWidth = 1), - (this._bottomAltitude = 0), - (this._pointSize = 1), - (this._pointColor = new Cesium.Color()); - } - function Rt(e, t) { - (e = Cesium.defaultValue(e, Cesium.defaultValue.EMPTY_OBJECT)), - Cesium.Check.defined("options.url", e.url), - Cesium.Check.defined("options.context", e.scene), - (this.id = Cesium.createGuid()), - (this.name = e.name), - (this.scene = e.scene), - (this.context = this.scene._context), - (this.show = !0), - (this._url = void 0), - (this._basePath = void 0), - (this._baseResource = void 0), - (this.modelMatrix = new Cesium.Matrix4()), - (this.invModelMatrix = new Cesium.Matrix4()), - (this._visibleDistanceMax = Cesium.defaultValue(e.far, Number.MAX_VALUE)), - (this._visibleDistanceMin = Cesium.defaultValue(e.near, 0)), - (this._lodRangeScale = Cesium.defaultValue(e.lodRangeScale, 1)), - (this._selectedColor = new Cesium.Color(1, 0, 0, 1)), - (this.fileType = void 0), - (this._position = void 0), - (this._rectangle = void 0), - (this._rootTiles = []), - (this._schuduler = new Tt()), - (this._selections = []), - (this._objsOperationList = {}), - (this._requestTiles = []), - (this._processTiles = []), - (this._selectedTiles = []), - (this._cache = new At()), - (this._maximumMemoryUsage = -1), - (this._totalMemoryUsageInBytes = 0), - (this._vertexCompressionType = void 0), - (this._style3D = new Mt()), - (this._maximumPriority = { - foveatedFactor: -Number.MAX_VALUE, - depth: -Number.MAX_VALUE, - distance: -Number.MAX_VALUE, - pixel: -Number.MAX_VALUE, - }), - (this._minimumPriority = { - foveatedFactor: Number.MAX_VALUE, - depth: Number.MAX_VALUE, - distance: Number.MAX_VALUE, - pixel: Number.MAX_VALUE, - }), - (this._readyPromise = Cesium.when.defer()), - this.loadConfig(e.url), - this.scene.primitives.add(this), - this.readyPromise - .then(() => { - t && t(this); - }) - .otherwise(function (e) { - console.log(e); - }); - } - function Ot(e, t) { - e.updateObjsOperation(t.ids, t); - } - function Bt(e, t) { - return e.priority - t.priority; - } - function Ft(e, t) { - t.free(); - } - function Ht(e) { - e._cache.unloadTiles(e, Ft); - } - Object.defineProperties(Mt.prototype, { - fillForeColor: { - get: function () { - return this._fillForeColor; - }, - set: function (e) { - Cesium.Check.typeOf.object("fillForeColor value", e), - Cesium.Color.clone(e, this._fillForeColor); - }, - }, - bottomAltitude: { - get: function () { - return this._bottomAltitude; - }, - set: function (e) { - Cesium.Check.typeOf.number("bottomAltitude value", e), - this._bottomAltitude !== e && - ((this._bottomAltitude = e), (this._dirty = !0)); - }, - }, - altitudeMode: { - get: function () { - return this._altitudeMode; - }, - set: function (e) { - Cesium.Check.typeOf.number("altitudeMode value", e), - (this._altitudeMode = e); - }, - }, - lineColor: { - get: function () { - return this._lineColor; - }, - set: function (e) { - Cesium.Check.typeOf.object("line color", e), - Cesium.Color.clone(e, this._lineColor); - }, - }, - lineWidth: { - get: function () { - return this._lineWidth; - }, - set: function (e) { - Cesium.Check.typeOf.number("line width", e), (this._lineWidth = e); - }, - }, - pointSize: { - get: function () { - return this._pointSize; - }, - set: function (e) { - Cesium.Check.typeOf.number("point size", e), (this._pointSize = e); - }, - }, - pointColor: { - get: function () { - return this._pointColor; - }, - set: function (e) { - Cesium.Check.typeOf.object("point color", e), - Cesium.Color.clone(e, this._pointColor); - }, - }, - }), - Object.defineProperties(Rt.prototype, { - ready: { - get: function () { - return 0 < this._rootTiles.length; - }, - }, - readyPromise: { - get: function () { - return this._readyPromise; - }, - }, - rectangle: { - get: function () { - return this._rectangle; - }, - }, - visibleDistanceMax: { - get: function () { - return this._visibleDistanceMax; - }, - set: function (e) { - Cesium.Check.typeOf.number("max visible distance", e), - (this._visibleDistanceMax = e); - }, - }, - visibleDistanceMin: { - get: function () { - return this._visibleDistanceMin; - }, - set: function (e) { - Cesium.Check.typeOf.number("min visible distance", e), - (this._visibleDistanceMin = e); - }, - }, - lodRangeScale: { - get: function () { - return this._lodRangeScale; - }, - set: function (e) { - Cesium.Check.typeOf.number("set layer lod range scale", e), - (this._lodRangeScale = e); - }, - }, - totalMemoryUsageInBytes: { - get: function () { - return this._totalMemoryUsageInBytes; - }, - set: function (e) { - this._totalMemoryUsageInBytes = e; - }, - }, - maximumMemoryUsage: { - get: function () { - return this._maximumMemoryUsage; - }, - set: function (e) { - this._maximumMemoryUsage = e; - }, - }, - style3D: { - get: function () { - return this._style3D; - }, - set: function (e) { - this._style3D = e; - }, - }, - }), - (Rt.prototype.loadConfig = function (t, s) { - let l = this; - Cesium.when(t) - .then(function (e) { - let t = Cesium.Resource.createIfNeeded(e); - return ( - (e = t.getBaseUri(!0)), - (l._url = t.url), - (l._basePath = e), - (l._baseResource = t), - s ? t.fetchXML() : t.fetchJson() - ); - }) - .then(function (e) { - var t = (e = s ? _e(e) : e).extensions, - t = - (t - ? ((l.fileType = t["s3m:FileType"]), - (l._vertexCompressionType = t["s3m:VertexCompressionType"])) - : (l.fileType = e.FileType), - e.position || e.Position), - i = t.x || t.X, - o = t.y || t.Y, - t = t.z || t.Z, - r = - ((l._position = Cesium.Cartesian3.fromDegrees(i, o, t)), - (l.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( - l._position - )), - (l.invModelMatrix = Cesium.Matrix4.inverse( - l.modelMatrix, - l.invModelMatrix - )), - e.heightRange - ? ((l._minHeight = e.heightRange.min), - (l._maxHeight = e.heightRange.max)) - : e.HeightRange && - ((l._minHeight = e.HeightRange.MinHeight), - (l._maxHeight = e.HeightRange.MaxHeight)), - e.geoBounds - ? (l._rectangle = Cesium.Rectangle.fromDegrees( - e.geoBounds.left, - e.geoBounds.bottom, - e.geoBounds.right, - e.geoBounds.top - )) - : (l.viewPosition = Cesium.Cartesian3.fromDegrees( - i, - o, - l._maxHeight - )), - e.wDescript && - ((t = e.wDescript.range), - (l._minWValue = t.min), - (l._maxWValue = t.max)), - e.tiles || e.rootTiles || (e.OSGFiles && e.OSGFiles.Files)); - for (let e = 0, t = r.length; e < t; e++) { - var n = r[e]; - if (n) { - var a = n.url || n.FileName; - let e = { box: n.boundingbox }, - t = - (n.BoundingSphere && - (e.sphere = { - radius: n.BoundingSphere.Radius, - center: new Cesium.Cartesian3( - n.BoundingSphere.CenterX, - n.BoundingSphere.CenterY, - n.BoundingSphere.CenterZ - ), - }), - new Ct(l, void 0, e, a)); - (t.isRootTile = !0), l._cache.add(t), l._rootTiles.push(t); - } - } - l._readyPromise.resolve(l); - }) - .otherwise(function (e) { - s ? l._readyPromise.reject(e) : l.loadConfig(t, !0); - }); - }), - (Rt.prototype._tranverseRenderEntity = function (i, o) { - let r = []; - for (let e = 0, t = this._rootTiles.length; e < t; e++) { - var n = this._rootTiles[e]; - r.push(n); - } - for (; r.length; ) { - var a = r.pop(); - for (let e = 0, t = a.renderEntities.length; e < t; e++) { - var s = a.renderEntities[e]; - s.ready && o(s, i); - } - for (let e = 0, t = a.children.length; e < t; e++) - r.push(a.children[e]); - } - }), - (Rt.prototype._updateObjsOperation = function (e) { - this._tranverseRenderEntity({ ids: e }, Ot); - }), - (Rt.prototype._setObjsOperationType = function (i, o) { - Cesium.Check.defined("set Objs Operation ids", i), - Cesium.Check.defined("set Objs Operation operationType", o), - Array.isArray(i) || (i = [i]); - let r = new Cesium.AssociativeArray(); - for (let e = 0, t = i.length; e < t; e++) { - var n, - a = i[e]; - Cesium.defined(a) && - (n = Cesium.defaultValue(this._objsOperationList[a], 0)) !== o && - ((n |= o), (this._objsOperationList[a] = n), r.set(a, n)); - } - 0 < r.length && this._updateObjsOperation(r._hash); - }), - (Rt.prototype._removeObjsOperationType = function (i, e) { - Cesium.Check.defined("set Objs Operation ids", i), - Array.isArray(i) || (i = [i]); - var o = Lt.ALL ^ e; - let r = new Cesium.AssociativeArray(); - for (let e = 0, t = i.length; e < t; e++) { - var n = i[e], - a = this._objsOperationList[n]; - Cesium.defined(a) && - ((a &= o) === Lt.RESET - ? delete this._objsOperationList[n] - : (this._objsOperationList[n] = a), - r.set(n, a)); - } - 0 < r.length && this._updateObjsOperation(r._hash); - }), - (Rt.prototype.releaseSelection = function () { - this._selections.length < 1 || - (this._removeObjsOperationType(this._selections, Lt.SELECTED), - (this._selections.length = 0)); - }), - (Rt.prototype.setSelection = function (e) { - Cesium.Check.defined("setSelection ids", e), - Array.isArray(e) || (e = [e]), - this.releaseSelection(), - (this._selections = this._selections.concat(e)), - this._setObjsOperationType(e, Lt.SELECTED); - }), - (Rt.prototype.prePassesUpdate = function (e) { - this.ready && - e.newFrame && - (this._cache.reset(), - (this._requestTiles.length = 0), - (this._processTiles.length = 0), - (this._selectedTiles.length = 0)); - }), - (Rt.prototype.postPassesUpdate = function (e) { - this.ready && Ht(this); - }), - (Rt.prototype.update = function (e) { - if (this.ready && this.show) { - this._schuduler.schedule(this, e); - { - let i = this._requestTiles; - var o = i.length; - i.sort(Bt); - for (let t = 0; t < o; ++t) { - let e = i[t]; - e.requestContent(); - } - } - var i = this, - r = e, - n = i._processTiles, - a = n.length; - for (let t = 0; t < a; ++t) { - let e = n[t]; - e.update(r, i); - } - { - var s = this, - l = e; - let t = s._selectedTiles; - var u = t.length; - for (let e = 0; e < u; e++) t[e].update(l, s); - } - } - }), - (Rt.prototype.isDestroyed = function () { - return !1; - }), - (Rt.prototype.deleteObject = function () { - this.scene.primitives.remove(this); - }), - (Rt.prototype.destroy = function () { - return ( - this._cache.reset(), - Ht(this), - (this._rootTiles.length = 0), - (this._requestTiles.length = 0), - (this._processTiles.length = 0), - (this._selectedTiles.length = 0), - Cesium.destroyObject(this) - ); - }), - (Rt.prototype.setVisibility = function (e) { - this.show = e; - }); - var Vt = - "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nif(plus && st.s < time && time - st.s <= 0.1){\nmaterial.alpha = 1.0 - (time - st.s) / 0.1;\nif(material.alpha < 0.3){\nmaterial.alpha = 0.3;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else if(inverse && st.s < (1.0 - time) && (1.0 - time) - st.s <= 0.1){\nmaterial.alpha = ((1.0-time) - st.s) / 0.1;\nif(material.alpha < 0.3){\nmaterial.alpha = 0.3;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else{\nmaterial.alpha = 0.3;\nmaterial.diffuse = color.rgb;\n}\nreturn material;\n}\n"; - let Gt = new Map(); - function v(e) { - this._viewer = e; - } - (v.prototype.defaultValue = X), - (v.prototype.createRandomId = function () { - return ( - (1e7 * Math.random()).toString(16).substr(0, 4) + - "-" + - new Date().getTime() + - "-" + - Math.random().toString().substr(2, 5) - ); - }), - (v.prototype.mouse = function (e, t, i) { - e.style.cursor = 1 == t ? "url(" + i + "),auto" : "default"; - }), - (v.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 = (this._viewer ? this._viewer.container : document).querySelector( - "#" + s - ); - return ( - u || - ((l = document.createElement("div")), - $(".cesium-viewer").append(l), - (l = - '<div id="' + - s + - '" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:榛戜綋;color:white;font-weight: bolder;font-size: 14px;' + - a + - '"></div>'), - $(".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"; - }, - } - ); - }), - (v.prototype.getWMTSData = function (u, t) { - ge(u.url + "?service=WMTS&request=GetCapabilities").then((o) => { - let r = o.xmlObj, - e, - n, - a, - s = {}; - if (u.gisserverTMS) (e = _e(r)), (n = e.Contents && e.Contents.Layer); - else { - let i = r.getElementsByTagName("Layer"); - for (let e = 0, t; e < i.length; e++) - if ( - (t = i[e].getElementsByTagName("ows:Identifier")) && - t[0] && - t[0].innerHTML === u.layer - ) { - r = i[e]; - break; - } - n = _e(r); - } - if (n) { - let e = n.TileMatrixSetLink, - t = n.WGS84BoundingBox; - var l; - t && - ((o = t.LowerCorner.split(" ")), - (l = t.UpperCorner.split(" ")), - (a = Cesium.BoundingSphere.fromPoints([ - Cesium.Cartesian3.fromDegrees(o[0], o[1]), - Cesium.Cartesian3.fromDegrees(l[0], l[1]), - ]))); - let i; - if (u.gisserverTMS) i = e; - else { - let t = u.srs || "EPSG:4326"; - i = e.filter((e) => e.TileMatrixSet === t)[0]; - } - i && - i.TileMatrixSetLimits && - i.TileMatrixSetLimits.TileMatrixLimits.forEach((e) => { - let t = e.TileMatrix; - var i = (t = t.split(":"))[t.length - 1]; - s[i] = { - maxCol: e.MaxTileCol, - minCol: e.MinTileCol, - maxRow: e.MaxTileRow, - minRow: e.MinTileRow, - }; - }); - } - t && t({ boundingSphere: a, TileMatrixLimits: s }); - }); - }), - (v.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)); - }), - (v.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, - ]; - }), - (v.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 }; - }), - (v.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 = - '<div id="' + - a + - '" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:榛戜綋;color:white;font-weight: bolder;font-size: 14px;' + - e + - '"></div>'), - $(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 ( - t.closeBtn && - ((s.className = "resultToolTip resultToolTipClose"), - (s.onclick = () => { - (s.style.display = "none"), (n = void 0), t.close && t.close(); - })), - 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(); - }, - } - ); - }), - (v.prototype.CombineEcharts = function (e, t, i) { - return ( - this._CombineEcharts || (this._CombineEcharts = new re(e)), - this._CombineEcharts.setOption(t, i) - ); - }), - (v.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; - }), - (v.prototype.pickFromRay = function (e, t, i, o = []) { - if (!t.equals(i)) - return ( - (i = Cesium.Cartesian3.normalize( - Cesium.Cartesian3.subtract(i, t, new Cesium.Cartesian3()), - new Cesium.Cartesian3() - )), - (t = new Cesium.Ray(t, i)), - e.scene.pickFromRay(t, o) - ); - }), - (v.prototype.openLocalFile = function (e = {}) { - let o = document.createElement("input"); - (o.accept = e.accept), - (o.type = "file"), - e.multiple && (o.multiple = "multiple"), - (o.onchange = function () { - if ("function" == typeof e.callback && o.files.length) - if (e.multiple) { - let t = [], - i = []; - for (let e = 0; e < o.files.length; e++) - t.push(URL.createObjectURL(o.files[e])), i.push(o.files[e]); - e.callback(t, i); - } else e.callback(URL.createObjectURL(o.files[0]), o.files[0]); - }), - o.click(); - }), - (v.prototype.openShapeFile = function (i, o) { - this.openLocalFile({ - multiple: !0, - accept: ".shp,.dbf", - callback: (r, e) => { - let n = new Map(); - e.forEach((e, t) => { - var i = e.name.substring(0, e.name.length - 4); - let o = n.get(i); - o || (n.set(i, { shp: void 0, dbf: void 0 }), (o = n.get(i))), - e.name.includes(".shp") ? (o.shp = r[t]) : (o.dbf = r[t]); - }), - n.forEach((e, t) => { - e.shp - ? this.loadShpFile( - { shp: e.shp, dbf: e.dbf, encoding: o, fileName: t }, - i - ) - : console.error("璇烽�夋嫨" + t + ".shp鏂囦欢"); - }); - }, - }); - }), - (v.prototype.loadShpFile = function ( - { fileName: o, shp: e, dbf: t, encoding: i }, - r - ) { - if (!window.shapefile) { - let e = new oe(!1); - e.addJs(window.SmartEarthRootUrl + "Workers/shapefile.js"); - } - return shapefile - .open(e, t, { encoding: i || "utf-8" }) - .then((i) => - i.read().then(function e(t) { - if (!t.done) - return ( - Cesium.GeoJsonDataSource.load(t.value, { - clampToGround: !0, - }).then((e) => { - r && o ? r(o, e.entities.values[0]) : r(e.entities.values[0]); - }), - i.read().then(e) - ); - }) - ) - .catch((e) => console.error(e.stack)); - }), - (v.prototype.getGifImageProperty = function (e, t = 6) { - if (!e || -1 === e.indexOf(".gif")) return e; - if (!window.SuperGif) { - let e = new oe(!1); - e.addJs(window.SmartEarthRootUrl + "Workers/libgif.js"); - } - let i = document.createElement("img"), - o = - ((i.src = e), - i.setAttribute("rel:animated_src", e), - i.setAttribute("rel:auto_play", "0"), - document.body.appendChild(i), - new SuperGif({ gif: i })), - r = [], - n = - (new Promise((e) => { - o.load(() => { - for (let e = 1; e <= o.get_length(); e++) - o.move_to(e), r.push(o.get_canvas().toDataURL()); - e(r); - }); - }), - 0); - return new Cesium.CallbackProperty(function () { - return r.length - ? (n < t * (r.length - 1) ? n++ : (n = 0), - r[Math.floor(n / t) === r.length - 1 ? 0 : Math.floor(n / t)]) - : e; - }, !1); - }), - (v.prototype.isDOM = function (e) { - return "object" == typeof HTMLElement - ? e instanceof HTMLElement - : e && - "object" == typeof e && - 1 === e.nodeType && - "string" == typeof e.nodeName; - }), - (v.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(); - }), - (v.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 - ); - }), - (v.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 - ), - } - ); - }), - (v.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 - ); - }), - (v.prototype.isClockwise = function (e) { - e = Cesium_turf.lineString(e); - return Cesium_turf.booleanClockwise(e); - }), - (v.prototype.saveAs = function (e, t) { - if (!window.saveAs) { - let e = new oe(!1); - e.addJs(window.SmartEarthRootUrl + "Workers/FileSaver.js"); - } - saveAs(e, t); - }), - (v.prototype.getEntityProp = function (e) { - var t = e.properties && e.properties.getValue(); - return { id: e.id, properties: t }; - }), - (v.prototype.getEntityPropValue = function (e, t) { - e = e.properties && e.properties.getValue(); - return ( - -1 < t.indexOf("[") && - -1 < t.indexOf("]") && - (t = t.replace("[", "").replace("]", "")), - e && e[t] - ); - }), - (v.prototype.setheight = function (e, t) { - e = Cesium.Cartographic.fromCartesian(e); - return Cesium.Cartesian3.fromRadians(e.longitude, e.latitude, t); - }), - (v.prototype.setpolylineheight = function (e, t) { - let i = []; - return ( - e.forEach(function (e) { - e = Cesium.Cartographic.fromCartesian(e); - i.push(Cesium.Cartesian3.fromRadians(e.longitude, e.latitude, t)); - }), - i - ); - }), - (v.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 - ); - }), - (v.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; - }), - (v.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(0.165, 0.165, 0.165, 0.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 - ); - }), - (v.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 })); - }), - (v.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), - }, - }) - ); - }), - (v.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; - }), - (v.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 - ); - }), - (v.prototype.unique = function (e) { - for (var t = [], i = 0; i < e.length; i++) - -1 === t.indexOf(e[i]) && t.push(e[i]); - return t; - }), - (v.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; - }), - (v.prototype.setPositionOffset = (e, t, i) => { - (e = Cesium.Transforms.headingPitchRollToFixedFrame( - e, - i || new Cesium.HeadingPitchRoll() - )), - (i = new Cesium.Cartesian3(0, 0, 0)); - return Cesium.Matrix4.multiplyByPoint(e, t, i), i; - }), - (v.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 = he.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 = he.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 - ); - }), - (v.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 = `<div id="trackedTooltip${a.id}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;"><div class="trackedTooltipContainer"></div></div>`; - 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 - ); - }), - (v.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)); - }), - (v.prototype.isnull = function (e) { - return null == e || "" === e; - }), - (v.prototype.getuid = function () { - return this.uuid(8, 16); - }), - (v.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; - }), - (v.prototype.customGeometry = function (t) { - if (t.scale) - for (let e = 0; e < t.position.length - 2; e += 3) - (t.position[e] *= t.scale[0]), - (t.position[e + 1] *= t.scale[1]), - (t.position[e + 2] *= t.scale[2]); - return new Cesium.Geometry({ - attributes: { - position: new Cesium.GeometryAttribute({ - componentDatatype: Cesium.ComponentDatatype.DOUBLE, - componentsPerAttribute: 3, - values: t.position, - }), - st: new Cesium.GeometryAttribute({ - componentDatatype: Cesium.ComponentDatatype.FLOAT, - componentsPerAttribute: 2, - values: t.st, - }), - }, - indices: t.indices, - primitiveType: t.grid - ? Cesium.PrimitiveType.LINES - : Cesium.PrimitiveType.TRIANGLES, - boundingSphere: t.boundingSphere, - }); - }), - (v.prototype.getLevel = function (e) { - let t = 0, - i = e.scene.globe._surface._tilesToRender; - return ( - i && - i.forEach((e) => { - e.level > t && (t = e.level); - }), - t - ); - }), - (v.prototype.getViewRectangle = function (e) { - e = e.camera.computeViewRectangle(); - return this.toDegreesRectangle(e); - }), - (v.prototype.toDegreesRectangle = function (e) { - let t = new Cesium.Rectangle(); - return ( - (t.west = Cesium.Math.toDegrees(e.west)), - (t.north = Cesium.Math.toDegrees(e.north)), - (t.east = Cesium.Math.toDegrees(e.east)), - (t.south = Cesium.Math.toDegrees(e.south)), - t - ); - }), - (v.prototype.getCenterOfMass = function (e) { - let i = [], - o = 0; - if (e[0].x) { - let t; - e.forEach((e) => { - (t = this.toDegrees(e)), i.push([t.lon, t.lat]), (o += t.height); - }); - } else - e[0].lon - ? e.forEach((e) => { - i.push([e.lon, e.lat]), (o += e.height || 0); - }) - : Array.isArray(e[0]) && - (i = e).forEach((e) => { - o += e[2] || 0; - }); - var t = turf.polygon([i]); - let r = turf.pointOnFeature(t); - return ( - (o /= e.length), (r.geometry.coordinates[2] = o), r.geometry.coordinates - ); - }), - (v.prototype.addPickStage = function (e, t = "rgba(255,0,0,0.6)") { - let i = e.scene.postProcessStages.add( - new Cesium.PostProcessStage({ - fragmentShader: - "uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 highlight;\nvoid main() {\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (czm_selected()) {\n vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n gl_FragColor = vec4(highlighted, 1.0);\n } else { \n gl_FragColor = color;\n }\n}\n", - uniforms: { - highlight: function () { - return new Cesium.Color.fromCssColorString(t); - }, - }, - }) - ); - return ( - (i.selected = []), - { - select(e) { - !e.color && e.content - ? (e = e.content.tile) - : e.id instanceof Cesium.Entity && (e = e.id), - (i.selected = [e]), - this.changeOtherHighlight(); - }, - changeOtherHighlight() { - let e = i.selected[0]; - e && - (e instanceof Cesium.Cesium3DTile - ? e.defaultColor - ? ((e.color = e.defaultColor), (e.defaultColor = null)) - : ((e.defaultColor = e.color && e.color.clone()), - (e.color = Cesium.Color.RED)) - : e instanceof Cesium.Entity || - (e.primitive instanceof Rt && - (e.primitive._selections.length - ? e.primitive.releaseSelection() - : e.primitive.setSelection(e.id)))); - }, - remove() { - this.changeOtherHighlight(), (i.selected = []); - }, - destroy() { - e.scene.postProcessStages.remove(i); - }, - } - ); - }), - (v.prototype.addLoading = function (e, t) { - let i = document.createElement("div"), - o = - ((i.id = "cesiumLoading"), - (i.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")); - return ( - (o.style.cssText = - "position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;"), - (o.src = t || window.SmartEarthRootUrl + I.loading), - i.appendChild(o), - e.appendChild(i), - { - isLoading(e) { - i.style.display = e ? "block" : "none"; - }, - remove() { - i && i.remove(), (i = null); - }, - } - ); - }), - (v.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(""); - }), - (v.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 - ); - }), - (v.prototype.isHtmlColor = function (e) { - return /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e); - }), - (v.prototype.isUrl = function (e) { - if (this.isnull(e)) return !1; - return /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.test( - e - ); - }), - (v.prototype.dateTimespan = function () { - return new Date().toTimeString(); - }), - (v.prototype.getPointFromTwoPointCenter = function (e, t, i) { - var o, - r, - n, - a, - s, - l = this.getSpaceDistancem(e, Cesium); - if (!(l < t)) - return ( - (n = e[0]), - (e = e[1]), - (n = Cesium.Cartographic.fromCartesian(n)), - (o = Cesium.Math.toDegrees(n.longitude)), - (r = Cesium.Math.toDegrees(n.latitude)), - (n = n.height), - (e = Cesium.Cartographic.fromCartesian(e)), - (a = Cesium.Math.toDegrees(e.longitude)), - (s = Cesium.Math.toDegrees(e.latitude)), - (e = e.height), - (l = parseFloat(l / t)), - (t = Cesium.Math.lerp(o, a, 1 / l) - o), - (a = Cesium.Math.lerp(r, s, 1 / l) - r), - (s = Cesium.Math.lerp(n, e, 1 / l) - n), - Cesium.Cartesian3.fromDegrees(o + t, r + a, i || n + s) - ); - }), - (v.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) + "绫�"; - }), - (v.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); - }), - (v.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) + "绫�"); - }), - (v.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; - } - }), - (v.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 } - ); - }), - (v.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() - ); - }), - (v.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; - }), - (v.prototype.computeCircle = function (t) { - let i = Gt.get(t); - if (i) return i; - i = []; - for (let e = 0; e < 360; e += 12) { - var o = Cesium.Math.toRadians(e); - i.push(new Cesium.Cartesian2(t * Math.cos(o), t * Math.sin(o))); - } - return Gt.set(t, i), i; - }), - (v.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) + "骞虫柟鍗冪背"); - } - }), - (v.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)); - }), - (v.prototype.Angle = function (e, t, i) { - e = this.Bearing(t, e) - this.Bearing(t, i); - return e < 0 && (e += 360), e; - }), - (v.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); - }), - (v.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); - } - }), - (v.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 f = 0; f < h; f++) { - var _ = l + (f + 1) * m, - C = u + (f + 1) * d, - _ = o.Cartesian3.fromDegrees(_, C); - p.push(o.Cartographic.fromCartesian(_)); - } - var y = 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), - f = 0; - f < g.length; - f++ - ) { - var t = y.get3DTileOrPrimitivesHeights(p[f], r), - t = (void 0 !== t && (g[f] = t), g[f].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); - } - }); - }), - (v.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); - }), - (v.prototype.get3DTileOrPrimitivesHeights = function (e, t) { - return t.scene.sampleHeight(e); - }), - (v.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); - }); - }), - (v.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, 0.05, 0.2, 0.35, 0.5, 0.65, 0.8, 0.95, 1]) - : "slope" === e - ? (r = n) - : "aspect" === e && (r = [0, 0, 0.2, 0.4, 0.6, 0.8, 0.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; - }), - (v.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); - }), - (v.prototype.to_Radian = function (e) { - return (e * Math.PI) / 180; - }), - (v.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)); - }), - (v.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)) - ); - }), - (v.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; - }), - (v.prototype.TwoPointAzimuth = function (e, t, i, o) { - function r(e) { - return (e * Math.PI) / 180; - } - var n = 0, - a = Math.round(0.5 + 36e4 * t), - s = Math.round(0.5 + 36e4 * o), - l = Math.round(0.5 + 36e4 * e), - u = Math.round(0.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 - ); - }), - (v.prototype.twoPointsHeadingPitchRoll = function (e, t, i) { - let o = new Cesium.Camera(e.scene); - (o.position = t), - (o.direction = Cesium.Cartesian3.subtract( - i, - t, - new Cesium.Cartesian3() - )), - (o.up = Cesium.Cartesian3.normalize(t, new Cesium.Cartesian3())); - var e = Cesium.Cartesian3.distance(t, i), - i = Cesium.Cartesian3.normalize( - Cesium.Cartesian3.subtract(i, t, new Cesium.Cartesian3()), - new Cesium.Cartesian3() - ), - { - heading: t, - pitch: i, - roll: r, - } = ((o.direction = i), (o.frustum.near = 0), (o.frustum.far = e), o); - return (o = null), { heading: t, pitch: i, roll: r, radius: e }; - }), - (v.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; - }), - (v.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)); - }), - (v.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 += 0.01) : (n.i = 0), - (n.curCanvas = "a" === n.curCanvas ? "b" : "a"), - i - ); - }, !1)), - new t.ImageMaterialProperty({ image: o, transparent: !0 }) - ); - }), - (v.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 - ); - }), - (v.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 += 0.01) : (i = 0), - (curCanvas = "a" === curCanvas ? "b" : "a"), - o - ); - }), - (v.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, - }; - }), - (v.prototype.fromDegrees = function (e) { - return Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height); - }), - (v.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; - f = void 0; - _ = 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 = C(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 = C(p, g)), - n.height.push(t), - n.positions.push(Cesium.Cartesian3.fromDegrees(p, g, t)); - } - n.lon_lat.push(c, h), - (t = C(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 f = l + (e + 1) * m, - _ = 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 C(e, t) { - e = Cesium.Cartographic.fromDegrees(e, t); - return i.scene.globe.getHeight(e); - } - return n; - }), - (v.prototype.CIMServerTool = function (e) { - return new ne(e); - }), - (v.prototype.Recorder = function (e, t) { - return ( - this._Recorder - ? ((this._Recorder.mediaOutputPath = this.defaultValue( - e, - "test.mp4" - )), - t && (this._Recorder.videoBPS = t)) - : (this._Recorder = new ae(e, t)), - this._Recorder - ); - }), - (v.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), - 0.5 < this.old && - t.time < 0.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 - 0.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 = Vt), - Cesium.Material._materialCache.addMaterial( - Cesium.Material.PolylineLinkType, - { - fabric: { - type: Cesium.Material.PolylineLinkType, - uniforms: { - color: new Cesium.Color(1, 0, 0, 0.5), - lightSpotColor: new Cesium.Color(1, 1, 1, 0.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) - ) - ); - }), - (v.prototype.getTrailLinkMaterial = function (e, t, i) { - return new te(e, t, i); - }), - (v.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, 0.5), time: 0 }, - source: Cesium.Material.ConeRadarSource, - }, - translucent: function (e) { - return !0; - }, - } - )), - new Cesium.ConeRadarMaterialProperty( - Cesium.Color.fromCssColorString(this.defaultValue(e, "#0000ff")), - 3e3 - ) - ); - }), - (v.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) - ) - ); - }), - (v.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) - ) - ); - }), - (v.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<time){\n float f = dis / time;\n material.alpha = pow(f, 4.0);\n }else{\n material.alpha = 0.0;\n }\n return material;\n }"), - Cesium.Material._materialCache.addMaterial( - Cesium.Material.CircleScanType, - { - fabric: { - type: Cesium.Material.CircleScanType, - uniforms: { color: new Cesium.Color(1, 0, 0, 1), time: 0 }, - source: Cesium.Material.CircleScanSource, - }, - translucent: function (e) { - return !0; - }, - } - )), - new Cesium.CircleScanMaterialProperty( - Cesium.Color.fromCssColorString(this.defaultValue(e, "#ff0000")), - this.defaultValue(t, 3e3) - ) - ); - }), - (v.prototype.getRadarScanMaterial = 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.RadarScanMaterialProperty || - (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 "RadarScan"; - }), - (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.angle1 = 360 * t.time), - (t.angle2 = 360 * t.time + 60), - 360 < t.angle2 && (t.angle2 = t.angle2 - 360), - t - ); - }), - (i.prototype.equals = function (e) { - return ( - this === e || - (e instanceof i && Cesium.Property.equals(this._color, e._color)) - ); - }), - (Cesium.RadarScanMaterialProperty = i), - (Cesium.Material.RadarScanType = "RadarScan"), - (Cesium.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 f = (nowAngle - angle1) / 60.0;\n material.alpha = f;\n }else if(nowAngle < 360.0 && nowAngle > angle1 && angle2 < 60.0){\n f = (nowAngle - angle1) / 60.0;\n material.alpha = f;\n }else if(nowAngle < angle2 && nowAngle > 0.0 && angle2 < 60.0){\n f = (nowAngle + 360.0 - angle1) / 60.0;\n material.alpha = f;\n }else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n }"), - Cesium.Material._materialCache.addMaterial( - Cesium.Material.RadarScanType, - { - fabric: { - type: Cesium.Material.RadarScanType, - uniforms: { - color: new Cesium.Color(1, 0, 0, 1), - time: 0, - angle2: 0, - angle1: 0, - }, - source: Cesium.Material.RadarScanSource, - }, - translucent: function (e) { - return !0; - }, - } - )), - new Cesium.RadarScanMaterialProperty( - Cesium.Color.fromCssColorString(this.defaultValue(e, "#ff0000")), - this.defaultValue(t, 3e3) - ) - ); - }), - (v.prototype.gradientColor = function (e, t, i) { - return new me(e, t, i); - }), - (v.prototype.xhr = function (e) { - var t = new XMLHttpRequest(), - i = !0, - i = null == e.async || null == e.async || e.async; - if ((t.open(e.type, e.url, i), e.headers)) - for (const o in e.headers) t.setRequestHeader(o, e.headers[o]); - t.send(e.data || {}), - (t.onreadystatechange = function () { - 4 === this.readyState && 200 === this.status - ? e.success && - "function" == typeof e.success && - e.success( - e.isXml ? this.responseXML : JSON.parse(this.responseText) - ) - : 200 !== this.status && - e.error && - "function" == typeof e.error && - e.error(t), - e.complete && "function" == typeof e.complete && e.complete(); - }); - }); - var jn, - kt = - "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 m(e, t) { - (this._viewer = e), (this._cesium = t), (this._core = new v()); - } - function Nt(e, t) { - (this._viewer = e), (this._cesium = t), (this._core = new v()); - } - function jt(e) { - (this._viewer = e), - (this.editType = "Entity"), - (this._core = new v()), - (this.tooltip = this._core.CreateTooltip({ id: "ModelEdit" })); - } - (v.prototype._serialize = function (e) { - var t, - i = [], - o = window.encodeURIComponent; - for (t in e) { - var r = e[t]; - "object" === (void 0 === r ? "undefined" : kt(r)) - ? i.push(o(t) + "=" + o(JSON.stringify(r))) - : i.push(o(t) + "=" + o(e[t])); - } - return i.join("&"); - }), - (v.prototype.xml2json = _e), - (v.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("涓嶆槸鏈夋晥鐨刪tml棰滆壊", 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); - }), - (Nt.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 - ); - }), - (Nt.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 - ); - }), - (Nt.prototype.setSpacing = function (e) { - try { - this.item.contourUniforms.spacing = parseFloat(e); - } catch (e) { - console.log(e); - } - return this; - }), - (Nt.prototype.setMaterialColor = function (e) { - try { - this.item.contourUniforms.color = new m( - this._viewer, - this._cesium - ).colorFromHtmlColor(e); - } catch (e) { - console.log(e); - } - return this; - }), - (Nt.prototype.setWidth = function (e) { - try { - this.item.contourUniforms.width = parseFloat(e); - } catch (e) { - console.log(e); - } - return this; - }), - (Nt.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(Nt.prototype, { - elevation: { - get: function () { - return this.item; - }, - set: function (e) { - this.item = e; - }, - }, - }), - (jt.prototype.start = function (i, o = {}) { - if ((this.end(), i)) { - let e, t; - if (i.item && i.item instanceof Cesium.Cesium3DTileset) - (this.editType = "SE3DTiles"), - (t = i.boundingSphereRadius), - (e = Cesium.Cartesian3.fromDegrees( - i.modelEditData.lon, - i.modelEditData.lat, - i.modelEditData.height - )); - else { - this.editType = "Entity"; - var r = this._viewer.scene.primitives._primitives.findIndex( - (e) => e.id && e.id.id === i.id - ); - if (r < 0) return; - r = this._viewer.scene.primitives.get(r).boundingSphere; - (t = r.radius), - (e = i.position.getValue()), - i.heading || (i.heading = 0), - i.pitch || (i.pitch = 0), - i.roll || (i.roll = 0); - } - this.model = i; - var r = (2 * t) / 3.63, - n = Cesium.Transforms.eastNorthUpToFixedFrame(e); - return ( - (this.axis = this._viewer.scene.primitives.add( - Cesium.Model.fromGltf({ - id: "modeEditAxis", - modelMatrix: n, - url: window.SmartEarthRootUrl + I.modelAxis, - scale: r, - minimumPixelSize: o.minimumPixelSize, - }) - )), - this.axis.readyPromise.then(() => { - !1 === o.rotateX && (this.axis._nodeCommands[1].show = !1), - !1 === o.rotateY && (this.axis._nodeCommands[0].show = !1), - !1 === o.rotateZ && (this.axis._nodeCommands[5].show = !1); - }), - this.initEvent(o), - this - ); - } - }), - (jt.prototype.initEvent = function (i) { - this.editHandler && this.editHandler.destroy(), - (this.editHandler = new Cesium.ScreenSpaceEventHandler( - this._viewer.scene.canvas - )); - let o, r; - this.editHandler.setInputAction((e) => { - o - ? ((r = e.position), - "Entity" === this.editType - ? ((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.originPosition = Cesium.Cartesian3.fromDegrees( - this.model.modelEditData.lon, - this.model.modelEditData.lat, - this.model.modelEditData.height - )), - (this.originHeading = this.model.modelEditData.heading || 0), - (this.originPitch = this.model.modelEditData.ritch || 0), - (this.originRoll = this.model.modelEditData.roll || 0)), - (this.startPosition = this._viewer.scene.pickPosition(r)), - this.defaultEvent(!1), - this.setMouseStyle("edit")) - : (r = void 0); - }, Cesium.ScreenSpaceEventType.LEFT_DOWN), - this.editHandler.setInputAction((e) => { - (r = void 0), this.defaultEvent(!0), this.setMouseStyle("default"); - }, Cesium.ScreenSpaceEventType.LEFT_UP), - this.editHandler.setInputAction((e) => { - if (r) - return ( - this.mouseTooltip(o, e), - this.edit(o, r, e.endPosition), - void (i.callback && i.callback(o)) - ); - var t = this._viewer.scene.pick(e.endPosition); - (o = - t && "modeEditAxis" === t.id - ? "XArrow_1" === (t = t.mesh ? t.mesh.name : t.detail.node._name) - ? "y" - : "YArrow_1" === t - ? "x" - : "ZArrow_1" === t - ? "z" - : "ZAxis_1" === t - ? "heading" - : "XAxis_1" === t - ? "pitch" - : "YAxis_1" === t - ? "roll" - : void 0 - : void 0), - this.mouseTooltip(o, e); - }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); - }), - (jt.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); - }), - (jt.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"); - }), - (jt.prototype.edit = function (e, i, o) { - if (e) { - var r = this.originPosition, - n = this.startPosition, - a = this._viewer.scene.pickPosition(o); - let t = this._core.toDegrees(r); - var n = this._core.toDegrees(n), - a = this._core.toDegrees(a), - r = this._viewer.scene.cartesianToCanvasCoordinates(r), - s = (o.x, i.x, o.y - i.y); - if ("x" === e) { - var l = n.lon - a.lon; - (t.lon -= l), this.setPosition(t); - } else if ("y" === e) { - l = n.lat - a.lat; - (t.lat -= l), this.setPosition(t); - } else if ("z" === e) { - (a = n.height - t.height), (l = s * Math.abs(a / (i.y - r.y))); - (t.height -= l), this.setPosition(t); - } else if ("heading" === e) { - (s = this.originHeading), (a = this._core.arge(r, i, o, "+-", !0)); - this.setRotate("heading", (s -= a)); - } else if ("pitch" === e) { - l = (n.lon - t.lon) / (i.x - r.x); - let e = this.originPitch; - a = this._core.arge(r, i, o, "+-", !0); - 0 < l ? (e += a) : (e -= a), this.setRotate("pitch", e); - } else if ("roll" === e) { - s = (n.lat - t.lat) / (i.x - r.x); - let e = this.originRoll; - l = this._core.arge(r, i, o, "+-", !0); - s < 0 ? (e -= l) : (e += l), this.setRotate("roll", e); - } - } - }), - (jt.prototype.setPosition = function (e) { - var t = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height); - "Entity" === this.editType - ? ((this.model.position = t), - window.SmartEarthPopupData && - window.SmartEarthPopupData.window && - SmartEarthPopupData.window.document.querySelector( - '.model input[name="height"]' - ) && - (SmartEarthPopupData.window.document.querySelector( - '.model input[name="height"]' - ).value = e.height.toFixed(2))) - : this.model.setEditData(e), - (this.axis.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(t)); - }), - (jt.prototype.setRotate = function (o, r) { - if (this.model) - if ("Entity" === this.editType) { - 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) - ) - )), - window.SmartEarthPopupData && - window.SmartEarthPopupData.window && - SmartEarthPopupData.window.document.querySelector( - `.model input[name="${o}"]` - ) && - (SmartEarthPopupData.window.document.querySelector( - `.model input[name="${o}"]` - ).value = r); - } else - switch (o) { - case "heading": - this.model.setEditData({ heading: -r }); - break; - case "pitch": - this.model.setEditData({ pitch: r }); - break; - case "roll": - this.model.setEditData({ roll: r }); - } - }), - (jt.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, "缁昛杞存棆杞�") - : "pitch" === e - ? this.tooltip.showAt(t, "缁昚杞存棆杞�") - : "roll" === e - ? this.tooltip.showAt(t, "缁昘杞存棆杞�") - : this.tooltip.show(!1)) - : this.tooltip.show(!1); - }), - (jt.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); - }); - var zn = "Expected a function", - Un = "__lodash_hash_undefined__", - Wn = "__lodash_placeholder__", - Yn = 128, - Jn = 9007199254740991, - Kn = NaN, - Qn = 4294967295, - qn = [ - ["ary", Yn], - ["bind", 1], - ["bindKey", 2], - ["curry", 8], - ["curryRight", 16], - ["flip", 512], - ["partial", 32], - ["partialRight", 64], - ["rearg", 256], - ], - Xn = "[object Arguments]", - Zn = "[object Array]", - $n = "[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]", - fa = "[object Float64Array]", - _a = "[object Int8Array]", - Ca = "[object Int16Array]", - ya = "[object Int32Array]", - va = "[object Uint8Array]", - wa = "[object Uint8ClampedArray]", - ba = "[object Uint16Array]", - Ta = "[object Uint32Array]", - Ea = /\b__p \+= '';/g, - Sa = /\b(__p \+=) '' \+/g, - Pa = /(__e\(.*?\)|\b__t\)) \+\n'';/g, - xa = /&(?:amp|lt|gt|quot|#39);/g, - Da = /[&<>"']/g, - Ia = RegExp(xa.source), - Aa = RegExp(Da.source), - La = /<%-([\s\S]+?)%>/g, - Ma = /<%([\s\S]+?)%>/g, - Ra = /<%=([\s\S]+?)%>/g, - Oa = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - Ba = /^\w*$/, - Fa = - /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, - Ha = /[\\^$.*+?()[\]{}|]/g, - Va = RegExp(Ha.source), - Ga = /^\s+/, - zt = /\s/, - ka = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, - Na = /\{\n\/\* \[wrapped with (.+)\] \*/, - ja = /,? & /, - za = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, - Ua = /[()=,{}\[\]\/\s]/, - Wa = /\\(\\)?/g, - Ya = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, - Ja = /\w*$/, - Ka = /^[-+]0x[0-9a-f]+$/i, - Qa = /^0b[01]+$/i, - qa = /^\[object .+?Constructor\]$/, - Xa = /^0o[0-7]+$/i, - Za = /^(?:0|[1-9]\d*)$/, - $a = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, - es = /($^)/, - ts = /['\n\r\u2028\u2029\\]/g, - Ut = "\\ud800-\\udfff", - Wt = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", - Yt = "\\u2700-\\u27bf", - Jt = "a-z\\xdf-\\xf6\\xf8-\\xff", - Kt = "A-Z\\xc0-\\xd6\\xd8-\\xde", - Qt = "\\ufe0e\\ufe0f", - qt = - "\\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", - Xt = "['鈥橾", - Zt = "[" + Ut + "]", - $t = "[" + qt + "]", - ei = "[" + Wt + "]", - ti = "[" + Yt + "]", - ii = "[" + Jt + "]", - qt = "[^" + Ut + qt + "\\d+" + Yt + Jt + Kt + "]", - Yt = "\\ud83c[\\udffb-\\udfff]", - Jt = "[^" + Ut + "]", - oi = "(?:\\ud83c[\\udde6-\\uddff]){2}", - ri = "[\\ud800-\\udbff][\\udc00-\\udfff]", - Kt = "[" + Kt + "]", - ni = "\\u200d", - ai = "(?:" + ii + "|" + qt + ")", - qt = "(?:" + Kt + "|" + qt + ")", - si = "(?:['鈥橾(?:d|ll|m|re|s|t|ve))?", - li = "(?:['鈥橾(?:D|LL|M|RE|S|T|VE))?", - ui = "(?:" + ei + "|" + Yt + ")" + "?", - ci = "[" + Qt + "]?", - ci = - ci + - ui + - ("(?:" + ni + "(?:" + [Jt, oi, ri].join("|") + ")" + ci + ui + ")*"), - ui = "(?:" + [ti, oi, ri].join("|") + ")" + ci, - ti = "(?:" + [Jt + ei + "?", ei, oi, ri, Zt].join("|") + ")", - is = RegExp(Xt, "g"), - os = RegExp(ei, "g"), - hi = RegExp(Yt + "(?=" + Yt + ")|" + ti + ci, "g"), - rs = RegExp( - [ - Kt + "?" + ii + "+" + si + "(?=" + [$t, Kt, "$"].join("|") + ")", - qt + "+" + li + "(?=" + [$t, Kt + ai, "$"].join("|") + ")", - Kt + "?" + ai + "+" + si, - Kt + "+" + li, - "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", - "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", - "\\d+", - ui, - ].join("|"), - "g" - ), - mi = RegExp("[" + ni + Ut + Wt + Qt + "]"), - 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[fa] = - ls[_a] = - ls[Ca] = - ls[ya] = - ls[va] = - ls[wa] = - ls[ba] = - ls[Ta] = - !0), - (ls[Xn] = - ls[Zn] = - ls[da] = - ls[$n] = - ls[pa] = - ls[ea] = - ls[ta] = - ls[ia] = - ls[ra] = - ls[na] = - ls[aa] = - ls[la] = - ls[ua] = - ls[ca] = - ls[ma] = - !1), - {}), - di = - ((us[Xn] = - us[Zn] = - us[da] = - us[pa] = - us[$n] = - us[ea] = - us[ga] = - us[fa] = - us[_a] = - us[Ca] = - us[ya] = - us[ra] = - us[na] = - us[aa] = - us[la] = - us[ua] = - us[ca] = - us[ha] = - us[va] = - 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, - Jt = - "object" == typeof global && global && global.Object === Object && global, - oi = "object" == typeof self && self && self.Object === Object && self, - ms = Jt || oi || Function("return this")(), - ri = "object" == typeof o && o && !o.nodeType && o, - pi = - ri && "object" == typeof module && module && !module.nodeType && module, - ds = pi && pi.exports === ri, - gi = ds && Jt.process, - Zt = (function () { - try { - var e = pi && pi.require && pi.require("util").types; - return e ? e : gi && gi.binding && gi.binding("util"); - } catch (e) {} - })(), - gs = Zt && Zt.isArrayBuffer, - fs = Zt && Zt.isDate, - _s = Zt && Zt.isMap, - Cs = Zt && Zt.isRegExp, - ys = Zt && Zt.isSet, - vs = Zt && Zt.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 Es(e, t) { - for (var i = null == e ? 0 : e.length; i-- && !1 !== t(e[i], i, e); ); - return e; - } - function Ss(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 Ps(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 < Fs(e, t, 0); - } - function Ds(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 Is(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 As(e, t) { - for (var i = -1, o = t.length, r = e.length; ++i < o; ) e[r + i] = t[i]; - return e; - } - function Ls(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 Ms(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 fi = ks("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 Bs(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 Fs(e, t, i) { - if (t != t) return Bs(e, Vs, i); - for (var o = e, r = t, n = i - 1, a = o.length; ++n < a; ) - if (o[n] === r) return n; - return -1; - } - function Hs(e, t, i, o) { - for (var r = i - 1, n = e.length; ++r < n; ) if (o(e[r], t)) return r; - return -1; - } - function Vs(e) { - return e != e; - } - function Gs(e, t) { - var i = null == e ? 0 : e.length; - return i ? js(e, t) / i : Kn; - } - function ks(t) { - return function (e) { - return null == e ? jn : e[t]; - }; - } - function _i(t) { - return function (e) { - return null == t ? jn : t[e]; - }; - } - function Ns(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 Is(e, function (e) { - return t[e]; - }); - } - function Js(e, t) { - return e.has(t); - } - function Ks(e, t) { - for (var i = -1, o = e.length; ++i < o && -1 < Fs(t, e[i], 0); ); - return i; - } - function Qs(e, t) { - for (var i = e.length; i-- && -1 < Fs(t, e[i], 0); ); - return i; - } - var qs = _i({ - 脌: "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", - 艗: "Oe", - 艙: "oe", - 艍: "'n", - 趴: "s", - }), - Xs = _i({ - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'", - }); - function Zs(e) { - return "\\" + di[e]; - } - function $s(e) { - return mi.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 ( - $s(e) - ? function (e) { - var t = (hi.lastIndex = 0); - for (; hi.test(e); ) ++t; - return t; - } - : fi - )(e); - } - function nl(e) { - return $s(e) ? e.match(hi) || [] : e.split(""); - } - function al(e) { - for (var t = e.length; t-- && zt.test(e.charAt(t)); ); - return t; - } - var sl = _i({ - "&": "&", - "<": "<", - ">": ">", - """: '"', - "'": "'", - }); - var f = (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, - B = e.Math, - g = e.Object, - j = e.RegExp, - z = e.String, - C = e.TypeError, - U = b.prototype, - W = O.prototype, - Y = g.prototype, - J = e["__core-js_shared__"], - K = W.toString, - F = Y.hasOwnProperty, - Q = 0, - q = (W = /[^.]+$/.exec((J && J.keys && J.keys.IE_PROTO) || "")) - ? "Symbol(src)_1." + W - : "", - X = Y.toString, - Z = K.call(g), - $ = ms._, - ee = j( - "^" + - K.call(F) - .replace(Ha, "\\$&") - .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 = Zi(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 = B.ceil, - ge = B.floor, - fe = g.getOwnPropertySymbols, - W = W ? W.isBuffer : jn, - _e = e.isFinite, - Ce = U.join, - ye = tl(g.keys, g), - y = B.max, - T = B.min, - ve = n.now, - we = e.parseInt, - be = B.random, - Te = U.reverse, - n = Zi(e, "DataView"), - Ee = Zi(e, "Map"), - Se = Zi(e, "Promise"), - Pe = Zi(e, "Set"), - e = Zi(e, "WeakMap"), - xe = Zi(g, "create"), - De = e && new e(), - Ie = {}, - Ae = Eo(n), - Le = Eo(Ee), - Me = Eo(Se), - Re = Eo(Pe), - Oe = Eo(e), - t = t ? t.prototype : jn, - Be = t ? t.valueOf : jn, - Fe = t ? t.toString : jn; - function p(e) { - if (N(e) && !k(e) && !(e instanceof v)) { - if (e instanceof f) return e; - if (F.call(e, "__wrapped__")) return So(e); - } - return new f(e); - } - var He = function (e) { - if (!P(e)) return {}; - if (re) return re(e); - Ve.prototype = e; - e = new Ve(); - return (Ve.prototype = jn), e; - }; - function Ve() {} - function Ge() {} - function f(e, t) { - (this.__wrapped__ = e), - (this.__actions__ = []), - (this.__chain__ = !!t), - (this.__index__ = 0), - (this.__values__ = jn); - } - function v(e) { - (this.__wrapped__ = e), - (this.__actions__ = []), - (this.__dir__ = 1), - (this.__filtered__ = !1), - (this.__iteratees__ = []), - (this.__takeCount__ = Qn), - (this.__views__ = []); - } - function ke(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 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 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 H(e) { - e = this.__data__ = new Ne(e); - this.size = e.size; - } - function Ue(e, t) { - var i, - o = k(e), - r = !o && Cr(e), - n = !o && !r && vr(e), - a = !o && !r && !n && Lr(e), - s = o || r || n || a, - l = s ? zs(e.length, z) : [], - u = l.length; - for (i in e) - (!t && !F.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 vo(E(e), tt(t, 0, e.length)); - } - function Je(e) { - return vo(E(e)); - } - function Ke(e, t, i) { - ((i === jn || G(e[t], i)) && (i !== jn || t in e)) || $e(e, t, i); - } - function Qe(e, t, i) { - var o = e[t]; - (F.call(e, t) && G(o, i) && (i !== jn || t in e)) || $e(e, t, i); - } - function qe(e, t) { - for (var i = e.length; i--; ) if (G(e[i][0], t)) return i; - return -1; - } - function Xe(e, o, r, n) { - return ( - nt(e, function (e, t, i) { - o(n, e, r(e), i); - }), - n - ); - } - function Ze(e, t) { - return e && fi(t, A(t), e); - } - function $e(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 (!P(i)) return i; - var c, - e = k(i); - if (e) { - if ( - ((a = (function (e) { - var t = e.length, - i = new e.constructor(t); - t && - "string" == typeof e[0] && - F.call(e, "index") && - ((i.index = e.index), (i.input = e.input)); - return i; - })(i)), - !s) - ) - return E(i, a); - } else { - var h = V(i), - m = h == ia || h == oa; - if (vr(i)) return ci(i, s); - if (h == aa || h == Xn || (m && !t)) { - if (((a = l || m ? {} : io(i)), !s)) - return l - ? ((d = m = i), - (d = (c = a) && fi(d, L(d), c)), - fi(m, eo(m), d)) - : ((m = Ze(a, (c = i))), fi(c, $i(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 $n: - 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 fa: - case _a: - case Ca: - case ya: - case va: - 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, Ja.exec(e)); - return (t.lastIndex = e.lastIndex), t; - })(e); - case ua: - return new o(); - case ha: - return (function (e) { - return Be ? g(Be.call(e)) : {}; - })(e); - } - })(i, h, s); - } - } - var d = (n = n || new H()).get(i); - if (d) return d; - n.set(i, a), - Ir(i) - ? i.forEach(function (e) { - a.add(w(e, o, r, e, i, n)); - }) - : Sr(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 ? L : A)(i); - return ( - Ts(p || i, function (e, t) { - p && (e = i[(t = e)]), Qe(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 C(zn); - return fo(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 = Is(t, Ws(i))), - o - ? ((n = Ds), (a = !1)) - : 200 <= t.length && ((n = Js), (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: La, - evaluate: Ma, - interpolate: Ra, - variable: "", - imports: { _: p }, - }), - ((p.prototype = Ge.prototype).constructor = p), - ((f.prototype = He(Ge.prototype)).constructor = f), - ((v.prototype = He(Ge.prototype)).constructor = v), - (ke.prototype.clear = function () { - (this.__data__ = xe ? xe(null) : {}), (this.size = 0); - }), - (ke.prototype.delete = function (e) { - return ( - (e = this.has(e) && delete this.__data__[e]), - (this.size -= e ? 1 : 0), - e - ); - }), - (ke.prototype.get = function (e) { - var t, - i = this.__data__; - return xe ? ((t = i[e]) === Un ? jn : t) : F.call(i, e) ? i[e] : jn; - }), - (ke.prototype.has = function (e) { - var t = this.__data__; - return xe ? t[e] !== jn : F.call(t, e); - }), - (ke.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 - ); - }), - (Ne.prototype.clear = function () { - (this.__data__ = []), (this.size = 0); - }), - (Ne.prototype.delete = function (e) { - var t = this.__data__; - return ( - !((e = qe(t, e)) < 0) && - (e == t.length - 1 ? t.pop() : ae.call(t, e, 1), --this.size, !0) - ); - }), - (Ne.prototype.get = function (e) { - var t = this.__data__; - return (e = qe(t, e)) < 0 ? jn : t[e][1]; - }), - (Ne.prototype.has = function (e) { - return -1 < qe(this.__data__, e); - }), - (Ne.prototype.set = function (e, t) { - var i = this.__data__, - o = qe(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 ke(), - map: new (Ee || Ne)(), - string: new ke(), - }); - }), - (je.prototype.delete = function (e) { - return (e = qi(this, e).delete(e)), (this.size -= e ? 1 : 0), e; - }), - (je.prototype.get = function (e) { - return qi(this, e).get(e); - }), - (je.prototype.has = function (e) { - return qi(this, e).has(e); - }), - (je.prototype.set = function (e, t) { - var i = qi(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); - }), - (H.prototype.clear = function () { - (this.__data__ = new Ne()), (this.size = 0); - }), - (H.prototype.delete = function (e) { - var t = this.__data__, - e = t.delete(e); - return (this.size = t.size), e; - }), - (H.prototype.get = function (e) { - return this.__data__.get(e); - }), - (H.prototype.has = function (e) { - return this.__data__.has(e); - }), - (H.prototype.set = function (e, t) { - var i = this.__data__; - if (i instanceof Ne) { - var o = i.__data__; - if (!Ee || 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 = yi(mt), - at = yi(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) - : As(r, s) - : o || (r[r.length] = s); - } - return r; - } - var ct = vi(), - ht = vi(!0); - function mt(e, t) { - return e && ct(e, t, A); - } - function dt(e, t) { - return e && ht(e, t, A); - } - function pt(t, e) { - return Ps(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 ft(e, t, i) { - t = t(e); - return k(e) ? t : As(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 = F.call(t, ue), - o = t[ue]; - try { - t[ue] = jn; - var r = !0; - } catch (e) {} - var n = X.call(t); - return r && (i ? (t[ue] = o) : delete t[ue]), n; - } - return X.call(e); - } - } - function _t(e, t) { - return t < e; - } - function Ct(e, t) { - return null != e && F.call(e, t); - } - function yt(e, t) { - return null != e && t in g(e); - } - function vt(e, t, i) { - for ( - var o = i ? Ds : 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 = Is(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 ? Js(m, p) : o(u, p, i))) { - for (a = n; --a; ) { - var g = s[a]; - if (!(g ? Js(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 N(e) && i(e) == Xn; - } - function Tt(e, t, i, o, r) { - { - if (e === t) return !0; - if (null == e || null == t || (!N(e) && !N(t))) - return e != e && t != t; - var n = Tt, - a = k(e), - s = k(t), - l = a ? Zn : V(e), - s = s ? Zn : V(t), - u = (l = l == Xn ? aa : l) == aa, - c = (s = s == Xn ? aa : s) == aa, - s; - if ((s = l == s) && vr(e)) { - if (!vr(t)) return !1; - u = !(a = !0); - } - if (s && !u) { - r = r || new H(); - if (a || Lr(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 f = n; - var _ = 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 && f(new te(h), new te(m)) - ? !0 - : !1; - case $n: - 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 C = el; - case ua: - var y = 1 & p; - if (((C = C || ol), h.size != m.size && !y)) return !1; - y = _.get(h); - if (y) return y == m; - (p |= 2), _.set(h, m); - y = zi(C(h), C(m), p, g, f, _); - return _.delete(h), y; - case ha: - if (Be) return Be.call(h) == Be.call(m); - } - return !1; - return; - } - } - if (!(1 & i)) { - (a = u && F.call(e, "__wrapped__")), - (l = c && F.call(t, "__wrapped__")); - if (a || l) - return ( - (u = a ? e.value() : e), - (c = l ? t.value() : t), - (r = r || new H()), - n(u, c, i, o, r) - ); - } - if (s) { - r = r || new H(); - var v = e, - w = t, - b = i, - T = o, - E = n, - S = r, - P = 1 & b, - x = Wi(v), - D = x.length, - a = Wi(w).length; - if (D != a && !P) return !1; - for (var I = D; I--; ) { - var A = x[I]; - if (!(P ? A in w : F.call(w, A))) return !1; - } - (a = S.get(v)), (l = S.get(w)); - if (a && l) return a == w && l == v; - for (var L = !0, M = (S.set(v, w), S.set(w, v), P); ++I < D; ) { - A = x[I]; - var R, - O = v[A], - B = w[A]; - if ( - !((R = T - ? P - ? T(B, O, A, w, v, S) - : T(O, B, A, v, w, S) - : R) === jn - ? O === B || E(O, B, b, T, S) - : R) - ) { - L = !1; - break; - } - M = M || "constructor" == A; - } - return ( - L && - !M && - ((a = v.constructor), - (l = w.constructor), - a != l && - "constructor" in v && - "constructor" in w && - !( - "function" == typeof a && - a instanceof a && - "function" == typeof l && - l instanceof l - ) && - (L = !1)), - S.delete(v), - S.delete(w), - L - ); - } - return !1; - } - } - function Et(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 H(); - if ( - !((h = o ? o(u, c, l, e, t, m) : h) === jn - ? Tt(c, u, 3, o, m) - : h) - ) - return !1; - } - } - return !0; - } - function St(e) { - return ( - !(!P(e) || ((t = e), q && q in t)) && (br(e) ? ee : qa).test(Eo(e)) - ); - var t; - } - function Pt(e) { - return "function" == typeof e - ? e - : null == e - ? M - : "object" == typeof e - ? k(e) - ? Mt(e[0], e[1]) - : Lt(e) - : In(e); - } - function xt(e) { - if (!lo(e)) return ye(e); - var t, - i = []; - for (t in g(e)) F.call(e, t) && "constructor" != t && i.push(t); - return i; - } - function Dt(e) { - if (!P(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 && F.call(e, r))) && a.push(r); - return a; - } - function It(e, t) { - return e < t; - } - function At(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 Lt(t) { - var i = Xi(t); - return 1 == i.length && i[0][2] - ? co(i[0][0], i[0][1]) - : function (e) { - return e === t || Et(e, t, i); - }; - } - function Mt(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, _, C, y) { - g !== f && - ct( - f, - function (e, t) { - var i, o, r, n, a, s, l, u, c, h, m, d, p; - (y = y || new H()), - P(e) - ? ((o = f), - (n = _), - (a = Rt), - (s = C), - (l = y), - (m = po((i = g), (r = t))), - (d = po(o, r)), - (p = l.get(d)) - ? Ke(i, r, p) - : ((p = s ? s(m, d, r + "", i, o, l) : jn), - (o = p === jn) && - ((u = k(d)), - (c = !u && vr(d)), - (h = !u && !c && Lr(d)), - (p = d), - u || c || h - ? (p = k(m) - ? m - : S(m) - ? E(m) - : c - ? ci(d, !(o = !1)) - : h - ? mi(d, !(o = !1)) - : []) - : xr(d) || Cr(d) - ? Cr((p = m)) - ? (p = Hr(m)) - : (P(m) && !br(m)) || (p = io(d)) - : (o = !1)), - o && (l.set(d, p), a(p, d, n, s, l), l.delete(d)), - Ke(i, r, p))) - : ((u = C ? C(po(g, t), e, t + "", g, f, y) : jn), - Ke(g, t, (u = u === jn ? e : u))); - }, - L - ); - } - function Ot(e, t) { - var i = e.length; - if (i) return ro((t += t < 0 ? i : 0), i) ? e[t] : jn; - } - function Bt(e, o, c) { - o = o.length - ? Is(o, function (t) { - return k(t) - ? function (e) { - return gt(e, 1 === t.length ? t[0] : t); - } - : t; - }) - : [M]; - var r = -1; - o = Is(o, Ws(h())); - var t = At(e, function (t, e, i) { - return { - criteria: Is(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 Ft(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 Ht(e, t, i, o) { - var r = o ? Hs : Fs, - n = -1, - a = t.length, - s = e; - for (e === t && (t = E(t)), i && (s = Is(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 Vt(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) : Zt(e, n)); - } - } - function Gt(e, t) { - return e + ge(be() * (t - e + 1)); - } - function kt(e, t) { - var i = ""; - if (!e || t < 1 || Jn < t) return i; - for (; t % 2 && (i += e), (t = ge(t / 2)) && (e += e), t; ); - return i; - } - function a(e, t) { - return _o(ho(e, t, M), e + ""); - } - function Nt(e) { - return We(rn(e)); - } - function jt(e, t) { - e = rn(e); - return vo(e, tt(t, 0, e.length)); - } - function zt(e, t, i, o) { - if (!P(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 = P(l) ? l : ro(t[r + 1]) ? [] : {})), - Qe(s, u, c), - (s = s[u]); - } - return e; - } - var Ut = De - ? function (e, t) { - return De.set(e, t), e; - } - : M, - t = ce - ? function (e, t) { - return ce(e, "toString", { - configurable: !0, - enumerable: !1, - value: Cn(t), - writable: !0, - }); - } - : M; - function Wt(e) { - return vo(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 Jt(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 Kt(e, t, M, i); - } - function Kt(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 Qt(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 qt(e) { - return "number" == typeof e ? e : x(e) ? Kn : +e; - } - function u(e) { - if ("string" == typeof e) return e; - if (k(e)) return Is(e, u) + ""; - if (x(e)) return Fe ? Fe.call(e) : ""; - var t = e + ""; - return "0" == t && 1 / e == -1 / 0 ? "-0" : t; - } - function Xt(e, t, i) { - var o = -1, - r = xs, - n = e.length, - a = !0, - s = [], - l = s; - if (i) (a = !1), (r = Ds); - else if (200 <= n) { - var u = t ? null : Hi(e); - if (u) return ol(u); - (a = !1), (r = Js), (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 Zt(e, t) { - return null == (e = mo(e, (t = ai(t, e)))) || delete e[To(o(t))]; - } - function $t(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 Ls( - t, - function (e, t) { - return t.func.apply(t.thisArg, As([e], t.args)); - }, - (i = e instanceof v ? e.value() : i) - ); - } - function ii(e, t, i) { - var o = e.length; - if (o < 2) return o ? Xt(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 Xt(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 S(e) ? e : []; - } - function ni(e) { - return "function" == typeof e ? e : M; - } - function ai(e, t) { - return k(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 = y(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 = y(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 E(e, t) { - var i = -1, - o = e.length; - for (t = t || b(o); ++i < o; ) t[i] = e[i]; - return t; - } - function fi(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 ? $e : Qe)(i, s, (l = l === jn ? e[s] : l)); - } - return i; - } - function _i(r, n) { - return function (e, t) { - var i = k(e) ? bs : Xe, - o = n ? n() : {}; - return i(e, r, h(t, 2), o); - }; - } - function Ci(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 yi(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 vi(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 = $s((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 Ls(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 = He(o.prototype), - i = o.apply(t, e); - return P(i) ? i : t; - }; - } - function Ei(n, a, s) { - var l = Ti(n); - return function e() { - for (var t = arguments.length, i = b(t), o = t, r = Qi(e); o--; ) - i[o] = arguments[o]; - r = t < 3 && i[0] !== r && i[t - 1] !== r ? [] : il(i, r); - return (t -= r.length) < s - ? Bi(n, a, xi, e.placeholder, jn, i, r, jn, jn, s - t) - : ws(this && this !== ms && this instanceof e ? l : n, this, i); - }; - } - function Si(n) { - return function (e, t, i) { - var o, - r = g(e), - t = - (c(e) || - ((o = h(t, 3)), - (e = A(e)), - (t = function (e) { - return o(r[e], e, r); - })), - n(e, t, i)); - return -1 < t ? r[o ? e[t] : t] : jn; - }; - } - function Pi(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 C(zn); - t && !s && "wrapper" == Ki(i) && (s = new f([], !0)); - } - for (e = s ? e : n; ++e < n; ) - var o = Ki((i = r[e])), - a = "wrapper" == o ? Ji(i) : jn, - s = - a && ao(a[0]) && 424 == a[1] && !a[4].length && 1 == a[9] - ? s[Ki(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 && k(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 f = s & Yn, - _ = 1 & s, - C = 2 & s, - y = 24 & s, - v = 512 & s, - w = C ? jn : Ti(a); - return function e() { - for (var t = b((n = arguments.length)), i = n; i--; ) - t[i] = arguments[i]; - if ( - (y && - (r = (function (e, t) { - for (var i = e.length, o = 0; i--; ) e[i] === t && ++o; - return o; - })(t, (o = Qi(e)))), - u && (t = pi(t, u, c, y)), - h && (t = gi(t, h, m, y)), - (n -= r), - y && n < g) - ) - return ( - (r = il(t, o)), Bi(a, s, xi, e.placeholder, l, t, r, d, p, g - n) - ); - var o = _ ? l : this, - r = C ? o[a] : a, - n = t.length; - return ( - d - ? (t = (function (e, t) { - for (var i = e.length, o = T(t.length, i), r = E(e); o--; ) { - var n = t[o]; - e[o] = ro(n, i) ? r[n] : jn; - } - return e; - })(t, d)) - : v && 1 < n && t.reverse(), - f && p < n && (t.length = p), - (r = - this && this !== ms && this instanceof e ? w || Ti(r) : r).apply( - o, - t - ) - ); - }; - } - function Di(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 Ii(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 = qt(e)), qt(t))), - (i = o(e, t)); - } - return i; - }; - } - function Ai(o) { - return Ui(function (e) { - return ( - (e = Is(e, Ws(h()))), - a(function (t) { - var i = this; - return o(e, function (e) { - return ws(e, i, t); - }); - }) - ); - }); - } - function Li(e, t) { - var i = (t = t === jn ? " " : u(t)).length; - if (i < 2) return i ? kt(t, e) : t; - i = kt(t, pe(e / rl(t))); - return $s(t) ? li(nl(i), 0, e).join("") : i.slice(0, e); - } - function Mi(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 = Br(e)), - t === jn ? ((t = e), (e = 0)) : (t = Br(t)), - (i = i === jn ? (e < t ? 1 : -1) : Br(i)); - for ( - var o = e, - r = i, - n = u, - a = -1, - s = y(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 = I(e)), (t = I(t))), - i(e, t) - ); - }; - } - function Bi(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), Co(n, e, t); - } - function Fi(e) { - var o = B[e]; - return function (e, t) { - var i; - return ( - (e = I(e)), - (t = null == t ? 0 : T(D(t), 292)) && _e(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 Hi = - Pe && 1 / ol(new Pe([, -0]))[1] == 1 / 0 - ? function (e) { - return new Pe(e); - } - : Sn; - function Vi(n) { - return function (e) { - var t, - i, - o, - r = V(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) - : Is(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 C(zn); - var u, - c, - h, - m, - d, - p = o ? o.length : 0, - g = - (p || ((t &= -97), (o = r = jn)), - (a = a === jn ? a : y(D(a), 0)), - (s = s === jn ? s : D(s)), - (p -= r ? r.length : 0), - 64 & t && ((f = o), (u = r), (o = r = jn)), - l ? jn : Ji(e)), - f = [e, t, i, o, r, f, 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); - })(f, g), - (e = f[0]), - (t = f[1]), - (i = f[2]), - (o = f[3]), - (r = f[4]), - !(s = f[9] = f[9] === jn ? (l ? 0 : e.length) : y(f[9] - p, 0)) && - 24 & t && - (t &= -25), - (u = - t && 1 != t - ? 8 == t || 16 == t - ? Ei(e, t, s) - : (32 != t && 33 != t) || r.length - ? xi.apply(jn, f) - : Mi(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); - })), - Co((g ? Ut : go)(u, f), e, t) - ); - } - function ki(e, t, i, o) { - return e === jn || (G(e, Y[i]) && !F.call(o, i)) ? t : e; - } - function Ni(e, t, i, o, r, n) { - return ( - P(e) && P(t) && (n.set(t, e), Rt(e, t, jn, Ni, 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 !Js(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 _o(ho(e, jn, Do), e + ""); - } - function Wi(e) { - return ft(e, A, $i); - } - function Yi(e) { - return ft(e, L, eo); - } - var Ji = De - ? function (e) { - return De.get(e); - } - : Sn; - function Ki(e) { - for ( - var t = e.name + "", i = Ie[t], o = F.call(Ie, t) ? i.length : 0; - o--; - - ) { - var r = i[o], - n = r.func; - if (null == n || n == e) return r.name; - } - return t; - } - function Qi(e) { - return (F.call(p, "placeholder") ? p : e).placeholder; - } - function h() { - var e = (e = p.iteratee || wn) === wn ? Pt : e; - return arguments.length ? e(arguments[0], arguments[1]) : e; - } - function qi(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 Xi(e) { - for (var t = A(e), i = t.length; i--; ) { - var o = t[i], - r = e[o]; - t[i] = [o, r, uo(r)]; - } - return t; - } - function Zi(e, t) { - t = t; - e = null == (e = e) ? jn : e[t]; - return St(e) ? e : jn; - } - var $i = fe - ? function (t) { - return null == t - ? [] - : ((t = g(t)), - Ps(fe(t), function (e) { - return ne.call(t, e); - })); - } - : Mn, - eo = fe - ? function (e) { - for (var t = []; e; ) As(t, $i(e)), (e = oe(e)); - return t; - } - : Mn, - V = 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) && - Er(r) && - ro(a, r) && - (k(e) || Cr(e)); - } - function io(e) { - return "function" != typeof e.constructor || lo(e) ? {} : He(oe(e)); - } - function oo(e) { - return k(e) || Cr(e) || !!(se && e && e[se]); - } - function ro(e, t) { - var i = typeof e; - return ( - !!(t = null == t ? Jn : t) && - ("number" == i || ("symbol" != i && Za.test(e))) && - -1 < e && - e % 1 == 0 && - e < t - ); - } - function m(e, t, i) { - var o; - if (P(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 (!k(e)) - return ( - (i = typeof e), - "number" == i || - "symbol" == i || - "boolean" == i || - null == e || - x(e) || - Ba.test(e) || - !Oa.test(e) || - (null != t && e in g(t)) - ); - } - function ao(e) { - var t = Ki(e), - i = p[t]; - if ("function" == typeof i && t in v.prototype) { - if (e === i) return 1; - t = Ji(i); - return t && e === t[0]; - } - } - ((n && V(new n(new ArrayBuffer(1))) != pa) || - (Ee && V(new Ee()) != ra) || - (Se && V(Se.resolve()) != sa) || - (Pe && V(new Pe()) != ua) || - (e && V(new e()) != ma)) && - (V = function (e) { - var t = i(e), - e = t == aa ? e.constructor : jn, - e = e ? Eo(e) : ""; - if (e) - switch (e) { - case Ae: - return pa; - case Le: - return ra; - case Me: - return sa; - case Re: - return ua; - case Oe: - return ma; - } - return t; - }); - var so = J ? br : Rn; - function lo(e) { - var t = e && e.constructor; - return e === (("function" == typeof t && t.prototype) || Y); - } - function uo(e) { - return e == e && !P(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 = y(a === jn ? n.length - 1 : a, 0)), - function () { - for ( - var e = arguments, t = -1, i = y(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 = yo(Ut), - fo = - de || - function (e, t) { - return ms.setTimeout(e, t); - }, - _o = yo(t); - function Co(e, t, i) { - var o, - r, - t = t + ""; - return _o( - 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(ka, "{\n/* [wrapped with " + t + "] */\n") - ); - })( - t, - ((o = (e = (e = t).match(Na)) ? e[1].split(ja) : []), - (r = i), - Ts(qn, function (e) { - var t = "_." + e[0]; - r & e[1] && !xs(o, t) && o.push(t); - }), - o.sort()) - ) - ); - } - function yo(i) { - var o = 0, - r = 0; - return function () { - var e = ve(), - t = 16 - (e - r); - if (((r = e), 0 < t)) { - if (800 <= ++o) return arguments[0]; - } else o = 0; - return i.apply(jn, arguments); - }; - } - function vo(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(Fa, 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 Eo(e) { - if (null != e) { - try { - return K.call(e); - } catch (e) {} - try { - return e + ""; - } catch (e) {} - } - return ""; - } - function So(e) { - if (e instanceof v) return e.clone(); - var t = new f(e.__wrapped__, e.__chain__); - return ( - (t.__actions__ = E(e.__actions__)), - (t.__index__ = e.__index__), - (t.__values__ = e.__values__), - t - ); - } - (n = a(function (e, t) { - return S(e) ? rt(e, l(t, 1, S, !0)) : []; - })), - (Se = a(function (e, t) { - var i = o(t); - return S(i) && (i = jn), S(e) ? rt(e, l(t, 1, S, !0), h(i, 2)) : []; - })), - (e = a(function (e, t) { - var i = o(t); - return S(i) && (i = jn), S(e) ? rt(e, l(t, 1, S, !0), jn, i) : []; - })); - function Po(e, t, i) { - var o = null == e ? 0 : e.length; - if (!o) return -1; - i = null == i ? 0 : D(i); - return i < 0 && (i = y(o + i, 0)), Bs(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 = D(i)), (r = i < 0 ? y(o + r, 0) : T(r, o - 1))), - Bs(e, h(t, 3), r, !0) - ); - } - function Do(e) { - return (null == e ? 0 : e.length) ? l(e, 1) : []; - } - function Io(e) { - return e && e.length ? e[0] : jn; - } - (J = a(function (e) { - var t = Is(e, ri); - return t.length && t[0] === e[0] ? vt(t) : []; - })), - (de = a(function (e) { - var t = o(e), - i = Is(e, ri); - return ( - t === o(i) ? (t = jn) : i.pop(), - i.length && i[0] === e[0] ? vt(i, h(t, 2)) : [] - ); - })), - (t = a(function (e) { - var t = o(e), - i = Is(e, ri); - return ( - (t = "function" == typeof t ? t : jn) && i.pop(), - i.length && i[0] === e[0] ? vt(i, jn, t) : [] - ); - })); - function o(e) { - var t = null == e ? 0 : e.length; - return t ? e[t - 1] : jn; - } - he = a(Ao); - function Ao(e, t) { - return e && e.length && t && t.length ? Ht(e, t) : e; - } - var Lo = Ui(function (e, t) { - var i = null == e ? 0 : e.length, - o = et(e, t); - return ( - Vt( - e, - Is(t, function (e) { - return ro(e, i) ? +e : e; - }).sort(di) - ), - o - ); - }); - function Mo(e) { - return null == e ? e : Te.call(e); - } - var Ro = a(function (e) { - return Xt(l(e, 1, S, !0)); - }), - Oo = a(function (e) { - var t = o(e); - return S(t) && (t = jn), Xt(l(e, 1, S, !0), h(t, 2)); - }), - Bo = a(function (e) { - var t = "function" == typeof (t = o(e)) ? t : jn; - return Xt(l(e, 1, S, !0), jn, t); - }); - function Fo(t) { - if (!t || !t.length) return []; - var i = 0; - return ( - (t = Ps(t, function (e) { - return S(e) && ((i = y(e.length, i)), 1); - })), - zs(i, function (e) { - return Is(t, ks(e)); - }) - ); - } - function Ho(e, t) { - if (!e || !e.length) return []; - e = Fo(e); - return null == t - ? e - : Is(e, function (e) { - return ws(t, jn, e); - }); - } - var Vo = a(function (e, t) { - return S(e) ? rt(e, t) : []; - }), - Go = a(function (e) { - return ii(Ps(e, S)); - }), - ko = a(function (e) { - var t = o(e); - return S(t) && (t = jn), ii(Ps(e, S), h(t, 2)); - }), - No = a(function (e) { - var t = "function" == typeof (t = o(e)) ? t : jn; - return ii(Ps(e, S), jn, t); - }), - jo = a(Fo); - var zo = a(function (e) { - var t = e.length, - t = - "function" == typeof (t = 1 < t ? e[t - 1] : jn) - ? (e.pop(), t) - : jn; - return Ho(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 v && 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 Jo = _i(function (e, t, i) { - F.call(e, i) ? ++e[i] : $e(e, i, 1); - }); - var Ko = Si(Po), - Qo = Si(xo); - function qo(e, t) { - return (k(e) ? Ts : nt)(e, h(t, 3)); - } - function Xo(e, t) { - return (k(e) ? Es : at)(e, h(t, 3)); - } - var Zo = _i(function (e, t, i) { - F.call(e, i) ? e[i].push(t) : $e(e, i, [t]); - }); - var $o = 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 = _i(function (e, t, i) { - $e(e, i, t); - }); - function tr(e, t) { - return (k(e) ? Is : At)(e, h(t, 3)); - } - var ir = _i( - 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]]), - Bt(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 C(zn); - return ( - (e = D(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, Qi(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, Qi(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 C(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 f(t); - l = fo(g, ((e = i - ((t = t) - u)), m ? T(e, a - (t - c)) : e)); - } - function f(e) { - return (l = jn), t && r ? d(e) : ((r = n = jn), s); - } - function _() { - var e = rr(), - t = p(e); - if (((r = arguments), (n = this), (u = e), t)) { - if (l === jn) return (c = e = u), (l = fo(g, i)), h ? d(e) : s; - if (m) return ui(l), (l = fo(g, i)), d(u); - } - return l === jn && (l = fo(g, i)), s; - } - return ( - (i = I(i) || 0), - P(e) && - ((h = !!e.leading), - (m = "maxWait" in e), - (a = m ? y(I(e.maxWait) || 0, i) : a), - (t = "trailing" in e ? !!e.trailing : t)), - (_.cancel = function () { - l !== jn && ui(l), (c = 0), (r = u = n = l = jn); - }), - (_.flush = function () { - return l === jn ? s : f(rr()); - }), - _ - ); - } - var me = a(function (e, t) { - return ot(e, 1, t); - }), - cr = a(function (e, t, i) { - return ot(e, I(t) || 0, i); - }); - function hr(o, r) { - if ("function" != typeof o || (null != r && "function" != typeof r)) - throw new C(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 C(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 && k(r[0]) ? Is(r[0], Ws(h())) : Is(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, Qi(dr)); - return Gi(e, 32, jn, t, i); - }), - pr = a(function (e, t) { - var i = il(t, Qi(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 fr = Oi(_t), - _r = Oi(function (e, t) { - return t <= e; - }), - Cr = bt( - (function () { - return arguments; - })() - ) - ? bt - : function (e) { - return N(e) && F.call(e, "callee") && !ne.call(e, "callee"); - }, - k = b.isArray, - yr = gs - ? Ws(gs) - : function (e) { - return N(e) && i(e) == da; - }; - function c(e) { - return null != e && Er(e.length) && !br(e); - } - function S(e) { - return N(e) && c(e); - } - var vr = W || Rn, - W = fs - ? Ws(fs) - : function (e) { - return N(e) && i(e) == ea; - }; - function wr(e) { - if (!N(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 (!P(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 == D(e); - } - function Er(e) { - return "number" == typeof e && -1 < e && e % 1 == 0 && e <= Jn; - } - function P(e) { - var t = typeof e; - return null != e && ("object" == t || "function" == t); - } - function N(e) { - return null != e && "object" == typeof e; - } - var Sr = _s - ? Ws(_s) - : function (e) { - return N(e) && V(e) == ra; - }; - function Pr(e) { - return "number" == typeof e || (N(e) && i(e) == na); - } - function xr(e) { - if (!N(e) || i(e) != aa) return !1; - e = oe(e); - if (null === e) return !0; - e = F.call(e, "constructor") && e.constructor; - return "function" == typeof e && e instanceof e && K.call(e) == Z; - } - var Dr = Cs - ? Ws(Cs) - : function (e) { - return N(e) && i(e) == la; - }; - var Ir = ys - ? Ws(ys) - : function (e) { - return N(e) && V(e) == ua; - }; - function Ar(e) { - return "string" == typeof e || (!k(e) && N(e) && i(e) == ca); - } - function x(e) { - return "symbol" == typeof e || (N(e) && i(e) == ha); - } - var Lr = vs - ? Ws(vs) - : function (e) { - return N(e) && Er(e.length) && !!ls[i(e)]; - }; - var Mr = Oi(It), - Rr = Oi(function (e, t) { - return e <= t; - }); - function Or(e) { - if (!e) return []; - if (c(e)) return (Ar(e) ? nl : E)(e); - if (le && e[le]) { - for (var t, i = e[le](), o = []; !(t = i.next()).done; ) - o.push(t.value); - return o; - } - var r = V(e); - return (r == ra ? el : r == ua ? ol : rn)(e); - } - function Br(e) { - return e - ? (e = I(e)) === 1 / 0 || e === -1 / 0 - ? 17976931348623157e292 * (e < 0 ? -1 : 1) - : e == e - ? e - : 0 - : 0 === e - ? e - : 0; - } - function D(e) { - var e = Br(e), - t = e % 1; - return e == e ? (t ? e - t : e) : 0; - } - function Fr(e) { - return e ? tt(D(e), 0, Qn) : 0; - } - function I(e) { - if ("number" == typeof e) return e; - if (x(e)) return Kn; - if ( - "string" != - typeof (e = P(e) - ? P((t = "function" == typeof e.valueOf ? e.valueOf() : e)) - ? t + "" - : t - : e) - ) - return 0 === e ? e : +e; - e = Us(e); - var t = Qa.test(e); - return t || Xa.test(e) - ? hs(e.slice(2), t ? 2 : 8) - : Ka.test(e) - ? Kn - : +e; - } - function Hr(e) { - return fi(e, L(e)); - } - function d(e) { - return null == e ? "" : u(e); - } - var Vr = Ci(function (e, t) { - if (lo(t) || c(t)) fi(t, A(t), e); - else for (var i in t) F.call(t, i) && Qe(e, i, t[i]); - }), - Gr = Ci(function (e, t) { - fi(t, L(t), e); - }), - kr = Ci(function (e, t, i, o) { - fi(t, L(t), e, o); - }), - Nr = Ci(function (e, t, i, o) { - fi(t, A(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 = L(n), s = -1, l = a.length; ++s < l; ) { - var u = a[s], - c = e[u]; - (c === jn || (G(c, Y[u]) && !F.call(e, u))) && (e[u] = n[u]); - } - return e; - }), - Ur = a(function (e) { - return e.push(jn, Ni), ws(Xr, 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, yt); - } - var Jr = Di(function (e, t, i) { - e[ - (t = null != t && "function" != typeof t.toString ? X.call(t) : t) - ] = i; - }, Cn(M)), - Kr = Di(function (e, t, i) { - null != t && "function" != typeof t.toString && (t = X.call(t)), - F.call(e, t) ? e[t].push(i) : (e[t] = [i]); - }, h), - Qr = a(wt); - function A(e) { - return (c(e) ? Ue : xt)(e); - } - function L(e) { - return c(e) ? Ue(e, !0) : Dt(e); - } - var qr = Ci(function (e, t, i) { - Rt(e, t, i); - }), - Xr = Ci(function (e, t, i, o) { - Rt(e, t, i, o); - }), - Zr = Ui(function (t, e) { - var i = {}; - if (null == t) return i; - for ( - var o = !1, - r = - ((e = Is(e, function (e) { - return (e = ai(e, t)), (o = o || 1 < e.length), e; - })), - fi(t, Yi(t), i), - o && (i = w(i, 7, ji)), - e.length); - r--; - - ) - Zt(i, e[r]); - return i; - }); - var $r = Ui(function (e, t) { - return null == e - ? {} - : Ft((i = e), t, function (e, t) { - return Yr(i, t); - }); - var i; - }); - function en(e, i) { - if (null == e) return {}; - var t = Is(Yi(e), function (e) { - return [e]; - }); - return ( - (i = h(i)), - Ft(e, t, function (e, t) { - return i(e, t[0]); - }) - ); - } - var tn = Vi(A), - on = Vi(L); - function rn(e) { - return null == e ? [] : Ys(e, A(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($a, qs).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 fn = a(function (e, t) { - try { - return ws(e, jn, t); - } catch (e) { - return wr(e) ? e : new R(e); - } - }), - _n = Ui(function (t, e) { - return ( - Ts(e, function (e) { - (e = To(e)), $e(t, e, sr(t[e], t)); - }), - t - ); - }); - function Cn(e) { - return function () { - return e; - }; - } - var yn = Pi(), - vn = Pi(!0); - function M(e) { - return e; - } - function wn(e) { - return Pt("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 En(o, t, e) { - var i = A(t), - r = pt(t, i), - n = - (null != e || - (P(t) && (r.length || !i.length)) || - ((e = t), (t = o), (o = this), (r = pt(t, A(t)))), - !(P(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__ = E( - this.__actions__ - )).push({ func: i, args: arguments, thisArg: o }), - (e.__chain__ = t), - e) - : i.apply(o, As([this.value()], arguments)); - }); - }), - o - ); - } - function Sn() {} - var Pn = Ai(Is), - xn = Ai(Ss), - Dn = Ai(Rs); - function In(e) { - return no(e) - ? ks(To(e)) - : ((t = e), - function (e) { - return gt(e, t); - }); - var t; - } - var An = Ri(), - Ln = Ri(!0); - function Mn() { - return []; - } - function Rn() { - return !1; - } - var On = Ii(function (e, t) { - return e + t; - }, 0), - Bn = Fi("ceil"), - Fn = Ii(function (e, t) { - return e / t; - }, 1), - Hn = Fi("floor"); - var Vn, - Gn = Ii(function (e, t) { - return e * t; - }, 1), - kn = Fi("round"), - Nn = Ii(function (e, t) { - return e - t; - }, 0); - return ( - (p.after = function (e, t) { - if ("function" != typeof t) throw new C(zn); - return ( - (e = D(e)), - function () { - if (--e < 1) return t.apply(this, arguments); - } - ); - }), - (p.ary = nr), - (p.assign = Vr), - (p.assignIn = Gr), - (p.assignInWith = kr), - (p.assignWith = Nr), - (p.at = jr), - (p.before = ar), - (p.bind = sr), - (p.bindAll = _n), - (p.bindKey = lr), - (p.castArray = function () { - if (!arguments.length) return []; - var e = arguments[0]; - return k(e) ? e : [e]; - }), - (p.chain = Uo), - (p.chunk = function (e, t, i) { - t = (i ? m(e, t, i) : t === jn) ? 1 : y(D(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 As(k(i) ? E(i) : [i], l(t, 1)); - }), - (p.cond = function (o) { - var r = null == o ? 0 : o.length, - t = h(); - return ( - (o = r - ? Is(o, function (e) { - if ("function" != typeof e[1]) throw new C(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 = A(t)), - function (e) { - return it(e, t, i); - } - ); - var t, i; - }), - (p.constant = Cn), - (p.countBy = Jo), - (p.create = function (e, t) { - return (e = He(e)), null == t ? e : Ze(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 = Se), - (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 : D(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 : D(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 = D(a)) < 0 && (a = l < -a ? 0 : l + a), - (s = s === jn || l < s ? l : D(s)) < 0 && (s += l), - s = s < a ? 0 : Fr(s); - a < s; - - ) - r[a++] = n; - return r; - }), - (p.filter = function (e, t) { - return (k(e) ? Ps : 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 : D(i)), l(tr(e, t), i); - }), - (p.flatten = Do), - (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 : D(t))) - : []; - }), - (p.flip = function (e) { - return Gi(e, 512); - }), - (p.flow = yn), - (p.flowRight = vn), - (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, A(e)); - }), - (p.functionsIn = function (e) { - return null == e ? [] : pt(e, L(e)); - }), - (p.groupBy = Zo), - (p.initial = function (e) { - return (null == e ? 0 : e.length) ? s(e, 0, -1) : []; - }), - (p.intersection = J), - (p.intersectionBy = de), - (p.intersectionWith = t), - (p.invert = Jr), - (p.invertBy = Kr), - (p.invokeMap = $o), - (p.iteratee = wn), - (p.keyBy = er), - (p.keys = A), - (p.keysIn = L), - (p.map = tr), - (p.mapKeys = function (e, o) { - var r = {}; - return ( - (o = h(o, 3)), - mt(e, function (e, t, i) { - $e(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) { - $e(r, t, o(e, t, i)); - }), - r - ); - }), - (p.matches = function (e) { - return Lt(w(e, 1)); - }), - (p.matchesProperty = function (e, t) { - return Mt(e, w(t, 1)); - }), - (p.memoize = hr), - (p.merge = qr), - (p.mergeWith = Xr), - (p.method = bn), - (p.methodOf = Tn), - (p.mixin = En), - (p.negate = mr), - (p.nthArg = function (t) { - return ( - (t = D(t)), - a(function (e) { - return Ot(e, t); - }) - ); - }), - (p.omit = Zr), - (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 - ? [] - : Bt( - e, - (t = k(t) ? t : null == t ? [] : [t]), - (i = k((i = o ? jn : i)) ? i : null == i ? [] : [i]) - ); - }), - (p.over = Pn), - (p.overArgs = si), - (p.overEvery = xn), - (p.overSome = Dn), - (p.partial = dr), - (p.partialRight = pr), - (p.partition = ir), - (p.pick = $r), - (p.pickBy = en), - (p.property = In), - (p.propertyOf = function (t) { - return function (e) { - return null == t ? jn : gt(t, e); - }; - }), - (p.pull = he), - (p.pullAll = Ao), - (p.pullAllBy = function (e, t, i) { - return e && e.length && t && t.length ? Ht(e, t, h(i, 2)) : e; - }), - (p.pullAllWith = function (e, t, i) { - return e && e.length && t && t.length ? Ht(e, t, jn, i) : e; - }), - (p.pullAt = Lo), - (p.range = An), - (p.rangeRight = Ln), - (p.rearg = gr), - (p.reject = function (e, t) { - return (k(e) ? Ps : 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 Vt(e, r), i; - }), - (p.rest = function (e, t) { - if ("function" != typeof e) throw new C(zn); - return a(e, (t = t === jn ? t : D(t))); - }), - (p.reverse = Mo), - (p.sampleSize = function (e, t, i) { - return ( - (t = (i ? m(e, t, i) : t === jn) ? 1 : D(t)), (k(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 (k(e) ? Je : 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 : D(t)), i === jn ? o : D(i))), - s(e, t, i)) - : []; - }), - (p.sortBy = or), - (p.sortedUniq = function (e) { - return e && e.length ? Qt(e) : []; - }), - (p.sortedUniqBy = function (e, t) { - return e && e.length ? Qt(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 ? Qn : i >>> 0) - ? (e = d(e)) && - ("string" == typeof t || (null != t && !Dr(t))) && - !(t = u(t)) && - $s(e) - ? li(nl(e), 0, i) - : e.split(t, i) - : [] - ); - }), - (p.spread = function (i, o) { - if ("function" != typeof i) throw new C(zn); - return ( - (o = null == o ? 0 : y(D(o), 0)), - a(function (e) { - var t = e[o], - e = li(e, 0, o); - return t && As(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 : D(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 : D(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 C(zn); - return ( - P(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 k(e) ? Is(e, To) : x(e) ? [e] : E(bo(d(e))); - }), - (p.toPlainObject = Hr), - (p.transform = function (e, o, r) { - var t, - i = k(e), - n = i || vr(e) || Lr(e); - return ( - (o = h(o, 4)), - null == r && - ((t = e && e.constructor), - (r = n ? (i ? new t() : []) : P(e) && br(t) ? He(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 = Bo), - (p.uniq = function (e) { - return e && e.length ? Xt(e) : []; - }), - (p.uniqBy = function (e, t) { - return e && e.length ? Xt(e, h(t, 2)) : []; - }), - (p.uniqWith = function (e, t) { - return ( - (t = "function" == typeof t ? t : jn), - e && e.length ? Xt(e, jn, t) : [] - ); - }), - (p.unset = function (e, t) { - return null == e || Zt(e, t); - }), - (p.unzip = Fo), - (p.unzipWith = Ho), - (p.update = function (e, t, i) { - return null == e ? e : $t(e, t, ni(i)); - }), - (p.updateWith = function (e, t, i, o) { - return ( - (o = "function" == typeof o ? o : jn), - null == e ? e : $t(e, t, ni(i), o) - ); - }), - (p.values = rn), - (p.valuesIn = function (e) { - return null == e ? [] : Ys(e, L(e)); - }), - (p.without = Vo), - (p.words = gn), - (p.wrap = function (e, t) { - return dr(ni(t), e); - }), - (p.xor = Go), - (p.xorBy = ko), - (p.xorWith = No), - (p.zip = jo), - (p.zipObject = function (e, t) { - return oi(e || [], t || [], Qe); - }), - (p.zipObjectDeep = function (e, t) { - return oi(e || [], t || [], zt); - }), - (p.zipWith = zo), - (p.entries = tn), - (p.entriesIn = on), - (p.extend = Gr), - (p.extendWith = kr), - En(p, p), - (p.add = On), - (p.attempt = fn), - (p.camelCase = nn), - (p.capitalize = an), - (p.ceil = Bn), - (p.clamp = function (e, t, i) { - return ( - i === jn && ((i = t), (t = jn)), - i !== jn && (i = (i = I(i)) == i ? i : 0), - t !== jn && (t = (t = I(t)) == t ? t : 0), - tt(I(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, A(t)); - }), - (p.deburr = sn), - (p.defaultTo = function (e, t) { - return null == e || e != e ? t : e; - }), - (p.divide = Fn), - (p.endsWith = function (e, t, i) { - (e = d(e)), (t = u(t)); - var o = e.length, - o = (i = i === jn ? o : tt(D(i), 0, o)); - return 0 <= (i -= t.length) && e.slice(i, o) == t; - }), - (p.eq = G), - (p.escape = function (e) { - return (e = d(e)) && Aa.test(e) ? e.replace(Da, Xs) : e; - }), - (p.escapeRegExp = function (e) { - return (e = d(e)) && Va.test(e) ? e.replace(Ha, "\\$&") : e; - }), - (p.every = function (e, t, i) { - return (k(e) ? Ss : st)(e, h((t = i && m(e, t, i) ? jn : t), 3)); - }), - (p.find = Ko), - (p.findIndex = Po), - (p.findKey = function (e, t) { - return Os(e, h(t, 3), mt); - }), - (p.findLast = Qo), - (p.findLastIndex = xo), - (p.findLastKey = function (e, t) { - return Os(e, h(t, 3), dt); - }), - (p.floor = Hn), - (p.forEach = qo), - (p.forEachRight = Xo), - (p.forIn = function (e, t) { - return null == e ? e : ct(e, h(t, 3), L); - }), - (p.forInRight = function (e, t) { - return null == e ? e : ht(e, h(t, 3), L); - }), - (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 = fr), - (p.gte = _r), - (p.has = function (e, t) { - return null != e && to(e, t, Ct); - }), - (p.hasIn = Yr), - (p.head = Io), - (p.identity = M), - (p.includes = function (e, t, i, o) { - return ( - (e = c(e) ? e : rn(e)), - (i = i && !o ? D(i) : 0), - (o = e.length), - i < 0 && (i = y(o + i, 0)), - Ar(e) ? i <= o && -1 < e.indexOf(t, i) : !!o && -1 < Fs(e, t, i) - ); - }), - (p.indexOf = function (e, t, i) { - var o = null == e ? 0 : e.length; - return o - ? ((i = null == i ? 0 : D(i)), - Fs(e, t, (i = i < 0 ? y(o + i, 0) : i))) - : -1; - }), - (p.inRange = function (e, t, i) { - return ( - (t = Br(t)), - i === jn ? ((i = t), (t = 0)) : (i = Br(i)), - (e = e = I(e)) >= T((t = t), (i = i)) && e < y(t, i) - ); - }), - (p.invoke = Qr), - (p.isArguments = Cr), - (p.isArray = k), - (p.isArrayBuffer = yr), - (p.isArrayLike = c), - (p.isArrayLikeObject = S), - (p.isBoolean = function (e) { - return !0 === e || !1 === e || (N(e) && i(e) == $n); - }), - (p.isBuffer = vr), - (p.isDate = W), - (p.isElement = function (e) { - return N(e) && 1 === e.nodeType && !xr(e); - }), - (p.isEmpty = function (e) { - if (null == e) return !0; - if ( - c(e) && - (k(e) || - "string" == typeof e || - "function" == typeof e.splice || - vr(e) || - Lr(e) || - Cr(e)) - ) - return !e.length; - var t, - i = V(e); - if (i == ra || i == ua) return !e.size; - if (lo(e)) return !xt(e).length; - for (t in e) if (F.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 && _e(e); - }), - (p.isFunction = br), - (p.isInteger = Tr), - (p.isLength = Er), - (p.isMap = Sr), - (p.isMatch = function (e, t) { - return e === t || Et(e, t, Xi(t)); - }), - (p.isMatchWith = function (e, t, i) { - return (i = "function" == typeof i ? i : jn), Et(e, t, Xi(t), i); - }), - (p.isNaN = function (e) { - return Pr(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 St(e); - }), - (p.isNil = function (e) { - return null == e; - }), - (p.isNull = function (e) { - return null === e; - }), - (p.isNumber = Pr), - (p.isObject = P), - (p.isObjectLike = N), - (p.isPlainObject = xr), - (p.isRegExp = Dr), - (p.isSafeInteger = function (e) { - return Tr(e) && -Jn <= e && e <= Jn; - }), - (p.isSet = Ir), - (p.isString = Ar), - (p.isSymbol = x), - (p.isTypedArray = Lr), - (p.isUndefined = function (e) { - return e === jn; - }), - (p.isWeakMap = function (e) { - return N(e) && V(e) == ma; - }), - (p.isWeakSet = function (e) { - return N(e) && "[object WeakSet]" == i(e); - }), - (p.join = function (e, t) { - return null == e ? "" : Ce.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 = D(i)) < 0 ? y(o + r, 0) : T(r, o - 1)), - t != t) - ) - return Bs(e, Vs, 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 = Mr), - (p.lte = Rr), - (p.max = function (e) { - return e && e.length ? lt(e, M, _t) : jn; - }), - (p.maxBy = function (e, t) { - return e && e.length ? lt(e, h(t, 2), _t) : jn; - }), - (p.mean = function (e) { - return Gs(e, M); - }), - (p.meanBy = function (e, t) { - return Gs(e, h(t, 2)); - }), - (p.min = function (e) { - return e && e.length ? lt(e, M, It) : jn; - }), - (p.minBy = function (e, t) { - return e && e.length ? lt(e, h(t, 2), It) : jn; - }), - (p.stubArray = Mn), - (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, D(t)) : jn; - }), - (p.noConflict = function () { - return ms._ === this && (ms._ = $), this; - }), - (p.noop = Sn), - (p.now = rr), - (p.pad = function (e, t, i) { - e = d(e); - var o = (t = D(t)) ? rl(e) : 0; - return !t || t <= o - ? e - : Li(ge((t = (t - o) / 2)), i) + e + Li(pe(t), i); - }), - (p.padEnd = function (e, t, i) { - e = d(e); - var o = (t = D(t)) ? rl(e) : 0; - return t && o < t ? e + Li(t - o, i) : e; - }), - (p.padStart = function (e, t, i) { - e = d(e); - var o = (t = D(t)) ? rl(e) : 0; - return t && o < t ? Li(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 = Br(e)), t === jn ? ((t = e), (e = 0)) : (t = Br(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 = k(e) ? Ls : Ns, - r = arguments.length < 3; - return o(e, h(t, 4), i, r, nt); - }), - (p.reduceRight = function (e, t, i) { - var o = k(e) ? Ms : Ns, - 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 : D(t)), kt(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 = kn), - (p.runInContext = r), - (p.sample = function (e) { - return (k(e) ? We : Nt)(e); - }), - (p.size = function (e) { - if (null == e) return 0; - if (c(e)) return Ar(e) ? rl(e) : e.length; - var t = V(e); - return t == ra || t == ua ? e.size : xt(e).length; - }), - (p.snakeCase = hn), - (p.some = function (e, t, i) { - return (k(e) ? Rs : Yt)(e, h((t = i && m(e, t, i) ? jn : t), 3)); - }), - (p.sortedIndex = function (e, t) { - return Jt(e, t); - }), - (p.sortedIndexBy = function (e, t, i) { - return Kt(e, t, h(i, 2)); - }), - (p.sortedIndexOf = function (e, t) { - var i = null == e ? 0 : e.length; - if (i) { - var o = Jt(e, t); - if (o < i && G(e[o], t)) return o; - } - return -1; - }), - (p.sortedLastIndex = function (e, t) { - return Jt(e, t, !0); - }), - (p.sortedLastIndexBy = function (e, t, i) { - return Kt(e, t, h(i, 2), !0); - }), - (p.sortedLastIndexOf = function (e, t) { - if (null == e ? 0 : e.length) { - var i = Jt(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(D(i), 0, e.length)), - (t = u(t)), - e.slice(i, i + t.length) == t - ); - }), - (p.subtract = Nn), - (p.sum = function (e) { - return e && e.length ? js(e, M) : 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 = kr({}, e, i, ki)); - var o = A((t = kr({}, e.imports, i.imports, ki))), - 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=" + - (F.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, Zs)), - 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 = F.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(Ea, "") : c) - .replace(Sa, "$1") - .replace(Pa, "$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 = fn(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 = D(e)) < 1 || Jn < e) return []; - for ( - var i = Qn, o = T(e, Qn), o = ((t = h(t)), (e -= Qn), zs(o, t)); - ++i < e; - - ) - t(i); - return o; - }), - (p.toFinite = Br), - (p.toInteger = D), - (p.toLength = Fr), - (p.toLower = function (e) { - return d(e).toLowerCase(); - }), - (p.toNumber = I), - (p.toSafeInteger = function (e) { - return e ? tt(D(e), -Jn, Jn) : 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, Ks(i, e), Qs(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, Qs(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)), Ks(i, nl(t))).join("") - : e; - }), - (p.truncate = function (e, t) { - var i, - o = 30, - r = "...", - t = - (P(t) && - ((i = "separator" in t ? t.separator : i), - (o = "length" in t ? D(t.length) : o), - (r = "omission" in t ? u(t.omission) : r)), - (e = d(e)).length); - if ((t = $s(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), Dr(i))) { - if (e.slice(t).search(i)) { - var a, - s = o; - for ( - (i = i.global - ? i - : j(i.source, d(Ja.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)) && Ia.test(e) ? e.replace(xa, sl) : e; - }), - (p.uniqueId = function (e) { - var t = ++Q; - return d(e) + t; - }), - (p.upperCase = dn), - (p.upperFirst = pn), - (p.each = qo), - (p.eachRight = Xo), - (p.first = Io), - En( - p, - ((Vn = {}), - mt(p, function (e, t) { - F.call(p.prototype, t) || (Vn[t] = e); - }), - Vn), - { 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) { - (v.prototype[i] = function (e) { - e = e === jn ? 1 : y(D(e), 0); - var t = this.__filtered__ && !o ? new v(this) : this.clone(); - return ( - t.__filtered__ - ? (t.__takeCount__ = T(e, t.__takeCount__)) - : t.__views__.push({ - size: T(e, Qn), - type: i + (t.__dir__ < 0 ? "Right" : ""), - }), - t - ); - }), - (v.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; - v.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" : ""); - v.prototype[e] = function () { - return this[i](1).value()[0]; - }; - }), - Ts(["initial", "tail"], function (e, t) { - var i = "drop" + (t ? "" : "Right"); - v.prototype[e] = function () { - return this.__filtered__ ? new v(this) : this[i](1); - }; - }), - (v.prototype.compact = function () { - return this.filter(M); - }), - (v.prototype.find = function (e) { - return this.filter(e).head(); - }), - (v.prototype.findLast = function (e) { - return this.reverse().find(e); - }), - (v.prototype.invokeMap = a(function (t, i) { - return "function" == typeof t - ? new v(this) - : this.map(function (e) { - return wt(e, t, i); - }); - })), - (v.prototype.reject = function (e) { - return this.filter(mr(h(e))); - }), - (v.prototype.slice = function (e, t) { - e = D(e); - var i = this; - return i.__filtered__ && (0 < e || t < 0) - ? new v(i) - : (e < 0 ? (i = i.takeRight(-e)) : e && (i = i.drop(e)), - t !== jn - ? (t = D(t)) < 0 - ? i.dropRight(-t) - : i.take(t - e) - : i); - }), - (v.prototype.takeRightWhile = function (e) { - return this.reverse().takeWhile(e).reverse(); - }), - (v.prototype.toArray = function () { - return this.take(Qn); - }), - mt(v.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, As([e], o))), h && s ? e[0] : e; - } - var t, - i = this.__wrapped__, - o = h ? [1] : arguments, - r = i instanceof v, - n = o[0], - a = r || k(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 v(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(k(e) ? e : [], t)) - : this[o](function (e) { - return i.apply(k(e) ? e : [], t); - }); - }; - }), - mt(v.prototype, function (e, t) { - var i, - o = p[t]; - o && - ((i = o.name + ""), - F.call(Ie, i) || (Ie[i] = []), - Ie[i].push({ name: t, func: o })); - }), - (Ie[xi(jn, 2).name] = [{ name: "wrapper", func: jn }]), - (v.prototype.clone = function () { - var e = new v(this.__wrapped__); - return ( - (e.__actions__ = E(this.__actions__)), - (e.__dir__ = this.__dir__), - (e.__filtered__ = this.__filtered__), - (e.__iteratees__ = E(this.__iteratees__)), - (e.__takeCount__ = this.__takeCount__), - (e.__views__ = E(this.__views__)), - e - ); - }), - (v.prototype.reverse = function () { - var e; - return ( - this.__filtered__ - ? (((e = new v(this)).__dir__ = -1), (e.__filtered__ = !0)) - : ((e = this.clone()).__dir__ *= -1), - e - ); - }), - (v.prototype.value = function () { - var e = this.__wrapped__.value(), - t = this.__dir__, - i = k(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 = y(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 f = u[p], - _ = f.iteratee, - f = f.type, - _ = _(g); - if (2 == f) g = _; - else if (!_) { - if (1 == f) 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 = So(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 v - ? ((e = e), - (e = (e = this.__actions__.length - ? new v(this) - : e).reverse()).__actions__.push({ - func: Wo, - args: [Mo], - thisArg: jn, - }), - new f(e, this.__chain__)) - : this.thru(Mo); - }), - (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 - ); - })(), - F = {}; - function Ci(e) { - (this._viewer = e), (this._core = new v()), (this._tree = F); - } - function C(e) { - (this._viewer = e), (this._cesium = Cesium), (this._core = new v()); - } - function yi(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F); - } - function vi(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._tree = F.getSource()), - (this._core = new v()); - } - (F.Source = []), - (F.TempSource = []), - (F.entity = []), - (F.lastSelectEntity = null), - (F.pointsId = []), - (F.states = 0), - (F.PointSelectSource = []), - (F.currentObj = null), - (F.selectedItem = null), - (F.setSource = function (e) { - this.Source = e; - }), - (F.setTempSource = function (e) { - this.TempSource = e; - }), - (F.setPointSelectSource = function (e) { - this.PointSelectSource = e; - }), - (F.getSource = function () { - return this.Source; - }), - (F.getTempSource = function () { - return this.TempSource; - }), - (F.getPointSelectSource = function () { - return this.PointSelectSource; - }), - (F.push = function (e) { - this.Source.push(e); - }), - (F.pusTemSource = function (e) { - this.TempSource.push(e); - }), - (F.pusPointSelectSource = function (e) { - this.PointSelectSource.push(e); - }), - (F.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(F.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 = f.clone(e); - return (i.item = null), (F.currentObj = i), this.pusTemSource(i), e.id; - }), - (F.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; - } - } - }), - (F.exitsGroup = function (e, t) { - if (e) - for (var i = F.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); - } - }), - (F.getTempSourceById = function (e) { - for (var t = 0; t < this.TempSource.length; t++) - if (this.TempSource[t].id == e) return this.TempSource[t]; - }), - (F.getPointSelectSourceById = function (e) { - for (var t = 0; t < this.PointSelectSource.length; t++) - if (this.PointSelectSource[t].id == e) return this.PointSelectSource[t]; - }), - (F.getSourceByName = function (e, t) { - return f.find(e, function (e) { - return e.name == t; - }); - }), - (F.delete = function (e, t, i) { - var o = this.getSourceById(F.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(F.Source, o)), F.Source.splice(a, 1)) - : ((n = this.getSourceById(F.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(F.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(F.Source, o)), F.Source.splice(a, 1)) - : ((n = this.getSourceById(F.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(F.Source, o.pId)) && - ((a = this.getIndex(n.children, o)), n.children.splice(a, 1)); - } - }), - (F.temporaryItem = { obj: [], state: "start", operation: "" }), - (F.endtemporaryItem = function () { - (F.temporaryItem.obj = []), - (F.temporaryItem.state = "end"), - (F.temporaryItem.operation = ""); - }), - (F.starttemporaryItem = function (e) { - var t = null; - try { - t = document.getElementById("toolTip"); - } catch (e) {} - if ( - (null != t && (t.style.display = "none"), - null != F.handler && (F.handler.destroy(), (F.handler = null)), - 0 < F.temporaryItem.obj.length && "start" == F.temporaryItem.state) - ) - for (var i = 0; i < F.temporaryItem.obj.length; i++) { - try { - F.temporaryItem.obj[i].destroy(); - } catch (e) {} - try { - e.entities.remove(F.temporaryItem.obj[i]); - } catch (e) {} - } - return ( - (F.temporaryItem.obj = []), - (F.temporaryItem.state = "start"), - F.temporaryItem.operation - ); - }), - (F.delete1 = function (e) { - for (var t = 0; t < this.TempSource.length; t++) - this.TempSource[t].id == e && this.TempSource.splice(t, 1); - }), - (F.getIndex = function (e, t) { - for (var i = 0; i < e.length; i++) if (e[i].id == t.id) return i; - return -1; - }), - (F.setVisibilityTemp = function (t, e) { - var i = f.filter(this.TempSource, function (e) { - return e.id == t; - }); - i && i.length && (i[0].checked = e); - }), - (F.setVisibility = function (e, t, i, o) { - this.setVisibilityTemp(e, t); - var r = this.getSourceById(F.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) {} - } - }), - (F.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; - }), - (F.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); - }), - (F.handler = null), - (F.removeHandler = function () { - F.handler && (F.handler.destroy(), (F.handler = null)); - }), - (Ci.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; - }), - (Ci.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 += - '<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">' + - e + - "</div>"; - }) - : (t = - '<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">' + - e + - "</div>"), - (i = `<div id="${o.id}" style="${ - o.onclick ? "cursor: pointer;" : "pointer-events: none;" - }position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;"> - <div class="divpoint"> - <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;"> - <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;"> - <div class="divpoint-arrow-lt"></div> - <div class="divpoint-b-t" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 44px;right: 0;height: 1px;z-index: 10;"></div> - <div class="divpoint-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;right: 0;bottom: 44px;width: 1px;z-index: 10;"></div> - <div class="divpoint-b-b" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;left: 0;right: 44px;bottom: 0;height: 1px;z-index: 10;"></div> - <div class="divpoint-b-l" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 44px;left: 0;bottom: 0;width: 1px;z-index: 10;"></div> - <div class="divpoint-arrow-rb"></div> - <div class="divpoint-label-wrap" style="padding-left: 12px;color:#fff;font-size: 16px;white-space: nowrap;overflow: hidden;"> - <div class="divpoint-title" style="background-image: linear-gradient(135deg,transparent 25px,#29baf1 25px); margin-top: 20px;padding: 0 12px 0 30px;height: 36px;line-height: 36px;position: relative;">${ - o.name - }</div> - <div class="divpoint-label-content" style="padding: 15px 0;margin-top: 3px;border-top: 2px solid #29baf1;"> - ${t} - </div> - </div> - </div> - <div class="divpoint-b-t-l" style="background-color:#29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(52px,-22px);z-index: 10;"></div> - <div class="divpoint-b-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;bottom: 0;right: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(-52px,22px);z-index: 10;"></div> - </div> - <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div> - </div> - </div>`), - $(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 = `<div id="${o.id}" style="${ - o.onclick ? "cursor: pointer;" : "pointer-events: none;" - }position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;"> - <div class="divpoint"> - <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;"> - <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;"> - <div class="divpoint-arrow-lt"></div> - <div class="divpoint-b-t" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 44px;right: 0;height: 1px;z-index: 10;"></div> - <div class="divpoint-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;right: 0;bottom: 44px;width: 1px;z-index: 10;"></div> - <div class="divpoint-b-b" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;left: 0;right: 44px;bottom: 0;height: 1px;z-index: 10;"></div> - <div class="divpoint-b-l" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 44px;left: 0;bottom: 0;width: 1px;z-index: 10;"></div> - <div class="divpoint-arrow-rb"></div> - <div class="divpoint-label-wrap" style="padding-left: 12px;color:#fff;font-size: 16px;white-space: nowrap;overflow: hidden;"> - <div class="divpoint-title" style="background-image: linear-gradient(135deg,transparent 25px,#28bbf0 25px,#28bbf0 50%,transparent 50%),linear-gradient(-45deg,transparent 32px,#28bbf0 32px,#28bbf0 50%,transparent 50%);margin-top: 10px;margin-bottom: 10px;padding: 0 12px 0 30px;height: 36px;line-height: 36px;position: relative;">${ - o.name - }</div> - </div> - </div> - <div class="divpoint-b-t-l" style="background-color:#29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(52px,-22px);z-index: 10;"></div> - <div class="divpoint-b-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;bottom: 0;right: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(-52px,22px);z-index: 10;"></div> - </div> - <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div> - </div> - </div>`), - $(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 = `<div id="${o.id}" style="${ - o.onclick ? "cursor: pointer;" : "pointer-events: none;" - }position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;"> - <div class="divpoint"> - ${e} - </div> - </div>`), - $(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(); - } - }), - (Ci.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(); - } - }), - (Ci.prototype.deleteObject = function () { - this._viewer.clock.onTick.removeEventListener( - this.updateDivPointEvent, - this - ); - let e = document.getElementById(this.item.id); - e && e.remove(); - }), - (Ci.prototype.setVisibility = function (e) { - this.item && (this.item.show = e); - }), - (Ci.prototype.getVisibility = function () { - return this.item && this.item.show; - }), - (Ci.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (C.prototype.getPosition = function () { - return this._viewer.camera.position; - }), - (C.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, - }; - }), - (C.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.camera.getPickRay(e)); - t && !Array.isArray(t) && (t = [t]); - let o = this._viewer.scene.pickPosition(e); - o = o - ? { position: o } - : ((this._viewer.scene.globe.depthTestAgainstTerrain = !0), - this._viewer.scene.pickFromRay(i, t)); - let r; - if ( - ((r = - o && o.position && this._viewer.scene.globe.depthTestAgainstTerrain - ? o.position - : this._viewer.scene.globe.pick(i, this._viewer.scene)), - (this._viewer.scene.globe.depthTestAgainstTerrain = - !!this.defaultDepthTest), - (this.defaultDepthTest = void 0), - r) - ) - return r; - console.log("鏈嬀鍙栧埌鍧愭爣锛�"); - }), - (C.prototype.getMouseDegrees = function (e, t) { - e = this.getMousePosition(e, t); - if (e) return this._core.toDegrees(e); - }), - (yi.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"); - }), - (yi.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 = "<span aria-hidden='true'>脳</span>"), - (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"); - }), - (yi.prototype.getBh = function (e, t) { - for ( - var i = "", - i = - "<div class='function-module-content' style(height:'500px')><div class='function-module-sub-section'> <label class='function-module-sub-section-caption'>绗﹀彿搴�</label><div id='icons' class='mark-list'>", - o = 0; - o < t.length; - o++ - ) - i = - i + - "<div class='mark-list-item'><img title=" + - t[o].title + - " src=" + - t[o].src + - " id=" + - t[o].title + - " onclick=" + - t[o].onclick + - "></div>"; - e.innerHTML = i += "</div></div></div>"; - }), - (yi.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"); - }), - (yi.prototype.getLi = function (e, t) { - for (var i = 0; i < t.length; i++) { - var o = document.createElement("li"); - (o.innerHTML = `<img src="${t[i].img}" /><p>${t[i].text}</p>`), - (o.onclick = t[i].onclick), - e.appendChild(o); - } - }), - (yi.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; - }); - }), - (yi.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(); - }, - }); - }), - (yi.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(); - }, - }); - }), - (vi.prototype.createGroup = function (e, t, i) { - if ( - 0 != i && - (null == i || "" == i) && - ((i = this._core.isnull(F.selectedItem) ? 0 : F.selectedItem.id), - (o = F.getSourceByName(this._tree, e))) - ) - return o.id; - var o, - r, - n = F.getSourceById(this._tree, i); - return n - ? (o = F.getSourceByName(n.children, e)) - ? o.id - : ((r = { - id: this._core.getuid(), - name: e, - pId: i, - checked: t, - type: "group", - item: this, - }), - (this.item = r), - F.insertGroupId(r, i)) - : ((r = { - id: this._core.getuid(), - name: e, - pId: i, - type: "group", - checked: t, - item: this, - }), - (this.item = r), - F.insertGroupId(r, i)); - }), - (vi.prototype.getVisibility = function () { - return this.item.checked; - }), - (vi.prototype.changeGroup = function (e, t) { - F.changeGroup(e, t); - }), - (vi.prototype.starttemporaryItem = function () { - return F.starttemporaryItem(this._viewer); - }), - (vi.prototype.pushtemporaryItem = function (e) { - F.temporaryItem.obj.push(e); - }), - (vi.prototype.pushStateItem = function (e) { - F.temporaryItem.operation = e; - }), - (vi.prototype.endtemporaryItem = function () { - F.endtemporaryItem(); - }), - (vi.prototype.export = function () { - return { - type: "group", - style: { name: this.item.name, pId: this.item.pId, id: this.item.id }, - }; - }); - var wi = 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" - ); - }, - bi = - "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 Ti(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 y(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 v()), - (this.tooltip = this._core.CreateTooltip()), - (this._getPosition = new C(this._viewer, this._cesium)); - } - function Ei(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (this._Provider = void 0), - (this._cache = !1), - (this._forceRefreshPrvimitive = null); - } - function Si(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._scene = e.scene), - (this._core = new v()), - (this._getPosition = new C(e)), - (this.num = 100), - (this.buffs = []), - (this.tooltip = this._core.CreateTooltip()); - } - function w(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._getPosition = new C(this._viewer, this._cesium)), - (this._tree = F), - (this._popupmessage = new yi(this._viewer, this._cesium)), - (this._bufferAnalysis = new Si(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 v()), - (this.tooltip = this._core.CreateTooltip()), - (this._getPosition = new C(this._viewer, this._cesium)); - } - function E(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (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 Pi(e, t, i, o) { - (this.UrlTemplateGeojsonProvider = new t.UrlTemplateGeojsonProvider(i, 1)), - (this.UrlTemplateGeojsonProvider.loadtitle = o), - (this.ent = e.imageryLayers.addImageryProvider( - this.UrlTemplateGeojsonProvider - )); - } - function xi(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 S(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (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 Di(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 Ii(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 - ); - } - (y.prototype._serialize = function (e) { - var t, - i = [], - o = window.encodeURIComponent; - for (t in e) { - var r = e[t]; - "object" === (void 0 === r ? "undefined" : bi(r)) - ? i.push(o(t) + "=" + o(JSON.stringify(r))) - : i.push(o(t) + "=" + o(e[t])); - } - return i.join("&"); - }), - (y.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); - }); - }), - (y.prototype._lonLatToTileInWGS84 = function (e, t) { - var e = wi(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), - ]; - }), - (y.prototype._radianToDegree = function (e) { - return (e / Math.PI) * 180; - }), - (y.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; - } - }), - (y.prototype._cameraMoveStartHandler = function () { - this._isCameraMoving = !0; - }), - (y.prototype._loadTile = function (e) { - var r = [], - n = new this._Cesium.ColorGeometryInstanceAttribute( - 0.75, - 0.75, - 0.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, Ti(e)); - }) - : (t = o[i]).push.apply(t, Ti(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, - }) - ); - }), - (y.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, Ti(t)), - n = Math.max.apply(Math, Ti(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; - })); - }); - } - }), - (y.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 - ); - }), - (y.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]); - }), - (y.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(); - }), - (y.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); - } - }), - (y.prototype.setStatus = function (e) { - (this._stop = e), - this._primitiveCollection._availability && e - ? (this._primitiveCollection._availability = void 0) - : this.availability && - !e && - (this._primitiveCollection._availability = this.availability); - }), - (y.prototype.isRemoved = function () { - return this._isRemoved; - }), - (y.prototype.filterBy = function (e, t, i) { - (this._propertyToBeFiltered = e), (this._valuesToBeFiltered = t); - }), - (y.prototype.removeFilter = function () { - (this._propertyToBeFiltered = null), (this._valuesToBeFiltered = null); - }), - (y.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 != F.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), - (F.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 !== F.states || - (r.id && r.id.VectorType - ? u.tooltip.showAt(t.endPosition, "鐐瑰嚮婵�娲荤紪杈�") - : u.tooltip.show(!1)) - : 0 != F.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 = F.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 < F.editPointID.add.length) - ) { - if (0 < r) { - let i = c.entities.getById(F.editPointID.add[r - 1]); - if (i) { - let e = c.entities.getById(F.editPointID.edit[r - 1]), - t = c.entities.getById(F.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(F.editPointID.add[r]); - if (i) { - let e = c.entities.getById(F.editPointID.edit[r]), - t = c.entities.getById(F.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( - F.editPointID.add[F.editPointID.add.length - 1] - ); - if (i) { - let e = c.entities.getById(F.editPointID.edit[0]), - t = c.entities.getById( - F.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), - F.editPointID.move && (F.editPointID.move.position = t), - ("polyline" !== p && - "wall" !== p && - "polygon" !== p && - "rectangle" !== p) || - SmartEarthPopupData.editGraphic.setValue( - "positions", - e - ); - } else if ("_height_point" === n) { - r = F.editPointID.height.indexOf(m.id); - let e = c.entities.getById(F.editPointID.edit[r]), - i = - (("ellipse" !== p && "cylinder" !== p && "box" !== p) || - (e = F.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); - F.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 = F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - t = - (F.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }), - r = - (F.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 = F.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(F.editPointID.edit[t]); - if ( - ((r = r || c.entities.getById(F.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 < F.editPointID.add.length && F.editPointID.add[t]) - ) { - let e = c.entities.getById(F.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 == F.states - ) { - e = e.id; - if ( - !e.VectorType && - -1 < F.editPointID.edit.indexOf(e.id) && - ((("polyline" === p || "wall" === p) && - 2 < F.editPointID.edit.length) || - ("polygon" === p && 3 < F.editPointID.edit.length)) - ) { - var i = F.editPointID.edit.indexOf(e.id); - if ( - (c.entities.removeById(e.id), - F.editPointID.edit.splice(i, 1), - h.pottingPoint.splice(i, 1), - 0 < F.editPointID.add.length) - ) - if (F.editPointID.add[i]) { - if ( - (c.entities.removeById(F.editPointID.add[i]), - F.editPointID.add.splice(i, 1), - 0 <= i - 1) - ) { - let e = c.entities.getById(F.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( - F.editPointID.add[F.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(F.editPointID.add[i - 1]), - F.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), - F.editPointID.move && (F.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), - F.editPointID.edit.forEach((e) => { - c.entities.removeById(e); - }), - (F.editPointID.edit = []), - F.editPointID.height.forEach((e) => { - c.entities.removeById(e); - }), - (F.editPointID.height = []), - F.editPointID.add.forEach((e) => { - c.entities.removeById(e); - }), - (F.editPointID.add = []), - F.editPointID.size.forEach((e) => { - c.entities.removeById(e); - }), - (F.editPointID.size = []), - F.editPointID.move && c.entities.remove(F.editPointID.move), - (F.editPointID.move = void 0), - h && c.entities.remove(h), - (p = h = void 0), - (SmartEarthPopupData.editGraphic = {}), - (u.isEditting = !1), - u.setStatus(!1), - (F.editVector = !1), - (u._primitiveCollection.show = !0), - u.delButton(!1); - } - } else a(); - }), - (y.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; - }), - (y.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)); - } - }), - (y.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); - }), - (y.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 - ); - }), - (y.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, - }; - }), - (y.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 < F.editPointID.height.length && - F.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 < F.editPointID.edit.length && - F.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 < F.editPointID.size.length && - F.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 < F.editPointID.add.length && - F.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 = F.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 () { - F.editPointID.edit.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.edit = []), - F.editPointID.height.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.height = []), - F.editPointID.add.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.add = []), - F.editPointID.size.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.size = []), - F.editPointID.move && s.entities.remove(F.editPointID.move), - (F.editPointID.move = void 0); - }, - setTreeID: function (i) { - F.editPointID.edit.forEach((e) => { - let t = s.entities.getById(e); - t.treeID = i; - }), - F.editPointID.height.forEach((e) => { - let t = s.entities.getById(e); - t.treeID = i; - }), - F.editPointID.add.forEach((e) => { - let t = s.entities.getById(e); - t.treeID = i; - }), - F.editPointID.size.forEach((e) => { - let t = s.entities.getById(e); - t.treeID = i; - }), - F.editPointID.move && (F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: o, - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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 < F.editPointID.edit.length && - !i && - t.forEach((e, t) => { - let i = s.entities.getById(F.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 < F.editPointID.add.length && - F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: o, - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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 = F.editPointID.move.position.getValue(), - r = a.GetPositionFromA_D(o, i, 90); - let e = s.entities.getById(F.editPointID.size[0]), - t = - ((e.position = r), - (n.pottingPoint[0] = r), - (n.pottingPoint[n.pottingPoint.length - 1] = o), - s.entities.getById(F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - (e.angle = 90), - F.editPointID.size.push(e.id), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: t[1], - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: o, - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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 = F.editPointID.move.position.getValue(), - o = a.GetPositionFromA_D(n, i / 2, o); - let e = s.entities.getById(F.editPointID.size[r]); - (e.position = o), - (this.entity.pottingPoint[r] = o), - (this.entity.pottingPoint[ - this.entity.pottingPoint.length - 1 - ] = n); - } else { - r = a.toDegrees(F.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(0.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })); - (t.angle = 180), - F.editPointID.size.push(e.id), - F.editPointID.size.push(t.id), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: i[2], - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - })); - F.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), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: i, - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.editPointID.add.push(r.id); - } - } - })); - }), - (Ei.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 - ); - }), - (Ei.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 y(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 - ); - }), - (Ei.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 }, - }; - }), - (Ei.prototype.setRefresh = function (e) { - try { - this._Provider && this._Provider.setStatus(e); - } catch (e) {} - }), - (Ei.prototype.setVisibility = function (e) { - (this.item.show = e), - this._Provider && this._Provider.setStatus(!e), - e || this.item.removeAll(); - }), - (Ei.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) {} - }), - (Ei.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Ei.prototype.edit = function (e, t) { - return ( - (this.isEditting = e), - (this.editoption = t), - this._Provider && this._Provider.edit && this._Provider.edit(e, t) - ); - }), - (Ei.prototype.forceRefresh = function () { - try { - for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) - this._Provider.quadtree._levelZeroTiles[e].freeResources(); - } catch (e) {} - }), - (Si.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); - } - }), - (Si.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 + I.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(0.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 - ); - }), - (Si.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)); - }), - (Si.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 + I.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 - ); - }), - (Si.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)); - }), - (Si.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 + I.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(0.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(0.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 - ); - }), - (Si.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)); - }), - (Si.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; - }), - (Si.prototype.pointsToDegreesArray = function (e) { - let t = []; - return ( - e.map((e) => { - t.push(e[0]), t.push(e[1]); - }), - t - ); - }), - (Si.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; - }), - (Si.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(0.6), - outline: !0, - outlineColor: Cesium.Color.YELLOW, - outlineWidth: 10, - zIndex: 0, - ...t, - }, - }) - ); - }), - (Si.prototype.clearBuff = function () { - var t = this._viewer; - 0 < this.buffs.length && - (this.buffs.forEach(function (e) { - t.entities.remove(e); - }), - (this.buffs.length = 0)); - }), - (w.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 - ); - }), - (w.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 - ); - }), - (w.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 - ); - }), - (w.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 - ); - }), - (w.prototype.createPointGeojsonFeatureLayer = function ( - e, - t, - s, - i, - l = !0, - 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 - ); - }), - (w.prototype.createModelGeojsonFeatureLayer = function ( - e, - t, - m = {}, - i, - o, - r - ) { - var d = { - color: m.color || "#ffffff", - url: window.SmartEarthRootUrl + I.testModel, - scale: 1, - minimumPixelSize: 0, - height: 0, - far: 5e3, - near: 0, - type: "default", - }, - n = (null == t && console.log("geojson is required"), null), - n = t.then ? t : this._cesium.GeoJsonDataSource.load(t), - n = - (m && - m.time && - new this._cesium.TimeIntervalCollection([ - new this._cesium.TimeInterval({ - start: m.time.start - ? this._cesium.JulianDate.fromDate(new Date(m.time.start)) - : this._cesium.Iso8601.MINIMUM_VALUE, - stop: m.time.end - ? this._cesium.JulianDate.fromDate(new Date(m.time.end)) - : this._cesium.Iso8601.MAXIMUM_VALUE, - }), - ]), - (this.option = m), - (this.option.color = - "string" == typeof d.color - ? Cesium.Color.fromCssColorString(d.color) - : d.colorF), - (this.loadGeosjonData = () => { - m = this.option; - var t = this.dataSourceItem.entities.values; - let o = this._core.extend(d, m, !0); - var e = parseFloat(o.near), - i = parseFloat(o.far), - r = new Cesium.DistanceDisplayCondition(e, i); - this.item.removeAll(); - let n = new Map(), - a, - s, - l, - u = []; - for (let e = 0, i; e < t.length; e++) - if (((i = t[e]), "polylineVolume" === o.type)) { - let e = this._core.extendgl(i, "[flieName]"); - (e = "/" + e.replace("xpl2", "gltf")), - n.get(o.url + e) || n.set(o.url + e, []), - (l = n.get(o.url + e)); - var c = new Cesium.Cartesian3( - this._core.extendgl(i, "[scaleY]", 1), - this._core.extendgl(i, "[scaleX]", 1), - this._core.extendgl(i, "[scaleZ]", 1) - ), - h = new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(this._core.extendgl(i, "[Yaw]", 0)), - Cesium.Math.toRadians(this._core.extendgl(i, "[Pitch]", 0)), - Cesium.Math.toRadians(this._core.extendgl(i, "[Roll]", 0)) - ), - h = Cesium.Matrix3.fromHeadingPitchRoll(h); - let t = this._core.toDegrees(i.position.getValue()); - (t.height = this._core.extendgl(i, "[Altitude]", 0)), - (s = new Cesium.Cartesian3.fromDegrees( - t.lon, - t.lat, - t.height - )), - u.push(s), - (a = Cesium.Transforms.eastNorthUpToFixedFrame(s)), - Cesium.Matrix4.multiplyByMatrix3(a, h, a), - Cesium.Matrix4.multiplyByScale(a, c, a), - Cesium.ModelInstanceCollection - ? l.push({ - modelMatrix: a, - modelId: this._core.getEntityProp(i), - }) - : this.item.add( - Cesium.Model.fromGltf({ - id: this._core.getEntityProp(i), - url: o.url + e, - modelMatrix: a, - color: o.color, - distanceDisplayCondition: r, - }) - ); - } else { - if ( - (n.get(o.url) || (n.set(o.url, []), (l = n.get(o.url))), - void 0 !== o.height || void 0 !== o.pointHeight) - ) { - let e = this._core.toDegrees(i.position.getValue()); - (e.height = o.height || o.pointHeight), - (s = new Cesium.Cartesian3.fromDegrees( - e.lon, - e.lat, - e.height - )), - (i.position = s); - } - (s = i.position.getValue()), - u.push(s), - (a = Cesium.Transforms.eastNorthUpToFixedFrame(s)); - (h = new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(this._core.extendgl(i, o.heading, 0)), - Cesium.Math.toRadians(this._core.extendgl(i, o.pitch, 0)), - Cesium.Math.toRadians(this._core.extendgl(i, o.roll, 0)) - )), - (c = Cesium.Matrix3.fromHeadingPitchRoll(h)); - Cesium.Matrix4.multiplyByMatrix3(a, c, a), - "object" == typeof o.scale - ? Cesium.Matrix4.multiplyByScale(a, o.scale, a) - : Cesium.Matrix4.multiplyByUniformScale(a, o.scale, a), - Cesium.ModelInstanceCollection - ? l.push({ - modelMatrix: a, - modelId: this._core.getEntityProp(i), - }) - : this.item.add( - Cesium.Model.fromGltf({ - id: this._core.getEntityProp(i), - url: o.url, - modelMatrix: a, - color: o.color, - distanceDisplayCondition: r, - }) - ); - } - (this.item.boundingSphere = Cesium.BoundingSphere.fromPoints(u)), - Cesium.ModelInstanceCollection && - n.forEach((e, t) => { - this.item.add( - new Cesium.ModelInstanceCollection({ - url: t, - instances: e, - color: o.color, - }) - ); - }); - }), - (this.item = new Cesium.PrimitiveCollection()), - this._viewer.scene.primitives.add(this.item), - n.then((e) => { - (this.dataSourceItem = e), - this.loadGeosjonData(), - o || this.setVisibility(!1), - "function" == typeof r && r(e); - }), - this._core.isnull(m.id) && (m.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + m.id), - { - id: m.id, - name: e, - checked: o, - pId: this._core.isnull(i) ? 0 : i, - type: "pointLayer", - item: this, - url: t, - style: m, - treeData: { - name: e, - geoOptions: t, - styleOption: m, - GroupID: i, - checked: o, - disFnc: r, - }, - }); - return ( - this.setTreeobj(n), - this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), - this - ); - }), - (w.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 - ); - }), - (w.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 - ); - }), - (w.prototype.createLabelPointGeoJsonFeatureLayer = function ( - s, - e, - l, - t, - i, - o - ) { - var u, - c = { - 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(0.165, 0.165, 0.165, 0.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), - pointHeight: 0, - maxDistanceDisplay: 99999999, - minDistanceDisplay: 0, - far: 99999999, - near: 0, - addHeight: 0, - }, - h = this, - r = - (this._core.isnull(l) || - this._core.isnull(l.fillColor) || - (this._core.isHtmlColor(l.fillColor) - ? (l.fillColor = this._color.colorFromHtmlColor(l.fillColor)) - : (/^rgb/.test(l.fillColor) && - (l.fillColor = this._color.rgbaStringToRgbaObj(l.fillColor)), - 1 < l.fillColor.r && (l.fillColor.r = l.fillColor.r / 255), - 1 < l.fillColor.g && (l.fillColor.g = l.fillColor.g / 255), - 1 < l.fillColor.b && (l.fillColor.b = l.fillColor.b / 255), - 1 < l.fillColor.a && (l.fillColor.a = l.fillColor.a / 255), - (l.fillColor = this._color.createColor( - l.fillColor.r, - l.fillColor.g, - l.fillColor.b, - l.fillColor.a - )))), - 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.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.isnull(l) || - this._core.isnull(l.backgroundColor) || - (this._core.isHtmlColor(l.backgroundColor) - ? (l.backgroundColor = this._color.colorFromHtmlColor( - l.backgroundColor - )) - : (/^rgb/.test(l.backgroundColor) && - (l.backgroundColor = this._color.rgbaStringToRgbaObj( - l.backgroundColor - )), - 1 < l.backgroundColor.r && - (l.backgroundColor.r = l.backgroundColor.r / 255), - 1 < l.backgroundColor.g && - (l.backgroundColor.g = l.backgroundColor.g / 255), - 1 < l.backgroundColor.b && - (l.backgroundColor.b = l.backgroundColor.b / 255), - 1 < l.backgroundColor.a && - (l.backgroundColor.a = l.backgroundColor.a / 255), - (l.backgroundColor = this._color.createColor( - l.backgroundColor.r, - l.backgroundColor.g, - l.backgroundColor.b, - l.backgroundColor.a - )))), - h._core.isnull(l.near) && (l.near = 0), - h._core.isnull(l.far) && (l.far = 999999999), - l && - l.time && - (u = new this._cesium.TimeIntervalCollection([ - new this._cesium.TimeInterval({ - start: l.time.start - ? this._cesium.JulianDate.fromDate(new Date(l.time.start)) - : this._cesium.Iso8601.MINIMUM_VALUE, - stop: l.time.end - ? this._cesium.JulianDate.fromDate(new Date(l.time.end)) - : this._cesium.Iso8601.MAXIMUM_VALUE, - }), - ])), - null == e && console.log("geojson is required"), - this._cesium.GeoJsonDataSource.load(e)), - h = (this._viewer.dataSources.add(r), this), - r = - ((this.option = l), - (this.loadGeosjonData = () => { - l = this.option; - var i = this.item.entities.values; - let o = this._core.extend(c, l, !0); - h._core.isnull(o.font_size) && (o.font_size = "30px"), - h._core.isnull(o.font_family) && (o.font_family = " sans-serif"), - -1 == o.font_size.toString().indexOf("px") - ? (o.font = o.font_size + "px " + o.font_family) - : (o.font = o.font_size + " " + o.font_family), - o.bold && (o.font = "bold " + o.font), - o.italic && (o.font = "italic " + o.font), - (h.Legend = []); - for (let t = 0; t < i.length; t++) { - let e = i[t]; - (o.font = h._core.extendgl(e, l.font, o.font)), - (o.style = parseInt(h._core.extendgl(e, o.style, o.style))), - (o.fillColor = h._core.extendgl(e, l.fillColor, o.fillColor)), - (o.outlineColor = h._core.extendgl( - e, - l.outlineColor, - o.outlineColor - )), - (o.outlineWidth = parseFloat( - h._core.extendgl(e, l.outlineWidth, o.outlineWidth) - )), - (o.show = h._core.extendgl(e, l.show, o.show)), - (o.showBackground = h._core.extendgl( - e, - l.showBackground, - o.showBackground - )), - (o.backgroundColor = h._core.extendgl( - e, - l.backgroundColor, - o.backgroundColor - )), - (o.backgroundPadding = h._core.extendgl( - e, - l.backgroundPadding, - o.backgroundPadding - )), - (o.scale = parseFloat(h._core.extendgl(e, l.scale, o.scale))), - (o.horizontalOrigin = h._core.extendgl( - e, - l.horizontalOrigin, - o.horizontalOrigin - )), - (o.pointHeight = parseFloat( - h._core.extendgl(e, l.pointHeight, o.pointHeight) - )), - (o.text = h._core.extendgl(e, l.text, o.text).toString()); - var r, - n = parseFloat(h._core.extendgl(e, o.near)), - a = parseFloat(h._core.extendgl(e, o.far)), - n = new h._cesium.DistanceDisplayCondition(n, a), - n = - ((o.distanceDisplayCondition = n), - null != o.image && null != o.image && 0 < o.image.length - ? ((e.billboard = { image: o.image }), - (e.billboard.scale = o.scale), - (e.billboard.color = o.color), - (e.billboard.verticalOrigin = o.verticalOrigin), - (e.billboard.horizontalOrigin = o.horizontalOrigin), - (e.billboard.disableDepthTestDistance = - o.disableDepthTestDistance), - (e.billboard.heightReference = o.heightReference), - (e.billboard.distanceDisplayCondition = - o.distanceDisplayCondition)) - : (e.billboard = void 0), - "ellipsoidlayer" == o.layertype && - ((e.name = s), - (a = { - show: !0, - radii: new h._cesium.Cartesian3( - o.long_axis, - o.short_axis, - o.long_axis - ), - material: h._cesium.Color.fromRandom({ alpha: 1 }), - }), - (e.ellipsoid = new h._cesium.EllipsoidGraphics(a)), - (e.ellipsoid.heightReference = o.heightReference), - (e.ellipsoid.material = url)), - { - Name: o.Name, - text: o.text, - font: o.font, - style: o.stylet, - ...o, - }), - a = - "fillColor:" + - 255 * o.fillColor.red + - "," + - 255 * o.fillColor.green + - "," + - 255 * o.fillColor.blue + - ";outlineColor:" + - 255 * o.outlineColor.red + - "," + - 255 * o.outlineColor.green + - "," + - 255 * o.outlineColor.blue; - h.Legend.push(a), - (e.label = new h._cesium.LabelGraphics(n)), - u && (e.availability = u), - (o.pointHeight || o.addHeight) && - ((a = h._cesium.Cartographic.fromCartesian( - e.position._value - )), - (n = h._cesium.Math.toDegrees(a.longitude)), - (r = h._cesium.Math.toDegrees(a.latitude)), - (a = (o.pointHeight || a.height) + o.addHeight), - (n = new Cesium.Cartesian3.fromDegrees(n, r, a)), - (e.position._value = n)), - e.label && - (o.labelData && Object.assign(e.label, o.labelData), - (o.offsetX || o.offsetY) && - (e.label.pixelOffset = new Cesium.Cartesian2( - o.offsetX || 0, - o.offsetY || 0 - ))), - e.billboard && - o.imageData && - Object.assign(e.billboard, o.imageData); - } - }), - r.then(function (e) { - (h.item = e), - h.loadGeosjonData(), - i || h.setVisibility(!1), - "function" == typeof o && o(e); - }), - this._core.isnull(l.id) && (l.id = this._core.getuid()), - this._core.isnull(s) && (s = "鏂板缓琛楁櫙" + l.id), - { - id: l.id, - name: s, - checked: i, - pId: this._core.isnull(t) ? 0 : t, - type: "labelPointLayer", - item: this, - url: e, - style: l, - treeData: { - name: s, - geoOptions: e, - styleOption: l, - GroupID: t, - checked: i, - disFnc: o, - }, - }); - return ( - this.setTreeobj(r), - this._tree.insertGroupId(r, this._core.isnull(t) ? 0 : t), - this - ); - }), - (w.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 - ); - }), - (w.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(0.165, 0.165, 0.165, 0.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 - ); - }), - (w.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 - ); - }), - (w.prototype.createPolylineGeoJsonFeatureLayer = function ( - e, - t, - s, - i, - o, - r - ) { - var l, - u = { - positions: [], - arcType: this._cesium.ArcType.GEODESIC, - clampToGround: !0, - width: 1, - show: !0, - material: this._cesium.Color.WHITE, - outlineColor: this._cesium.Color.WHITE, - gapColor: Cesium.Color.TRANSPARENT, - height: void 0, - dashLength: 16, - outlineWidth: 0, - maxDistanceDisplay: 99999999, - minDistanceDisplay: 0, - far: 99999999, - near: 0, - }, - c = this, - n = - (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)) || - ("(" == 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.gapColor && - "string" == typeof s.gapColor && - (s.gapColor = Cesium.Color.fromCssColorString(s.gapColor)), - c._core.isnull(s.near) && (s.near = 0), - c._core.isnull(s.far) && (s.far = 999999999), - null == t && console.log("geojson is required"), - null), - n = t.then ? t : this._cesium.GeoJsonDataSource.load(t), - n = - (this._viewer.dataSources.add(n, { - camera: this._viewer.scene.camera, - canvas: this._viewer.scene.canvas, - clampToGround: !0, - }), - s && - s.time && - (l = new c._cesium.TimeIntervalCollection([ - new c._cesium.TimeInterval({ - start: s.time.start - ? c._cesium.JulianDate.fromDate(new Date(s.time.start)) - : c._cesium.Iso8601.MINIMUM_VALUE, - stop: s.time.end - ? c._cesium.JulianDate.fromDate(new Date(s.time.end)) - : c._cesium.Iso8601.MAXIMUM_VALUE, - }), - ])), - (this.option = s), - (this.loadGeosjonData = () => { - s = this.option; - var o = this.item.entities.values; - let r = this._core.extend(u, s, !0); - c.Legend = []; - for (let i = 0; i < o.length; i++) { - let e = o[i]; - (r.arcType = c._core.extendgl(e, s.arcType, r.arcType)), - (r.clampToGround = c._core.extendgl( - e, - s.clampToGround, - r.clampToGround - )), - (r.width = parseFloat(c._core.extendgl(e, s.width, r.width))), - (r.show = c._core.extendgl(e, s.show, r.show)), - (r.material = c._core.extendgl(e, s.material, r.material)), - (r.height = parseFloat( - c._core.extendgl(e, s.height, r.height) - )); - var n = parseFloat(c._core.extendgl(e, r.near)), - a = parseFloat(c._core.extendgl(e, r.far)), - n = new c._cesium.DistanceDisplayCondition(n, a); - (r.distanceDisplayCondition = n), - void 0 !== r.height && - ((a = e.polyline.positions.getValue()), - (e.polyline.positions = c._core.setpolylineheight( - a, - r.height - ))), - (e.polyline.clampToGround = r.clampToGround), - (e.polyline.width = r.width), - (e.polyline.show = r.show), - (e.polyline.distanceDisplayCondition = n), - (e.polyline.classificationType = r.classificationType); - let t; - (t = r.dash - ? new Cesium.PolylineDashMaterialProperty({ - color: r.material, - gapColor: r.gapColor, - dashLength: s.dashLength, - }) - : new Cesium.PolylineOutlineMaterialProperty({ - color: r.material, - outlineColor: r.outlineColor, - outlineWidth: s.outlineWidth, - })), - (e.polyline.material = t), - l && (e.availability = l); - a = - "material:" + - 255 * r.material.red + - "," + - 255 * r.material.green + - "," + - 255 * r.material.blue; - c.Legend.push(a); - } - }), - n.then(function (e) { - (c.item = e), - c.loadGeosjonData(), - o || c.setVisibility(!1), - "function" == typeof r && r(e); - }), - this._core.isnull(s.id) && (s.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + s.id), - { - id: s.id, - name: e, - checked: o, - pId: this._core.isnull(i) ? 0 : i, - type: "polylineLayer", - item: this, - url: t, - 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), - this - ); - }), - (w.prototype.createpolylineVolumeGeojsonFeatureLayer = function ( - e, - t, - d, - i, - p, - g - ) { - var f, - 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: 0.5, - radiusScale: 1, - }, - _ = - (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), - C = (this._viewer.dataSources.add(o), this), - o = - ((_.shape = this.computeCircle(d.radius)), - d && - d.time && - (f = new C._cesium.TimeIntervalCollection([ - new C._cesium.TimeInterval({ - start: d.time.start - ? C._cesium.JulianDate.fromDate(new Date(d.time.start)) - : C._cesium.Iso8601.MINIMUM_VALUE, - stop: d.time.end - ? C._cesium.JulianDate.fromDate(new Date(d.time.end)) - : C._cesium.Iso8601.MAXIMUM_VALUE, - }), - ])), - o.then(function (e) { - var t, - i, - o = (C.item = e).entities.values, - r = - (C._core.isnull(d.near) && (d.near = 0), - C._core.isnull(d.far) && (d.far = 999999999), - parseFloat(d.near)), - n = parseFloat(d.far), - a = new C._cesium.DistanceDisplayCondition(r, n); - if ( - ((_.distanceDisplayCondition = a), - "string" == typeof _.radius && - -1 < _.radius.indexOf("[") && - -1 < _.radius.indexOf("]")) - ) { - let e; - (_.radius = _.radius.replace("[", "")), - (_.radius = _.radius.replace("]", "")), - o[0] && o[0].properties[_.radius] - ? (e = o[0].properties[_.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]) * _.radiusScale), - (i = parseFloat(e[1]) * _.radiusScale), - (_.shape = [ - new C._cesium.Cartesian2(-t, -i), - new C._cesium.Cartesian2(t, -i), - new C._cesium.Cartesian2(t, i), - new C._cesium.Cartesian2(-t, i), - ])) - : (_.shape = C._core.computeCircle(e * _.radiusScale)) - : (_.shape = C._core.computeCircle(0.5)); - } else "0" == _.slttype || 0 == _.slttype ? (_.shape = C._core.computeCircle(_.radius)) : "1" == _.slttype || 1 == _.slttype ? (_.shape = C._core.starPositions(_.number, _.exradius, _.inradius)) : ("2" != _.slttype && 2 != _.slttype) || ((t = _.orth_width / 2), (i = _.orth_height / 2), (_.shape = [new C._cesium.Cartesian2(-t, -i), new C._cesium.Cartesian2(t, -i), new C._cesium.Cartesian2(t, i), new C._cesium.Cartesian2(-t, i)])); - for (var s = 0; s < o.length; s++) { - var l, - u, - c = o[s], - h = - ((_.show = C._core.extendgl(c, d.show, _.show)), - (_.shape = C._core.extendgl(c, d.shape, _.shape)), - (_.cornerType = C._core.extendgl( - c, - d.cornerType, - _.cornerType - )), - (_.granularity = C._core.extendgl( - c, - d.granularity, - _.granularity - )), - (_.fill = C._core.extendgl(c, d.fill, _.fill)), - (_.material = C._core.extendgl(c, d.material, _.material)), - (_.outline = C._core.extendgl(c, d.outline, _.outline)), - (_.outlineColor = C._core.extendgl( - c, - d.outlineColor, - _.outlineColor - )), - (_.outlineWidth = parseFloat( - C._core.extendgl(c, d.outlineWidth, _.outlineWidth) - )), - (_.shadows = C._core.extendgl(c, d.shadows, _.shadows)), - []), - m = - (c.polyline.positions._value.forEach(function (e) { - _.height - ? ((u = C._cesium.Cartographic.fromCartesian(e)), - (l = C._cesium.Math.toDegrees(u.longitude)), - (u = C._cesium.Math.toDegrees(u.latitude)), - h.push( - C._cesium.Cartesian3.fromDegrees(l, u, _.height) - )) - : h.push(e); - }), - (c.polylineVolume = new C._cesium.PolylineVolumeGraphics({ - positions: h, - show: _.show, - shape: _.shape, - cornerType: _.cornerType, - fill: _.fill, - outline: _.outline, - outlineWidth: _.outlineWidth, - material: _.material, - distanceDisplayCondition: a, - })), - "material:" + - 255 * _.material.red + - "," + - 255 * _.material.green + - "," + - 255 * _.material.blue); - C.Legend.push(m), - (c.polyline = void 0), - f && (c.availability = f); - } - p || C.setVisibility(!1), "function" == typeof g && g(e); - }), - this._core.isnull(_.id) && (_.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓绠$姸鍥惧眰" + _.id), - { - id: _.id, - name: e, - checked: p, - pId: this._core.isnull(i) ? 0 : i, - type: "polylineVolumeLayer", - item: this, - url: t, - style: _, - 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 - ); - }), - (w.prototype.createpolylineVolumeGeojsonPrimitiveLayer = function ( - e, - t, - s, - i, - o, - r - ) { - let l = { - 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: 0.5, - height: 0, - radiusScale: 1, - }, - n = - (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 - )))), - null == t && console.log("geojson is required"), - null), - d = ((n = t.then ? t : this._cesium.GeoJsonDataSource.load(t)), this), - p = - (s && - s.time && - new d._cesium.TimeIntervalCollection([ - new d._cesium.TimeInterval({ - start: s.time.start - ? d._cesium.JulianDate.fromDate(new Date(s.time.start)) - : d._cesium.Iso8601.MINIMUM_VALUE, - stop: s.time.end - ? d._cesium.JulianDate.fromDate(new Date(s.time.end)) - : d._cesium.Iso8601.MAXIMUM_VALUE, - }), - ]), - new Cesium.PrimitiveCollection()), - g = { - allowPicking: !0, - appearance: new d._cesium.PerInstanceColorAppearance({ - translucent: !1, - vertexShaderSource: d._core.Shaders("vertexShaderSource"), - fragmentShaderSource: d._core.Shaders("fragmentShaderSource"), - }), - shadows: s.shadows, - geometryInstances: void 0, - }, - u = ((this.option = s), {}); - function c(e) { - return u[e] || (u[e] = d._core.computeCircle(e)), u[e]; - } - (this.loadGeosjonData = () => { - (s = this.option), - d._core.isnull(s.near) && (s.near = 0), - d._core.isnull(s.far) && (s.far = 999999999), - (s.near = parseFloat(s.near)), - (s.far = parseFloat(s.far)), - p.removeAll(); - var o = this.dataSourceItem.entities.values; - d.Legend = []; - for (let e = 0, t, i; e < o.length; e++) { - (i = o[e]), - (t = this._core.extend(l, s, !0)), - (r = n = r = n = a = n = void 0); - var r, - n = i, - a = t; - if ( - "string" == typeof a.radius && - -1 < a.radius.indexOf("[") && - -1 < a.radius.indexOf("]") - ) { - let e = d._core.getEntityPropValue(n, a.radius); - e - ? e.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")), - (n = parseFloat(e[0]) * a.radiusScale), - (r = parseFloat(e[1]) * a.radiusScale), - u[n + "*" + r] || - (u[n + "*" + r] = [ - new d._cesium.Cartesian2(-n, -r), - new d._cesium.Cartesian2(n, -r), - new d._cesium.Cartesian2(n, r), - new d._cesium.Cartesian2(-n, r), - ]), - (a.shape = u[n + "*" + r]), - (a.radius = r)) - : ((a.radius = e * a.radiusScale), - (a.shape = c(a.radius)), - a.connect && - ((a.connectRadius = e * a.radiusScale * 1.1), - (a.connectRadius2 = e * a.radiusScale * 1.2), - (a.connectShape1 = c(a.connectRadius)), - (a.connectShape2 = c(a.connectRadius2)))) - : ((a.shape = c(0.5)), - (a.radius = 0.5), - a.connect && - ((a.connectRadius = 1.1 * a.radius), - (a.connectRadius2 = 1.2 * a.radius), - (a.connectShape1 = c(a.connectRadius)), - (a.connectShape2 = c(a.connectRadius2)))); - } else - "0" == a.slttype || 0 == a.slttype - ? ((a.shape = c(a.radius)), - a.connect && - ((a.connectRadius = 1.1 * a.radius), - (a.connectRadius2 = 1.2 * a.radius), - (a.connectShape1 = c(a.connectRadius)), - (a.connectShape2 = c(a.connectRadius2)))) - : "1" == a.slttype || 1 == a.slttype - ? (a.shape = d._core.starPositions( - a.number, - a.exradius, - a.inradius - )) - : ("2" != a.slttype && 2 != a.slttype) || - ((n = a.orth_width / 2), - (r = a.orth_height / 2), - (a.shape = [ - new d._cesium.Cartesian2(-n, -r), - new d._cesium.Cartesian2(n, -r), - new d._cesium.Cartesian2(n, r), - new d._cesium.Cartesian2(-n, r), - ]), - (a.radius = r)); - (t.show = d._core.extendgl(i, s.show, t.show)), - (t.shape = d._core.extendgl(i, s.shape, t.shape)), - (t.cornerType = d._core.extendgl(i, s.cornerType, t.cornerType)), - (t.granularity = d._core.extendgl(i, s.granularity, t.granularity)), - (t.fill = d._core.extendgl(i, s.fill, t.fill)), - (t.material = d._core.extendgl(i, s.material, t.material)), - (t.outline = d._core.extendgl(i, s.outline, t.outline)), - (t.outlineColor = d._core.extendgl( - i, - s.outlineColor, - t.outlineColor - )), - (t.outlineWidth = parseFloat( - d._core.extendgl(i, s.outlineWidth, t.outlineWidth) - )), - (t.shadows = d._core.extendgl(i, s.shadows, t.shadows)), - "string" == typeof t.material && - (t.material = Cesium.Color.fromCssColorString(t.material)), - !(async function (e, o) { - let t = e.polyline && e.polyline.positions.getValue(); - if (t && !(t.length < 2)) { - let i; - (o.height = d._core.defaultValue(s.height, -2)), - o.height.start && o.height.end - ? (o.height = { - start: - d._core.getEntityPropValue(e, s.height.start) || -2, - end: d._core.getEntityPropValue(e, s.height.end) || -2, - }) - : ("string" == typeof o.height && - o.height.includes("[") && - o.height.includes("]") && - (o.height = - d._core.getEntityPropValue(e, s.height) || -2), - (o.height = { start: o.height, end: o.height })), - (o.height._height = - (o.height.end - o.height.start) / (t.length - 1)), - t.forEach(function (e, t) { - ((i = Cesium.Cartographic.fromCartesian(e)).height = - o.height.start + o.height._height * t - o.radius), - Cesium.Cartesian3.clone( - Cesium.Cartographic.toCartesian(i), - e - ); - }); - var r = { - polylinePositions: t, - shapePositions: o.shape, - cornerType: o.cornerType, - VertexFormat: { - bitangent: !0, - color: !0, - position: !0, - st: !0, - normal: !0, - tangent: !0, - }, - }, - r = new Cesium.PolylineVolumeGeometry(r), - r = new Cesium.GeometryInstance({ - id: d._core.getEntityProp(e), - geometry: r, - attributes: { - color: - new Cesium.ColorGeometryInstanceAttribute.fromColor( - o.material - ), - distanceDisplayCondition: - new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( - o.near, - o.far - ), - }, - }), - r = - ((g.geometryInstances = r), - p.add(new Cesium.Primitive(g)), - console.log(o.material.toCssColorString()), - o.connect && - 10 < o.shape.length && - !(async function (t, i, o) { - let r = [], - n = d._core.getPointFromTwoPointCenter( - [i[0], i[1]], - 2 * o.connectRadius - ), - a = d._core.getPointFromTwoPointCenter( - [i[0], i[1]], - 2 * o.connectRadius2 - ), - s = d._core.getPointFromTwoPointCenter( - [i[i.length - 1], i[i.length - 2]], - 2 * o.connectRadius - ), - l = d._core.getPointFromTwoPointCenter( - [i[i.length - 1], i[i.length - 2]], - 2 * o.connectRadius2 - ); - i[0].equals(i[1]) && - i[2] && - ((n = d._core.getPointFromTwoPointCenter( - [i[0], i[2]], - 2 * o.connectRadius - )), - (a = d._core.getPointFromTwoPointCenter( - [i[0], i[2]], - 2 * o.connectRadius2 - ))); - i[i.length - 1].equals(i[i.length - 2]) && - i[i.length - 3] && - ((s = d._core.getPointFromTwoPointCenter( - [i[i.length - 1], i[i.length - 3]], - 2 * o.connectRadius - )), - (l = d._core.getPointFromTwoPointCenter( - [i[i.length - 1], i[i.length - 3]], - 2 * o.connectRadius2 - ))); - let u = [], - c = new Cesium.EllipsoidGeometry({ - vertexFormat: { - bitangent: !0, - color: !0, - position: !0, - st: !0, - normal: !0, - tangent: !0, - }, - stackPartitions: 16, - slicePartitions: 16, - radii: new Cesium.Cartesian3( - o.connectRadius, - o.connectRadius, - o.connectRadius - ), - }), - h; - if (n && a) { - if (!i[0].equals(n)) { - let e = []; - ((h = d._core.toDegrees(i[0])).height -= - 0.1 * o.radius), - e.push(d._core.fromDegrees(h)), - ((h = d._core.toDegrees(n)).height -= - 0.1 * o.radius), - e.push(d._core.fromDegrees(h)); - var m = new d._cesium.PolylineVolumeGeometry({ - polylinePositions: e, - shapePositions: o.connectShape1, - cornerType: o.cornerType, - VertexFormat: { - bitangent: !0, - color: !0, - position: !0, - st: !0, - normal: !0, - tangent: !0, - }, - }); - r.push(m); - } - if (!n.equals(a)) { - let e = []; - ((h = d._core.toDegrees(n)).height -= - 0.2 * o.radius), - e.push(d._core.fromDegrees(h)), - ((h = d._core.toDegrees(a)).height -= - 0.2 * o.radius), - e.push(d._core.fromDegrees(h)); - m = new d._cesium.PolylineVolumeGeometry({ - polylinePositions: e, - shapePositions: o.connectShape2, - cornerType: o.cornerType, - VertexFormat: { - bitangent: !0, - color: !0, - position: !0, - st: !0, - normal: !0, - tangent: !0, - }, - }); - r.push(m); - } - m = new Cesium.GeometryInstance({ - geometry: c, - modelMatrix: Cesium.Matrix4.multiplyByTranslation( - Cesium.Transforms.eastNorthUpToFixedFrame(i[0]), - new Cesium.Cartesian3(0, 0, o.radius), - new Cesium.Matrix4() - ), - attributes: { - color: - Cesium.ColorGeometryInstanceAttribute.fromColor( - o.material - ), - distanceDisplayCondition: - new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( - o.near, - o.far - ), - }, - }); - u.push(m); - } - if (s && l) { - if (!i[i.length - 1].equals(s)) { - let e = []; - ((h = d._core.toDegrees(i[i.length - 1])).height -= - 0.1 * o.radius), - e.push(d._core.fromDegrees(h)), - ((h = d._core.toDegrees(s)).height -= - 0.1 * o.radius), - e.push(d._core.fromDegrees(h)); - (m = new d._cesium.PolylineVolumeGeometry({ - polylinePositions: e, - shapePositions: o.connectShape1, - cornerType: o.cornerType, - VertexFormat: { - bitangent: !0, - color: !0, - position: !0, - st: !0, - normal: !0, - tangent: !0, - }, - })), - (m = - (r.push(m), - new Cesium.GeometryInstance({ - geometry: c, - modelMatrix: - Cesium.Matrix4.multiplyByTranslation( - Cesium.Transforms.eastNorthUpToFixedFrame( - i[i.length - 1] - ), - new Cesium.Cartesian3(0, 0, o.radius), - new Cesium.Matrix4() - ), - attributes: { - color: - Cesium.ColorGeometryInstanceAttribute.fromColor( - o.material - ), - distanceDisplayCondition: - new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( - o.near, - o.far - ), - }, - }))); - u.push(m); - } - if (!l.equals(s)) { - let e = []; - ((h = d._core.toDegrees(s)).height -= - 0.2 * o.radius), - e.push(d._core.fromDegrees(h)), - ((h = d._core.toDegrees(l)).height -= - 0.2 * o.radius), - e.push(d._core.fromDegrees(h)); - i = new d._cesium.PolylineVolumeGeometry({ - polylinePositions: e, - shapePositions: o.connectShape2, - cornerType: o.cornerType, - VertexFormat: { - bitangent: !0, - color: !0, - position: !0, - st: !0, - normal: !0, - tangent: !0, - }, - }); - r.push(i); - } - } - r.forEach((e) => { - e = new d._cesium.GeometryInstance({ - id: d._core.getEntityProp(t), - geometry: e, - attributes: { - color: - new d._cesium.ColorGeometryInstanceAttribute.fromColor( - o.material - ), - distanceDisplayCondition: - new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( - o.near, - o.far - ), - }, - }); - u.push(e); - }), - (g.geometryInstances = u), - p.add(new Cesium.Primitive(g)); - })(e, t, o), - "material:" + - 255 * o.material.red + - "," + - 255 * o.material.green + - "," + - 255 * o.material.blue); - d.Legend.push(r); - } - })(i, t); - } - d._viewer.scene.primitives.add(p); - }), - (d.item = p), - n.then(function (e) { - (d.dataSourceItem = e), - d.loadGeosjonData(), - o || d.setVisibility(!1), - "function" == typeof r && r(p); - }), - this._core.isnull(s.id) && (s.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓绠$姸鍥惧眰" + s.id); - e = { - id: s.id, - name: e, - checked: o, - pId: this._core.isnull(i) ? 0 : i, - type: "polylineVolumeLayer", - item: this, - url: t, - style: s, - treeData: { - name: e, - geoOptions: t, - styleOption: s, - GroupID: i, - checked: o, - disFnc: r, - }, - }; - return ( - this.setTreeobj(e), - this._tree.insertGroupId(e, this._core.isnull(i) ? 0 : i), - this - ); - }), - (w.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; - }), - (w.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 - ); - }), - (w.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 - ); - }), - (w.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 - ); - }), - (w.prototype.createPrimitivePolygon = async function (t, i) { - let e; - var o = i.clampToGround - ? Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT - : Cesium.VertexFormat.POSITION_AND_NORMAL, - o = - ((e = - "bulidingWall" === t - ? new Cesium.CorridorGeometry({ - positions: i.positions, - width: i.bulidingWallWidth || 0.8, - height: i.height, - extrudedHeight: i.extrudedHeight, - vertexFormat: o, - cornerType: Cesium.CornerType.MITERED, - }) - : new Cesium.PolygonGeometry({ - polygonHierarchy: new Cesium.PolygonHierarchy( - i.positions, - i.holes - ), - height: i.height, - extrudedHeight: i.extrudedHeight, - vertexFormat: o, - perPositionHeight: !1, - })), - new Cesium.GeometryInstance({ - id: i.prop, - geometry: e, - attributes: { - color: new Cesium.ColorGeometryInstanceAttribute.fromColor( - i.material - ), - distanceDisplayCondition: - new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( - i.near, - i.far - ), - }, - })); - if ("mask" === t) - (this.primitivePolygon = new Cesium.GroundPrimitive({ - geometryInstances: o, - appearance: new Cesium.PerInstanceColorAppearance({ - translucent: i.material.alpha < 1, - }), - classificationType: i.classificationType, - })), - this._viewer.scene.primitives.add(this.primitivePolygon); - else { - this.primitivePolygon || - ((this.primitivePolygon = new Cesium.PrimitiveCollection()), - this._viewer.scene.primitives.add(this.primitivePolygon)); - let e = i.clampToGround ? Cesium.GroundPrimitive : Cesium.Primitive; - t = new e({ - geometryInstances: o, - appearance: new Cesium.PerInstanceColorAppearance({ - translucent: i.material.alpha < 1, - }), - classificationType: i.classificationType, - }); - this.primitivePolygon.add(t); - } - }), - (w.prototype.createPolygonGeoJsonFeatureLayer = function ( - e, - t, - l = {}, - i, - o, - r - ) { - var u, - c = { - 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, - disableDepthTestDistance: 1 / 0, - near: 0, - mask: !1, - }, - n = - (l.material && - "string" == typeof l.material && - -1 === l.material.indexOf("[") && - (l.material = Cesium.Color.fromCssColorString(l.material)), - l.fillColor && - "string" == typeof l.fillColor && - -1 === l.fillColor.indexOf("[") && - (l.fillColor = Cesium.Color.fromCssColorString(l.fillColor)), - l.outlineColor && - "string" == typeof l.outlineColor && - -1 === l.outlineColor.indexOf("[") && - (l.outlineColor = Cesium.Color.fromCssColorString(l.outlineColor)), - l.labelOutlineColor && - "string" == typeof l.labelOutlineColor && - -1 === l.labelOutlineColor.indexOf("[") && - (l.labelOutlineColor = Cesium.Color.fromCssColorString( - l.labelOutlineColor - )), - (l.checked = o), - null == t && console.log("geojson is required"), - null), - n = t.then - ? t - : this._cesium.GeoJsonDataSource.load(t, { clampToGround: !0 }), - h = (this._viewer.dataSources.add(n), this), - n = - (l && - l.time && - (u = new h._cesium.TimeIntervalCollection([ - new h._cesium.TimeInterval({ - start: l.time.start - ? h._cesium.JulianDate.fromDate(new Date(l.time.start)) - : h._cesium.Iso8601.MINIMUM_VALUE, - stop: l.time.end - ? h._cesium.JulianDate.fromDate(new Date(l.time.end)) - : h._cesium.Iso8601.MAXIMUM_VALUE, - }), - ])), - (this.option = l), - (this.loadGeosjonData = () => { - l = this.option; - var i = this.item.entities.values; - let o = this._core.extend(c, l, !0); - h._core.isnull(l.near) && (l.near = 0), - h._core.isnull(l.far) && (l.far = 999999999); - var e = parseFloat(l.near), - t = parseFloat(l.far), - r = new h._cesium.DistanceDisplayCondition(e, t); - (o.distanceDisplayCondition = r), - o.text && - (o.font_family || (o.font_family = "寰蒋闆呴粦"), - o.font_size || (o.font_size = "18px"), - (o.font = o.font_size + " " + o.font_family), - o.bold && (o.font = "bold " + o.font), - o.italic && (o.font = "italic " + o.font), - (o.labelNearFar = new Cesium.DistanceDisplayCondition( - o.labelNear || e, - o.labelFar || t - ))), - (h.Legend = []); - let n = []; - h.primitivePolygon && - h._viewer.scene.primitives.remove(h.primitivePolygon), - (h.primitivePolygon = null); - for (let t = 0; t < i.length; t++) { - let e = i[t]; - (o.height = parseFloat(h._core.extendgl(e, l.height, o.height))), - (o.extrudedHeight = h._core.extendgl( - e, - l.extrudedHeight, - o.extrudedHeight - )), - (o.extrudedHeight = o.height + o.extrudedHeight), - (o.heightReference = h._core.extendgl( - e, - l.heightReference, - o.heightReference - )), - (o.show = h._core.extendgl(e, l.show, o.show)), - (o.fill = h._core.extendgl(e, l.fill, o.fill)), - (o.material = h._core.extendgl(e, l.material, o.material)), - void 0 !== o.extrudedHeight && - (o.extrudedHeight = parseFloat(o.extrudedHeight)), - (o.outline = h._core.extendgl(e, l.outline, o.outline)), - (o.outlineColor = h._core.extendgl( - e, - l.outlineColor, - o.outlineColor - )), - (o.outlineWidth = parseFloat( - h._core.extendgl(e, l.outlineWidth, o.outlineWidth) - )), - (o.stRotation = h._core.extendgl( - e, - l.stRotation, - o.stRotation - )), - (o.granularity = h._core.extendgl( - e, - l.granularity, - o.granularity - )), - (o.distanceDisplayCondition = h._core.extendgl( - e, - l.distanceDisplayCondition, - o.distanceDisplayCondition - )), - (o.perPositionHeight = h._core.extendgl( - e, - l.perPositionHeight, - o.perPositionHeight - )), - (o.closeTop = h._core.extendgl(e, l.closeTop, o.closeTop)), - (o.closeBottom = h._core.extendgl( - e, - l.closeBottom, - o.closeBottom - )), - (o.shadows = h._core.extendgl(e, l.shadows, o.shadows)), - (o.classificationType = h._core.extendgl( - e, - l.classificationType, - o.classificationType - )), - (o.text = h._core.extendgl(e, l.text, o.text)), - o.clampToGround && o.mask - ? ((e.polygon.show = !1), - n.push(e.polygon.hierarchy.getValue()), - t === i.length - 1 && - h.createPrimitivePolygon("mask", { - positions: Cesium.Cartesian3.fromDegreesArray([ - 30, 0, 30, 80, 179, 80, 179, 0, - ]), - holes: n, - ...o, - })) - : (e.polygon.defaultHierarchy && - (e.polygon.hierarchy = e.polygon.defaultHierarchy), - (e.polygon.show = !0), - (e.polygon.extrudedHeightReference = - o.extrudedHeightReference), - (e.polygon.heightReference = o.heightReference), - 1 != o.heightReference && - ((e.polygon.height = o.height), - o.height && (e.polygon.perPositionHeight = !1)), - 1 != o.extrudedHeightReference && - (e.polygon.extrudedHeight = o.extrudedHeight), - o.clampToGround && - ((e.polygon.height = void 0), - (e.polygon.heightReference = 1), - (e.polygon.extrudedHeight = void 0), - (e.polygon.perPositionHeight = !1)), - (e.polygon.show = o.show), - (e.polygon.fill = o.fill), - (e.polygon.material = o.material), - (e.polygon.outline = o.outline), - (e.polygon.outlineColor = o.outlineColor), - (e.polygon.outlineWidth = o.outlineWidth), - (e.polygon.stRotation = o.stRotation), - (e.polygon.granularity = o.granularity), - (e.polygon.distanceDisplayCondition = r), - (e.polygon.closeTop = o.closeTop), - (e.polygon.closeBottom = o.closeBottom), - (e.polygon.shadows = o.shadows), - (e.polygon.classificationType = o.classificationType), - o.bulidingWall && - ((e.polygon.show = !1), - (a = e.polygon.hierarchy.getValue().positions), - h.createPrimitivePolygon("bulidingWall", { - positions: a, - ...o, - }), - t === i.length - 1 - ? ((h.item.boundingSphere = - Cesium.BoundingSphere.fromPoints( - h.item.boundingPointsArr - )), - (h.item.boundingPointsArr = null)) - : (h.item.boundingPointsArr || - (h.item.boundingPointsArr = []), - h.item.boundingPointsArr.push(a[0])))), - o.clampToGround && o.outline - ? (e.polyline = { - positions: e.polygon.hierarchy.getValue().positions, - material: o.outlineColor, - width: o.outlineWidth, - classificationType: o.classificationType, - clampToGround: !0, - distanceDisplayCondition: r, - zIndex: 1, - }) - : (e.polyline = void 0), - o.text - ? ((a = h._core.getCenterOfMass( - e.polygon.hierarchy.getValue().positions - )), - (e.position = Cesium.Cartesian3.fromDegrees( - a[0], - a[1], - a[2] - )), - void 0 !== o.pointHeight && - (e.position = Cesium.Cartesian3.fromDegrees( - a[0], - a[1], - o.pointHeight - )), - (e.label = { - text: o.text, - font: o.font, - style: Cesium.LabelStyle.FILL_AND_OUTLINE, - fillColor: o.fillColor || o.material, - outlineColor: o.labelOutlineColor || o.outlineColor, - outlineWidth: o.labelOutlineWidth || 0, - pixelOffset: o.pixelOffset, - disableDepthTestDistance: h._core.defaultValue( - o.disableDepthTestDistance, - 1 / 0 - ), - distanceDisplayCondition: o.labelNearFar, - })) - : (e.label = void 0); - var a, - s = - "material:" + - 255 * o.material.red + - "," + - 255 * o.material.green + - "," + - 255 * o.material.blue + - ";outlineColor:" + - 255 * o.outlineColor.red + - "," + - 255 * o.outlineColor.green + - "," + - 255 * o.outlineColor.blue; - h.Legend.push(s), u && (e.availability = u); - } - }), - n.then(function (e) { - (h.item = e), - h.loadGeosjonData(), - l.checked ? (h.isShow = !0) : h.setVisibility(!1), - "function" == typeof r && r(e); - }), - this._core.isnull(l.id) && (l.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + l.id), - { - id: l.id, - name: e, - checked: o, - pId: this._core.isnull(i) ? 0 : i, - type: "polygonLayer", - item: this, - url: t, - style: l, - treeData: { - name: e, - geoOptions: t, - styleOption: l, - GroupID: i, - checked: o, - disFnc: r, - }, - }); - return ( - this.setTreeobj(n), - this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), - this - ); - }), - (w.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 - ); - }), - (w.prototype.deleteObject = function () { - this._viewer.dataSources.remove(this.item), - this._viewer.scene.primitives.remove(this.item), - (this.item = null), - this.primitivePolygon && - this._viewer.scene.primitives.remove(this.primitivePolygon), - (this.primitivePolygon = null); - }), - (w.prototype.getLevel = function () { - var e, - t = this._viewer.camera; - return t && t.positionCartographic && t.positionCartographic.height - ? ((e = - (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; - }), - (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.setVisibility = function (e) { - (this.isShow = e), - null != this.item && (this.item.show = e), - this.primitivePolygon && (this.primitivePolygon.show = e); - }), - (w.prototype.getVisibility = function () { - return this.item.show; - }), - (w.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; - }), - (w.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 - ); - }), - (w.prototype.saveDefaultGeosjonData = function () { - this.defaultVectorData = this._core.extend({}, this.option, !0); - }), - (w.prototype.restoreGeosjon = function () { - this.defaultVectorData && - ((this.option = this.defaultVectorData), this.loadGeosjonData()), - (this.defaultVectorData = void 0); - }), - (w.prototype.updataGeosjon = function (e = {}) { - (e.material || - e.color || - e.fillColor || - e.labelOutlineColor || - e.outlineColor || - e.backgroundColor || - e.gapColor) && - (e.color && (e.color = Cesium.Color.fromCssColorString(e.color)), - e.material && - (e.material = Cesium.Color.fromCssColorString(e.material)), - e.fillColor && - (e.fillColor = Cesium.Color.fromCssColorString(e.fillColor)), - e.outlineColor && - (e.outlineColor = Cesium.Color.fromCssColorString(e.outlineColor)), - e.labelOutlineColor && - (e.labelOutlineColor = Cesium.Color.fromCssColorString( - e.labelOutlineColor - )), - e.backgroundColor && - (e.backgroundColor = Cesium.Color.fromCssColorString( - e.backgroundColor - )), - e.gapColor && - (e.gapColor = Cesium.Color.fromCssColorString(e.gapColor))), - (this.option = this._core.extend(this.option, e, !0)), - this.item && - (clearTimeout(this.updataGeojsonTime), - (this.updataVectorTime = setTimeout(() => { - this.loadGeosjonData(); - }, 100))); - }), - (w.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" }; - }), - (w.prototype.getLegend = function () { - var e = []; - return (e = null != this.Legend ? this._core.unique(this.Legend) : e); - }), - (w.prototype.getFirstDataSourceItem = function () { - if (this.item.entities.values) return this.item.entities.values[0]; - }), - (w.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (w.prototype.setItem = function (e) { - this.item = e; - }), - Object.defineProperties(w.prototype, { - labelText: { - set: f.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( - 0.165, - 0.165, - 0.165, - 0.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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( - 0.165, - 0.165, - 0.165, - 0.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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 (o) { - if ( - (this._quadtree.beginFrame(o), - this._quadtree.render(o), - this._quadtree.endFrame(o), - this._availability && (this._state = this.isAvailable(o.time)), - this._state && this._client && this._quadtree._tilesToRender) - ) - for (let e = 0, t = this._quadtree._tilesToRender.length, i; e < t; e++) - !(i = this._quadtree._tilesToRender[e]).data || - !i.data.geometryPrimitive || - i.data.geometryPrimitive instanceof Cesium.Cesium3DTileset || - (i.data.geometryPrimitive.update && - i.data.geometryPrimitive.update(o)); - }), - (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)); - }), - (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 != F.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), - (F.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 !== F.states || - (r.id && r.id.VectorType - ? u.tooltip.showAt(t.endPosition, "鐐瑰嚮婵�娲荤紪杈�") - : u.tooltip.show(!1)) - : 0 != F.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 = F.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 < F.editPointID.add.length) - ) { - if (0 < r) { - let i = c.entities.getById(F.editPointID.add[r - 1]); - if (i) { - let e = c.entities.getById(F.editPointID.edit[r - 1]), - t = c.entities.getById(F.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(F.editPointID.add[r]); - if (i) { - let e = c.entities.getById(F.editPointID.edit[r]), - t = c.entities.getById(F.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( - F.editPointID.add[F.editPointID.add.length - 1] - ); - if (i) { - let e = c.entities.getById(F.editPointID.edit[0]), - t = c.entities.getById( - F.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), - F.editPointID.move && (F.editPointID.move.position = t), - ("polyline" !== p && - "polygon" !== p && - "rectangle" !== p) || - SmartEarthPopupData.editGraphic.setValue( - "positions", - e - ); - } else if ("_height_point" === n) { - r = F.editPointID.height.indexOf(m.id); - let e = c.entities.getById(F.editPointID.edit[r]), - i = - (("ellipse" !== p && "cylinder" !== p && "box" !== p) || - (e = F.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); - F.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 = F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - t = - (F.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }), - r = - (F.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 = F.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(F.editPointID.edit[t]); - if ( - ((r = r || c.entities.getById(F.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 < F.editPointID.add.length && F.editPointID.add[t]) - ) { - let e = c.entities.getById(F.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 == F.states - ) { - e = e.id; - if ( - !e.VectorType && - -1 < F.editPointID.edit.indexOf(e.id) && - (("polyline" === p && 2 < F.editPointID.edit.length) || - ("polygon" === p && 3 < F.editPointID.edit.length)) - ) { - var i = F.editPointID.edit.indexOf(e.id); - if ( - (c.entities.removeById(e.id), - F.editPointID.edit.splice(i, 1), - h.pottingPoint.splice(i, 1), - 0 < F.editPointID.add.length) - ) - if (F.editPointID.add[i]) { - if ( - (c.entities.removeById(F.editPointID.add[i]), - F.editPointID.add.splice(i, 1), - 0 <= i - 1) - ) { - let e = c.entities.getById(F.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( - F.editPointID.add[F.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(F.editPointID.add[i - 1]), - F.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), - F.editPointID.move && (F.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), - F.editPointID.edit.forEach((e) => { - c.entities.removeById(e); - }), - (F.editPointID.edit = []), - F.editPointID.height.forEach((e) => { - c.entities.removeById(e); - }), - (F.editPointID.height = []), - F.editPointID.add.forEach((e) => { - c.entities.removeById(e); - }), - (F.editPointID.add = []), - F.editPointID.size.forEach((e) => { - c.entities.removeById(e); - }), - (F.editPointID.size = []), - F.editPointID.move && c.entities.remove(F.editPointID.move), - (F.editPointID.move = void 0), - h && c.entities.remove(h), - (p = h = void 0), - (SmartEarthPopupData.editGraphic = {}), - (u.isEditting = !1), - u.setStatus(!0), - (F.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 < F.editPointID.height.length && - F.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 < F.editPointID.edit.length && - F.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 < F.editPointID.size.length && - F.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 < F.editPointID.add.length && - F.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 = F.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 () { - F.editPointID.edit.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.edit = []), - F.editPointID.height.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.height = []), - F.editPointID.add.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.add = []), - F.editPointID.size.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.size = []), - F.editPointID.move && s.entities.remove(F.editPointID.move), - (F.editPointID.move = void 0); - }, - setTreeID: function (i) { - F.editPointID.edit.forEach((e) => { - let t = s.entities.getById(e); - t.treeID = i; - }), - F.editPointID.height.forEach((e) => { - let t = s.entities.getById(e); - t.treeID = i; - }), - F.editPointID.add.forEach((e) => { - let t = s.entities.getById(e); - t.treeID = i; - }), - F.editPointID.size.forEach((e) => { - let t = s.entities.getById(e); - t.treeID = i; - }), - F.editPointID.move && (F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: o, - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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 < F.editPointID.edit.length && - !i && - t.forEach((e, t) => { - let i = s.entities.getById(F.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 < F.editPointID.add.length && - F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: o, - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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 = F.editPointID.move.position.getValue(), - r = a.GetPositionFromA_D(o, i, 90); - let e = s.entities.getById(F.editPointID.size[0]), - t = - ((e.position = r), - (n.pottingPoint[0] = r), - (n.pottingPoint[n.pottingPoint.length - 1] = o), - s.entities.getById(F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - (e.angle = 90), - F.editPointID.size.push(e.id), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: t[1], - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - }); - F.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), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: o, - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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 = F.editPointID.move.position.getValue(), - o = a.GetPositionFromA_D(n, i / 2, o); - let e = s.entities.getById(F.editPointID.size[r]); - (e.position = o), - (this.entity.pottingPoint[r] = o), - (this.entity.pottingPoint[ - this.entity.pottingPoint.length - 1 - ] = n); - } else { - r = a.toDegrees(F.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(0.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })); - (t.angle = 180), - F.editPointID.size.push(e.id), - F.editPointID.size.push(t.id), - (F.editPointID.move = s.entities.add({ - name: "_move_point", - position: i[2], - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - heightReference: - this.graphic.heightReference && - this.graphic.heightReference.getValue(), - }, - })); - } - })) - : "corridor" !== e && "ellipsoid" === e && n.isSphere; - }), - (E.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( - 0.165, - 0.165, - 0.165, - 0.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 - ); - }), - (E.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(0.165, 0.165, 0.165, 0.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 - ); - }), - (E.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 - ); - }), - (E.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); - } - }), - (E.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); - }), - (E.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)); - (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, - })); - (a = this._viewer.scene.primitives), - 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); - })), - a.add(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), - (s = { - 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 - ); - }), - (E.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)); - (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( - 0.165, - 0.165, - 0.165, - 0.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, - })); - (n = this._viewer.scene.primitives), - 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); - })), - n.add(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), - (n = { - 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(n), - this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), - "function" == typeof r && r(this.item), - this - ); - }), - (E.prototype.createLabelImageGeoJsonFeatureLayerProvider = function ( - e, - t, - c, - i, - o, - r - ) { - var n, - 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, - }, - h = this, - s = - (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)), - l = parseFloat(c.far), - u = new h._cesium.DistanceDisplayCondition(s, l); - c.distanceDisplayCondition = u; - let m = -1 < t.url.indexOf("/gisserver/"); - function d(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 p() { - 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(0.165, 0.165, 0.165, 0.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, - }; - } - (n = m - ? t.url + - `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent( - "{x}" - )}/${window.encodeURIComponent("{y}")}.json` - : t.url + "?" + this._core._serialize(a.urlParams)), - (this._urlTemplate = n), - (this._Provider = new T( - this._viewer, - this._cesium, - m ? new Cesium.WebMercatorTilingScheme() : void 0 - )), - (this._Provider._normalTile = c.level_max), - (this._Provider._minimumHeight = parseFloat(c.height) || 0), - (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 ( - (m && - (i.reverseY = - h._Provider.tilingScheme.getNumberOfYTilesAtLevel( - i.level - ) - - i.y - - 1), - 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 = n - .replace(window.encodeURIComponent("{x}"), i.x) - .replace(window.encodeURIComponent("{y}"), i.reverseY || 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 = p(), - 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 = d(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 = d(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 = d(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 = d( - 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 = d(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 = d(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(); - }), - "function" == typeof r && r(this.item); - }); - let g, f; - 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 = () => { - f = h._core.extend({}, c, !0); - }), - (this.restoreVector = () => { - if ( - f && - ((c = f), - (h._Provider._normalTile = c.level_max), - h._Provider && h._Provider.EntityCollection) - ) { - var e = p(); - 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 = d(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 = d(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; - }); - } - f = 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 && (s = parseFloat(a.near)), - void 0 !== a.far && (l = parseFloat(a.far)), - (e = new Cesium.DistanceDisplayCondition(s, l)), - (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(g), - (g = 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 = d(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 = d(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 C; - function y() { - h._Provider.EntityCollection.show && - (clearTimeout(C), - (C = 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, - }); - (u = this._viewer.scene.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); - })), - u.add(this._primitive), - this._core.getWMTSData( - { - url: t.url, - layer: t.layer, - srs: t.srs || "EPSG:4490", - gisserverTMS: m, - }, - (e) => { - (h.item.boundingSphere = e.boundingSphere), - (h.TileMatrixLimits = e.TileMatrixLimits), - h.initThisProvider(); - } - ), - 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), - (a = { - 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(a), - this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), - this - ); - }), - (E.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(0.165, 0.165, 0.165, 0.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)); - (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 = f.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, - })); - (n = this._viewer.scene.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); - })), - n.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: c, - treeData: { - name: e, - geoOptions: t, - styleOption: c, - GroupID: i, - checked: o, - disFnc: r, - }, - }); - return ( - (this._Provider.treeID = c.id), - this.setTreeobj(n), - this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), - "function" == typeof r && r(this.item), - this - ); - }), - (E.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)); - (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, - })); - (n = this._viewer.scene.primitives), - 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); - })), - n.add(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), - (n = { - 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 - ); - }), - (E.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.width, - r.height && r.height, - r.image && r.image, - (this._urlTemplate = - t.url + "?" + this._core._serialize(s.urlParams)), - t.url + "?" + this._core._serialize(s.urlParams)); - (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, - })); - (s = this._viewer.scene.primitives), - 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); - })), - s.add(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), - (s = { - 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(s), - this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), - "function" == typeof a && a(this.item), - this - ); - }), - (E.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 = - '<div id="' + - e.id + - '" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url(' + - window.SmartEarthRootUrl + - I.divpoint1 + - ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">' + - p.optiontext[i] + - "</div>\n </div>"), - $(".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 - ); - }), - (E.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 y(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 = - '<div id="' + - e.id + - '" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url(' + - window.SmartEarthRootUrl + - I.divpoint1 + - ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">' + - u.optiontext[i] + - "</div>\n </div>"), - $(".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 - ); - }), - (E.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)); - (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.primitives.add(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); - n = { - 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 - ); - }), - (E.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)); - (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( - 0.165, - 0.165, - 0.165, - 0.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.primitives.add(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); - n = { - 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 - ); - }), - (E.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (E.prototype.getLegend = function () { - var e = []; - return (e = null != this.Legend ? this._core.unique(this.Legend) : e); - }), - (E.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) {} - }), - (E.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, - }; - }), - (E.prototype.setRefresh = function (e) { - try { - this._Provider && this._Provider.setStatus(!e); - } catch (e) {} - }), - (E.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); - }), - (E.prototype.edit = function (e, t) { - return ( - (this.isEditting = e), - (this.editoption = t), - this._Provider && this._Provider.edit && this._Provider.edit(e, t) - ); - }), - (E.prototype.forceRefresh = function () { - try { - (this._cache = !0), - this._forceRefreshPrvimitive || - (this._forceRefreshPrvimitive = f.cloneDeep(this._primitive)); - var e = f.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(E.prototype, { - labelText: { - set: f.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( - 0.165, - 0.165, - 0.165, - 0.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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( - 0.165, - 0.165, - 0.165, - 0.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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 Ai = - "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 Li(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 Mi(e, t, i) { - (this._viewer = e), - (this._cesium = t), - (this._tree = i), - (this._core = new v()); - } - function Ri(e, t) { - (this._viewer = e), - (this._cesium = t), - (this.item = { show: !0 }), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (this._flyTo = new Mi(this._viewer, this._cesium, this._tree)), - (this._Provider = void 0), - (this.Legend = []), - (this.model = []), - (this._cache = !1), - (this._forceRefreshPrvimitive = null), - (this._forceRefreshProvider = null); - } - function P(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (this._createGroup = new vi()), - (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 Oi(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (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); - } - (S.prototype._serialize = function (e) { - var t, - i = [], - o = window.encodeURIComponent; - for (t in e) { - var r = e[t]; - "object" === (void 0 === r ? "undefined" : Ai(r)) - ? i.push(o(t) + "=" + o(JSON.stringify(r))) - : i.push(o(t) + "=" + o(e[t])); - } - return i.join("&"); - }), - (S.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: 0.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) && - ((f = { name: g.color[0].name, value: { ">": {}, "<": {} } }), - g.color.forEach((e) => { - var t; - e.value.indexOf && -1 < e.value.indexOf(">") - ? ((t = e.value.split(">")), - (f.value[">"][t[1]] = Cesium.Color.fromCssColorString( - e.color - ).withAlpha(g.alpha))) - : e.value.indexOf && -1 < e.value.indexOf("<") - ? ((t = e.value.split("<")), - (f.value["<"][t[1]] = Cesium.Color.fromCssColorString( - e.color - ).withAlpha(g.alpha))) - : (f.value[e.value] = Cesium.Color.fromCssColorString( - e.color - ).withAlpha(g.alpha)); - })), - Cesium.Color.fromCssColorString(g.defaultColor).withAlpha(g.alpha)); - var l = this, - C = { - 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)); - (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 (f && t[f.name]) { - var a = t[f.name]; - if (f.value[a]) r = f.value[a]; - else { - for (var s in f.value[">"]) - if (a > s) { - r = f.value[">"][s]; - break; - } - if (!r) - for (var l in f.value["<"]) - if (a < l) { - r = f.value["<"][l]; - break; - } - } - } - r = r || _.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 Cesium.Primitive({ - geometryInstances: n, - appearance: new Cesium.EllipsoidSurfaceAppearance({ - material: c, - }), - shadows: g.shadows, - }); - h.add(e), - g.showLabel && - ((n = p._core.toDegrees(u)), - (C.text = g.value ? g.value(i, t) : i + ""), - (C.position = Cesium.Cartesian3.fromDegrees( - n.lon, - n.lat, - 1.1 * o - )), - C.useColorConfig && (C.fillColor = r), - d.add(C)); - }), - m.length && - ((e = new Cesium.GroundPrimitive({ - geometryInstances: m, - appearance: new Cesium.PerInstanceColorAppearance({ - translucent: g.alpha < 1, - }), - classificationType: 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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 5, - })); - this._viewer.scene.primitives.add(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); - a = { - 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 = a.id), - this.setTreeobj(a), - this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), - "function" == typeof n && n(this.item), - this - ); - }), - (S.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: 0.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)); - (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 Cesium.PerInstanceColorAppearance({ - translucent: c.alpha < 1, - }), - classificationType: 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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 5, - })); - this._viewer.scene.primitives.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); - a = { - 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 - ); - }), - (S.prototype.createVector3DTilesFeatureLayer = function (e, t, a, i, o, r) { - var n = { - 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(n, a, !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); - (this._Provider = new T(this._viewer, this._cesium, u.tilingScheme)), - (this._Provider._normalTile = a.level_max - 1), - (this._Provider._minimumHeight = 0), - (this._Provider.loadTile = function (i, e) { - var o = i, - r = e, - n = c; - if (r.state === Cesium.QuadtreeTileLoadState.START) { - if ( - ((r.data = { lines: [], geometryPrimitive: void 0 }), - !(r.level >= a.level_min && r.level < a.level_max && n.item.show)) - ) - return void ((r.state = Cesium.QuadtreeTileLoadState.DONE), - (r.renderable = !0)); - { - i = h - .replace("{x}", r.x - s) - .replace("{y}", r.y - l) - .replace("{z}", r.level); - n._cache && (i += "&" + n._core.getuid()); - let e = new Cesium.Cesium3DTileset({ url: i, ...u }), - t = e.readyPromise.then(function (e) { - n.probj.push(e), - (r.data.geometryPrimitive = e), - n._viewer.scene.primitives.add(e), - (r.state = Cesium.QuadtreeTileLoadState.LOADING), - r.state === Cesium.QuadtreeTileLoadState.LOADING && - (r.data.geometryPrimitive.update(o, []), - (r.state = Cesium.QuadtreeTileLoadState.DONE), - (r.renderable = !0)); - }); - t.catch && - t.catch(function (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); - }), - t.otherwise && - t.otherwise(function (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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 5, - })); - this._viewer.scene.primitives.add(this._primitive), - o || this.setVisibility(!1), - this._core.isnull(u.id) && (u.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + u.id); - n = { - id: u.id, - name: e, - checked: !0, - pId: this._core.isnull(i) ? 0 : i, - type: "modelLayer", - item: this, - url: t.url, - style: a, - }; - return ( - (this._Provider.treeID = n.id), - this.setTreeobj(n), - this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), - "function" == typeof r && r(this.item), - this - ); - }), - (S.prototype.createVector3DTilesFeatureLayerRelease = function ( - e, - t, - a, - i, - o, - r - ) { - var n = { - 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(n, a, !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); - (this._Provider = new T(this._viewer, this._cesium, u.tilingScheme)), - (this._Provider._normalTile = a.level_max - 1), - (this._Provider._minimumHeight = 0), - (this._Provider.loadTile = function (i, e) { - var o = i, - r = e, - n = c; - if (r.state === Cesium.QuadtreeTileLoadState.START) { - if ( - ((r.data = { lines: [], geometryPrimitive: void 0 }), - !(r.level >= a.level_min && r.level < a.level_max && n.item.show)) - ) - return void ((r.state = Cesium.QuadtreeTileLoadState.DONE), - (r.renderable = !0)); - { - i = h - .replace("{x}", r.x - s) - .replace("{y}", r.y - l) - .replace("{z}", 18); - n._cache && (i += "&" + n._core.getuid()); - let e = new Cesium.Cesium3DTileset({ url: i, ...u }), - t = e.readyPromise.then(function (e) { - function t(e) { - Cesium.defined(e) && e.freeResources(); - } - (r.freeResources = function () { - (r.state = 0), - (r.renderable = !1), - (r.upsampledFromParent = !1), - Cesium.defined(r.data) && - Cesium.defined(r.data.freeResources) && - r.data.freeResources(), - Cesium.defined(this.data) && - Cesium.defined(this.data.geometryPrimitive) && - 18 <= r._level && - (this.data.geometryPrimitive.destroy(), - (this.data.geometryPrimitive = void 0)), - t(r._southwestChild), - (r._southwestChild = void 0), - t(r._southeastChild), - (r._southeastChild = void 0), - t(r._northwestChild), - (r._northwestChild = void 0), - t(r._northeastChild), - (r._northeastChild = void 0); - }), - n.probj.push(e), - n._viewer.scene.primitives.add(e), - (r.state = Cesium.QuadtreeTileLoadState.LOADING), - r.state === Cesium.QuadtreeTileLoadState.LOADING && - (r.data.geometryPrimitive.update(o, []), - (r.state = Cesium.QuadtreeTileLoadState.DONE), - (r.renderable = !0)); - }); - t.catch && - t.catch(function (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); - }), - t.otherwise && - t.otherwise(function (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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 5, - })); - this._viewer.scene.primitives.add(this._primitive), - o || this.setVisibility(!1), - this._core.isnull(u.id) && (u.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + u.id); - n = { - id: u.id, - name: e, - checked: !0, - pId: this._core.isnull(i) ? 0 : i, - type: "modelLayer", - item: this, - url: t.url, - style: a, - }; - return ( - (this._Provider.treeID = n.id), - this.setTreeobj(n), - this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), - "function" == typeof r && r(this.item), - this - ); - }), - (S.prototype.VectorGeoJsonFeatureLayer = function (e, t, g, i, o, r) { - var n = this._core.VectorSlice(t, this._cesium), - n = new y(this._viewer, this._cesium, n), - f = 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 = f._core.StyleContrast( - "lable", - g.lable, - Cesium - )).fillColor = f._color.VectorColorTransformation( - t.fillColor, - e - )), - (t.outlineColor = f._color.VectorColorTransformation( - t.outlineColor, - e - )), - (t.backgroundColor = f._color.VectorColorTransformation( - t.backgroundColor, - e - )), - (t.text = f._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 = f._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 = f._core.StyleContrast("point", s, Cesium)).position = - new Cesium.Cartesian3.fromDegrees( - e.geometry.coordinates[0], - e.geometry.coordinates[1], - o - )), - (r.color = f._color.VectorColorTransformation(r.color, e)), - (r.outlineColor = f._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]))), - f._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 = f._core.coordinate( - (i = []), - e.geometry.coordinates[n] - )), - (r.positions = Cesium.Cartesian3.fromDegreesArray(i)); - var a = f._core.createPolyline(r, p, e, Cesium); - m.push(a); - } - else { - (i = f._core.coordinate(i, e.geometry.coordinates)), - (r.positions = Cesium.Cartesian3.fromDegreesArray(i)); - a = f._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 = f._core.StyleContrast( - "polygon", - s, - Cesium - )).material = f._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 = f._core.coordinate( - i, - e.geometry.coordinates[n] - )), - (r.polygonHierarchy = new Cesium.PolygonHierarchy( - Cesium.Cartesian3.fromDegreesArray(i) - )); - a = f._core.createPolygon(r, p, e, Cesium); - d.push(a); - } - else { - (i = f._core.coordinate(i, e.geometry.coordinates)), - (r.polygonHierarchy = new Cesium.PolygonHierarchy( - Cesium.Cartesian3.fromDegreesArray(i) - )); - a = f._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: - f._core.Shaders("vertexShaderSource"), - fragmentShaderSource: f._core.Shaders( - "fragmentShaderSource" - ), - }), - }) - ) - : t.add( - new Cesium.Primitive({ - geometryInstances: d, - appearance: new Cesium.PerInstanceColorAppearance({ - translucent: !0, - vertexShaderSource: - f._core.Shaders("vertexShaderSource"), - fragmentShaderSource: f._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 - ); - }), - (S.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)); - (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 = Cesium.Cartesian3.fromDegreesArray(n)), - (m.polygonHierarchy = new Cesium.PolygonHierarchy(e)), - (e = new Cesium.PolygonGeometry(m)), - (e = new Cesium.GeometryInstance({ - id: a, - geometry: e, - attributes: { - color: - new 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 Cesium.Primitive({ - geometryInstances: i, - appearance: new 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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - a = { - 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(a), - this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), - "function" == typeof n && n(this.item), - this - ); - }), - (S.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; - (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 = f.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 Cesium.Primitive({ - geometryInstances: o[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.state = 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 = Ii(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 = Cesium.Cartesian3.fromDegreesArray(s)), - (m.polygonHierarchy = - new Cesium.PolygonHierarchy(e)), - (e = new Cesium.PolygonGeometry(m)), - (e = new Cesium.GeometryInstance({ - id: l, - geometry: e, - attributes: { - color: - new 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 Cesium.Primitive({ - geometryInstances: i, - appearance: new 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 = Cesium.QuadtreeTileLoadState.LOADING), - t.state === Cesium.QuadtreeTileLoadState.LOADING && - (t.data.geometryPrimitive && - (t.state = Cesium.QuadtreeTileLoadState.DONE), - (t.renderable = !0)); - } - }), - (this._primitive = new Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - n = { - 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(n), - this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), - "function" == typeof r && r(this.item); - }), - (S.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; - (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 = f.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 Cesium.Primitive({ - geometryInstances: o[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.state = 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 < - f.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 = Cesium.Color.WHITE; - 2 <= n.length && - ((e = Cesium.Cartesian3.fromDegreesArray(n)), - (m.polygonHierarchy = new Cesium.PolygonHierarchy(e)), - (e = new Cesium.PolygonGeometry(m)), - (e = new Cesium.GeometryInstance({ - id: a, - geometry: e, - attributes: { - color: - new 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 Cesium.Primitive({ - geometryInstances: i, - appearance: new 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 = f.remove(s, 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.state = Cesium.QuadtreeTileLoadState.DONE), - (c.renderable = !0)); - }, - }))); - } else - (t.state = Cesium.QuadtreeTileLoadState.LOADING), - t.state === Cesium.QuadtreeTileLoadState.LOADING && - (t.data.geometryPrimitive && - (t.state = Cesium.QuadtreeTileLoadState.DONE), - (t.renderable = !0)); - } - var c, n, h; - }), - (this._primitive = new Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - n = { - 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 - ); - }), - (S.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 Pi( - 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 Cesium.PrimitiveCollection(), - l = new Cesium.PointPrimitiveCollection(), - u = new Cesium.LabelCollection(), - c = new Cesium.BillboardCollection(), - i = - (e.templateValues.z, - e.templateValues.x, - e.templateValues.reverseY, - (e.data = { lines: [], geometryPrimitive: void 0 }), - e.url.replace("png", "json")); - 0 < - f.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, - 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 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, - Cesium - )).position = new 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, - Cesium - )).position = new 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 - ); - }), - (S.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 Pi( - 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 < - f.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 Cesium.Primitive({ - geometryInstances: i, - appearance: new 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, 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 = - Cesium.Cartesian3.fromDegreesArray(o)), - (e = new Cesium.GeometryInstance({ - id: r, - geometry: new Cesium.PolylineGeometry(t), - attributes: { - color: - new 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 - ); - }), - (S.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 Pi( - 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 < - f.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 Cesium.Primitive({ - geometryInstances: t, - appearance: new 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 = Cesium.Cartesian3.fromDegreesArray(o)), - (u.polygonHierarchy = new Cesium.PolygonHierarchy( - e - )), - (e = new Cesium.PolygonGeometry(u)), - (e = new Cesium.GeometryInstance({ - id: r, - geometry: e, - attributes: { - color: - new 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 - ); - }), - (S.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; - (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 = f.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 Cesium.Primitive({ - geometryInstances: o[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.state = 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 - ? Cesium.Cartesian3.fromDegreesArrayHeights(n) - : 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 Cesium.PolygonHierarchy(e)), - new Cesium.PolygonGeometry(d)), - e = - ((s.treeID = d.id), - (s.VectorType = "polygon"), - (s.VectorStyle = { - haveZ: a, - extrudedHeight: d.extrudedHeight, - positions: n, - material: d.material, - }), - new Cesium.GeometryInstance({ - id: s, - geometry: t, - attributes: { - color: - new 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 Cesium.ClassificationPrimitive({ - geometryInstances: i, - appearance: new Cesium.PerInstanceColorAppearance({ - translucent: !1, - vertexShaderSource: - p._core.Shaders("vertexShaderSource"), - fragmentShaderSource: p._core.Shaders( - "fragmentShaderSource" - ), - }), - classificationType: d.classificationType, - shadows: 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 = f.remove(s, function (e) { - return e.x == h.x && e.y == h.y && e.level == h.level; - }); - }, - complete: function (e, t) { - (h.state = Cesium.QuadtreeTileLoadState.LOADING), - h.state === Cesium.QuadtreeTileLoadState.LOADING && - (h.data.geometryPrimitive && - (h.state = Cesium.QuadtreeTileLoadState.DONE), - (h.renderable = !0)); - }, - })); - } else - (t.state = Cesium.QuadtreeTileLoadState.LOADING), - t.state === Cesium.QuadtreeTileLoadState.LOADING && - (t.data.geometryPrimitive && - (t.state = Cesium.QuadtreeTileLoadState.DONE), - (t.renderable = !0)); - } - var h; - }), - (this._primitive = new Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - (n = this._viewer.scene.primitives), - m && - m.time && - ((this._Provider._availability = new Cesium.TimeIntervalCollection([ - new Cesium.TimeInterval({ - start: m.time.start - ? Cesium.JulianDate.fromDate(new Date(m.time.start)) - : Cesium.Iso8601.MINIMUM_VALUE, - stop: m.time.end - ? Cesium.JulianDate.fromDate(new Date(m.time.end)) - : 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), - 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), - (a = { - 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 - ); - }), - (S.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)); - (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 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 = Cesium.Cartesian3.fromDegreesArray(n)), - (h.polygonHierarchy = new Cesium.PolygonHierarchy(e)), - (e = new Cesium.PolygonGeometry(h)), - (e = new Cesium.GeometryInstance({ - id: a, - geometry: e, - attributes: { - color: - new Cesium.ColorGeometryInstanceAttribute.fromColor( - h.material - ), - }, - })), - (e = new Cesium.ClassificationPrimitive({ - geometryInstances: e, - appearance: new 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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - 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); - a = { - 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(a), - this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), - "function" == typeof n && n(this.item), - this - ); - }), - (S.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)); - (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 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 = Cesium.Cartesian3.fromDegreesArray(n)), - (m.polygonHierarchy = new Cesium.PolygonHierarchy(e)), - (e = new Cesium.PolygonGeometry(m)), - (e = new Cesium.GeometryInstance({ - id: a, - geometry: e, - attributes: { - color: - new 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 Cesium.ClassificationPrimitive1({ - geometryInstances: t, - appearance: new 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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - a = { - 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(a), - this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), - "function" == typeof n && n(this.item), - this - ); - }), - (S.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; - (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 = f.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 Cesium.Primitive({ - geometryInstances: o[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.state = 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 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 = Cesium.Cartesian3.fromDegreesArray(n)), - (m.polygonHierarchy = new Cesium.PolygonHierarchy( - e - )), - (e = new Cesium.PolygonGeometry(m)), - (e = new Cesium.GeometryInstance({ - id: a, - geometry: e, - attributes: { - color: - new Cesium.ColorGeometryInstanceAttribute.fromColor( - m.material - ), - }, - })), - (e = new Cesium.ClassificationPrimitive({ - geometryInstances: e, - appearance: new 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 = f.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.state = Cesium.QuadtreeTileLoadState.DONE), - (c.renderable = !0)); - }, - })); - } else - (t.state = Cesium.QuadtreeTileLoadState.LOADING), - t.state === Cesium.QuadtreeTileLoadState.LOADING && - (t.data.geometryPrimitive && - (t.state = Cesium.QuadtreeTileLoadState.DONE), - (t.renderable = !0)); - } - var c, h; - }), - (this._primitive = new Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - a = { - 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(a), - this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), - "function" == typeof r && r(this.item), - this - ); - }), - (S.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; - (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 = f.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 Cesium.Primitive({ - geometryInstances: o[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.state = 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 = Ii(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 = - Cesium.Cartesian3.fromDegreesArray(s)), - (m.polygonHierarchy = - new Cesium.PolygonHierarchy(e)), - (e = new Cesium.PolygonGeometry(m)), - (e = new Cesium.GeometryInstance({ - id: l, - geometry: e, - attributes: { - color: - new 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 Cesium.GroundPrimitive({ - geometryInstances: i, - appearance: - new 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 = Cesium.QuadtreeTileLoadState.LOADING), - t.state === Cesium.QuadtreeTileLoadState.LOADING && - (t.data.geometryPrimitive && - (t.state = Cesium.QuadtreeTileLoadState.DONE), - (t.renderable = !0)); - } - }), - (this._primitive = new Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - n = { - 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(n), - this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), - "function" == typeof r && r(this.item), - this - ); - }), - (S.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)); - (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 = Cesium.Cartesian3.fromDegreesArray(n)), - (m.polygonHierarchy = new Cesium.PolygonHierarchy(e)), - (e = new Cesium.PolygonGeometry(m)), - (e = new Cesium.GeometryInstance({ - id: a, - geometry: e, - attributes: { - color: - new 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 Cesium.GroundPrimitive1({ - geometryInstances: i, - appearance: new 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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - a = { - 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(a), - this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), - "function" == typeof n && n(this.item), - this - ); - }), - (S.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)); - (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 = Cesium.Cartesian3.fromDegreesArray(a)), - (d.polygonHierarchy = new Cesium.PolygonHierarchy(e)), - (0 != d.extrudedHeight && - "0" != d.extrudedHeight && - null != d.extrudedHeight && - null != d.extrudedHeight) || - (d.extrudedHeight = 1e4), - (e = new Cesium.PolygonGeometry(d)), - (t = i[Math.floor(Math.random() * i.length)]), - (e = new Cesium.GeometryInstance({ - id: s, - geometry: e, - attributes: { - color: - Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromCssColorString(t).withAlpha( - 0.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 Cesium.ClassificationPrimitive1({ - geometryInstances: o, - classificationType: 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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - a = { - 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(a), - this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), - "function" == typeof n && n(this.item), - this - ); - }), - (S.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: Cesium.LabelStyle.OUTLINE, - fillColor: Cesium.Color.WHITE, - outlineColor: Cesium.Color.BLACK, - outlineWidth: 1, - show: !0, - showBackground: !1, - backgroundColor: new Cesium.Color(0.165, 0.165, 0.165, 0.8), - backgroundPadding: new Cesium.Cartesian2(7, 5), - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.CENTER, - eyeOffset: Cesium.Cartesian3.ZERO, - pixelOffset: Cesium.Cartesian2.ZERO, - heightReference: Cesium.HeightReference.NONE, - scaleByDistance: new 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 Cesium.DistanceDisplayCondition(n, 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 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 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, - })); - (c = this._viewer.scene.primitives), - a && - a.time && - ((this._Provider._availability = new Cesium.TimeIntervalCollection([ - new Cesium.TimeInterval({ - start: a.time.start - ? Cesium.JulianDate.fromDate(new Date(a.time.start)) - : Cesium.Iso8601.MINIMUM_VALUE, - stop: a.time.end - ? Cesium.JulianDate.fromDate(new Date(a.time.end)) - : 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), - 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), - (n = { - 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 - ); - }), - (S.prototype.VolumeVectorGeoJsonFeatureLayerOptimization = function ( - e, - t, - d, - i, - o, - r - ) { - var n, - 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: 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, - }, - p = - (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._option = this._core.extend({ ...a }, d, !0)), - null == t && console.log("geoOptions is required"), - null == e && console.log("layername is required"), - { - id: this._option.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, - }), - l = this; - let u = -1 < t.url.indexOf("/gisserver/"); - (n = u - ? t.url + - `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent( - "{x}" - )}/${window.encodeURIComponent("{y}")}.json` - : t.url + "?" + this._serialize(s.urlParams)), - (this._urlTemplate = n), - (this._Provider = new T( - this._viewer, - this._cesium, - u ? new Cesium.WebMercatorTilingScheme() : void 0 - )), - (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 = l; - 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 ( - (u && - (h.reverseY = - m._Provider.tilingScheme.getNumberOfYTilesAtLevel( - h.level - ) - - h.y - - 1), - 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 = n - .replace(window.encodeURIComponent("{x}"), h.x) - .replace(window.encodeURIComponent("{y}"), h.reverseY || 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(/\]/, "")), - (p.extrudedHeight = parseFloat(l.properties[e]))) - : m._option.extrudedHeight && - (p.extrudedHeight = parseFloat( - m._option.extrudedHeight - )), - /^\[/.test(m._option.height) && - /\]$/.test(m._option.height) - ? ((e = m._option.height - .replace(/\[/, "") - .replace(/\]/, "")), - (p.height = parseFloat(l.properties[e]))) - : m._option.height && - (p.height = parseFloat(m._option.height)), - (p.material = m._option.material), - /^\[/.test(m._option.material) && - /\]$/.test(m._option.material) - ? ((e = m._option.material - .replace(/\[/, "") - .replace(/\]/, "")), - (p.material = l.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.red && - (p.material.red = p.material.red / 255), - 1 < p.material.green && - (p.material.green = p.material.green / 255), - 1 < p.material.blue && - (p.material.blue = p.material.blue / 255), - 1 < p.material.alpha && - (p.material.a = p.material.alpha / 255), - (p.material = m._color.createColor( - p.material.red, - p.material.green, - p.material.blue, - p.material.alpha - )))) - : (m._option.material && - (p.material = m._option.material), - p.material && - (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.red && - (p.material.red = p.material.red / 255), - 1 < p.material.green && - (p.material.green = - p.material.green / 255), - 1 < p.material.blue && - (p.material.blue = p.material.blue / 255), - 1 < p.material.alpha && - (p.material.a = p.material.alpha / 255), - (p.material = m._color.createColor( - p.material.red, - p.material.green, - p.material.blue, - p.material.alpha - ))))), - d.preLoad && d.preLoad(p, l), - 2 <= a.length && - ((e = s - ? Cesium.Cartesian3.fromDegreesArrayHeights(a) - : Cesium.Cartesian3.fromDegreesArray(a)), - (p.polygonHierarchy = new Cesium.PolygonHierarchy( - e - )), - (e = new Cesium.PolygonGeometry(p)), - (l.treeID = p.id), - (l.VectorType = "polygon"), - (l.VectorStyle = { - haveZ: s, - extrudedHeight: p.extrudedHeight, - positions: a, - material: p.material, - }), - (e = new Cesium.GeometryInstance({ - id: l, - geometry: e, - attributes: { - color: - new Cesium.ColorGeometryInstanceAttribute.fromColor( - p.material - ), - distanceDisplayCondition: - new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( - m._option.near, - m._option.far - ), - }, - })), - (t = - "material:" + - 255 * p.material.red + - "," + - 255 * p.material.green + - "," + - 255 * p.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 = - p.material.alpha < 1 - ? new Cesium.PerInstanceColorAppearance({ - translucent: !0, - }) - : new Cesium.PerInstanceColorAppearance({ - translucent: !1, - vertexShaderSource: - m._core.Shaders("vertexShaderSource"), - fragmentShaderSource: m._core.Shaders( - "fragmentShaderSource" - ), - })), - (r = m._option.clampToGround - ? new Cesium.GroundPrimitive({ - geometryInstances: i, - appearance: r, - classificationType: m._option.classificationType, - }) - : new 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); - } - }), - "function" == typeof r && r(this.item); - }); - let c, h; - (this.saveDefaultVectorData = () => { - h = l._core.extend({}, d, !0); - }), - (this.restoreVector = () => { - h && - ((d = h), - (l._option = l._core.extend({ ...a }, d, !0)), - (l._Provider._normalTile = d.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)), - (d = l._core.extend(d, e, !0)), - (l._option = l._core.extend(l._option, d, !0)), - (l._Provider._normalTile = d.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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 5, - })); - (s = this._viewer.scene.primitives), - d && - d.time && - ((this._Provider._availability = new Cesium.TimeIntervalCollection([ - new Cesium.TimeInterval({ - start: d.time.start - ? Cesium.JulianDate.fromDate(new Date(d.time.start)) - : Cesium.Iso8601.MINIMUM_VALUE, - stop: d.time.end - ? Cesium.JulianDate.fromDate(new Date(d.time.end)) - : 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), - this._core.getWMTSData( - { - url: t.url, - layer: t.layer, - srs: t.srs || "EPSG:4490", - gisserverTMS: u, - }, - (e) => { - (l.item.boundingSphere = e.boundingSphere), - (l.TileMatrixLimits = e.TileMatrixLimits), - l.initThisProvider(); - } - ), - 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), - (s = { - id: p.id, - name: e, - checked: !0, - pId: this._core.isnull(i) ? 0 : i, - type: "polygonLayer", - item: this, - url: t.url, - style: d, - treeData: { - name: e, - geoOptions: t, - styleOption: d, - GroupID: i, - checked: o, - disFnc: r, - }, - }); - return ( - (this._Provider.treeID = s.id), - this.setTreeobj(s), - this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), - this - ); - }), - (S.prototype.createModelGeoJsonFeatureLayerProvider0825 = function ( - e, - t, - o, - i, - r, - n - ) { - var a = this, - s = { url: "", color: 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 Cesium.DistanceDisplayCondition(s, c), - h = - ((u.distanceDisplayCondition = s), - o.material, - (this._urlTemplate = t.url + "?" + this._serialize(l.urlParams)), - t.url + "?" + this._serialize(l.urlParams)); - (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 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 = - Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees( - e.geometry.coordinates[0], - e.geometry.coordinates[1], - t - ) - )), - 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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - c = { - 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(c), - this._tree.insertGroupId(c, this._core.isnull(i) ? 0 : i), - "function" == typeof n && n(this.item), - this - ); - }), - (S.prototype.createModelGeoJsonFeatureLayerProvider = function ( - e, - t, - o, - i, - r, - n - ) { - var a, - s = this, - l = { url: "", color: Cesium.Color.DARKSALMON, scale: 2 }, - u = { - 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, - }, - c = - (s._core.isnull(o) || - s._core.isnull(o.color) || - (/^\[/.test(o.color) && - "[" == o.color.toString().charAt(0) && - "]" == o.color.toString().charAt(o.color.length - 1)) || - (s._core.isHtmlColor(o.color) - ? (o.color = s._color.colorFromHtmlColor(o.color)) - : (/^rgb/.test(o.color) && - (o.color = s._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 = s._color.createColor( - o.color.r, - o.color.g, - o.color.b, - o.color.a - )))), - s._core.extend(l, o, !0)), - h = - (s._core.isnull(o.near) && (o.near = 0), - s._core.isnull(o.far) && (o.far = 999999999), - parseFloat(o.near)), - m = parseFloat(o.far), - h = new Cesium.DistanceDisplayCondition(h, m); - (c.distanceDisplayCondition = h), o.material; - let d = -1 < t.url.indexOf("/gisserver/"); - (a = d - ? t.url + - `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent( - "{x}" - )}/${window.encodeURIComponent("{y}")}.json` - : t.url + "?" + this._serialize(u.urlParams)), - (this._urlTemplate = a), - (this._Provider = new T( - this._viewer, - this._cesium, - d ? new Cesium.WebMercatorTilingScheme() : void 0 - )), - (this._Provider._normalTile = o.level_max - 1), - (this._Provider._minimumHeight = parseFloat(c.height) || 0), - (this.initThisProvider = () => { - (this.initThisProvider = void 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 && - s.item.show - )) - ) - return ( - (i.state = Cesium.QuadtreeTileLoadState.DONE), - void (i.renderable = !0) - ); - if ( - (d && - (i.reverseY = - s._Provider.tilingScheme.getNumberOfYTilesAtLevel( - i.level - ) - - i.y - - 1), - s.TileMatrixLimits) - ) { - var e = s.TileMatrixLimits[i.level]; - if ( - !e || - i.x > e.maxCol || - i.x < e.minCol || - i.y > e.maxRow || - i.y < e.minRow - ) - return ( - (i.state = Cesium.QuadtreeTileLoadState.DONE), - void (i.renderable = !0) - ); - } - e = a - .replace(window.encodeURIComponent("{x}"), i.x) - .replace(window.encodeURIComponent("{y}"), i.reverseY || i.y) - .replace(window.encodeURIComponent("{z}"), i.level); - s._cache && (e += "&" + s._core.getuid()), - s._core.xhr({ - url: e, - type: "get", - dataType: "json", - success: function (e) { - if (null == e) - return ( - (i.state = Cesium.QuadtreeTileLoadState.DONE), - void (i.renderable = !0) - ); - let a = [], - s; - Cesium.ModelInstanceCollection || - (s = new Cesium.PrimitiveCollection()), - e.features.forEach(function (e) { - var t = (c.id = e).geometry.coordinates[2] || 0, - i = - (null != e.properties.height && - (t = parseFloat(e.properties.height)), - /^\[/.test(c.height) && /\]$/.test(c.height) - ? ((i = c.height - .replace(/\[/, "") - .replace(/\]/, "")), - (t += parseFloat(e.properties[i]))) - : (t += parseFloat(c.height) || 0), - Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees( - e.geometry.coordinates[0], - e.geometry.coordinates[1], - t - ) - )); - let o = c.heading || 0, - r = c.pitch || 0, - n = c.roll || 0; - /^\[/.test(o) && - /\]$/.test(o) && - ((o = o.replace(/\[/, "").replace(/\]/, "")), - (o = parseFloat(e.properties[o]))), - /^\[/.test(r) && - /\]$/.test(r) && - ((r = r.replace(/\[/, "").replace(/\]/, "")), - (r = parseFloat(e.properties[r]))), - /^\[/.test(n) && - /\]$/.test(n) && - ((n = n.replace(/\[/, "").replace(/\]/, "")), - (n = parseFloat(e.properties[n]))); - (t = new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(o), - Cesium.Math.toRadians(r), - Cesium.Math.toRadians(n) - )), - (t = Cesium.Matrix3.fromHeadingPitchRoll(t)); - Cesium.Matrix4.multiplyByMatrix3(i, t, i), - Cesium.Matrix4.multiplyByUniformScale( - i, - c.scale, - i - ), - s - ? s.add( - Cesium.Model.fromGltf({ - id: e, - url: c.uri, - modelMatrix: i, - color: c.color, - }) - ) - : a.push({ modelMatrix: i, modelId: e }); - }), - (s = - s || - new Cesium.ModelInstanceCollection({ - url: c.uri, - instances: a, - color: c.color, - })), - 0 == e.features.length && - ((i.state = Cesium.QuadtreeTileLoadState.DONE), - (i.renderable = !0)), - (i.data.geometryPrimitive = s), - (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); - } - }), - "function" == typeof n && n(this.item); - }); - let p, g; - (this.saveDefaultVectorData = () => { - g = s._core.extend({}, o, !0); - }), - (this.restoreVector = () => { - g && - ((o = g), - (c = s._core.extend({ ...l }, o, !0)), - (s._Provider._normalTile = o.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 = []))), - (g = void 0); - }), - (this.updataVector = (e = {}) => { - (e.color || e.material) && - (e.color = Cesium.Color.fromCssColorString(e.color || e.material)), - (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 = s._core.extend(o, e, !0)), - (c = s._core.extend(c, o, !0)), - (s._Provider._normalTile = o.level_max - 1), - s._primitive && - s._primitive._tilesToRender && - s._primitive._tilesToRender.length && - (clearTimeout(p), - (p = 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._primitive = new this._cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - (m = this._viewer.scene.primitives), - o && - o.time && - ((this._Provider._availability = new Cesium.TimeIntervalCollection([ - new Cesium.TimeInterval({ - start: o.time.start - ? Cesium.JulianDate.fromDate(new Date(o.time.start)) - : Cesium.Iso8601.MINIMUM_VALUE, - stop: o.time.end - ? Cesium.JulianDate.fromDate(new Date(o.time.end)) - : 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), - this._core.getWMTSData( - { - url: t.url, - layer: t.layer, - srs: t.srs || "EPSG:4490", - gisserverTMS: d, - }, - (e) => { - (s.item.boundingSphere = e.boundingSphere), - (s.TileMatrixLimits = e.TileMatrixLimits), - s.initThisProvider(); - } - ), - 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), - (h = { - id: c.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(h), - this._tree.insertGroupId(h, this._core.isnull(i) ? 0 : i), - this - ); - }), - (S.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; - (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 = f.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 Cesium.Primitive({ - geometryInstances: r[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.state = 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 Cesium.ImageMaterialProperty({ - image: h._canvas, - transparent: !0, - }), - zIndex: a.level, - classificationType: 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 = Cesium.QuadtreeTileLoadState.LOADING), - t.state === Cesium.QuadtreeTileLoadState.LOADING && - (t.data.geometryPrimitive && - (t.state = Cesium.QuadtreeTileLoadState.DONE), - (t.renderable = !0)); - } - var a, s, l; - }), - (this._primitive = new Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - a = { - 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 - ); - }), - (S.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; - (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 = f.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 Cesium.Primitive({ - geometryInstances: r[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.state = 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 Cesium.ImageMaterialProperty({ - image: e, - transparent: !0, - }), - zIndex: a.level, - classificationType: 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 = Cesium.QuadtreeTileLoadState.LOADING), - t.state === Cesium.QuadtreeTileLoadState.LOADING && - (t.data.geometryPrimitive && - (t.state = Cesium.QuadtreeTileLoadState.DONE), - (t.renderable = !0)); - } - var a, s; - }), - (this._primitive = new Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - this._viewer.scene.primitives.add(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); - a = { - 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 - ); - }), - (S.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest = - 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: 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, - }, - 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(a, o, !0)), - null == t && console.log("geoOptions is required"), - null == e && console.log("layername is required"), - { - id: this._option.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, - }), - l = this, - a = -1 < t.url.indexOf("/gisserver/"), - u = a - ? t.url + - `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent( - "{x}" - )}/${window.encodeURIComponent("{y}")}.json` - : t.url + "?" + this._serialize(s.urlParams); - (this._urlTemplate = u), - (this._Provider = new T( - this._viewer, - this._cesium, - a ? new Cesium.WebMercatorTilingScheme() : void 0 - )), - (this._Provider._normalTile = o.level_max - 1), - (this._Provider._minimumHeight = parseFloat(o.height || 0)), - (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 = f.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 - ? Cesium.Cartesian3.fromDegreesArrayHeights(a) - : Cesium.Cartesian3.fromDegreesArray(a)), - (d.polygonHierarchy = new Cesium.PolygonHierarchy( - e - )), - (e = new Cesium.PolygonGeometry(d)), - (l.treeID = d.id), - (l.VectorType = "polygon"), - (l.VectorStyle = { - haveZ: s, - extrudedHeight: d.extrudedHeight, - positions: a, - material: d.material, - }), - (e = new Cesium.GeometryInstance({ - id: l, - geometry: e, - attributes: { - color: - new 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 Cesium.GroundPrimitive({ - geometryInstances: i, - appearance: new Cesium.PerInstanceColorAppearance({ - translucent: !1, - vertexShaderSource: - m._core.Shaders("vertexShaderSource"), - fragmentShaderSource: m._core.Shaders( - "fragmentShaderSource" - ), - }), - classificationType: m._option.classificationType, - 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 Cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 5, - })); - this._viewer.scene.primitives.add(this._primitive), - this._core.getWMTSData( - { - url: t.url, - layer: t.layer, - srs: t.srs || "EPSG:4490", - gisserverTMS: a, - }, - (e) => { - (l.item.boundingSphere = e.boundingSphere), - (l.TileMatrixLimits = e.TileMatrixLimits), - l.initThisProvider(); - } - ), - 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); - s = { - id: d.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._Provider.treeID = s.id), - this.setTreeobj(s), - this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), - "function" == typeof n && n(this.item), - this - ); - }), - (S.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); - } - }); - }), - (S.prototype._drawGeojson = function (o, r, n, e, a, t, i, s, l, u, c, h) { - var m, - d, - p, - g, - f, - _, - C, - y, - v, - w, - b, - T, - E, - S = this; - function P(e) { - if (S._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 = S._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 = Li(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 = Li(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)), Li(o, m, a, r, n, t, !1, !0)) - : "LineString" != e.geometry.type || - (e.properties.isOutline && !d.outline) || - ((i = turf.getCoords(e)), - Li(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 xi( - (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 = []), - S._styleFilter && - (turf.featureEach(e, function (e, t) { - S._styleFilter && - ((d = S._defaultStyle.clone()), - S._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) || - P(e); - }), - g && - g.length && - ((f = m), - (_ = a), - (C = r), - (y = 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), - (E = T.getContext("2d")), - t.map(function (e) { - E.clearRect(0, 0, T.width, T.height), E.beginPath(); - var t = 0; - e.map(function (e) { - e = f.project(e, _); - 0 == t - ? E.moveTo(C + e.x, y + e.y) - : E.lineTo(C + e.x, y + e.y), - t++; - }), - E.closePath(), - (E.fillStyle = "rgba(255,255,255,1)"), - E.fill(), - (v = E.getImageData(0, 0, T.width, T.height).data); - for (var i = 3; i < v.length; i += 4) 0 < v[i] && (b.data[i] = 0); - }), - i.putImageData(b, 0, 0)), - turf.featureEach(e, function (e, t) { - ("LineString" != e.geometry.type && - "MultiLineString" != e.geometry.type) || - P(e); - }), - turf.featureEach(e, function (e, t) { - ("Point" != e.geometry.type && "MultiPoint" != e.geometry.type) || - P(e); - })); - }), - (S.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()); - }), - (S.prototype.getLegend = function () { - var e = []; - return (e = null != this.Legend ? this._core.unique(this.Legend) : e); - }), - (S.prototype.removeObsoletePrimitives1 = function (e) {}), - (S.prototype.removeObsoletePrimitives = function (e) { - for ( - var t = this._viewer.scene.globe._surface._tilesToRender.map(function ( - e - ) { - return e.level; - }), - i = Math.min.apply(Math, Di(t)), - o = Math.max.apply(Math, Di(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))); - }), - (S.prototype.removeObsoleteEntities = function (e) { - for ( - var t = this._viewer.scene.globe._surface._tilesToRender.map(function ( - e - ) { - return e.level; - }), - i = Math.min.apply(Math, Di(t)) - 1, - o = Math.max.apply(Math, Di(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))); - }), - (S.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); - } - }), - (S.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; - }), - (S.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (S.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, - }; - }), - (S.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) {} - }), - (S.prototype.setRefresh = function (e) { - try { - this._Provider && this._Provider.setStatus(e); - } catch (e) {} - }), - (S.prototype.getLevel = function () { - var e, - t = this._viewer.camera; - return t && t.positionCartographic && t.positionCartographic.height - ? ((e = - (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; - }), - (S.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) {} - }), - (S.prototype.edit = function (e, t) { - return ( - (this.isEditting = e), - (this.editoption = t), - this._Provider && this._Provider.edit && this._Provider.edit(e, t) - ); - }), - (S.prototype.isCache = function (e) { - this._cache = e; - }), - (S.prototype.forceRefresh = function () { - try { - for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) - this._Provider.quadtree._levelZeroTiles[e].freeResources(); - } catch (e) {} - }), - (Mi.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 - ), - }); - }), - (Mi.prototype.flyToPointsInterest = function (e, t) { - return this._viewer.camera.flyTo({ - destination: e.destination, - orientation: e.orientation, - duration: e.duration, - complete: t, - }); - }), - (Mi.prototype.flyToPosition = function (e, t, i, o = {}) { - o = { - heading: this._core.defaultValue(o.heading, 0), - pitch: this._core.defaultValue(o.pitch, -90), - roll: this._core.defaultValue(o.roll, 0), - time: this._core.defaultValue(o.time, 3), - }; - Math.abs(e) <= 180 && Math.abs(t) <= 90 - ? this._viewer.camera.flyTo({ - destination: this._cesium.Cartesian3.fromDegrees(e, t, i), - orientation: new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(o.heading), - Cesium.Math.toRadians(o.pitch), - Cesium.Math.toRadians(o.roll) - ), - duration: o.time, - }) - : this._viewer.camera.flyTo({ - destination: { x: e, y: t, z: i }, - orientation: new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(o.heading), - Cesium.Math.toRadians(o.pitch), - Cesium.Math.toRadians(o.roll) - ), - duration: o.time, - }); - }), - (Ri.prototype.createPolylineGeoJsonFeatureLayer = function ( - e, - t, - p, - i, - g, - f - ) { - var o = { - positions: [], - arcType: this._cesium.ArcType.GEODESIC, - clampToGround: !1, - width: 1, - show: !0, - material: this._cesium.Color.WHITE, - height: 30, - }, - _ = - (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), - C = this, - o = - (o.then(function (e) { - for ( - var t, - i = e.entities.values, - o = new C._cesium.PrimitiveCollection(), - r = 0; - r < i.length; - r++ - ) { - var n = i[r], - a = null; - if (_.clampToGround) { - _.positions = n.polyline.positions._value; - var s = { - positions: n.polyline.positions._value, - width: _.width, - }, - s = new C._cesium.GroundPolylineGeometry(s), - a = new C._cesium.GeometryInstance({ - id: n, - geometry: s, - attributes: { - color: - new C._cesium.ColorGeometryInstanceAttribute.fromColor( - _.material - ), - }, - }); - } else { - for ( - var l = [], r = 0; - r < n.polyline.positions._value.length; - r++ - ) { - C._viewer.scene.globe.ellipsoid; - var u = C._cesium.Cartographic.fromCartesian( - n.polyline.positions._value[r] - ), - c = C._cesium.Math.toDegrees(u.longitude), - h = C._cesium.Math.toDegrees(u.latitude), - u = u.height + _.height, - c = new C._cesium.Cartesian3.fromDegrees(c, h, u); - l.push(c); - } - _.positions = l; - var s = new C._cesium.PolylineGeometry(_), - m = C._cesium.PolylineGeometry.createGeometry(s); - a = new C._cesium.GeometryInstance({ - id: n, - geometry: m, - attributes: { - color: - new C._cesium.ColorGeometryInstanceAttribute.fromColor( - _.material - ), - }, - }); - } - n.positions = _.positions; - var m = - "material:" + - 255 * _.material.red + - "," + - 255 * _.material.green + - "," + - 255 * _.material.blue, - d = (C.Legend.push(m), null), - d = _.clampToGround - ? new C._cesium.GroundPolylinePrimitive({ - geometryInstances: a, - appearance: new C._cesium.MaterialAppearance({ - material: new C._cesium.Material({ - fabric: { - type: "Color", - uniforms: { color: _.material }, - }, - }), - faceForward: !0, - flat: !1, - }), - }) - : new C._cesium.Primitive({ - geometryInstances: a, - appearance: new C._cesium.PolylineMaterialAppearance({ - material: new C._cesium.Material({ - fabric: { - type: "Color", - uniforms: { color: _.material }, - }, - }), - }), - shadows: C._cesium.ShadowMode.ENABLED, - }); - o.add(d); - } - p && - p.time && - (t = new C._cesium.TimeIntervalCollection([ - new C._cesium.TimeInterval({ - start: p.time.start - ? C._cesium.JulianDate.fromDate(new Date(p.time.start)) - : C._cesium.Iso8601.MINIMUM_VALUE, - stop: p.time.end - ? C._cesium.JulianDate.fromDate(new Date(p.time.end)) - : C._cesium.Iso8601.MAXIMUM_VALUE, - }), - ])), - (C._viewer.scene.primitives.add(o, t).show = _.show), - (C.item = o), - g || C.setVisibility(!1), - "function" == typeof f && f(C.item); - }), - this._core.isnull(_.id) && (_.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + _.id), - { - id: _.id, - name: e, - checked: g, - pId: this._core.isnull(i) ? 0 : i, - type: "polylineLayer", - item: this, - url: t, - style: _, - }); - return ( - this.setTreeobj(o), - this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), - this - ); - }), - (Ri.prototype.createGroundPolylineGeoJsonFeatureLayer = function ( - e, - t, - p, - i, - g, - f - ) { - var o = { - positions: [], - arcType: this._cesium.ArcType.GEODESIC, - clampToGround: !1, - width: 1, - show: !0, - material: this._cesium.Color.WHITE, - height: 30, - }, - _ = - (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), - C = this, - o = - (o.then(function (e) { - for ( - var t, - i = e.entities.values, - o = new C._cesium.PrimitiveCollection(), - r = 0; - r < i.length; - r++ - ) { - var n = i[r], - a = null; - if (_.clampToGround) { - _.positions = n.polyline.positions._value; - var s = { - positions: n.polyline.positions._value, - width: _.width, - }, - s = new C._cesium.GroundPolylineGeometry(s), - a = new C._cesium.GeometryInstance({ - id: n, - geometry: s, - attributes: { - color: - new C._cesium.ColorGeometryInstanceAttribute.fromColor( - _.material - ), - }, - }); - } else { - for ( - var l = [], r = 0; - r < n.polyline.positions._value.length; - r++ - ) { - C._viewer.scene.globe.ellipsoid; - var u = C._cesium.Cartographic.fromCartesian( - n.polyline.positions._value[r] - ), - c = C._cesium.Math.toDegrees(u.longitude), - h = C._cesium.Math.toDegrees(u.latitude), - u = u.height + _.height, - c = new C._cesium.Cartesian3.fromDegrees(c, h, u); - l.push(c); - } - _.positions = l; - var s = new C._cesium.PolylineGeometry(_), - m = C._cesium.PolylineGeometry.createGeometry(s); - a = new C._cesium.GeometryInstance({ - id: n, - geometry: m, - attributes: { - color: - new C._cesium.ColorGeometryInstanceAttribute.fromColor( - _.material - ), - }, - }); - } - n.positions = _.positions; - var m = - "material:" + - 255 * _.material.red + - "," + - 255 * _.material.green + - "," + - 255 * _.material.blue, - d = (C.Legend.push(m), null), - d = _.clampToGround - ? new C._cesium.GroundPolylinePrimitive({ - geometryInstances: a, - appearance: new C._cesium.MaterialAppearance({ - material: new C._cesium.Material({ - fabric: { - type: "Color", - uniforms: { color: _.material }, - }, - }), - faceForward: !0, - flat: !1, - }), - }) - : new C._cesium.Primitive({ - geometryInstances: a, - appearance: new C._cesium.PolylineMaterialAppearance({ - material: new C._cesium.Material({ - fabric: { - type: "Color", - uniforms: { color: _.material }, - }, - }), - }), - shadows: C._cesium.ShadowMode.ENABLED, - }); - o.add(d); - } - p && - p.time && - (t = new C._cesium.TimeIntervalCollection([ - new C._cesium.TimeInterval({ - start: p.time.start - ? C._cesium.JulianDate.fromDate(new Date(p.time.start)) - : C._cesium.Iso8601.MINIMUM_VALUE, - stop: p.time.end - ? C._cesium.JulianDate.fromDate(new Date(p.time.end)) - : C._cesium.Iso8601.MAXIMUM_VALUE, - }), - ])), - (C._viewer.scene.primitives.add(o, t).show = _.show), - (C.item = o), - g || C.setVisibility(!1), - "function" == typeof f && f(C.item); - }), - this._core.isnull(_.id) && (_.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + _.id), - { - id: _.id, - name: e, - checked: g, - pId: this._core.isnull(i) ? 0 : i, - type: "polylineLayer", - item: this, - url: t, - style: _, - }); - return ( - this.setTreeobj(o), - this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), - this - ); - }), - (Ri.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 y(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 - ); - }), - (Ri.prototype.createPolylineVectorGeoJsonFeatureLayerProvider = function ( - e, - t, - d, - i, - o, - r - ) { - var n, - a = { - 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, - }, - s = { - url: t.url, - urlParams: { - REQUEST: "GetTile", - SERVICE: "WMTS", - VERSION: "1.0.0", - LAYER: t.layer, - STYLE: "", - TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4326") + ":{z}", - TILEMATRIXSET: this._core.defaultValue(t.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({ ...a }, d, !0)), - l = this; - let u = -1 < t.url.indexOf("/gisserver/"); - (n = u - ? t.url + - `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent( - "{x}" - )}/${window.encodeURIComponent("{y}")}.json` - : t.url + "?" + this._core._serialize(s.urlParams)), - (this._urlTemplate = n), - (this._Provider = new T( - this._viewer, - this._cesium, - u ? new Cesium.WebMercatorTilingScheme() : void 0 - )), - (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 = l; - 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 ( - (u && - (h.reverseY = - m._Provider.tilingScheme.getNumberOfYTilesAtLevel( - h.level - ) - - h.y - - 1), - 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 = n - .replace(window.encodeURIComponent("{x}"), h.x) - .replace(window.encodeURIComponent("{y}"), h.reverseY || 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), - d.preLoad && d.preLoad(p, o), - (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.PolylineMaterialAppearance({ - 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, - classificationType: p.classificationType, - }) - : 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); - } - }), - "function" == typeof r && r(this.item); - }); - let c, h; - (this.saveDefaultVectorData = () => { - h = l._core.extend({}, d, !0); - }), - (this.restoreVector = () => { - h && - ((d = h), - (p = l._core.extend({ ...a }, d, !0)), - (l._Provider._normalTile = d.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.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 = l._core.extend(d, e, !0)), - (p = l._core.extend(p, d, !0)), - (l._Provider._normalTile = d.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._forceRefreshProvider = this._Provider), - (this._primitive = new l._cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 5, - })); - this._viewer.scene.primitives.add(this._primitive), - this._core.getWMTSData( - { - url: t.url, - layer: t.layer, - srs: t.srs || "EPSG:4326", - gisserverTMS: u, - }, - (e) => { - (l.item.boundingSphere = e.boundingSphere), - (l.TileMatrixLimits = e.TileMatrixLimits), - l.initThisProvider(); - } - ), - d && - d.time && - (geoJSONVectorTileProvider.availability = - new l._cesium.TimeIntervalCollection([ - new l._cesium.TimeInterval({ - start: d.time.start - ? l._cesium.JulianDate.fromDate(new Date(d.time.start)) - : l._cesium.Iso8601.MINIMUM_VALUE, - stop: d.time.end - ? l._cesium.JulianDate.fromDate(new Date(d.time.end)) - : l._cesium.Iso8601.MAXIMUM_VALUE, - }), - ])), - 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); - s = { - 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._Provider.treeID = p.id), - this.setTreeobj(s), - this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), - this - ); - }), - (Ri.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 y(this._viewer, this._cesium, a), - a = - (((this._Provider = n)._loadTile = function (e, t) { - var s = new h._cesium.PrimitiveCollection(), - l = []; - if ( - (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) - ) { - let t; - Cesium.ModelInstanceCollection - ? (t = 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, - })) - : ((t = new Cesium.PrimitiveCollection()), - l.forEach((e) => { - t.add({ - id: e.modelId, - url: c.url, - modelMatrix: e.modelMatrix, - color: c.color, - lightColor: c.lightColor, - scale: parseInt(c.scale), - heightReference: parseInt(c.heightReference), - distanceDisplayCondition: c.distanceDisplayCondition, - }); - })), - s.add(t); - } - return 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 - ); - }), - (Ri.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)); - (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); - } - if (l.length) { - let t; - Cesium.ModelInstanceCollection - ? (t = 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, - })) - : ((t = new Cesium.PrimitiveCollection()), - l.forEach((e) => { - t.add({ - id: e.modelId, - url: p.url, - modelMatrix: e.modelMatrix, - color: p.color, - lightColor: p.lightColor, - scale: parseInt(p.scale), - heightReference: parseInt(p.heightReference), - distanceDisplayCondition: - p.distanceDisplayCondition, - }); - })), - a.add(t); - } - 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.primitives.add(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); - n = { - 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(n), - this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), - "function" == typeof r && r(this.item), - this - ); - }), - (Ri.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, - f = 0; - f < d; - f++ - ) { - var _ = s.Transforms.eastNorthUpToFixedFrame( - s.Cartesian3.fromDegrees( - h + (f + 1) * p, - m + (f + 1) * g, - parseInt(n.height) - ) - ); - Cesium.Matrix4.multiplyByUniformScale(_, parseInt(n.scale), _), - a && a({ modelMatrix: _, modelId: n }); - } - }), - (Ri.prototype.getType = function () { - return { label: "绾�", value: "polylineLayer" }; - }), - (Ri.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 }, - }; - }), - (Ri.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) {} - }), - (Ri.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Ri.prototype.getLegend = function () { - var e = []; - return (e = null != this.Legend ? this._core.unique(this.Legend) : e); - }), - (Ri.prototype.setRefresh = function (e) { - try { - this._Provider && this._Provider.setStatus(!e); - } catch (e) {} - }), - (Ri.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; - }), - (Ri.prototype.edit = function (e, t) { - return ( - (this.editoption = t), - (this.isEditting = e), - this._Provider && this._Provider.edit && this._Provider.edit(e, t) - ); - }), - (Ri.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.exectPointModel = function (e, t, f, i, _, C) { - var o = { - positions: [], - arcType: this._cesium.ArcType.GEODESIC, - clampToGround: !1, - width: 1, - show: !0, - material: this._cesium.Color.WHITE, - height: 30, - }, - y = - (this._core.isnull(f) || - this._core.isnull(f.material) || - ("[" == f.material.toString().charAt(0) && - "]" == f.material.toString().charAt(f.material.length - 1)) || - (this._core.isHtmlColor(f.material) - ? (f.material = this._color.colorFromHtmlColor(f.material)) - : (/^rgb/.test(f.material) && - (f.material = this._color.rgbaStringToRgbaObj(f.material)), - 1 < f.material.r && (f.material.r = f.material.r / 255), - 1 < f.material.g && (f.material.g = f.material.g / 255), - 1 < f.material.b && (f.material.b = f.material.b / 255), - 1 < f.material.a && (f.material.a = f.material.a / 255), - (f.material = this._color.createColor( - f.material.r, - f.material.g, - f.material.b, - f.material.a - )))), - this._core.isnull(f) || - this._core.isnull(f.color) || - ("[" == f.color.toString().charAt(0) && - "]" == f.color.toString().charAt(f.color.length - 1)) || - (this._core.isHtmlColor(f.color) - ? (f.color = this._color.colorFromHtmlColor(f.color)) - : (/^rgb/.test(f.color) && - (f.color = this._color.rgbaStringToRgbaObj(f.color)), - 1 < f.color.r && (f.color.r = f.color.r / 255), - 1 < f.color.g && (f.color.g = f.color.g / 255), - 1 < f.color.b && (f.color.b = f.color.b / 255), - 1 < f.color.a && (f.color.a = f.color.a / 255), - (f.color = this._color.createColor( - f.color.r, - f.color.g, - f.color.b, - f.color.a - )))), - this._core.isnull(f) || - this._core.isnull(f.lightColor) || - ("[" == f.lightColor.toString().charAt(0) && - "]" == f.lightColor.toString().charAt(f.lightColor.length - 1)) || - (this._core.isHtmlColor(f.lightColor) - ? (f.lightColor = this._color.colorFromHtmlColor(f.lightColor)) - : (/^rgb/.test(f.lightColor) && - (f.lightColor = this._color.rgbaStringToRgbaObj( - f.lightColor - )), - 1 < f.lightColor.r && (f.lightColor.r = f.lightColor.r / 255), - 1 < f.lightColor.g && (f.lightColor.g = f.lightColor.g / 255), - 1 < f.lightColor.b && (f.lightColor.b = f.lightColor.b / 255), - 1 < f.lightColor.a && (f.lightColor.a = f.lightColor.a / 255), - (f.lightColor = this._color.createColor( - f.lightColor.r, - f.lightColor.g, - f.lightColor.b, - f.lightColor.a - )))), - this._core.isnull(f) || - this._core.isnull(f.linecolor) || - ("[" == f.linecolor.toString().charAt(0) && - "]" == f.linecolor.toString().charAt(f.linecolor.length - 1)) || - (this._core.isHtmlColor(f.linecolor) - ? (f.linecolor = this._color.colorFromHtmlColor(f.linecolor)) - : (/^rgb/.test(f.linecolor) && - (f.linecolor = this._color.rgbaStringToRgbaObj(f.linecolor)), - 1 < f.linecolor.r && (f.linecolor.r = f.linecolor.r / 255), - 1 < f.linecolor.g && (f.linecolor.g = f.linecolor.g / 255), - 1 < f.linecolor.b && (f.linecolor.b = f.linecolor.b / 255), - 1 < f.linecolor.a && (f.linecolor.a = f.linecolor.a / 255), - (f.linecolor = this._color.createColor( - f.linecolor.r, - f.linecolor.g, - f.linecolor.b, - f.linecolor.a - )))), - this._core.extend(o, f, !0)), - o = - (this._core.isnull(f.near) && (f.near = 0), - this._core.isnull(f.far) && (f.far = 999999999), - parseFloat(f.near)), - r = parseFloat(f.far), - o = new this._cesium.DistanceDisplayCondition(o, r), - r = - ((y.distanceDisplayCondition = o), - null == t && console.log("geojson is required"), - null), - r = t.then ? t : this._cesium.GeoJsonDataSource.load(t), - v = 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 v._cesium.GeometryInstance({ - id: n, - geometry: new v._cesium.CorridorGeometry({ - positions: n.polyline.positions._value, - width: y.width, - height: y.height, - arcType: y.arcType, - vertexFormat: v._cesium.VertexFormat.POSITION_ONLY, - }), - attributes: { - color: - new v._cesium.ColorGeometryInstanceAttribute.fromColor( - y.linecolor - ), - }, - }); - i.push(a); - } - f && - f.time && - (t = new v._cesium.TimeIntervalCollection([ - new v._cesium.TimeInterval({ - start: f.time.start - ? v._cesium.JulianDate.fromDate(new Date(f.time.start)) - : v._cesium.Iso8601.MINIMUM_VALUE, - stop: f.time.end - ? v._cesium.JulianDate.fromDate(new Date(f.time.end)) - : v._cesium.Iso8601.MAXIMUM_VALUE, - }), - ])); - for ( - var e = v._viewer.scene.primitives.add( - new v._cesium.GroundPrimitive({ - geometryInstances: i, - classificationType: v._cesium.ClassificationType.BOTH, - }), - t - ), - s = ((e.show = y.show), (v.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]), - v._cesium.SceneTransforms.wgs84ToWindowCoordinates( - v._viewer.scene, - l[u - 1] - ).x), - m = v._cesium.SceneTransforms.wgs84ToWindowCoordinates( - v._viewer.scene, - l[u - 1] - ).y, - d = v._cesium.SceneTransforms.wgs84ToWindowCoordinates( - v._viewer.scene, - l[u] - ).x, - p = v._cesium.SceneTransforms.wgs84ToWindowCoordinates( - v._viewer.scene, - l[u] - ).y, - s = v.setPolylinemodels( - c, - h, - m, - d, - p, - s, - y, - v._cesium, - v._viewer, - t - ); - } catch (e) {} - let g; - Cesium.ModelInstanceCollection - ? (g = new v._cesium.ModelInstanceCollection({ - url: y.url, - instances: s, - color: y.color, - lightColor: y.lightColor, - scale: parseInt(y.scale), - heightReference: parseInt(y.heightReference), - distanceDisplayCondition: y.distanceDisplayCondition, - })) - : ((g = new Cesium.PrimitiveCollection()), - s.forEach((e) => { - g.add({ - id: e.modelId, - url: y.url, - modelMatrix: e.modelMatrix, - color: y.color, - lightColor: y.lightColor, - scale: parseInt(y.scale), - heightReference: parseInt(y.heightReference), - distanceDisplayCondition: y.distanceDisplayCondition, - }); - })), - v._viewer.scene.primitives.add(g), - v.model.push(g), - _ || v.setVisibility(!1), - "function" == typeof C && C(e); - }), - this._core.isnull(y.id) && (y.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + y.id), - { - id: y.id, - name: e, - checked: _, - 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 - ); - }), - (P.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, - f = (e.objid, e.cyjj), - r = e.url, - _ = ((this.modelurl = r), []), - n = { point: h._cesium.Color.RED, polyline: h._cesium.Color.YELLOW }, - C = - (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()), - y = { spot: [], distance: [], label: [], polyline: [], model: [] }, - a = - (m.setInputAction(function (e) { - 0 === d.length - ? C.showAt(e.endPosition, "宸﹂敭寮�濮�,鍙抽敭缁撴潫锛�") - : C.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 }); - _.push(e), y.spot.push(o), y.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 < _.length; o++) { - var r = [], - n = _[o - 1].lxy.px, - a = _[o - 1].lxy.py, - s = _[o].lxy.px, - l = _[o].lxy.py, - u = g; - r.push(_[o - 1].positionsxp), - r.push(_[o].positionsxp), - (i = h.setPolylinemodel( - r, - n, - a, - s, - l, - u, - f, - h.modelurl, - i, - h._cesium, - h._viewer - )); - } - (y.model = i), - "" != c && null != c && "function" == typeof c && c(y), - C.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), y.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; - }), - (P.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, - f = u.Math.lerp(d, a, 1 / p) - d, - _ = u.Math.lerp(t, o, 1 / p) - t, - C = u.Math.lerp(i, r, 1 / p) - i, - y = 0; - y < p; - y++ - ) { - var v = m + (y + 1) * g, - w = d + (y + 1) * f; - (0 == y || 1 == y) && new u.Cartesian3(v, w, 0); - (v = t + (y + 1) * _), (w = i + (y + 1) * C); - var b = c.camera.pickEllipsoid({ x: v, y: w }, c.scene.globe.ellipsoid), - b = u.Cartographic.fromCartesian(b), - v = u.Math.toDegrees(b.longitude), - w = u.Math.toDegrees(b.latitude), - b = u.Transforms.eastNorthUpToFixedFrame( - u.Cartesian3.fromDegrees(v, w, 6) - ), - v = u.Model.fromGltf({ url: s, modelMatrix: b, scale: 100 }); - c.scene.primitives.add(v), l.push(v); - } - return l; - }), - (P.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), - f = (c.height, s.Math.toDegrees(e.height), h), - _ = s.Math.lerp(d, m, 1 / f) - d, - C = s.Math.lerp(p, g, 1 / f) - p; - s.Math.lerp(t, o, 1 / f), s.Math.lerp(i, r, 1 / f); - for (var y = 0; y < f; y++) { - var v = s.Transforms.eastNorthUpToFixedFrame( - s.Cartesian3.fromDegrees(d + (y + 1) * _, p + (y + 1) * C, a.height) - ), - v = - (parseInt(a.heightReference), - s.Model.fromGltf({ - url: a.url, - modelMatrix: v, - color: a.color, - lightColor: a.lightColor, - scale: parseInt(a.scale), - heightReference: parseInt(a.heightReference), - distanceDisplayCondition: a.distanceDisplayCondition, - })); - l.scene.primitives.add(v, u), n.push(v); - } - return n; - }), - (P.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), - f = (c.height, s.Math.toDegrees(e.height), h), - _ = s.Math.lerp(d, m, 1 / f) - d, - C = s.Math.lerp(p, g, 1 / f) - p; - s.Math.lerp(t, o, 1 / f), s.Math.lerp(i, r, 1 / f); - for (var y = 0; y < f; y++) { - var v = s.Transforms.eastNorthUpToFixedFrame( - s.Cartesian3.fromDegrees( - d + (y + 1) * _, - p + (y + 1) * C, - parseInt(a.height || 0) - ) - ); - parseInt(a.heightReference), - Cesium.Matrix4.multiplyByUniformScale(v, parseInt(a.scale), v), - n.push({ modelMatrix: v, modelId: a }); - } - return n; - }), - (P.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, - f = - (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), - (f.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 }), - _ = (this._viewer.dataSources.add(r), this), - r = - (m && - m.time && - (p = new _._cesium.TimeIntervalCollection([ - new _._cesium.TimeInterval({ - start: m.time.start - ? _._cesium.JulianDate.fromDate(new Date(m.time.start)) - : _._cesium.Iso8601.MINIMUM_VALUE, - stop: m.time.end - ? _._cesium.JulianDate.fromDate(new Date(m.time.end)) - : _._cesium.Iso8601.MAXIMUM_VALUE, - }), - ])), - r.then(function (e) { - (_.item = e), (_.model = []); - var t = e.entities.values, - i = - (_._core.isnull(m.near) && (m.near = 0), - _._core.isnull(m.far) && (m.far = 999999999), - parseFloat(m.near)), - o = parseFloat(m.far), - r = new _._cesium.DistanceDisplayCondition(i, o); - f.distanceDisplayCondition = r; - for (var n = 0; n < t.length; n++) { - for ( - var a = t[n], - s = - ((f.height = parseFloat( - _._core.extendgl(a, m.height, f.height) - )), - (f.extrudedHeight = parseFloat( - _._core.extendgl(a, m.extrudedHeight, f.extrudedHeight) - )), - (f.heightReference = _._core.extendgl( - a, - m.heightReference, - f.heightReference - )), - (f.show = _._core.extendgl(a, m.show, f.show)), - (f.material = _._core.extendgl(a, m.material, f.material)), - (f.outline = _._core.extendgl(a, m.outline, f.outline)), - (f.outlineColor = _._core.extendgl( - a, - m.outlineColor, - f.outlineColor - )), - (f.outlineWidth = parseFloat( - _._core.extendgl(a, m.outlineWidth, f.outlineWidth) - )), - (f.stRotation = _._core.extendgl( - a, - m.stRotation, - f.stRotation - )), - (f.granularity = _._core.extendgl( - a, - m.granularity, - f.granularity - )), - (f.distanceDisplayCondition = _._core.extendgl( - a, - m.distanceDisplayCondition, - f.distanceDisplayCondition - )), - (f.perPositionHeight = _._core.extendgl( - a, - m.perPositionHeight, - f.perPositionHeight - )), - (f.closeTop = _._core.extendgl(a, m.closeTop, f.closeTop)), - (f.closeBottom = _._core.extendgl( - a, - m.closeBottom, - f.closeBottom - )), - (f.shadows = _._core.extendgl(a, m.shadows, f.shadows)), - (f.classificationType = _._core.extendgl( - a, - m.classificationType, - f.classificationType - )), - a.polygon._hierarchy._value.positions, - (a.polygon.heightReference = 1), - (a.polygon.show = f.show), - (a.polygon.material = f.material), - (a.polygon.outline = f.outline), - (a.polygon.outlineColor = f.outlineColor), - (a.polygon.outlineWidth = f.outlineWidth), - (a.polygon.stRotation = f.stRotation), - (a.polygon.granularity = f.granularity), - (a.polygon.distanceDisplayCondition = r), - (a.polygon.closeTop = f.closeTop), - (a.polygon.closeBottom = f.closeBottom), - (a.polygon.shadows = f.shadows), - (a.polygon.classificationType = f.classificationType), - p && (a.availability = p), - []), - l = a.polygon.hierarchy.getValue().positions, - u = 0; - u < l.length; - u++ - ) { - var c = _._cesium.Math.toDegrees( - _._cesium.Cartographic.fromCartesian(l[u]).longitude - ), - h = _._cesium.Math.toDegrees( - _._cesium.Cartographic.fromCartesian(l[u]).latitude - ); - s.push(c), s.push(h); - } - a = _.getTheBottomPoint(s); - _.scanningPolygon(a, f.offset_x, f.offset_y, s).forEach(function ( - e - ) { - (e = _._cesium.Transforms.eastNorthUpToFixedFrame( - _._cesium.Cartesian3.fromDegrees(e.lon, e.lat, f.height) - )), - (e = _._cesium.Model.fromGltf({ - url: g, - color: f.color, - silhouetteColor: f.lightColor, - silhouetteSize: f.lightWidth, - modelMatrix: e, - scale: f.scale, - heightReference: parseInt(f.heightReference), - distanceDisplayCondition: r, - })); - _._viewer.scene.primitives.add(e, p), - (e.time = p), - _.model.push(e); - }); - } - m.checked || _.setVisibility(!1), "function" == typeof d && d(e); - }), - this._core.isnull(f.id) && (f.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + f.id), - { - id: f.id, - name: e, - checked: o, - pId: this._core.isnull(i) ? 0 : i, - type: "polygonLayer", - item: this, - url: t, - style: f, - }); - return ( - this.setTreeobj(r), - this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i), - this - ); - }), - (P.prototype.setItem = function (e) { - this.item = e; - }), - (P.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); - }), - (P.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] }; - }), - (P.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; - }), - (P.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, - ]; - }), - (P.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; - }), - (P.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 - ); - }), - (P.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.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 - ); - }), - (P.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); - }), - (P.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(0.5), - outline: !0, - outlineWidth: 10, - outlineColor: r, - numberOfVerticalLines: o, - slices: o, - }, - show: n, - }); - }), - (P.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); - } - }), - (P.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; - }), - (P.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); - }), - (P.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); - }), - (P.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; - }), - (P.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (P.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); - }), - (P.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)) - ) - )); - }), - (P.prototype.setScale = function (e) { - this.item && this.item.model && (this.item.model.scale = e); - }), - (P.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] - ))); - }), - (P.prototype.getVisibility = function () { - return this.item.show; - }), - (P.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) {} - }), - (Oi.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 - ); - }), - (Oi.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) {} - }), - (Oi.prototype.setRefresh = function (e) { - try { - this._Provider && this._Provider.setStatus(!e); - } catch (e) {} - }), - (Oi.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); - }), - (Oi.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 y(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 - ); - }), - (Oi.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 y(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 - ); - }), - (Oi.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, - ]; - }), - (Oi.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] }; - }), - (Oi.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; - }), - (Oi.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; - }), - (Oi.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), - f = s.Math.lerp(m, h, 1 / g) - m, - _ = s.Math.lerp(d, p, 1 / g) - d; - s.Math.lerp(t, o, 1 / g), s.Math.lerp(i, r, 1 / g); - for (var C = 0; C < g; C++) { - var y = s.Transforms.eastNorthUpToFixedFrame( - s.Cartesian3.fromDegrees(m + (C + 1) * f, d + (C + 1) * _, a.height) - ), - y = - (parseInt(a.heightReference), - s.Model.fromGltf({ - url: a.url, - modelMatrix: y, - color: a.color, - lightColor: a.lightColor, - scale: a.scale, - heightReference: parseInt(a.heightReference), - })); - l.scene.primitives.add(y), n.push(y); - } - return n; - }), - (Oi.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 y(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 - ); - }), - (Oi.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 y(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 - ); - }), - (Oi.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 y(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 - ); - }), - (Oi.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Oi.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 y(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); - }), - (Oi.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 y(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( - 0.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); - }), - (Oi.prototype.getLegend = function () { - var e = []; - return (e = null != this.Legend ? this._core.unique(this.Legend) : e); - }), - (Oi.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 Bi = {}; - function Fi(e) { - (this.buf = - ArrayBuffer.isView && ArrayBuffer.isView(e) ? e : new Uint8Array(e || 0)), - (this.pos = 0), - (this.type = 0), - (this.length = this.buf.length); - } - (Bi.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); - }), - (Bi.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; - }), - (Fi.Varint = 0), - (Fi.Fixed64 = 1), - (Fi.Bytes = 2), - (Fi.Fixed32 = 5); - var Hi = 4294967296, - Vi = 1 / Hi; - function Gi(e) { - return e.type === Fi.Bytes ? e.readVarint() + e.pos : e.pos + 1; - } - function ki(e, t, i) { - return i ? 4294967296 * t + (e >>> 0) : 4294967296 * (t >>> 0) + (e >>> 0); - } - function Ni(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 ji(e, t) { - for (var i = 0; i < e.length; i++) t.writeVarint(e[i]); - } - function zi(e, t) { - for (var i = 0; i < e.length; i++) t.writeSVarint(e[i]); - } - function Ui(e, t) { - for (var i = 0; i < e.length; i++) t.writeFloat(e[i]); - } - function Wi(e, t) { - for (var i = 0; i < e.length; i++) t.writeDouble(e[i]); - } - function Yi(e, t) { - for (var i = 0; i < e.length; i++) t.writeBoolean(e[i]); - } - function Ji(e, t) { - for (var i = 0; i < e.length; i++) t.writeFixed32(e[i]); - } - function Ki(e, t) { - for (var i = 0; i < e.length; i++) t.writeSFixed32(e[i]); - } - function Qi(e, t) { - for (var i = 0; i < e.length; i++) t.writeFixed64(e[i]); - } - function qi(e, t) { - for (var i = 0; i < e.length; i++) t.writeSFixed64(e[i]); - } - function Xi(e, t) { - return (e[t] | (e[t + 1] << 8) | (e[t + 2] << 16)) + 16777216 * e[t + 3]; - } - function Zi(e, t, i) { - (e[i] = t), - (e[i + 1] = t >>> 8), - (e[i + 2] = t >>> 16), - (e[i + 3] = t >>> 24); - } - function $i(e, t) { - return (e[t] | (e[t + 1] << 8) | (e[t + 2] << 16)) + (e[t + 3] << 24); - } - function eo(e, t) { - (this.x = e), (this.y = t); - } - function to(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(io, this, t); - } - function io(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 oo(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(ro, this, t), - (this.length = this._features.length); - } - function ro(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 no(e, t) { - this.layers = e.readFields(ao, {}, t); - } - function ao(e, t, i) { - 3 === e && - (e = new oo(i, i.readVarint() + i.pos)).length && - (t[e.name] = e); - } - function so(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (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 = []); - } - (Fi.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 = Xi(this.buf, this.pos); - return (this.pos += 4), e; - }, - readSFixed32: function () { - var e = $i(this.buf, this.pos); - return (this.pos += 4), e; - }, - readFixed64: function () { - var e = Xi(this.buf, this.pos) + Xi(this.buf, this.pos + 4) * Hi; - return (this.pos += 8), e; - }, - readSFixed64: function () { - var e = Xi(this.buf, this.pos) + $i(this.buf, this.pos + 4) * Hi; - return (this.pos += 8), e; - }, - readFloat: function () { - var e = Bi.read(this.buf, this.pos, !0, 23, 4); - return (this.pos += 4), e; - }, - readDouble: function () { - var e = Bi.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 ki(i, r, t); - if (((n = e[o.pos++]), (r |= (127 & n) << 3), n < 128)) - return ki(i, r, t); - if (((n = e[o.pos++]), (r |= (127 & n) << 10), n < 128)) - return ki(i, r, t); - if (((n = e[o.pos++]), (r |= (127 & n) << 17), n < 128)) - return ki(i, r, t); - if (((n = e[o.pos++]), (r |= (127 & n) << 24), n < 128)) - return ki(i, r, t); - if (((n = e[o.pos++]), (r |= (1 & n) << 31), n < 128)) return ki(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 = Gi(this); - for (e = e || []; this.pos < i; ) e.push(this.readVarint(t)); - return e; - }, - readPackedSVarint: function (e) { - var t = Gi(this); - for (e = e || []; this.pos < t; ) e.push(this.readSVarint()); - return e; - }, - readPackedBoolean: function (e) { - var t = Gi(this); - for (e = e || []; this.pos < t; ) e.push(this.readBoolean()); - return e; - }, - readPackedFloat: function (e) { - var t = Gi(this); - for (e = e || []; this.pos < t; ) e.push(this.readFloat()); - return e; - }, - readPackedDouble: function (e) { - var t = Gi(this); - for (e = e || []; this.pos < t; ) e.push(this.readDouble()); - return e; - }, - readPackedFixed32: function (e) { - var t = Gi(this); - for (e = e || []; this.pos < t; ) e.push(this.readFixed32()); - return e; - }, - readPackedSFixed32: function (e) { - var t = Gi(this); - for (e = e || []; this.pos < t; ) e.push(this.readSFixed32()); - return e; - }, - readPackedFixed64: function (e) { - var t = Gi(this); - for (e = e || []; this.pos < t; ) e.push(this.readFixed64()); - return e; - }, - readPackedSFixed64: function (e) { - var t = Gi(this); - for (e = e || []; this.pos < t; ) e.push(this.readSFixed64()); - return e; - }, - skip: function (e) { - e &= 7; - if (e === Fi.Varint) for (; 127 < this.buf[this.pos++]; ); - else if (e === Fi.Bytes) this.pos = this.readVarint() + this.pos; - else if (e === Fi.Fixed32) this.pos += 4; - else { - if (e !== Fi.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), Zi(this.buf, e, this.pos), (this.pos += 4); - }, - writeSFixed32: function (e) { - this.realloc(4), Zi(this.buf, e, this.pos), (this.pos += 4); - }, - writeFixed64: function (e) { - this.realloc(8), - Zi(this.buf, -1 & e, this.pos), - Zi(this.buf, Math.floor(e * Vi), this.pos + 4), - (this.pos += 8); - }, - writeSFixed64: function (e) { - this.realloc(8), - Zi(this.buf, -1 & e, this.pos), - Zi(this.buf, Math.floor(e * Vi), 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 && Ni(t, e, this), - (this.pos = t - 1), - this.writeVarint(e), - (this.pos += e); - }, - writeFloat: function (e) { - this.realloc(4), - Bi.write(this.buf, e, this.pos, !0, 23, 4), - (this.pos += 4); - }, - writeDouble: function (e) { - this.realloc(8), - Bi.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 && Ni(i, e, this), - (this.pos = i - 1), - this.writeVarint(e), - (this.pos += e); - }, - writeMessage: function (e, t, i) { - this.writeTag(e, Fi.Bytes), this.writeRawMessage(t, i); - }, - writePackedVarint: function (e, t) { - this.writeMessage(e, ji, t); - }, - writePackedSVarint: function (e, t) { - this.writeMessage(e, zi, t); - }, - writePackedBoolean: function (e, t) { - this.writeMessage(e, Yi, t); - }, - writePackedFloat: function (e, t) { - this.writeMessage(e, Ui, t); - }, - writePackedDouble: function (e, t) { - this.writeMessage(e, Wi, t); - }, - writePackedFixed32: function (e, t) { - this.writeMessage(e, Ji, t); - }, - writePackedSFixed32: function (e, t) { - this.writeMessage(e, Ki, t); - }, - writePackedFixed64: function (e, t) { - this.writeMessage(e, Qi, t); - }, - writePackedSFixed64: function (e, t) { - this.writeMessage(e, qi, t); - }, - writeBytesField: function (e, t) { - this.writeTag(e, Fi.Bytes), this.writeBytes(t); - }, - writeFixed32Field: function (e, t) { - this.writeTag(e, Fi.Fixed32), this.writeFixed32(t); - }, - writeSFixed32Field: function (e, t) { - this.writeTag(e, Fi.Fixed32), this.writeSFixed32(t); - }, - writeFixed64Field: function (e, t) { - this.writeTag(e, Fi.Fixed64), this.writeFixed64(t); - }, - writeSFixed64Field: function (e, t) { - this.writeTag(e, Fi.Fixed64), this.writeSFixed64(t); - }, - writeVarintField: function (e, t) { - this.writeTag(e, Fi.Varint), this.writeVarint(t); - }, - writeSVarintField: function (e, t) { - this.writeTag(e, Fi.Varint), this.writeSVarint(t); - }, - writeStringField: function (e, t) { - this.writeTag(e, Fi.Bytes), this.writeString(t); - }, - writeFloatField: function (e, t) { - this.writeTag(e, Fi.Fixed32), this.writeFloat(t); - }, - writeDoubleField: function (e, t) { - this.writeTag(e, Fi.Fixed64), this.writeDouble(t); - }, - writeBooleanField: function (e, t) { - this.writeVarintField(e, Boolean(t)); - }, - }), - (eo.prototype = { - clone: function () { - return new eo(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 - ); - }, - }), - (eo.convert = function (e) { - return !(e instanceof eo) && Array.isArray(e) ? new eo(e[0], e[1]) : e; - }), - (to.types = ["Unknown", "Point", "LineString", "Polygon"]), - (to.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 eo(a, s)); - else { - if (7 !== r) throw new Error("unknown command " + r); - e && e.push(e[0].clone()); - } - return e && l.push(e), l; - }), - (to.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]; - }), - (to.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 = to.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; - }), - (oo.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 to(this._pbf, e, this.extent, this._keys, this._values); - }); - var lo = - "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 uo(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (this._VectorTileProvider = new T(this._viewer, this._cesium)), - (this._primitive = void 0), - (this._Provider = void 0), - (this.Legend = []); - } - function x(e) { - (this._viewer = e), - (this._cesium = Cesium), - (this._core = new v()), - (this._tree = F), - (this._getPosition = new C(this._viewer, this._cesium)), - (this._ModelEdit = new jt(this._viewer)), - (this._popupmessage = new yi(this._viewer, this._cesium)), - (this._createGroup = new vi(this._viewer, this._cesium)), - (this._billboardGeoJsonFeatureLayer = new Ei(this._viewer, this._cesium)), - (this._GeoJsonFeatureLayer = new w(this._viewer, this._cesium)), - (this._LabelGeoJsonFeatureLayercopy = new E(this._viewer, this._cesium)), - (this._VectorGeoJsonFeatureLayer = new S(this._viewer, this._cesium)), - (this._PolylineGeoJsonFeatureLayer = new Ri(this._viewer, this._cesium)), - (this._PointModel = new P(this._viewer, this._cesium)), - (this._PolygonGeoJsonFeatureLayer = new Oi(this._viewer, this._cesium)), - (this._PolygonVectorTileLayerArcgis = new so(this._viewer, this._cesium)), - (this._WallGeoFeatureLayer = new uo(this._viewer, this._cesium)), - (this.tooltip = this._core.CreateTooltip()), - (this.objectsToExclude = []), - (this.SimpleGraphicObj = []), - F.editPointID || - (F.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); - } - (so.prototype._serialize = function (e) { - var t, - i = [], - o = window.encodeURIComponent; - for (t in e) { - var r = e[t]; - "object" === (void 0 === r ? "undefined" : lo(r)) - ? i.push(o(t) + "=" + o(JSON.stringify(r))) - : i.push(o(t) + "=" + o(e[t])); - } - return i.join("&"); - }), - (so.prototype.createVolumeVectorGeoJsonFeatureLayer = function ( - e, - t, - S, - 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, - }, - P = - (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(S) || - this._core.isnull(S.fill) || - ("[" == S.fill.toString().charAt(0) && - "]" == S.fill.toString().charAt(S.fill.length - 1)) || - (this._core.isHtmlColor(S.fill) - ? (S.fill = this._color.colorFromHtmlColor(S.fill)) - : (/^rgb/.test(S.fill) && - (S.fill = this._color.rgbaStringToRgbaObj(S.fill)), - 1 < S.fill.r && (S.fill.r = S.fill.r / 255), - 1 < S.fill.g && (S.fill.g = S.fill.g / 255), - 1 < S.fill.b && (S.fill.b = S.fill.b / 255), - 1 < S.fill.a && (S.fill.a = S.fill.a / 255), - (S.fill = this._color.createColor( - S.fill.r, - S.fill.g, - S.fill.b, - S.fill.a - )))), - this._core.isnull(S) || - this._core.isnull(S.polylinefill) || - ("[" == S.polylinefill.toString().charAt(0) && - "]" == - S.polylinefill.toString().charAt(S.polylinefill.length - 1)) || - (this._core.isHtmlColor(S.polylinefill) - ? (S.polylinefill = this._color.colorFromHtmlColor( - S.polylinefill - )) - : (/^rgb/.test(S.polylinefill) && - (S.polylinefill = this._color.rgbaStringToRgbaObj( - S.polylinefill - )), - 1 < S.polylinefill.r && - (S.polylinefill.r = S.polylinefill.r / 255), - 1 < S.polylinefill.g && - (S.polylinefill.g = S.polylinefill.g / 255), - 1 < S.polylinefill.b && - (S.polylinefill.b = S.polylinefill.b / 255), - 1 < S.polylinefill.a && - (S.polylinefill.a = S.polylinefill.a / 255), - (S.polylinefill = this._color.createColor( - S.polylinefill.r, - S.polylinefill.g, - S.polylinefill.b, - S.polylinefill.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._option = this._core.extend(r, S, !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; - P._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 = [], - E = 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( - P._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 no(new Fi(e)), - a = [], - s = []; - for (r in ((P.labelCollections = new P._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 f = c.properties._symbol, _ = 0; - _ < E.length; - _++ - ) - null != E[_].filter && - "==" == E[_].filter[0] && - "_symbol" == E[_].filter[1] && - E[_].filter[2] == f && - (g = E[_]); - else if (null != l.name) - for (var C = l.name, _ = 0; _ < E.length; _++) - null != E[_]["source-layer"] && - E[_]["source-layer"] == C && - (g = E[_]); - if (1 == c.type) - try { - var y, - v = c.toGeoJSON(0, 0, 0, P.extent), - w = - (null != S.text && - /^\[/.test(S.text) && - /\]$/.test(S.text) && - ((y = S.text - .replace(/\[/, "") - .replace(/\]/, "")), - (P._option.text = c.properties[y])), - null != g.paint && - g.paint["icon-color"] && - (P._option.fill = - P._color.createColorTransformation( - g.paint["icon-color"] - )), - (P._option.position = - new P._cesium.Cartesian3.fromDegrees( - v.geometry.coordinates[0], - v.geometry.coordinates[1], - P._option.height - )), - {}), - w = - "point" == v.geometry.type - ? { - id: v, - color: P._option.fill, - position: P._option.position, - } - : P._option; - P.labelCollections.add(w); - } catch (e) {} - if (2 == c.type) { - d[0]; - v = c.toGeoJSON(0, 0, 0, P.extent); - if ( - (!P._core.isnull(S.polylinefill) && - null != g.paint && - g.paint["icon-color"] && - (P._option.polylinefill = - P._color.createColorTransformation( - g.paint["icon-color"] - )), - Array.isArray(v.geometry.coordinates) && - 0 < v.geometry.coordinates.length) - ) - if (Array.isArray(v.geometry.coordinates[0][0])) - for (m = 0; m < v.geometry.coordinates.length; m++) - (T = []), i(v.geometry.coordinates[m]), t(T); - else i(v.geometry.coordinates), t(T); - } - if (3 == c.type) - try { - d[0]; - var v = c.toGeoJSON(0, 0, 0, P.extent), - b = Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.AQUA - ); - if ( - (null != g.paint["fill-color"] && - (b = - Cesium.ColorGeometryInstanceAttribute.fromColor( - P._color.createColorTransformation( - g.paint["fill-color"] - ) - )), - Array.isArray(v.geometry.coordinates) && - 0 < v.geometry.coordinates.length) - ) - if (Array.isArray(v.geometry.coordinates[0][0])) - for ( - m = 0; - m < v.geometry.coordinates.length; - m++ - ) - (T = []), i(v.geometry.coordinates[m]), o(T); - else i(v.geometry.coordinates), o(T); - } catch (e) {} - } - 0 < P.labelCollections.length && - P._viewer.scene.primitives.add(P.labelCollections), - 0 < a.length && - P._viewer.scene.primitives.add( - new Cesium.Primitive({ - geometryInstances: a, - appearance: new Cesium.PolylineColorAppearance(), - }) - ), - 0 < s.length && - P._viewer.scene.primitives.add( - new Cesium.Primitive({ - geometryInstances: s, - appearance: new P._cesium.MaterialAppearance({ - material: new Cesium.Material({ - fabric: { - type: "Color", - uniforms: { - color: Cesium.Color.fromRandom({ alpha: 1 }), - }, - }, - }), - faceForward: !0, - flat: !1, - }), - shadows: Cesium.ShadowMode.ENABLED, - }) - ); - }); - }, - }); - }), - (so.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 = f.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)) - ) - ); - (v = 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 no(new Fi(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(v.x, v.y, v.level, b.extent), - h = 0; - h < d.geometry.coordinates.length; - h++ - ) - try { - var g = [], - f = - (d.geometry.coordinates[h].forEach( - function (e) { - g.push(e[0], e[1]); - } - ), - new Cesium.PolylineGeometry({ - positions: - Cesium.Cartesian3.fromDegreesArray(g), - width: 10, - })), - _ = - Cesium.PolylineGeometry.createGeometry(f), - C = new Cesium.GeometryInstance({ - geometry: _, - }); - o.push(C); - } catch (e) {} - } - if (3 == s.type) { - c[0]; - for ( - d = s.toGeoJSON(v.x, v.y, v.level, b.extent), - h = 0; - h < d.geometry.coordinates.length; - h++ - ) - try { - var g = [], - y = - (d.geometry.coordinates[h].forEach( - function (e) { - g.push(e[0], e[1]); - } - ), - new Cesium.PolygonGeometry({ - polygonHierarchy: - new Cesium.PolygonHierarchy( - Cesium.Cartesian3.fromDegreesArray( - g - ) - ), - })), - _ = - Cesium.PolygonGeometry.createGeometry(y), - C = new Cesium.GeometryInstance({ - geometry: _, - }); - r.push(C); - } 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 v; - }), - (this._primitive = new b._cesium.QuadtreePrimitive({ - tileProvider: this._Provider, - })), - this._viewer.scene.primitives.add(this._primitive); - }), - (so.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("/]/", "") - : f.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 - ); - }), - (so.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; - }), - (so.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 y(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); - }), - (so.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (so.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 }, - }; - }), - (so.prototype.deleteObject = function () { - this._viewer.scene.primitives.remove(this.item); - try { - this._Provider.remove(); - } catch (e) {} - }), - (so.prototype.setRefresh = function (e) { - try { - this._Provider && this._Provider.setStatus(e); - } catch (e) {} - }), - (so.prototype.setVisibility = function (e) { - (this.item.show = e), this._Provider && this._Provider.setStatus(e); - }), - (uo.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 = f.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); - } - (f.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 = f.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); - }), - (uo.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("/]/", "") - : f.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 - ); - }), - (uo.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 y(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 - ); - }), - (uo.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (uo.prototype.deleteObject = function () { - this._viewer.scene.primitives.remove(this.item); - try { - this._Provider.remove(); - } catch (e) {} - }), - (uo.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 }, - }; - }), - (uo.prototype.getLegend = function () { - var e = []; - return (e = null != this.Legend ? this._core.unique(this.Legend) : e); - }), - (uo.prototype.setRefresh = function (e) { - try { - this._Provider && this._Provider.setStatus(!e); - } catch (e) {} - }), - (uo.prototype.setVisibility = function (e) { - (this.item.show = e), this._Provider && this._Provider.setStatus(!e); - }), - (uo.prototype.edit = function (e, t) { - return ( - (this.isEditting = e), - (this.editoption = t), - this._Provider && this._Provider.edit && this._Provider.edit(e, t) - ); - }), - (uo.prototype.forceRefresh = function () { - try { - for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) - this._Provider.quadtree._levelZeroTiles[e].freeResources(); - } catch (e) {} - }), - (x.prototype.createSimpleGraphic = function (e, i = {}, o) { - let t = null; - var r = (e, t) => { - e && i.removeEdit && this.SimpleGraphicObj.pop(), - i.propData && this.setPropData(e, i.propData), - (e.deleteObject = () => { - this.remove(e.id), this._viewer.entities.removeById(e.id); - }), - this.defaultEdit(), - o && o(e, t); - }; - switch ( - (this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.draw - ), - e) - ) { - case "point": - t = this.createPoint(i, r); - break; - case "billboard": - t = this.createBillboard(i, r); - break; - case "label": - t = this.createLabel(i, r); - break; - case "model": - t = this.createModel(i, r); - break; - case "polyline": - t = this.createPolyline(i, r); - break; - case "polygon": - t = this.createPolygon(i, r); - break; - case "triangle": - t = this.createTriangle(i, r); - break; - case "polygon-rectangle": - t = this.createPolygonRectangle(i, r); - break; - case "rectangle": - t = this.createRectangle(i, r); - break; - case "circle": - t = this.createCircle(i, r); - break; - case "ellipse": - t = this.createEllipse(i, r); - break; - case "box": - t = this.createBox(i, r); - break; - case "cylinder": - t = this.createCylinder(i, r); - break; - case "cone": - t = this.createCone(i, r); - break; - case "sphere": - t = this.createSphere(i, r); - break; - case "polyhedron": - t = this.createPolyhedron(i, r); - } - return t; - }), - (x.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 ( - (o && i.removeEdit && this.SimpleGraphicObj.pop(), - i.propData && this.setPropData(o, i.propData), - this.defaultEdit(), - (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)), - F.insertGroupId(e, i.GroupID); - } - return o; - }), - (x.prototype.getDefaultLabelStyle = function (e) { - return { - show: this._core.defaultValue(e.showLabel, !1), - text: this._core.defaultValue(e.label_text, "鏂板缓鏂囨湰"), - font: this._core.defaultValue(e.label_font, "24px 瀹嬩綋"), - scale: this._core.defaultValue(e.label_scale, 1), - style: this._core.defaultValue(e.label_style, 2), - fillColor: this._cesium.Color.fromCssColorString( - this._core.defaultValue(e.label_fillColor, "#ffffff") - ), - outlineColor: this._cesium.Color.fromCssColorString( - this._core.defaultValue(e.label_outlineColor, "#000000") - ), - outlineWidth: this._core.defaultValue(e.label_outlineWidth, 0), - showBackground: this._core.defaultValue(e.label_showBackground, !1), - backgroundColor: this._cesium.Color.fromCssColorString( - this._core.defaultValue(e.label_backgroundColor, "rgba(42,42,42,0.8)") - ), - heightReference: this._core.defaultValue(e.label_heightReference, 1), - horizontalOrigin: this._core.defaultValue( - e.label_horizontalOrigin, - this._cesium.HorizontalOrigin.CENTER - ), - verticalOrigin: this._core.defaultValue( - e.label_verticalOrigin, - this._cesium.VerticalOrigin.CENTER - ), - scaleByDistance: this._core.defaultValue( - e.label_scaleByDistance, - void 0 - ), - pixelOffset: this._core.defaultValue(e.label_pixelOffset, void 0), - disableDepthTestDistance: this._core.defaultValue( - e.label_disableDepthTestDistance, - Number.POSITIVE_INFINITY - ), - distanceDisplayCondition: this._core.defaultValue( - e.label_distanceDisplayCondition, - new this._cesium.DistanceDisplayCondition(0, 1e8) - ), - }; - }), - (x.prototype.end = function (e) {}), - (x.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 - )), - (F.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, - heightReference: 0, - 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 () { - F.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 () { - F.states = 0; - }, 100), - o._core.mouse(o._viewer.container, 0, "0"); - }), - this - ); - }), - (x.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, 0), - 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; - }), - (x.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 - )), - (F.states = 1), - (t.image = this._core.getGifImageProperty(t.image)), - 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, - heightReference: 0, - 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 + I.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) - ), - }, - label: this.getDefaultLabelStyle(t), - })), - o.SimpleGraphicObj.push(e.id), - o.drawHandler.destroy(), - (o.drawHandler = void 0), - o.tooltip.show(!1), - setTimeout(function () { - F.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 () { - F.states = 0; - }, 100), - o._core.mouse(o._viewer.container, 0, "0"); - }), - this - ); - }), - (x.prototype.addBillboard = function (e = {}) { - var t = this; - let i = this._viewer; - e.image = this._core.getGifImageProperty(e.image); - 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 + I.mark - ), - color: t._cesium.Color.fromCssColorString( - t._core.defaultValue(e.color, "#ffffff") - ), - heightReference: t._core.defaultValue(e.heightReference, 0), - 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) - ), - }, - label: this.getDefaultLabelStyle(e), - }); - return t.SimpleGraphicObj.push(e.id), e; - }), - (x.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 - )), - (F.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") - ), - heightReference: 0, - scale: 1, - style: 2, - outlineColor: o._cesium.Color.BLACK, - outlineWidth: 0, - showBackground: !1, - backgroundColor: new o._cesium.Color(0.165, 0.165, 0.165, 0.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 () { - F.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 () { - F.states = 0; - }, 100), - o._core.mouse(o._viewer.container, 0, "0"); - }), - this - ); - }), - (x.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, 0), - 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; - }), - (x.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 - )), - (F.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 + I.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 () { - F.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 + I.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(0.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 () { - F.states = 0; - }, 100), - r._core.mouse(r._viewer.container, 0, "0"); - }), - this - ); - }), - (x.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 + I.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 - ); - }), - (x.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 - )), - (F.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(0.6), - }), - depthFailMaterial: - i.depthFailColor && - new Cesium.PolylineOutlineMaterialProperty({ - color: o._cesium.Color.fromCssColorString( - i.depthFailColor - ), - outlineWidth: 0, - outlineColor: o._cesium.Color.WHITE.withAlpha(0.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 () { - F.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 - ); - }), - (x.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(0.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; - }), - (x.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 - ); - }), - (x.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 - )), - (F.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(0.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(0.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(), - (e = o.showSizeData("polygon", n)), - a && (a.sizeData = e)))); - }, 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 () { - F.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, n); - }), - this.drawHandler.setInputAction((e) => { - o.end(); - }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), - this - ); - }), - (x.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 - )), - (F.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(0.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 () { - F.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; - }), - (x.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 - )), - (F.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(0.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 () { - F.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 - ); - }), - (x.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; - }), - (x.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(0.6), - blendColor: - e.watherColor || Cesium.Color.SKYBLUE.withAlpha(0.6), - normalMap: e.url, - frequency: e.frequency || 1e3, - animationSpeed: e.watherSpeed || 0.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 - ); - }), - (x.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 - )), - (F.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(0.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 () { - F.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 - ); - }), - (x.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; - }), - (x.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 - )), - (F.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(0.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 () { - F.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 - ); - }), - (x.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; - }), - (x.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 - )), - (F.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(0.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 () { - F.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 - ); - }), - (x.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; - }), - (x.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 - )), - (F.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 () { - F.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 - ); - }), - (x.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; - }), - (x.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 - )), - (F.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 () { - F.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 - ); - }), - (x.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; - }), - (x.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 - )), - (F.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 () { - F.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 - ); - }), - (x.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; - }), - (x.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 - )), - (F.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 () { - F.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 - ); - }), - (x.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; - }), - (x.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 - )), - (F.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 () { - F.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 - ); - }), - (x.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; - }), - (x.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, - }; - }), - (x.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, - }, - }); - return this.SizeData.push(o.id), s; - }), - (x.prototype.clearLastSizeData = function () { - var e; - this.SizeData.length && - ((e = this.SizeData.pop()), this._viewer.entities.removeById(e)); - }), - (x.prototype.clearAllSizeData = function () { - this.SizeData.forEach((e) => { - this._viewer.entities.removeById(e); - }), - (this.SizeData = []); - }), - (x.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)) - ); - }), - (x.prototype.setEdit = function (e, t) { - (this.openEdit = e = void 0 === e ? !0 : e), - t && (this.editOption = t), - this.defaultEdit(); - }), - (x.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: () => { - this.setPropData(e), - i.callBack && i.callBack.end && i.callBack.end(e), - (SmartEarthPopupData.layerIndex = void 0), - (SmartEarthPopupData.window = void 0), - this.endThisEdit && this.endThisEdit(); - }, - }, - }); - }), - (x.prototype.setPropData = function (i, e) { - if ((e && (i.propData = e), Array.isArray(i.propData))) { - let t = {}; - i.propData.forEach((e) => { - e.key && (t[e.key] = e.value); - }), - (i.propData = t); - } - if (i.propData) { - (i.properties = new Cesium.PropertyBag(i.propData)), - (i.description = - '<table class="cesium-infoBox-defaultTable"><tbody>'); - for (let e = 0; e < i.properties.propertyNames.length; e++) { - var t = i.properties.propertyNames[e], - o = i.properties[t]; - i.description += `<tr><th>${t}</th><td>${o}</td></tr>`; - } - i.description += "</tbody></table>"; - } - }), - (x.prototype.getPropData = function (e) { - let t = e.properties, - i = ((t = t || new Cesium.PropertyBag()), {}); - for (let e = 0; e < t.propertyNames.length; e++) { - var o = t.propertyNames[e]; - i[o] = t[o] && t[o].getValue ? t[o].getValue() : t[o]; - } - return i; - }), - (x.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); - }), - (x.prototype.edit = function (e, a) { - let c = this, - h = this._viewer, - s = - (void 0 !== (a = a || this.editOption || {}).editProp && - (this.editProp = a.editProp), - this._core.defaultValue(a.enableDelete, !0)); - var m, d, p, g; - this.editHandler && - (this.editHandler.destroy(), (this.editHandler = void 0)), - void 0 === e && (e = !0), - (this.isEditting = !1); - let l; - (this.endThisEdit = () => { - c.defaultEvent(!0), - F.editPointID.edit.forEach((e) => { - h.entities.removeById(e); - }), - (F.editPointID.edit = []), - F.editPointID.height.forEach((e) => { - h.entities.removeById(e); - }), - (F.editPointID.height = []), - F.editPointID.add.forEach((e) => { - h.entities.removeById(e); - }), - (F.editPointID.add = []), - F.editPointID.size.forEach((e) => { - h.entities.removeById(e); - }), - (F.editPointID.size = []), - F.editPointID.move && h.entities.remove(F.editPointID.move), - (F.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 (!F.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 != F.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, - }), - (l = "height_point")) - : "move_point" == e.name - ? (l = "move_point") - : "point" === e.GeoType || - "billboard" === e.GeoType || - "label" === e.GeoType - ? (c.tooltip.showAt(t.position, "閲婃斁鍚庡畬鎴愪慨鏀�"), - (l = "move_point")) - : "edit_point" == e.name - ? (l = "edit_point") - : "add_point" == e.name - ? (l = "add_point") - : "size_point" == e.name && (l = "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, a)); - } 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 (!F.editVector) { - let e = h.scene.pick(t.endPosition); - if (c._cesium.defined(e)) - 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) || - e.id != m - ? e.id && "edit_point" === e.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, "鎷栨嫿淇敼浣嶇疆") - : !e.id || - ("move_point" !== e.id.name && - "size_point" !== e.id.name) - ? e.id && "add_point" === e.id.name - ? c.tooltip.showAt(t.endPosition, "鎷栨嫿澧炲姞鑺傜偣") - : e.id && "height_point" === e.id.name - ? c.tooltip.showAt(t.endPosition, "鎷栨嫿淇敼楂樺害") - : e.id == m || "modeEditAxis" === e.id - ? c.tooltip.show(!1) - : (e.id && - -1 !== c.SimpleGraphicObj.indexOf(e.id.id)) || - (a.editProp || - !c.isEditting || - ("point" !== g && - "billboard" !== g && - "label" !== g) || - c.endThisEdit(), - c.tooltip.show(!1)) - : c.tooltip.showAt(t.endPosition, "鎷栨嫿淇敼浣嶇疆") - : s - ? c.tooltip.showAt( - t.endPosition, - "model" === g ? "鍙抽敭鍒犻櫎" : "鎷栨嫿淇敼浣嶇疆锛屽彸閿垹闄�" - ) - : "model" !== g && - c.tooltip.showAt(t.endPosition, "鎷栨嫿淇敼浣嶇疆"); - } else - c.isEditting || - 0 !== F.states || - (e.id && -1 < c.SimpleGraphicObj.indexOf(e.id.id) - ? a.editProp - ? c.tooltip.showAt( - t.endPosition, - "鐐瑰嚮婵�娲荤紪杈�" + (s ? "锛屽彸閿垹闄�" : "") - ) - : (void 0 === e.id.GeoType && - ((r = c.getEntityTypeAndObject(e.id)), - (e.id.GeoType = r.type)), - "point" === (r = e.id.GeoType) || - "billboard" === r || - "label" === r - ? ((m = e.id), - (g = r), - c.getSimpleGraphicData(g, m), - (c.isEditting = !0), - c.tooltip.showAt(t.endPosition, "鎷栨嫿淇敼浣嶇疆")) - : c.tooltip.showAt( - t.endPosition, - "鐐瑰嚮婵�娲荤紪杈�" + (s ? "锛屽彸閿垹闄�" : "") - )) - : c.tooltip.show(!1)); - else - 0 != F.states || - d || - (a.editProp || - !c.isEditting || - ("point" !== g && "billboard" !== g && "label" !== g) || - c.endThisEdit(), - 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" === l) - if ("edit_point" === l) { - d.position = i; - var r = F.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 < F.editPointID.height.length) - ) { - let e = h.entities.getById(F.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 < F.editPointID.add.length) { - if (0 < r) { - let i = h.entities.getById(F.editPointID.add[r - 1]); - if (i) { - let e = h.entities.getById(F.editPointID.edit[r - 1]), - t = h.entities.getById(F.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(F.editPointID.add[r]); - if (i) { - let e = h.entities.getById(F.editPointID.edit[r]), - t = h.entities.getById(F.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( - F.editPointID.add[F.editPointID.add.length - 1] - ); - if (i) { - let e = h.entities.getById(F.editPointID.edit[0]), - t = h.entities.getById( - F.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), - F.editPointID.move && (F.editPointID.move.position = t), - ("polyline" !== g && - "polygon" !== g && - "rectangle" !== g) || - SmartEarthPopupData.editGraphic.setValue( - "positions", - e - ); - } else if ("height_point" === l) { - var u = F.editPointID.height.indexOf(d.id); - let e = h.entities.getById(F.editPointID.edit[u]), - i = - (("ellipse" !== g && "cylinder" !== g && "box" !== g) || - (e = F.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); - F.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" === l) { - (t = F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }))); - if ( - (F.editPointID.edit.splice(t + 1, 0, n.id), - m.pottingPoint.splice(t + 1, 0, i.clone()), - 0 < F.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(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - F.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - (t = - (F.editPointID.add.splice(t, 1, r.id, u.id), - (d = n), - (l = "edit_point"), - m.pottingPoint.concat([]))); - ("polyline" !== g && "polygon" !== g) || - SmartEarthPopupData.editGraphic.setValue("positions", t); - } else if ("size_point" === l) { - (r = F.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(F.editPointID.edit[t]); - if ( - ((n = n || h.entities.getById(F.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 < F.editPointID.height.length) - ) { - let e = h.entities.getById(F.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 < F.editPointID.add.length && - F.editPointID.add[t] - ) { - let e = h.entities.getById(F.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 < F.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)) - : F.editVector || - (d && - a.callBack && - a.callBack.update && - a.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 (!F.editVector) { - var o = h.scene.pick(e.position); - if (c._cesium.defined(o) && 0 == F.states) { - let i = o.id; - if (-1 < c.SimpleGraphicObj.indexOf(i.id) && s) - c.tooltip.show(!1), - c.delButton(!0, e.position, function () { - i.treeobj && F.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(), - a.callBack && a.callBack.delete && a.callBack.delete(i); - }); - else if ( - -1 < F.editPointID.edit.indexOf(i.id) && - (("polyline" === g && 2 < F.editPointID.edit.length) || - ("polygon" === g && 3 < F.editPointID.edit.length)) - ) { - o = F.editPointID.edit.indexOf(i.id); - if ( - (h.entities.removeById(i.id), - F.editPointID.edit.splice(o, 1), - 0 < F.editPointID.height.length && - (h.entities.removeById(F.editPointID.height[o]), - F.editPointID.height.splice(o, 1)), - m.pottingPoint.splice(o, 1), - 0 < F.editPointID.add.length) - ) - if (F.editPointID.add[o]) { - if ( - (h.entities.removeById(F.editPointID.add[o]), - F.editPointID.add.splice(o, 1), - 0 <= o - 1) - ) { - let e = h.entities.getById(F.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( - F.editPointID.add[F.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(F.editPointID.add[o - 1]), - F.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), - F.editPointID.move && (F.editPointID.move.position = t), - m.pottingPoint.concat([]))); - ("polyline" !== g && "polygon" !== g) || - SmartEarthPopupData.editGraphic.setValue("positions", o), - c.tooltip.show(!1), - a.callBack && - a.callBack.update && - a.callBack.update(d && d.name, m); - } - } - } - }, this._cesium.ScreenSpaceEventType.RIGHT_DOWN)); - }), - (x.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)); - } - }), - (x.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); - }), - (x.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, - ]; - }), - (x.prototype.isClampToGround = function (e) { - return e.heightReference && 1 === e.heightReference.getValue(); - }), - (x.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); - }), - (x.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); - }), - (x.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 - ? e.billboard - ? ((t.type = "billboard"), (t.object = e.billboard)) - : ((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 - ); - }), - (x.prototype.getSimpleGraphicData = function (r, n) { - let a = this, - s = this._viewer; - var e, t, i; - function o(e) { - (SmartEarthPopupData.editGraphic.fillColor = u( - "rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")" - )), - (SmartEarthPopupData.editGraphic.alpha = 100 * e.alpha); - } - function l(e) { - (SmartEarthPopupData.editGraphic.outlineColor = u( - "rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")" - )), - (SmartEarthPopupData.editGraphic.outlineAlpha = 100 * e.alpha); - } - function u(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], - labelGraphic: n.label, - 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]) - : -1 < e.indexOf("label_") - ? ((e = e.replace("label_", "")), - this.labelGraphic && - this.labelGraphic[e] && - (this.labelGraphic[e].getValue - ? this.labelGraphic[e].getValue() - : this.labelGraphic[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 < F.editPointID.height.length && - F.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 < F.editPointID.edit.length && - F.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 < F.editPointID.size.length && - F.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 < F.editPointID.add.length && - F.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 = F.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 () { - F.editPointID.edit.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.edit = []), - F.editPointID.height.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.height = []), - F.editPointID.add.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.add = []), - F.editPointID.size.forEach((e) => { - s.entities.removeById(e); - }), - (F.editPointID.size = []), - F.editPointID.move && s.entities.remove(F.editPointID.move), - (F.editPointID.move = void 0); - }, - }), - "billboard" === r && - ((e = SmartEarthPopupData.editGraphic.getValue("label_fillColor")) - ? ((e = e), - (SmartEarthPopupData.editGraphic.label_fillColor = u( - "rgb(" + - 255 * e.red + - "," + - 255 * e.green + - "," + - 255 * e.blue + - ")" - )), - (SmartEarthPopupData.editGraphic.label_alpha = 100 * e.alpha)) - : ((SmartEarthPopupData.editGraphic.lable_fillColor = "#00ff00"), - (SmartEarthPopupData.editGraphic.label_alpha = 60)), - (e = SmartEarthPopupData.editGraphic.getValue("label_outlineColor")) - ? ((e = e), - (SmartEarthPopupData.editGraphic.label_outlineColor = u( - "rgb(" + - 255 * e.red + - "," + - 255 * e.green + - "," + - 255 * e.blue + - ")" - )), - (SmartEarthPopupData.editGraphic.label_outlineAlpha = - 100 * e.alpha)) - : ((SmartEarthPopupData.editGraphic.label_outlineColor = "#ffffff"), - (SmartEarthPopupData.editGraphic.label_outlineAlpha = 60)), - (e = SmartEarthPopupData.editGraphic.getValue( - "label_backgroundColor" - )) - ? ((e = e), - (SmartEarthPopupData.editGraphic.label_backgroundColor = u( - "rgb(" + - 255 * e.red + - "," + - 255 * e.green + - "," + - 255 * e.blue + - ")" - )), - (SmartEarthPopupData.editGraphic.label_backgroundAlpha = - 100 * e.alpha)) - : ((SmartEarthPopupData.editGraphic.label_backgroundColor = - "#000000"), - (SmartEarthPopupData.editGraphic.label_backgroundAlpha = 80))), - "billboard" === r || "point" === r || "label" === r || "model" === r - ? ((e = - SmartEarthPopupData.editGraphic.getValue("color") || - SmartEarthPopupData.editGraphic.getValue("fillColor")) - ? o(e) - : ((SmartEarthPopupData.editGraphic.fillColor = "#00ff00"), - (SmartEarthPopupData.editGraphic.alpha = 60)), - (i = SmartEarthPopupData.editGraphic.getValue("outlineColor")) - ? l(i) - : ((SmartEarthPopupData.editGraphic.outlineColor = "#ffffff"), - (SmartEarthPopupData.editGraphic.outlineAlpha = 60)), - "label" === r && - ((i = SmartEarthPopupData.editGraphic.getValue("backgroundColor")) - ? ((i = i), - (SmartEarthPopupData.editGraphic.backgroundColor = u( - "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) { - var i; - if ("showLabel" === e) this.labelGraphic.show = t; - else 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 ("pHeight" === e) { - if (this.getValue("position")) { - var o = this.getValue("position"); - let e = Cesium.Cartographic.fromCartesian(o); - (e.height = t), - (this.entity.position = - Cesium.Cartographic.toCartesian(e)); - } - } else if (-1 < e.indexOf("label_")) { - if ( - "color" === (e = e.replace("label_", "")) || - "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 (this.labelGraphic.fillColor._value.alpha = - t); - if ("outlineAlpha" === e) - return void (this.labelGraphic.outlineColor._value.alpha = - t); - if ("backgroundAlpha" === e) - return void (this.labelGraphic.backgroundColor._value.alpha = - t); - } - this.labelGraphic[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); - } - 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 - ? ((i = SmartEarthPopupData.editGraphic.getValue("material")).color - ? o(i.color) - : ((SmartEarthPopupData.editGraphic.fillColor = "#00ff00"), - (SmartEarthPopupData.editGraphic.alpha = 60)), - i.outlineColor - ? l(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 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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - if ( - (F.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(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - F.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), - (F.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(0.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - F.editPointID.add.push(i.id); - } - } - })) - : "polygon" === r - ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color - ? o(t.color) - : ((SmartEarthPopupData.editGraphic.fillColor = "#00ff00"), - (SmartEarthPopupData.editGraphic.alpha = 60)), - (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) - ? l(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.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 < F.editPointID.edit.length && - !i && - t.forEach((e, t) => { - let i = s.entities.getById(F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - if ( - (F.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(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - F.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), - (F.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(0.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - F.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(0.4), - outlineWidth: 2, - outlineColor: Cesium.Color.WHITE.withAlpha(0.4), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - F.editPointID.add.push(o.id); - } - })) - : "ellipse" === r || "cylinder" === r || n.isSphere - ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color - ? o(t.color) - : ((SmartEarthPopupData.editGraphic.fillColor = "#00ff00"), - (SmartEarthPopupData.editGraphic.alpha = 60)), - (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) - ? l(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 = F.editPointID.move.position.getValue(), - r = a.GetPositionFromA_D(o, i, 90); - let e = s.entities.getById(F.editPointID.size[0]), - t = - ((e.position = r), - (n.pottingPoint[0] = r), - (n.pottingPoint[n.pottingPoint.length - 1] = o), - s.entities.getById(F.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - if ( - ((e.angle = 90), - F.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(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - F.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(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - F.editPointID.height.push(void 0, o.id)); - F.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(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - } - })) - : "rectangle" === r - ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color - ? o(t.color) - : ((SmartEarthPopupData.editGraphic.fillColor = "#00ff00"), - (SmartEarthPopupData.editGraphic.alpha = 60)), - (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) - ? l(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 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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - if ( - (F.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(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - F.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), - (F.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(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })); - } - })) - : "box" === r - ? ((t = SmartEarthPopupData.editGraphic.getValue("material")).color - ? o(t.color) - : ((SmartEarthPopupData.editGraphic.fillColor = "#00ff00"), - (SmartEarthPopupData.editGraphic.alpha = 60)), - (t = SmartEarthPopupData.editGraphic.getValue("outlineColor")) - ? l(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 = F.editPointID.move.position.getValue(), - o = a.GetPositionFromA_D(n, i / 2, o); - let e = s.entities.getById(F.editPointID.size[r]); - (e.position = o), - (this.entity.pottingPoint[r] = o), - (this.entity.pottingPoint[ - this.entity.pottingPoint.length - 1 - ] = n); - } else { - r = a.toDegrees(F.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(0.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })); - (t.angle = 180), - F.editPointID.size.push(e.id), - F.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(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - F.editPointID.height.push(void 0, void 0, o.id), - (F.editPointID.move = s.entities.add({ - name: "move_point", - position: i[2], - point: { - color: Cesium.Color.PURPLE, - pixelSize: 10, - outlineColor: Cesium.Color.WHITE.withAlpha(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })); - } - })) - : "corridor" !== r && "ellipsoid" === r && n.isSphere; - }), - (x.prototype.getStyle = function (t) { - let e, i; - i = this.getEntityTypeAndObject(t).type; - var o = n("distanceDisplayCondition"), - r = n("label_distanceDisplayCondition"); - function n(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]) - : -1 < e.indexOf("label_") - ? ((e = e.replace("label_", "")), - t.label && - t.label[e] && - (t.label[e].getValue ? t.label[e].getValue() : t.label[e])) - : t[i][e] && (t[i][e].getValue ? t[i][e].getValue() : t[i][e]); - } - return ( - "point" === i - ? (e = { - id: n("id"), - name: n("name"), - position: n("position"), - pixelSize: n("pixelSize"), - scaleByDistance: n("scaleByDistance"), - color: n("color") && n("color").toCssColorString(), - outlineWidth: n("outlineWidth"), - outlineColor: - n("outlineColor") && n("outlineColor").toCssColorString(), - heightReference: n("heightReference"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - }) - : "billboard" === i - ? ((r = { - showLabel: n("label_show"), - label_text: n("label_text"), - label_font: n("label_font"), - label_style: n("label_style"), - label_scale: n("label_scale"), - label_scaleByDistance: n("label_scaleByDistance"), - label_fillColor: - n("label_fillColor") && n("label_fillColor").toCssColorString(), - label_outlineColor: - n("label_outlineColor") && - n("label_outlineColor").toCssColorString(), - label_outlineWidth: n("label_outlineWidth"), - label_showBackground: n("label_showBackground"), - label_backgroundColor: - n("label_backgroundColor") && - n("label_backgroundColor").toCssColorString(), - label_horizontalOrigin: n("label_horizontalOrigin"), - label_verticalOrigin: n("label_verticalOrigin"), - label_heightReference: n("label_heightReference"), - label_distanceDisplayCondition: r && { near: r.near, far: r.far }, - }), - (e = { - id: n("id"), - name: n("name"), - position: n("position"), - image: n("image"), - scale: n("scale"), - scaleByDistance: n("scaleByDistance"), - rotation: n("rotation"), - width: n("width"), - height: n("height"), - color: n("color") && n("color").toCssColorString(), - horizontalOrigin: n("horizontalOrigin"), - verticalOrigin: n("verticalOrigin"), - heightReference: n("heightReference"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - ...r, - })) - : "label" === i - ? (e = { - id: n("id"), - name: n("name"), - position: n("position"), - text: n("text"), - font: n("font"), - style: n("style"), - scale: n("scale"), - scaleByDistance: n("scaleByDistance"), - fillColor: n("fillColor") && n("fillColor").toCssColorString(), - outlineColor: - n("outlineColor") && n("outlineColor").toCssColorString(), - outlineWidth: n("outlineWidth"), - showBackground: n("showBackground"), - backgroundColor: - n("backgroundColor") && n("backgroundColor").toCssColorString(), - horizontalOrigin: n("horizontalOrigin"), - verticalOrigin: n("verticalOrigin"), - heightReference: n("heightReference"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - }) - : "model" === i - ? (e = { - id: n("id"), - name: n("name"), - position: n("position"), - url: n("uri"), - minimumPixelSize: n("minimumPixelSize"), - runAnimations: n("runAnimations"), - scale: n("scale"), - heading: t.heading, - pitch: t.pitch, - roll: t.roll, - color: n("color") && n("color").toCssColorString(), - heightReference: n("heightReference"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - }) - : "polyline" === i - ? (e = { - id: n("id"), - name: n("name"), - positions: n("positions"), - clampToGround: n("clampToGround"), - color: n("material") && n("material").color.toCssColorString(), - outlineWidth: n("material") && n("material").outlineWidth, - outlineColor: - n("material") && n("material").outlineColor.toCssColorString(), - width: n("width"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - }) - : "polylineVolume" !== i && - "corridor" !== i && - "wall" !== i && - "path" !== i && - "plane" !== i && - ("polygon" === i - ? (e = { - id: n("id"), - name: n("name"), - positions: n("hierarchy").positions, - color: - n("material") && n("material").color.toCssColorString(), - image: n("material") && n("material").image, - repeat: n("material") && n("material").repeat, - outlineColor: - n("outlineColor") && n("outlineColor").toCssColorString(), - outline: n("outline"), - perPositionHeight: n("perPositionHeight"), - height: n("height"), - extrudedHeight: n("extrudedHeight"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - }) - : "ellipse" === i - ? ((e = { - id: n("id"), - name: n("name"), - position: n("position"), - radius: n("radius"), - semiMajorAxis: n("semiMajorAxis"), - semiMinorAxis: n("semiMinorAxis"), - color: - n("material") && n("material").color.toCssColorString(), - image: n("material") && n("material").image, - repeat: n("material") && n("material").repeat, - outlineColor: - n("outlineColor") && n("outlineColor").toCssColorString(), - outline: n("outline"), - height: n("height"), - heightReference: n("heightReference"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - }), - (i = "circle")) - : "rectangle" === i - ? (e = { - id: n("id"), - name: n("name"), - coordinates: n("coordinates"), - color: - n("material") && n("material").color.toCssColorString(), - image: n("material") && n("material").image, - repeat: n("material") && n("material").repeat, - outlineColor: - n("outlineColor") && n("outlineColor").toCssColorString(), - outline: n("outline"), - height: n("height"), - rotation: n("rotation"), - heightReference: n("heightReference"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - }) - : "box" === i - ? (e = { - id: n("id"), - name: n("name"), - position: n("position"), - dimensions: n("dimensions"), - color: - n("material") && n("material").color.toCssColorString(), - image: n("material") && n("material").image, - repeat: n("material") && n("material").repeat, - outlineColor: - n("outlineColor") && n("outlineColor").toCssColorString(), - outline: n("outline"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - }) - : "cylinder" === i - ? (e = { - id: n("id"), - name: n("name"), - position: n("position"), - radius: n("radius"), - topRadius: n("topRadius"), - bottomRadius: n("bottomRadius"), - length: n("length"), - color: - n("material") && n("material").color.toCssColorString(), - image: n("material") && n("material").image, - repeat: n("material") && n("material").repeat, - outlineColor: - n("outlineColor") && n("outlineColor").toCssColorString(), - outline: n("outline"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - changeTop: t.changeTop, - }) - : "ellipsoid" === i && - (e = { - id: n("id"), - name: n("name"), - position: n("position"), - radius: n("radius"), - radii: n("radii"), - color: - n("material") && n("material").color.toCssColorString(), - image: n("material") && n("material").image, - repeat: n("material") && n("material").repeat, - outlineColor: - n("outlineColor") && n("outlineColor").toCssColorString(), - outline: n("outline"), - distanceDisplayCondition: o && { near: o.near, far: o.far }, - isSphere: t.isSphere, - })), - (e.type = i), - (e.propData = this.getPropData(t)), - e - ); - }), - (x.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)); - }), - (x.prototype.addFeatures = function (e) { - let t = new this._cesium.EntityCollection(); - return ( - e.forEach((e) => { - e && (e = this.addFeature(e)) && t.add(e); - }), - t - ); - }), - (x.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); - }), - (x.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); - }); - }), - (x.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); - }); - }), - (x.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); - }), - (x.prototype.ScreenPlotting = function (e) { - -1 != e.treeobj.type.indexOf("Plotting") && this.featuresPlotting.push(e); - }); - var co, - ho, - mo = []; - function po(e) { - (this._viewer = e), - (this._core = new v()), - (this.points = []), - (this._SimpleGraphic = new x(this._viewer)), - this._SimpleGraphic.setEdit(!1); - } - (x.prototype.createsj = function (t) { - let i = 0, - e = ""; - if (0 != t.style.pId) - for (let e = 0; e < mo.length; e++) - mo[e].id === t.style.pId && (i = mo[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 }; - mo.push(o); - }), - (x.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 - ); - }), - (x.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 && - (F.editPointID.edit.forEach((e) => { - t.entities.removeById(e); - }), - (F.editPointID.edit = []), - F.editPointID.height.forEach((e) => { - t.entities.removeById(e); - }), - (F.editPointID.height = []), - F.editPointID.add.forEach((e) => { - t.entities.removeById(e); - }), - (F.editPointID.add = []), - F.editPointID.size.forEach((e) => { - t.entities.removeById(e); - }), - (F.editPointID.size = []), - F.editPointID.move && t.entities.remove(F.editPointID.move), - (F.editPointID.move = void 0), - window.layuiLayer.close(SmartEarthPopupData.layerIndex), - (SmartEarthPopupData.editGraphic = {}))), - this.defaultEdit(); - }), - (x.prototype.clear = function () { - let t = this._viewer; - this.SimpleGraphicObj.forEach((e) => { - t.entities.removeById(e); - }), - (this.SimpleGraphicObj = []), - this.PrimitiveCollection.removeAll(), - F.editPointID.edit.forEach((e) => { - t.entities.removeById(e); - }), - (F.editPointID.edit = []), - F.editPointID.height.forEach((e) => { - t.entities.removeById(e); - }), - (F.editPointID.height = []), - F.editPointID.add.forEach((e) => { - t.entities.removeById(e); - }), - (F.editPointID.add = []), - F.editPointID.size.forEach((e) => { - t.entities.removeById(e); - }), - (F.editPointID.size = []), - F.editPointID.move && t.entities.remove(F.editPointID.move), - (F.editPointID.move = void 0), - window.layuiLayer.close(SmartEarthPopupData.layerIndex), - (SmartEarthPopupData.editGraphic = {}), - this.defaultEdit(); - }), - (x.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"); - }), - (x.prototype.setRichtext = function (e, t) { - var i = e.position.getValue(); - this._viewer.entities.removeById(e.id); - let o = "0", - r = - (e.treeobj && - (F.delete(e.treeobj.id, this._viewer, this._cesium), - (o = e.treeobj.pId)), - new Ci(this._viewer)); - return ( - r.createDivPoint(e.name, i, { id: e.id, description: t, GroupID: o }), r - ); - }), - (x.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) {} - }), - (po.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 - ); - }), - (po.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, - }); - }), - (po.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, - }); - }), - (po.prototype.setVisibility = function (e) {}), - (po.prototype.deleteObject = function () { - this._SimpleGraphic.clear(); - }); - let go; - function fo(e) { - (this._viewer = e), (this.left = []), (this.right = []); - } - function _o() { - window.removeEventListener("mousemove", yo, !1), - window.removeEventListener("mouseup", _o, !1); - } - function Co(e) { - (go.dragStartX = e.clientX - go.slider.offsetLeft), - window.addEventListener("mousemove", yo, !1), - window.addEventListener("mouseup", _o, !1); - } - function yo(e) { - e = (e.clientX - go.dragStartX) / go.slider.parentElement.offsetWidth; - (go.slider.style.left = 100 * e + "%"), (go.scene.splitPosition = e); - } - function vo(e) { - (this._core = new v()), - (this._viewer = e), - (this.camera = this._viewer.camera), - (this.collision = !1), - (this.indoor_data = { - X_speedScale: 1, - Y_speedScale: 0.8, - moveRate: 0.2, - movementX: 0, - movementY: 0, - moveFactor: 0, - enable_looking: !1, - }), - (this.flags = { - looking: !1, - moveForward: !1, - moveBackward: !1, - moveUp: !1, - moveDown: !1, - moveLeft: !1, - moveRight: !1, - }); - } - function wo(e, t) { - (this._viewer = e), (this._cesium = t); - } - function bo(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this.Fireworks = []), - (this.Smog = []), - (this.Fountain = []), - (this.Flame = []), - (this.Blast = []); - } - function To(e) { - (this._viewer = e), (this._depth = 100), (this.show = !1); - } - function Eo(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F), - (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); - } - (fo.prototype.createSlider = function () { - this.close(); - let e = document.createElement("div"); - (e.id = "slider"), - (e.style.position = "absolute"), - (e.style.cursor = "e-resize"), - (e.style.top = 0), - (e.style.backgroundColor = "#D3D3D3"), - (e.style.width = "8px"), - (e.style.height = "100%"), - (e.style.zIndex = "1000"), - (e.style.left = "50%"), - this._viewer.container.appendChild(e), - (this._viewer.scene.splitPosition = - e.offsetLeft / e.parentElement.offsetWidth), - e.addEventListener("mousedown", Co, !1), - (this.slider = e), - (go = { dragStartX: 0, slider: e, scene: this._viewer.scene }); - }), - (fo.prototype.curtainContrast = function (e, t) { - this.createSlider(); - let i = this._viewer.imageryLayers.get(e), - o = this._viewer.imageryLayers.get(t); - this.left.push(i), - this.right.push(o), - (i.splitDirection = -1), - (o.splitDirection = 1); - }), - (fo.prototype.curtainContrastPro = function (e) { - this.createSlider(), - e.left.forEach((e) => { - (e.splitDirection = -1), e.item && (e.item.splitDirection = -1); - }), - e.right.forEach((e) => { - (e.splitDirection = 1), e.item && (e.item.splitDirection = 1); - }), - this.left.push(...e.left), - this.right.push(...e.right); - }), - (fo.prototype.close = function () { - this.slider && - ((this._viewer.scene.splitPosition = 0), - this.slider.removeEventListener("mousedown", Co, !1), - window.removeEventListener("mouseup", _o, !1), - window.removeEventListener("mousemove", yo, !1), - this.slider.remove(), - (this.slider = null), - this.left.forEach((e) => { - (e.splitDirection = 0), e.item && (e.item.splitDirection = 0); - }), - this.right.forEach((e) => { - (e.splitDirection = 0), e.item && (e.item.splitDirection = 0); - }), - (this.left = []), - (this.right = []), - (go = null)); - }), - (vo.prototype.createIndoormode = function (e = {}) { - let t = this._viewer.scene, - i = this._viewer.canvas; - if ( - (i.setAttribute("tabindex", "0"), - i.focus(), - (i.onclick = function () { - i.focus(); - }), - (t.screenSpaceCameraController.enableRotate = !1), - (t.screenSpaceCameraController.enableTranslate = !1), - (t.screenSpaceCameraController.enableZoom = !1), - (t.screenSpaceCameraController.enableTilt = !1), - (t.screenSpaceCameraController.enableLook = !1), - (this.bindEvent = { - pointerlockchange: this.pointerlockchange.bind(this), - mousemove: this.mousemove.bind(this), - keydown: this.keydown.bind(this), - keyup: this.keyup.bind(this), - mousewheel: this.mousewheel.bind(this), - dblclick: this.dblclick.bind(this), - }), - document.addEventListener( - "pointerlockchange", - this.bindEvent.pointerlockchange, - !1 - ), - document.addEventListener("mousemove", this.bindEvent.mousemove, !1), - document.addEventListener("keydown", this.bindEvent.keydown, !1), - document.addEventListener("keyup", this.bindEvent.keyup, !1), - document.addEventListener("mousewheel", this.bindEvent.mousewheel, !1), - document.addEventListener("dblclick", this.bindEvent.dblclick, !1), - this._viewer.clock.onTick.addEventListener(this.onTick, this), - this._viewer.container.requestPointerLock(), - e.showHelp) - ) { - var o, - r = e.helpPosition || { left: "20px", bottom: "20px" }; - for (o in ((this.explainContainer = document.createElement("div")), - (this.explainContainer.id = "IndoormodeExplainContainer"), - (this.explainContainer.style.cssText = ` - position: absolute; - padding: 10px; - background-color: rgba(0, 0, 0, 0.6); - border: 1px solid rgba(32, 160, 255, 0.6); - color: rgb(255, 255, 255); - font-size: 16px; - font-family: 寰蒋闆呴粦; - border-radius: 5px; - z-index: 999; - `), - r)) - this.explainContainer.style[o] = r[o]; - (this.explainContainer.innerHTML = - "W锛氬墠锛汼锛氬悗锛汚锛氬乏锛汥锛氬彸<br>Q锛氫笂锛汦锛氫笅<br>鍙屽嚮锛氱鎾炴娴嬶紱婊氳疆锛氱Щ鍔ㄩ�熷害<br>榧犳爣绉诲姩锛氭柟鍚戞帶鍒讹紱Esc锛氶��鍑�"), - this._viewer.container.append(this.explainContainer); - } - return this; - }), - (vo.prototype.dblclick = function (e) { - 0 === e.button && - ((this.collision = !this.collision), - layuiLayer.msg(this.collision ? "寮�鍚鎾炴娴�" : "鍏抽棴纰版挒妫�娴�")); - }), - (vo.prototype.mousemove = function (t) { - if (this.indoor_data.enable_looking) { - (this.indoor_data.movementX = t.movementX), - (this.indoor_data.movementY = t.movementY); - var t = this._viewer.canvas.clientWidth, - i = this._viewer.canvas.clientHeight, - t = this.indoor_data.movementX / t; - let e = -this.indoor_data.movementY / i; - ((!this.camera.roll && this.camera.pitch < 0 && e < 0) || - (!this.camera.roll && 0 < this.camera.pitch && 0 < e)) && - (e = 0), - this.camera.rotate( - this.camera.position, - t * this.indoor_data.X_speedScale - ), - this.camera.lookUp(e * this.indoor_data.Y_speedScale); - } - }), - (vo.prototype.mousewheel = function (e) { - 0 < e.wheelDelta - ? (this.indoor_data.moveRate += 0.02) - : (this.indoor_data.moveRate -= 0.02), - 1 < this.indoor_data.moveRate && (this.indoor_data.moveRate = 1), - this.indoor_data.moveRate < 0.1 && (this.indoor_data.moveRate = 0.1); - }), - (vo.prototype.pointerlockchange = function () { - document.pointerLockElement - ? (this.indoor_data.enable_looking = !0) - : this.indoor_data.enable_looking && this.close(); - }), - (vo.prototype.keydown = function (e) { - e = this.getFlagForKeyCode(e.keyCode); - void 0 !== e && (this.flags[e] = !0); - }), - (vo.prototype.keyup = function (e) { - e = this.getFlagForKeyCode(e.keyCode); - void 0 !== e && (this.flags[e] = !1); - }), - (vo.prototype.getFlagForKeyCode = function (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; - } - }), - (vo.prototype.onTick = function () { - let e = this.camera; - var t = this._viewer.scene.globe.getHeight(e.positionCartographic), - i = e.positionCartographic.height, - i = - ((this.indoor_data.moveFactor = i - t), - 100 < this.indoor_data.moveFactor - ? this.indoor_data.moveFactor / 100 - : this.indoor_data.moveRate); - (this.oldCameraPosition = { - position: e.position.clone(), - heading: e.heading, - pitch: e.pitch, - roll: e.roll, - }), - this.flags.moveForward && e.moveForward(i), - this.flags.moveBackward && e.moveBackward(i), - this.flags.moveUp && e.moveUp(i), - this.flags.moveDown && e.moveDown(i), - this.flags.moveLeft && e.moveLeft(i), - this.flags.moveRight && e.moveRight(i), - this.collision && this.checkCollision(); - }), - (vo.prototype.checkCollision = function () { - let e = this._core.pickFromRay( - this._viewer, - this.oldCameraPosition.position, - this.camera.position - ), - t = - (e && - e.position && - Cesium.Cartesian3.distance( - this.oldCameraPosition.position, - e.position - ) < 1 && - this.camera.setView({ - destination: this.oldCameraPosition.position, - orientation: { - heading: this.oldCameraPosition.heading, - pitch: this.oldCameraPosition.pitch, - roll: this.oldCameraPosition.roll, - }, - }), - this.camera.positionCartographic.clone()); - var i; - --t.height, - (t = Cesium.Cartographic.toCartesian(t)), - (e = this._core.pickFromRay(this._viewer, this.camera.position, t)) && - e.position && - 1.65 !== - Cesium.Cartesian3.distance(this.camera.position, e.position) && - ((i = - 1.65 - - Cesium.Cartesian3.distance(this.camera.position, e.position)), - ((t = this.camera.positionCartographic.clone()).height += i), - (t = Cesium.Cartographic.toCartesian(t)), - this.camera.setView({ - destination: t, - orientation: { - heading: this.oldCameraPosition.heading, - pitch: this.oldCameraPosition.pitch, - roll: this.oldCameraPosition.roll, - }, - })); - }), - (vo.prototype.close = function () { - this._handler && this._handler.destroy(), - (this._handler = null), - this.bindEvent && - (document.removeEventListener( - "pointerlockchange", - this.bindEvent.pointerlockchange, - !1 - ), - document.removeEventListener( - "mousemove", - this.bindEvent.mousemove, - !1 - ), - document.removeEventListener("keydown", this.bindEvent.keydown, !1), - document.removeEventListener("keyup", this.bindEvent.keyup, !1), - document.removeEventListener( - "mousewheel", - this.bindEvent.mousewheel, - !1 - ), - document.removeEventListener("dblclick", this.bindEvent.dblclick, !1), - (this.bindEvent = null)), - (this.collision = !1), - this._viewer.clock.onTick.removeEventListener(this.onTick, this), - this.explainContainer && this.explainContainer.remove(), - (this.explainContainer = null), - document.exitPointerLock(), - (this.indoor_data.enable_looking = !1), - (document.body.style.cursor = "default"), - (this._viewer.scene.screenSpaceCameraController.enableRotate = !0), - (this._viewer.scene.screenSpaceCameraController.enableTranslate = !0), - (this._viewer.scene.screenSpaceCameraController.enableZoom = !0), - (this._viewer.scene.screenSpaceCameraController.enableTilt = !0), - (this._viewer.scene.screenSpaceCameraController.enableLook = !0); - }), - (wo.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: 0.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: 0.7 }, - g = { min: 0.1, max: 0.9 }; - if ("sun" === e) - return ( - this.createWeather("rain", !1), - this.createWeather("snow", !1), - void this.createWeather("fog", !1) - ); - 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: 0.3, test3: -0.4, test4: 1 }), - (r = { test1: 7, test2: 0.3, test3: -0.4, test4: 1 })), - (n.test1 = 15 * (10 - parseFloat(n.test1)) + 10), - (n.test2 = 2.5 * parseFloat(n.test2) + 0.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 f = 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(f); - } - 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: 0.1, test3: 0.5, test4: 0.5 }), - (a = { test1: 7, test2: 0.1, test3: 0.5, test4: 0.5 })), - (n.test1 = 15 * (10 - parseFloat(n.test1)) + 10), - (n.test2 = parseFloat(n.test2) / 10), - (n.test3 = 0.7 * parseFloat(n.test3)), - (n.test4 = 0.8 * (1 - parseFloat(n.test4)) + 0.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 + "")); - f = 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(f); - } - 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; - f = 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(f); - } - } - }), - (wo.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); - }), - (bo.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; - }), - (bo.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 = [])); - }), - (bo.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 = [])); - } - }), - (bo.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), - f = 10, - r = c.defaultValue(t.num, 20), - _ = new c.Matrix4(); - function n(e, t, i) { - var o, - e = c.Cartesian3.add(m, e, new c.Cartesian3()), - e = c.Matrix4.fromTranslation(e, _), - 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 = 0.7 * ((a - d) / (p - d)) + 0.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(0.1), - bursts: i, - lifetime: f, - 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: 0.75, green: 0, minimumBlue: 0.8, alpha: 1 }, - { red: 0, minimumGreen: 0.75, minimumBlue: 0.8, alpha: 1 }, - { red: 0, green: 0, minimumBlue: 0.8, alpha: 1 }, - { minimumRed: 0.75, minimumGreen: 0.75, blue: 0, alpha: 1 }, - ], - s = 0; - s < r; - ++s - ) { - for ( - var C = c.Math.randomBetween(-100, 100), - y = c.Math.randomBetween(-80, 100), - v = c.Math.randomBetween(-50, 50), - C = new c.Cartesian3(C, y, v), - y = c.Color.fromRandom(a[s % a.length]), - w = [], - b = 0; - b < 3; - ++b - ) - w.push( - new c.ParticleBurst({ - time: c.Math.nextRandomNumber() * f, - minimum: 400, - maximum: 400, - }) - ); - this.Fireworks.push(n(C, y, 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)); - }), - (bo.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 + I.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(0.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); - }), - (bo.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 + I.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, 0.3), - endColor: new n.Color(0.8, 0.86, 1, 0.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); - }), - (bo.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 + I.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(0.7), - endColor: r.Color.YELLOW.withAlpha(0.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); - }), - (bo.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 + I.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); - }), - (bo.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; - }), - (bo.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) - ); - }), - (To.prototype.refreshGridLines = function () { - var e = this._relativeHeight < 0 && this.show, - t = this._viewer.camera, - t = new Cesium.Cartographic( - t.positionCartographic.longitude, - t.positionCartographic.latitude, - t.positionCartographic.height - this._depth - ); - this.item = this.UndergroundGridLines(t, e); - }), - (To.prototype.add = function (e) { - if (((this.show = !0), (this._depth = e || 100), !this.item)) - return ( - this._viewer.scene.primitives.add(this), this.refreshGridLines(), this - ); - }), - (To.prototype.update = function (e) { - this.item && - this.show && - (this.getRelativeHeight(), this.item.show && this.item.update(e)); - }), - (To.prototype.destroy = function () { - this.item && - (this._viewer.scene.primitives.remove(this), (this.item = null)); - }), - (To.prototype.UndergroundGridLines = function (e, t) { - let i = e; - e instanceof Cesium.Cartesian3 && - (i = this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e)); - e = new Cesium.GeometryInstance({ - geometry: new Cesium.EllipseGeometry({ - center: Cesium.Cartesian3.fromRadians(i.longitude, i.latitude), - height: i.height, - semiMinorAxis: 2e4, - semiMajorAxis: 2e4, - vertexFormat: Cesium.VertexFormat.POSITION_AND_ST, - }), - id: "undergroundSurface", - }); - let o = Cesium.Material.fromType("Grid"), - r = - ((o.uniforms.color = Cesium.Color.WHITE.withAlpha(0.8)), - (o.uniforms.cellAlpha = 0.01), - (o.uniforms.lineCount = new Cesium.Cartesian2(200, 200)), - (o.uniforms.lineThickness = new Cesium.Cartesian2(1, 1)), - Cesium.Material.fromType("Color")); - return ( - (r.uniforms.color = Cesium.Color.BLACK.withAlpha(0.8)), - this.grid1 && this.grid1.destroy(), - (this.grid1 = new Cesium.Primitive({ - geometryInstances: e, - appearance: new Cesium.EllipsoidSurfaceAppearance({ material: o }), - asynchronous: !1, - })), - this.grid2 && this.grid2.destroy(), - (this.grid2 = new Cesium.Primitive({ - geometryInstances: e, - appearance: new Cesium.EllipsoidSurfaceAppearance({ material: r }), - asynchronous: !1, - })), - (this.grid1.appearance.renderState.depthTest.enabled = !0), - (this.grid2.appearance.renderState.depthTest.enabled = !0), - { - show: t, - destroy: () => { - this.grid1 && this.grid1.destroy(), - this.grid2 && this.grid2.destroy(), - (this.grid1 = this.grid2 = null); - }, - update: (e) => { - this.grid1 && this.grid1.update(e), - this.grid2 && this.grid2.update(e); - }, - } - ); - }), - (To.prototype.getRelativeHeight = function () { - let e = this._viewer.camera; - var t = this._viewer.scene.globe.getHeight(e.positionCartographic); - (this._groundHeightAtCameraPosition = - t || this._groundHeightAtCameraPosition), - (this._relativeHeight = - e.positionCartographic.height - this._groundHeightAtCameraPosition), - this.oldCameraPosition || (this.oldCameraPosition = e.position.clone()), - this.oldCameraHeight || - (this.oldCameraHeight = e.positionCartographic.height), - 0 < this._relativeHeight - ? this.item && (this.item.show = !1) - : (this.item && (this.item.show = !0), - (Math.abs(this.oldCameraHeight - e.positionCartographic.height) > - this._depth / 10 || - 1e4 < - Cesium.Cartesian3.distance( - this.oldCameraPosition, - e.position - )) && - ((this.oldCameraPosition = e.position.clone()), - (this.oldCameraHeight = e.positionCartographic.height), - this.refreshGridLines())); - }), - (Eo.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: t.flyTime, - 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 - ); - }), - (Eo.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); - }, - })); - }), - (Eo.prototype.extend = function (e, t, i) { - for (var o in t) - t.hasOwnProperty(o) && (e.hasOwnProperty(o) || i) && (e[o] = t[o]); - return e; - }), - (Eo.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); - }), - (Eo.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) - ); - }), - (Eo.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) {}, - }); - }), - (Eo.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; - }), - (Eo.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, - f = 1 / 0; - "lide" === this.StreetViewType && - ((i = "&row={row}&col={col}"), - (d = this.StreetViewData.row), - (p = this.StreetViewData.col), - (g = this.StreetViewData.maxWidth), - (f = this.StreetViewData.maxHeight)); - for ( - var _ = () => { - if (++h == d * p) { - null == u && - ((u = document.createElement("canvas")), - (c = u.getContext("2d")), - (u.height = s > f ? f : 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 }); - } - }, - C = 0; - C < d; - C++ - ) - for (var y = 0; y < p; y++) { - var v = (v = t + i).replace("{row}", C).replace("{col}", y), - w = new Image(); - (w.onload = function () { - (r = this.width), (n = this.height), (a = r * p), (s = n * d), _(); - }), - (w.onerror = function () { - (this.src = ""), (this.onerror = void 0), _(); - }), - w.setAttribute("crossOrigin", "Anonymous"); - try { - w.src = v; - } catch (e) { - w.src = ""; - } - m.push(w); - } - }), - (Eo.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); - } - }), - (Eo.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); - } - ); - }); - }), - (Eo.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); - }, - }); - }), - (Eo.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 So, - Po, - xo, - Do, - Io, - Ao, - Lo, - Mo, - Ro, - Oo = null, - Bo = null, - Fo = { - looking: !(Eo.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 Ho(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F); - } - function Vo(e, t) { - (this._viewer = e), (this._cesium = t); - } - (Eo.prototype.attachMouseEvent = function () { - var t = this; - (Oo = this._viewer.scene), - (Bo = this._viewer.canvas), - (this.StreetViewData._handler = new this._cesium.ScreenSpaceEventHandler( - Bo - )), - Bo.setAttribute("tabindex", "0"), - Bo.focus(), - (Bo.onclick = function () { - Bo.focus(); - }), - setTimeout(function () { - t.setCesiumFov(t.StreetViewData.fov); - }, 4e3), - (Oo.screenSpaceCameraController.enableRotate = !1), - (Oo.screenSpaceCameraController.enableTranslate = !1), - (Oo.screenSpaceCameraController.enableZoom = !1), - (Oo.screenSpaceCameraController.enableTilt = !1), - (Oo.screenSpaceCameraController.enableLook = !1), - this.StreetViewData._handler.setInputAction(function (e) { - Fo.looking = !0; - }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), - this.StreetViewData._handler.setInputAction(function (e) { - Fo.looking && - ((co = e.startPosition), - (ho = e.endPosition), - t.StreetView_mouseMove()); - }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), - this.StreetViewData._handler.setInputAction(function (e) { - Fo.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); - }), - (Eo.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); - } - )); - }), - (Eo.prototype.StreetView_mouseMove = function () { - var e, - t, - i = this._viewer.camera; - Fo.looking && - ((e = Bo.clientWidth), - (t = Bo.clientHeight), - (e = -(ho.x - co.x) / e), - (t = (ho.y - co.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)); - }), - (Eo.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); - }), - (Eo.prototype.setCesiumFov = function (e) { - this._viewer.camera.frustum.fov = this._cesium.Math.toRadians(e); - }), - (Eo.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("鏆傛棤琛楁櫙鏁版嵁"); - }), - (Eo.prototype.updateStreetSphereIndex = function () { - this.StreetViewSphereIndex = 0 === this.StreetViewSphereIndex ? 1 : 0; - }), - (Eo.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], 0.5758, 135)), - i.push(e[0], e[1]), - (e = l(e[0], e[1], 0.2, 270)), - i.push(e[0], e[1]), - (e = l(e[0], e[1], 0.5, 180)), - i.push(e[0], e[1]), - (e = l(e[0], e[1], 0.4, 270)), - i.push(e[0], e[1]), - (e = l(e[0], e[1], 0.5, 0)), - i.push(e[0], e[1]), - (e = l(e[0], e[1], 0.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(0.2), - height: o.height, - }, - }); - (e.geometryName = "琛楁櫙"), - (e.isNavigation = !0), - (e.linkImageData = t), - i.StreetViewNavigation.push(e); - }), - (i.StreetViewData.navigation_handler = - new i._cesium.ScreenSpaceEventHandler(Bo)), - 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(0.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(0.9))) - : t && - ((t.polygon.outlineColor = - i._cesium.Color.BLACK.withAlpha(0.5)), - (t.polygon.material = i._cesium.Color.WHITE), - (t = void 0))), - t && i.MoveToLinkImage(t.linkImageData); - }, i._cesium.ScreenSpaceEventType.LEFT_CLICK); - }), - (Ho.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; - }), - (Ho.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; - }), - (Ho.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; - }), - (Ho.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; - }), - (Ho.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) - ); - }), - (Ho.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<time){\n float f = dis / time;\n material.alpha = pow(f, 4.0);\n }else{\n material.alpha = 0.0;\n }\n return material;\n }"), - a.Material._materialCache.addMaterial(a.Material.CircleScanType, { - fabric: { - type: a.Material.CircleScanType, - uniforms: { color: new a.Color(1, 0, 0, 1), time: 0 }, - source: a.Material.CircleScanSource, - }, - translucent: function (e) { - return !0; - }, - })); - e = { - name: "CircleScan", - position: e, - ellipse: { - height: r ? void 0 : s, - semiMinorAxis: t, - semiMajorAxis: t, - material: new a.CircleScanMaterialProperty(i, o), - }, - }; - return n.entities.add(e); - }), - (Ho.prototype.AddCircleScanMultiPostStage = 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.u_radius1 = 0), - (this.u_radius2 = 0), - (this.u_radius3 = 0), - (this.duration = t), - (this._time = new Date().getTime()); - } - a.CircleScanMultiMaterialProperty || - (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 "CircleScanMulti"; - }), - (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.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 - ); - }), - (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); - }), - (Ho.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), - 0.5 < this.old && t.time < 0.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); - }), - (Ho.prototype.setRadius = function (e) { - this.item && - ((this.item.ellipse.semiMinorAxis = parseFloat(e)), - (this.item.ellipse.semiMajorAxis = parseFloat(e))); - }), - (Ho.prototype.setTime = function (e) { - this.item && (this.item.ellipse.material.duration = parseFloat(e)); - }), - (Ho.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))); - }), - (Ho.prototype.setRadarRange = function (e) { - this.item && - "RadarScan" === this.item.ellipse.material.getType() && - (this.item.ellipse.material.range = 360 < e ? 360 : parseFloat(e)); - }), - (Ho.prototype.setRadarIsReturn = function (e) { - this.item && - "RadarScan" === this.item.ellipse.material.getType() && - (this.item.ellipse.material.isReturn = e); - }), - (Ho.prototype.setRadarIsGradient = function (e) { - this.item && - "RadarScan" === this.item.ellipse.material.getType() && - (this.item.ellipse.material.isGradient = e); - }), - (Ho.prototype.setPosition = function (e) { - this.item && - (this.item.position = new Cesium.Cartesian3.fromDegrees(e.lon, e.lat)); - }), - (Ho.prototype.remove = function () { - this._viewer.entities.remove(this.item); - }), - (Ho.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Ho.prototype.deleteObject = function () { - this.item && this._viewer.entities.remove(this.item); - }), - (Ho.prototype.setVisibility = function (e) { - this.item && (this.item.show = e); - }), - (Vo.prototype.depthTestAgainstTerrain = function (e) { - this._viewer.scene.globe.depthTestAgainstTerrain = e; - }), - (Vo.prototype.show = function () { - return this._viewer.scene.globe.depthTestAgainstTerrain; - }); - var D, - Go = [1, 1e5]; - function ko(e, t) { - var i, o; - if (!(D.canvas.width <= 0 || D.canvas.height <= 0)) - return ( - (o = D.camera.getPickRay(e)), - o && (i = D.scene.globe.pick(o, D.scene)), - (o = D.scene.pick(e)), - (o = o && o.id instanceof Cesium.Entity ? void 0 : o) && - (o = D.scene.pickPosition(e)) - ? o - : i - ); - } - function No(e, t) { - (this._normalShadowMap = e.scene.shadowMap), - (D = e), - (Cesium.Scene.prototype.screenToWorld = ko), - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._getPosition = new C(e)), - (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), - (So = 53 * Cesium.Math.RADIANS_PER_DEGREE), - (Po = 53 * Cesium.Math.RADIANS_PER_DEGREE), - (xo = 6371010), - (Do = { ABOVE_SEA_LEVEL: 0, ABOVE_GROUND_LEVEL: 1, ABOVE_MODEL: 2 }), - (Io = new Cesium.Cartesian3()), - (Mo = new Cesium.Matrix4()), - (Ao = new Cesium.Cartesian4()), - (Lo = new Cesium.Cartesian3()), - (Mo = new Cesium.Matrix4()), - ((Ro = new Array(4))[0] = new Cesium.Cartesian4(-1, -1, 1, 1)), - (Ro[1] = new Cesium.Cartesian4(1, -1, 1, 1)), - (Ro[2] = new Cesium.Cartesian4(1, 1, 1, 1)), - (Ro[3] = new Cesium.Cartesian4(-1, 1, 1, 1)); - } - (No.prototype.setOptions = function (e) { - this._currentObject = { - viewshedPrimitive: this._viewshedPrimitive, - viewshedMap: this._viewshedMap, - viewshedObjOptions: e || {}, - }; - }), - (No.prototype.startDraw = function (e) { - this._viewshedPrimitive && - (D.scene.primitives.remove(this._viewshedPrimitive), - (this._viewshedPrimitive = null)), - this._core.setDepthTest("open", this._viewer), - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.draw - ), - this._eventListener && this._eventListener.destroy(), - (this._eventListener = new Cesium.ScreenSpaceEventHandler( - D.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 - ), - D.scene.preRender.addEventListener(this.onPreFrameMobile, this)) - : (this._eventListener.setInputAction( - $.proxy(this.setViewshedPosition, this), - Cesium.ScreenSpaceEventType.LEFT_CLICK - ), - D.scene.preRender.addEventListener(this.onPreFrame, this)), - (this.end = (e) => { - (this.end = void 0), - D.scene.preRender.removeEventListener(this.onPreFrame, this); - try { - D.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); - }); - }), - (No.prototype.close = function () { - D.scene.preRender.removeEventListener(this.onPreFrame, this); - try { - D.scene.preRender.removeEventListener(this.onPreFrameMobile, this); - } catch (e) {} - this._eventListener && this._eventListener.destroy(), - this._viewshedPrimitive && - (D.scene.primitives.remove(this._viewshedPrimitive), - (this._viewshedPrimitive = null)); - var e, - t = D.scene, - i = { context: D.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), - (D.scene.globe.shadows = Cesium.ShadowMode.fromCastReceive(!0, !0)), - (D.scene.globe.show = !0), - (t.skyAtmosphere.show = !0), - (D.scene.shadowMap = this._normalShadowMap), - (this._startPositionCartesian = null), - this.resetAllVariables(), - this._core.setDepthTest("close", this._viewer), - this._core.mouse(this._viewer.container, 0); - }), - (No.prototype.setVisibility = function (e) { - (this._viewshedPrimitive.show = e), (D.shadowMap.enabled = e); - }), - (No.prototype.reset = function () { - var e, - t = D.scene, - i = { context: D.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), - (D.scene.globe.shadows = Cesium.ShadowMode.fromCastReceive(!0, !0)), - (D.scene.globe.show = !0), - (t.skyAtmosphere.show = !0), - (D.scene.shadowMap = this._normalShadowMap); - }), - (No.prototype.addViewshed = function (e = {}) { - this._viewshedPrimitive && this.close(); - var t = new Cesium.HeadingPitchRange(e.heading, e.pitch, 0.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 - ); - }), - (No.prototype.CreateViewshed = function (e, t, i, o) { - var r = D.scene, - n = new Cesium.Camera(r), - a = D.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), - (D.scene.globe.shadows = Cesium.ShadowMode.fromCastReceive(!0, !0)), - (D.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 - ); - }), - (No.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); - }), - (No.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, 0.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 = D.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 = D.scene.primitives._primitives[t]), - D.scene.primitives.remove(o))))) - : Cesium.defined(e) && - void 0 !== this._currentObject && - void 0 !== (t = this._getPosition.getMousePosition(e)) && - ((o = 0), - (this._startPositionCartographic = - D.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), xo)), - (this._occluder = new Cesium.Occluder(o, t)), - (this._canEnlarge = !0), - this._eventListener.setInputAction( - $.proxy(this.onMouseMove, this), - Cesium.ScreenSpaceEventType.MOUSE_MOVE - ))); - }), - (No.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 - ); - } - }), - (No.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, 0.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 = D.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 = D.scene.primitives._primitives[t]), - D.scene.primitives.remove(o))))) - : Cesium.defined(e) && - void 0 !== this._currentObject && - void 0 !== (t = this._getPosition.getMousePosition(e)) && - ((o = 0), - (this._startPositionCartographic = - D.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), xo)), - (this._occluder = new Cesium.Occluder(o, t)), - (this._canEnlarge = !0), - this._eventListener.setInputAction( - $.proxy(this.onMouseMove, this), - Cesium.ScreenSpaceEventType.MOUSE_MOVE - ))); - }), - (No.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 = D.scene.globe.ellipsoid.cartesianToCartographic(t)), - (this._currentObject.viewshedObjOptions.pickHeight = - r.height), - (this._currentObject.viewshedObjOptions.terrainHeight = - D.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, - D.camera.position, - this._scratchCartesian3 - ), - this._scratchCartesian3 - ) * - (e / D.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 == - Do.ABOVE_SEA_LEVEL - ? new Cesium.Cartesian3.fromRadians( - r.longitude, - r.latitude, - this._startingRepoZHeight - ) - : t), - (this._newPosition = o)) - : ((e = Cesium.Matrix4.multiplyByVector( - D.camera._viewMatrix, - Cesium.Cartesian4.fromElements(t.x, t.y, t.z, 1, Ao), - Ao - )), - (r = Cesium.Matrix4.multiplyByVector( - D.camera.frustum.projectionMatrix, - e, - Ao - )), - (o = Cesium.Cartesian3.divideByScalar(r, r.w, Lo)), - (e = Math.floor((0.5 * o.x + 0.5) * D.canvas.width)), - (r = Math.floor((0.5 * o.y + 0.5) * D.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))); - }), - (No.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 && - D.scene.primitives.remove(this._viewshedPrimitive); - var r = Cesium.Matrix4.multiplyByTranslation( - Cesium.Transforms.eastNorthUpToFixedFrame(i), - new Cesium.Cartesian3(0, 0, 0), - Mo - ), - 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, 0.5) - ), - }, - }), - a = - ((this._viewshedPrimitive = D.scene.primitives.add( - new Cesium.Primitive({ - geometryInstances: n, - appearance: new Cesium.PerInstanceColorAppearance({ - flat: !0, - renderState: { lineWidth: 1 }, - }), - allowPicking: !1, - asynchronous: !1, - }) - )), - new Cesium.Camera(D.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; - }), - (No.prototype.createViewshedCameraPrimitive = function (e, t) { - null != this._viewshedPrimitive && - D.scene.primitives.remove(this._viewshedPrimitive); - var i = new Cesium.Camera(D.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 = D.scene.globe.ellipsoid.geodeticSurfaceNormal( - i.position, - Io - ))), - (i.frustum.isViewshed = !0), - (i.frustum.fov = Cesium.defaultValue( - this._currentObject.viewshedObjOptions.fov, - So - )), - (i.frustum._fovy = Cesium.defaultValue( - this._currentObject.viewshedObjOptions.fovy, - Po - )), - (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 = D.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) - ); - }), - (No.prototype.createViewshedMap = function () { - null == D.scene.viewsheds && D.scene.viewsheds, - null != this._viewshedPrimitive._camera && - this._canEnlarge && - (null == this._viewshedMap - ? ((this._viewshedMap = new Cesium.ShadowMap({ - context: D.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 - )))); - }), - (No.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 = Go)[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, Mo)), - (i = Cesium.Matrix4.inverse(o, Mo))) - : (t = Cesium.Matrix4.inverseTransformation(s, Mo)), - 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(Ro[c], No[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 = 0.5 * (d.x * (r.right - r.left) + r.left + r.right)), - (d.y = 0.5 * (d.y * (r.top - r.bottom) + r.bottom + r.top)), - (d.z = 0.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, - f = new Uint16Array(8 * (2 * a + 1 + 1)); - for (u = 0; u < a + 1; ++u) - (f[(p = 8 * u)] = g = 4 * u), - (f[p + 1] = g + 1), - (f[p + 2] = g + 1), - (f[p + 3] = g + 2), - (f[p + 4] = g + 2), - (f[p + 5] = g + 3), - (f[p + 6] = g + 3), - (f[p + 7] = g); - for (u = 0; u < a; ++u) - (f[(p = 8 * (a + 1 + u))] = g = 4 * u), - (f[p + 1] = g + 4), - (f[p + 2] = g + 1), - (f[p + 3] = g + 5), - (f[p + 4] = g + 2), - (f[p + 5] = g + 6), - (f[p + 6] = g + 3), - (f[p + 7] = g + 7); - (f[(p += 8)] = g + 8), - (f[p + 1] = g + 1), - (f[p + 2] = g + 8), - (f[p + 3] = g + 2), - (f[p + 4] = g + 8), - (f[p + 5] = g + 3), - (f[p + 6] = g + 8), - (f[p + 7] = g + 4), - (this._outlinePrimitive = new Cesium.Primitive({ - geometryInstances: new Cesium.GeometryInstance({ - geometry: { - attributes: s, - indices: f, - 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); - } - }), - (No.prototype.getHorizonDistance = function (e) { - return Math.sqrt(Math.pow(xo + e, 2) - Math.pow(xo, 2)); - }), - (No.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 = D.scene.globe.getHeight(t)), - (this._currentObject.viewshedMap.isBelowGround = t.height < i + 0.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 == - Do.ABOVE_GROUND_LEVEL && null == this._zAxisNewPosition - ? ((o = Cesium.Cartographic.fromCartesian( - this._newPosition.clone() - )), - (r = Cesium.Cartesian3.fromRadians( - o.longitude, - o.latitude, - D.scene.globe.getHeight(o) + - this._currentObject.startingAltitudeAboveGround - )), - (this._currentObject.viewshedPrimitive._camera.position = - r)) - : this._currentObject.viewshedObjOptions.altitudeMethod == - Do.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()))); - }), - (No.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 = D.scene.globe.getHeight(t)), - (this._currentObject.viewshedMap.isBelowGround = t.height < i + 0.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 == - Do.ABOVE_GROUND_LEVEL && null == this._zAxisNewPosition - ? ((o = Cesium.Cartographic.fromCartesian( - this._newPosition.clone() - )), - (r = Cesium.Cartesian3.fromRadians( - o.longitude, - o.latitude, - D.scene.globe.getHeight(o) + - this._currentObject.startingAltitudeAboveGround - )), - (this._currentObject.viewshedPrimitive._camera.position = - r)) - : this._currentObject.viewshedObjOptions.altitudeMethod == - Do.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()))); - }); - var jo, - zo, - Uo, - Wo, - Yo = - "vec4 toEye(in vec2 uv, in float depth){\nvec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\nvec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\nposInCamera =posInCamera / posInCamera.w;\nreturn posInCamera;\n}\nfloat getDepth(in vec4 depth){\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}\nmat4 inverse_mat4(mat4 m)\n{\nfloat Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\nfloat Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];\nfloat Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3];\nfloat Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\nfloat Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3];\nfloat Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3];\nfloat Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\nfloat Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2];\nfloat Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2];\nfloat Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\nfloat Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3];\nfloat Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3];\nfloat Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\nfloat Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2];\nfloat Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2];\nfloat Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\nfloat Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];\nfloat Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];\nconst vec4 SignA = vec4( 1.0, -1.0, 1.0, -1.0);\nconst vec4 SignB = vec4(-1.0, 1.0, -1.0, 1.0);\nvec4 Fac0 = vec4(Coef00, Coef00, Coef02, Coef03);\nvec4 Fac1 = vec4(Coef04, Coef04, Coef06, Coef07);\nvec4 Fac2 = vec4(Coef08, Coef08, Coef10, Coef11);\nvec4 Fac3 = vec4(Coef12, Coef12, Coef14, Coef15);\nvec4 Fac4 = vec4(Coef16, Coef16, Coef18, Coef19);\nvec4 Fac5 = vec4(Coef20, Coef20, Coef22, Coef23);\nvec4 Vec0 = vec4(m[1][0], m[0][0], m[0][0], m[0][0]);\nvec4 Vec1 = vec4(m[1][1], m[0][1], m[0][1], m[0][1]);\nvec4 Vec2 = vec4(m[1][2], m[0][2], m[0][2], m[0][2]);\nvec4 Vec3 = vec4(m[1][3], m[0][3], m[0][3], m[0][3]);\nvec4 Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);\nvec4 Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);\nvec4 Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);\nvec4 Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);\nmat4 Inverse = mat4(Inv0, Inv1, Inv2, Inv3);\nvec4 Row0 = vec4(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);\nfloat Determinant = dot(m[0], Row0);\nInverse /= Determinant;\nreturn Inverse;\n}\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec3 cen;\nuniform vec3 position;\nuniform vec3 eupp;\nuniform vec3 angle;\nuniform vec4 nearAndFar;\nuniform sampler2D video;\nuniform vec4 visible;\nuniform vec4 unvisible;\nuniform float type;\nuniform sampler2D stcshadow;\nuniform mat4 _shadowMap_matrix;\nuniform vec4 shadowMap_lightPositionEC;\nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;\nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;\nmat4 computeMat(){\nvec3 dir = normalize( position - cen );\nvec3 up = normalize( eupp - cen);\nvec3 right = cross(dir , up);\nright = normalize(right);\nup = cross(right , dir);\nup = normalize(up);\nreturn mat4(\nright.x,right.y,right.z,0.,\nup.x,up.y,up.z,0.,\ndir.x,dir.y,dir.z,0.,\ncen.x,cen.y,cen.z,1.\n);\n}\nmat3 computeMat3(float an){\nfloat sa = sin(an);\nfloat ca = cos(an);\nreturn mat3(\nca , -sa ,0.,\nsa , ca , 0.,\n0.,0.,1.\n);\n}\nvoid main(){\nvec2 uv = v_textureCoordinates;\nfloat depth = getDepth(texture2D( depthTexture , uv));\nvec4 oc = texture2D(colorTexture , uv);\nvec4 ec = toEye( uv , depth);\nec /= ec.w;\nvec3 snor = normalize(position - cen);\nvec3 pd = ec.xyz - cen;\nfloat dd = length(pd);\nvec3 n = normalize(ec.xyz - cen);\nfloat d = dot(n , snor);\nmat4 localMat = computeMat();\nvec4 p = inverse_mat4(localMat) * ec;\np /= p.w;\nif( p.z < nearAndFar.x || p.z > nearAndFar.y){\ngl_FragColor = oc;\nreturn;\n}\nvec3 pp = p.xyz;\nmat3 rm = computeMat3( radians( angle.z ) );\npp = rm * pp;\nvec3 nn = pp.xyz;\nvec3 zn = vec3(0.,0.,1.);\nfloat dist = dot( nn , zn);\nfloat dx = pp.x ;\nfloat xangle = tan(radians( angle.x ));\nfloat yangle = tan(radians( angle.y ));\nfloat tanx = pp.x / dist;\nfloat tany = pp.y / dist;\nif( (tanx > -xangle && tanx< xangle) &&(tany > -yangle && tany < yangle)){\nczm_shadowParameters shadowParameters;\nshadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;\nshadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;\nshadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;\nshadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;\nshadowParameters.depthBias *= max(depth * 0.01, 1.0);\nvec3 directionEC = normalize(ec.xyz - shadowMap_lightPositionEC.xyz);\nvec3 normalEC = vec3(1.0);\nfloat nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);\nvec4 shadowPosition = _shadowMap_matrix * ec;\nshadowPosition /= shadowPosition.w;\nshadowParameters.texCoords = shadowPosition.xy;\nshadowParameters.depth = shadowPosition.z;\nshadowParameters.nDotL = nDotL;\nfloat visibility = czm_shadowVisibility(stcshadow, shadowParameters);\nif(type == 0.0){\nif(visibility == 1.0){\ngl_FragColor = mix(oc , visible , nearAndFar.z);\n}else{\ngl_FragColor = mix(oc , unvisible , nearAndFar.z);\n}\n}else{\nif(visibility == 1.0){\nfloat r = (tanx + xangle) / (2. * xangle);\nfloat g = (tany + yangle) / (2. * yangle);\nvec4 col = texture2D( video , vec2( r , g));\nfloat f1 = 1.;\nfloat v1 = nearAndFar.w ;\nfloat v2 = 1. - v1;\nif(r < v1){\nf1 = r / v1;\n}\nif(r > v2){\nf1 = (1. - r) / v1;\n}\nfloat f2 = 1.;\nif(g < v1){\nf2 = g / v1;\n}\nif(g > v2){\nf2 = (1. - g) / v1;\n}\nfloat f12 = f1 * f2;\nfloat ff = smoothstep( 0. , 1. , f12 );\nff *= nearAndFar.z;\ngl_FragColor = mix(oc , col , ff);\n}else{\ngl_FragColor = oc;\n}\n}\n}else{\ngl_FragColor = oc;\n}\n}\n"; - let Jo = new v(); - function Ko(e, t) { - (this._viewer = e), - (this.video = t.video), - (this.viewshed = t.viewshed || {}), - (this.cameraPosition = - t.cameraPosition.x && t.cameraPosition.y && t.cameraPosition.z - ? t.cameraPosition - : Cesium.Cartesian3.fromDegrees( - t.cameraPosition.lon, - t.cameraPosition.lat, - t.cameraPosition.height - )), - (this.position = - t.position && - (t.position instanceof Cesium.Cartesian3 - ? t.position - : Cesium.Cartesian3.fromDegrees( - t.position.lon, - t.position.lat, - t.position.height - ))), - (this.heading = t.heading || 0), - (this.pitch = t.pitch || 0), - (this.alpha = t.alpha || 0.9), - (this.horizonAngle = t.horizonAngle || 60), - (this.verticalAngle = t.verticalAngle || 40), - (this.angle = new Cesium.Cartesian3( - this.horizonAngle / 2, - this.verticalAngle / 2, - 0 - )), - (this.near = Jo.defaultValue(t.near, 1)), - (this.far = t.far || 30), - (this.showFarScale = t.showFarScale || 5), - (this.offset = 0), - (this.show = !0), - this.video && (this.offset = Jo.defaultValue(t.video.offset, 0.1)), - (this.viewshed.visible = Cesium.Color.fromCssColorString( - this.viewshed.visible || "#00ff00" - )), - (this.viewshed.unvisible = Cesium.Color.fromCssColorString( - this.viewshed.unvisible || "#ff0000" - )), - (this.nearAndFar = new Cesium.Cartesian4( - this.near, - this.far, - this.alpha, - this.offset - )), - (this.center = new Cesium.Cartesian3()), - (this.eupp = new Cesium.Cartesian3()), - (this.epp = new Cesium.Cartesian3()), - (this.upp = this.setSpHeight(this.cameraPosition)), - (this.useLine = Cesium.defaultValue(t.useLine, !0)), - this._viewer.scene.primitives.add(this), - this.init(); - } - function Qo(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F), - (this._getPosition = new C(this._viewer, this._cesium)), - (this.tooltip = this._core.CreateTooltip()); - } - function qo(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this.isPause = !1), - (this.isLoad = !1); - } - function Xo(e, t) { - (this._viewer = e), (this._cesium = t); - } - function Zo(e, t, i, h, m, d) { - const { - Pass: o, - defined: r, - PerspectiveFrustum: n, - PerspectiveOffCenterFrustum: a, - OrthographicFrustum: s, - OrthographicOffCenterFrustum: l, - } = Cesium; - (jo = jo || new n()), - (zo = zo || new a()), - (Uo = Uo || new s()), - (Wo = Wo || new l()); - let u = e._us, - c = u._frameState, - p = c.camera, - g = p._scene, - f = g._view, - _ = f.frustumCommandsList, - C = _.length; - var y, - v, - w, - b = g._globeTranslucencyState, - T = b.translucent; - function E(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 S = r(p.frustum.fov) - ? p.frustum.clone(jo) - : r(p.frustum.infiniteProjectionMatrix) - ? p.frustum.clone(zo) - : r(p.frustum.width) - ? p.frustum.clone(Uo) - : p.frustum.clone(Wo), - P = 0; - P < C; - ++P - ) { - var x = C - P - 1, - D = _[x], - I = i.framebuffer; - if ( - ((i.framebuffer = t), - (S.near = 0 != x ? D.near * g.opaqueFrustumNearOffset : D.near), - (S.far = D.far), - u.updateFrustum(S), - u.updatePass(o.GLOBE), - (w = D.commands[o.GLOBE]), - (v = D.indices[o.GLOBE]), - T) - ) - b.executeGlobeCommands(D, E, globeTranslucencyFramebuffer, g, i); - else for (y = 0; y < v; ++y) E(w[y], g, e, i); - for ( - u.updatePass(o.CESIUM_3D_TILE), - w = D.commands[o.CESIUM_3D_TILE], - v = D.indices[o.CESIUM_3D_TILE], - y = 0; - y < v; - ++y - ) - E(w[y], g, e, i); - for ( - u.updatePass(o.OPAQUE), - w = D.commands[o.OPAQUE], - v = D.indices[o.OPAQUE], - y = 0; - y < v; - ++y - ) - E(w[y], g, e, i); - for ( - u.updatePass(o.TRANSLUCENT), - w = D.commands[o.TRANSLUCENT], - v = D.indices[o.TRANSLUCENT], - y = 0; - y < v; - ++y - ) - E(w[y], g, e, i); - i.framebuffer = I; - } - } - (Ko.prototype.createViewCone = function () { - var e; - this.line && - (this._viewer.scene.primitives.remove(this.line), (this.line = null)), - this.useLine && - ((e = this.viewShadowMap._lightCamera), - (this.line = new Cesium.Primitive({ - geometryInstances: new Cesium.GeometryInstance({ - geometry: new Cesium.FrustumOutlineGeometry({ - origin: e.positionWC, - orientation: this.orientationData, - frustum: e.frustum, - }), - attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromCssColorString("#fff") - ), - }, - }), - appearance: new Cesium.PerInstanceColorAppearance({ - translucent: !1, - flat: !0, - }), - asynchronous: !1, - allowPicking: !1, - })), - this._viewer.scene.primitives.add(this.line)); - }), - (Ko.prototype.isShow = function () { - return ( - this.show && - Jo.getPointToCameraDistance(this._viewer, this.cameraPosition) < - this.far * this.showFarScale - ); - }), - (Ko.prototype.init = function () { - if (!this.post || !this.texture) { - if (!(this.upp instanceof Cesium.Cartesian3)) - throw new Error("璁$畻涓婃柟鍚戦敊璇�"); - this._createShadowMap(), this.createViewCone(); - const o = this.video && this.video.container, - r = this; - let e = this._viewer.scene.context.uniformState, - t = this.viewShadowMap._isPointLight - ? this.viewShadowMap._pointBias - : this.viewShadowMap._primitiveBias, - i = 0; - o && - ((this.texture = new Cesium.Texture({ - context: this._viewer.scene.context, - source: o, - width: 1, - height: 1, - })), - (i = 1)), - (this.post = new Cesium.PostProcessStage({ - uniforms: { - type: function () { - return i; - }, - cen: function () { - return Cesium.Matrix4.multiplyByPoint( - e.view3D, - r.cameraPosition, - r.center - ); - }, - position: function () { - return Cesium.Matrix4.multiplyByPoint( - e.view3D, - r.videoCenter, - r.epp - ); - }, - eupp: function () { - return Cesium.Matrix4.multiplyByPoint(e.view3D, r.upp, r.eupp); - }, - video: function () { - return ( - o && - 2 <= o.readyState && - !r.isPause && - r.texture.copyFrom({ source: o }), - r.texture || r._viewer.scene.context.defaultTexture - ); - }, - visible: function () { - return r.viewshed.visible; - }, - unvisible: function () { - return r.viewshed.unvisible; - }, - angle: function () { - return r.angle; - }, - nearAndFar: function () { - return r.nearAndFar; - }, - _shadowMap_matrix: function () { - return r.viewShadowMap._shadowMapMatrix; - }, - shadowMap_lightPositionEC: function () { - return r.viewShadowMap._lightPositionEC; - }, - shadowMap_texelSizeDepthBiasAndNormalShadingSmooth: function () { - let e = new Cesium.Cartesian2(); - return ( - (e.x = 1 / r.viewShadowMap._textureSize.x), - (e.y = 1 / r.viewShadowMap._textureSize.y), - Cesium.Cartesian4.fromElements( - e.x, - e.y, - t.depthBias, - t.normalShadingSmooth - ) - ); - }, - shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness: - function () { - return Cesium.Cartesian4.fromElements( - t.normalOffsetScale, - r.viewShadowMap._distance, - r.viewShadowMap.maximumDistance, - r.viewShadowMap._darkness - ); - }, - stcshadow: function () { - return r.viewShadowMap._shadowMapTexture; - }, - }, - fragmentShader: Yo, - })), - this._viewer.scene.postProcessStages.add(this.post); - } - }), - (Ko.prototype._createShadowMap = function () { - let e = new Cesium.Camera(this._viewer.scene); - (e.frustum.fov = Cesium.Math.toRadians(this.horizonAngle)), - (e.frustum.aspectRatio = this.horizonAngle / this.verticalAngle), - (e.frustum.near = this.near), - (e.frustum.far = this.far), - this.position - ? ((e.position = this.cameraPosition), - (e.direction = Cesium.Cartesian3.subtract( - this.position, - this.cameraPosition, - new Cesium.Cartesian3(0, 0, 0) - )), - (e.up = Cesium.Cartesian3.normalize( - this.cameraPosition, - new Cesium.Cartesian3(0, 0, 0) - )), - (t = Cesium.Cartesian3.normalize( - Cesium.Cartesian3.subtract( - this.position, - this.cameraPosition, - new Cesium.Cartesian3() - ), - new Cesium.Cartesian3() - )), - (e.direction = t), - (this.heading = Cesium.Math.toDegrees(e.heading)), - (this.pitch = Cesium.Math.toDegrees(e.pitch))) - : e.setView({ - destination: this.cameraPosition, - orientation: { - heading: Cesium.Math.toRadians(this.heading), - pitch: Cesium.Math.toRadians(this.pitch), - roll: 0, - }, - }); - var t = new Cesium.Cartesian3(), - i = new Cesium.Matrix3(), - o = new Cesium.Quaternion(), - r = e.upWC, - n = e.rightWC, - n = Cesium.Cartesian3.negate(n, t), - t = i; - if ( - (Cesium.Matrix3.setColumn(t, 0, n, t), - Cesium.Matrix3.setColumn(t, 1, r, t), - Cesium.Matrix3.setColumn(t, 2, e.direction, t), - (this.orientationData = Cesium.Quaternion.fromRotationMatrix(t, o)), - !this.position) - ) { - var a = new Float64Array(24); - Cesium.FrustumGeometry._computeNearFarPlanes( - e.positionWC, - this.orientationData, - 0, - e.frustum, - a - ); - let t = new Cesium.Cartesian3(); - for (let e = 12; e < a.length; e += 3) - (t.x += a[e]), (t.y += a[e + 1]), (t.z += a[e + 2]); - Cesium.Cartesian3.multiplyByScalar(t, 0.25, t), (this.position = t); - } - (this.videoCenter = this.position), - (this.position = null), - (this.viewShadowMap = new Cesium.ShadowMap({ - lightCamera: e, - enabled: !1, - isPointLight: !1, - isSpotLight: !0, - cascadesEnabled: !1, - context: this._viewer.scene.context, - pointLightRadius: this.far, - })), - (this.viewShadowMap.guid = Cesium.createGuid()); - }), - (Ko.prototype.flyTo = function () { - var e; - this.viewShadowMap && - this.viewShadowMap._lightCamera && - ((e = this.viewShadowMap._lightCamera), - this._viewer.camera.flyTo({ - destination: e.position, - orientation: { heading: e.heading, pitch: e.pitch, roll: 0 }, - })); - }), - (Ko.prototype.updatePost = function (e) { - e.cameraPosition && - (this.cameraPosition = - e.cameraPosition instanceof Cesium.Cartesian3 - ? e.cameraPosition - : Cesium.Cartesian3.fromDegrees( - e.cameraPosition.lon, - e.cameraPosition.lat, - e.cameraPosition.height - )), - e.position && - (this.position = - e.position instanceof Cesium.Cartesian3 - ? e.position - : Cesium.Cartesian3.fromDegrees( - e.position.lon, - e.position.lat, - e.position.height - )), - isNaN(e.heading) || - "number" != typeof e.heading || - (this.heading = e.heading), - isNaN(e.pitch) || "number" != typeof e.pitch || (this.pitch = e.pitch), - isNaN(e.alpha) || "number" != typeof e.alpha || (this.alpha = e.alpha), - isNaN(e.horizonAngle) || - "number" != typeof e.horizonAngle || - ((this.horizonAngle = e.horizonAngle), - (this.angle.x = this.horizonAngle / 2)), - isNaN(e.verticalAngle) || - "number" != typeof e.verticalAngle || - ((this.verticalAngle = e.verticalAngle), - (this.angle.y = this.verticalAngle / 2)), - isNaN(e.near) || - "number" != typeof e.near || - ((this.near = e.near), (this.nearAndFar.x = this.near)), - isNaN(e.far) || - "number" != typeof e.far || - ((this.far = e.far), (this.nearAndFar.y = this.far)), - isNaN(e.offset) || - "number" != typeof e.offset || - ((this.nearAndFar.w = e.offset), (this.offset = e.offset)), - isNaN(e.alpha) || - "number" != typeof e.alpha || - ((this.nearAndFar.z = e.alpha), (this.alpha = e.alpha)), - isNaN(e.showFarScale) || - "number" != typeof e.showFarScale || - (this.showFarScale = e.showFarScale), - void 0 !== e.useLine && (this.useLine = e.useLine), - this._createShadowMap(), - this.createViewCone(); - }), - (Ko.prototype.update = function (e) { - var t; - this.viewShadowMap && - this.show && - ((t = this.isShow()), - this.post && (this.post.enabled = t), - this.line && (this.line.show = t), - t && this._viewer.scene.frameState.shadowMaps.push(this.viewShadowMap)); - }), - (Ko.prototype.setVisibility = function (e) { - (this.show = e), - this.post && (this.post.enabled = e), - this.line && (this.line.show = e); - }), - (Ko.prototype.destroy = function () { - return ( - 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._viewer.scene.primitives.remove(this), - this.shadowMaps && this.shadowMaps.destroy(), - this.line && - (this._viewer.scene.primitives.remove(this.line), (this.line = null)), - Cesium.destroyObject(this) - ); - }), - (Ko.prototype.setSpHeight = function (e, t = 5e3) { - let i = Cesium.Cartographic.fromCartesian(e); - return (i.height += t), Cesium.Cartographic.toCartesian(i); - }), - (Ko.prototype.changeHorizonAngle = function (e) { - this.updatePost({ horizonAngle: parseFloat(e) }); - }), - (Ko.prototype.changeVerticalAngle = function (e) { - this.updatePost({ verticalAngle: parseFloat(e) }); - }), - (Ko.prototype.changeRotateAngle = function (e) { - this.updatePost({ angleZ: parseFloat(e) }); - }), - (Qo.prototype.createViewCone = function (s, l) { - (s = s || {}), - (s = this._core.extend( - { - roll: 0, - fov: 60, - near: 1, - height: 1.6, - 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 + I.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 - )), - (F.states = 1), - []); - return ( - this.drawHandler.setInputAction((t) => { - var e, - i, - o, - r, - n, - a, - t = u._getPosition.getMousePosition(t); - if (t) { - if (0 === h.length) { - if (s.height) { - let e = u._core.toDegrees(t); - (e.height += s.height), - h.push(Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height)); - } else h.push(t); - h.push(t); - } else - u.drawHandler.destroy(), - (u.drawHandler = void 0), - u.tooltip.show(!1), - setTimeout(function () { - F.states = 0; - }, 100), - u._core.mouse(u._viewer.container, 0, "0"), - l && "function" == typeof l && l(u.item, h); - u.item || - ((u.viewConeCamera = new Cesium.Camera(c.scene)), - (t = Cesium.Cartesian3.normalize( - Cesium.Cartesian3.subtract(h[1], h[0], new Cesium.Cartesian3()), - new Cesium.Cartesian3() - )), - (u.viewConeCamera.position = h[0]), - (u.viewConeCamera.direction = t), - (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()), - (e = 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, t, n), - (a = Cesium.Quaternion.fromRotationMatrix(n, e)), - 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 - ); - }), - (Qo.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 - ); - }), - (Qo.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); - }), - (Qo.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) - ); - }), - (qo.prototype.createViewshed = function (i = {}) { - (i.alpha = this._core.defaultValue(i.alpha, 0.5)), - (i.horizonAngle = this._core.defaultValue(i.horizonAngle, 60)), - (i.verticalAngle = this._core.defaultValue(i.verticalAngle, 60)); - let o = new Qo(this._viewer, Cesium); - return ( - o.createViewCone( - { height: this._core.defaultValue(i.height, 1.7) }, - (e, t) => { - (this.ShadowPostProcess = new Ko(this._viewer, { - cameraPosition: t[0], - position: t[1], - far: Cesium.Cartesian3.distance(t[0], t[1]), - showFarScale: 6, - viewshed: { visible: i.visible, unvisible: i.unvisible }, - ...i, - })), - o.destroy(), - (o = null); - } - ), - this - ); - }), - (qo.prototype.addViewshed = function (e = {}) { - return ( - (e.alpha = this._core.defaultValue(e.alpha, 0.5)), - (e.horizonAngle = this._core.defaultValue(e.horizonAngle, 60)), - (e.verticalAngle = this._core.defaultValue(e.verticalAngle, 60)), - (this.ShadowPostProcess = new Ko(this._viewer, { - showFarScale: 6, - viewshed: { visible: e.visible, unvisible: e.unvisible }, - ...e, - })), - this - ); - }), - (qo.prototype.updateViewshed = function (e) { - this.ShadowPostProcess.updatePost(e); - }), - (qo.prototype.destroy = function () { - this.ShadowPostProcess && this.ShadowPostProcess.destroy(), - (this.ShadowPostProcess = null); - }), - (qo.prototype.changeHorizonAngle = function (e) { - this.ShadowPostProcess && this.ShadowPostProcess.changeHorizonAngle(e); - }), - (qo.prototype.changeVerticalAngle = function (e) { - this.ShadowPostProcess && this.ShadowPostProcess.changeVerticalAngle(e); - }), - (Xo.prototype.createSkylineAnalysis = function (e = {}) { - this.clear(); - let t; - t = - "string" == typeof e - ? { color: e, scale: 2 } - : { color: e.color || "#ff0000", scale: e.scale || 2 }; - e = Cesium.Color.fromCssColorString(t.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: 0.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: 0.25, - }, - }), - e = 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: e, scale: t.scale }, - }); - (this.postProccessStage = new Cesium.PostProcessStageComposite({ - name: "czm_skyline", - stages: [o, r, n, e], - inputPreviousStageTexture: !1, - uniforms: o.uniforms, - })), - i.add(this.postProccessStage); - }), - (Xo.prototype.clear = function () { - this.postProccessStage && - this._viewer.scene.postProcessStages.remove(this.postProccessStage); - }); - const $o = ` -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 ); -} -`, - er = - "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 tr(e) { - const { - defaultValue: r, - BoundingRectangle: i, - Pass: V, - Sampler: n, - DrawCommand: G, - Color: h, - ShaderSource: y, - defined: v, - ClearCommand: t, - RenderState: m, - Texture: d, - PixelDatatype: a, - PixelFormat: s, - Framebuffer: k, - } = Cesium; - this._selectedIdTexture = null; - let { - name: N, - vertexShader: w, - fragmentShader: b, - uniforms: p, - renderStateProcess: g, - beforeUpdate: f, - renderType: _, - textureScale: o, - pixelFormat: j, - pixelDatatype: z, - sampler: U, - viewportScale: l, - shaderRedefine: T, - overrideViewport: u, - } = e, - E = "renderPass_" + N.replace(/[\.\\\/\-]/g, "_"), - S = `czm_non_${E}_main`, - P = `czm_${E}_main`, - C = "_cache_" + E, - x = E + "Command", - D = null, - c = null, - I = null, - A = null, - L, - M = new t({ color: h.TRANSPARENT, depth: 1 }), - R = new i(), - O = this; - if ( - (u && i.clone(u, R), - (T = T || "add"), - (_ = _ || "all"), - (o = o || 1) < 0 || 8 < o) - ) - throw new Cesium.DeveloperError( - "CesiumRenderPass锛歵extureScale蹇呴』澶т簬0灏忎簬绛変簬8" - ); - function W(t, i, o, r) { - var n = t.shaderCache.getDerivedShaderProgram(i, E); - if (!v(n)) { - var a = i._attributeLocations, - s = i.fragmentShaderSource, - l = i.vertexShaderSource, - u = i._vertexShaderText, - c = (C = s.sources).length; - let e = - !!A && - (function () { - if (A) { - var e = A.selected || A.parentSelected; - if (e.length) return e; - } - })(); - var h = er, - 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; -} - `), - er + - ` -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 (_ = 0; _ < c; ++_) - if (/vec4\s?packDepthToRGBA\s?\(/.test(C[_])) { - g = !0; - break; - } - for ( - var u = - (g ? "" : $o) + - (e ? h : "") + - y.replaceMain(b, P) + - "void main() \n{ \n" + - ("replace" != T - ? ` ${S}(); -` - : "") + - ` ${P}(); -` + - "} \n", - f = new Array(c + 1), - _ = 0; - _ < c; - ++_ - ) - f[_] = y.replaceMain(C[_], S); - (f[c] = u), - d - ? s.defines.push("HAS_NORMAL") - : p && s.defines.push("HAS_V_NORMAL"), - (s = new y({ sources: f, defines: s.defines })); - } - if (w || b) { - var C, - c = (C = l.sources).length, - g = !1; - for (_ = 0; _ < c; ++_) - if (/vec4\s?packDepthToRGBA\s?\(/.test(C[_])) { - g = !0; - break; - } - (e = e && "varying" == r && !m), - d - ? l.defines.push("HAS_NORMAL") - : p && l.defines.push("HAS_V_NORMAL"); - for ( - h = - (g ? "" : $o) + - (e ? o : "") + - y.replaceMain(w || "void main(){}", P) + - "void main() \n{ \n" + - ("replace" != T - ? ` ${S}(); -` - : "") + - (e ? " me_isSelected=czm_selected()?1.:0.;\n" : "") + - ` ${P}(); -` + - "} \n", - f = new Array(c + 1), - _ = 0; - _ < c; - ++_ - ) - f[_] = y.replaceMain(C[_], S); - (f[c] = h), (l = new y({ sources: f, defines: l.defines })); - } - n = t.shaderCache.createDerivedShaderProgram(i, E, { - 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 (v(l)) { - let e = (l = (t = - s.useLogDepth && v(l.logDepth) ? l.logDepth.command : t) - .derivedCommands).renderPass; - v(l.renderPass) || (e = l.renderPass = {}), - v(e[x]) && ((n = e[x].shaderProgram), (a = e[x].renderState)), - (e[x] = G.shallowClone(t, e[x])), - v(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[C] = n._renderPassCache[C] || {}), - (o = (n = n._renderPassCache[C])[a.id]), - v(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 A._selectedIdTexture; - }), - (c.czm_selectedIdTextureWidth = function () { - return A._selectedIdTexture ? A._selectedIdTexture.width : 0; - }), - (c.czm_selectedIdTextureStep = function () { - return A._selectedIdTexture ? 1 / A._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 (v(e)) return e.dimensions; - }; - })(c, h))); - } - } - function B(e, t, i) { - var o = t.width, - t = t.height; - (c && c.width === o && c.height === t && i === L) || - ((L = i), - c && (c.destroy(), D.destroy(), (D = void 0), (c = void 0)), - I && (I.destroy(), (I = 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), - })), - (I = new d({ - context: e, - width: o, - height: t, - pixelFormat: s.DEPTH_COMPONENT, - pixelDatatype: a.UNSIGNED_SHORT, - sampler: n.NEAREST, - })), - (D = new k({ - colorTextures: [c], - context: e, - destroyAttachments: !1, - depthTexture: I, - }))); - } - function F(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 H(e, t) { - var i = e._us._frameState.camera._scene, - o = i._view; - try { - if (w || b) { - for ( - var r, - n = F(o), - a = - ("function" == typeof f && f.call(O, i, t), - B(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 (!A || h != V.GLOBE) - for (r = 0; r < d; ++r) Y(m[r], a, a._context); - } - Zo( - e, - D, - n, - "renderPass", - x, - "all" != _ && A && A._selectedIdTexture ? J : null - ); - } else { - var p = F(o); - "function" == typeof f && f.call(O, i, t), - B(e, R, i.hdr, o.sceneFramebuffer), - Zo(e, D, p); - } - } catch (e) { - console.error(e); - } - } - function J(e, t) { - var i = A && (A.selected || A.parentSelected); - if (!A || !i || !i.length) return !1; - if (!e.pickId || "uniform" != e._pickIdQualifier) return !0; - let o = !0, - r = e.owner; - var n = "selected" == _; - 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 K(e) { - var t; - D && - ((t = e._us._frameState.camera._scene._view), - (M.framebuffer = D), - M.execute(e, t.passState), - (M.framebuffer = void 0)); - } - (this.update = H), - (this.clear = K), - Object.defineProperties(this, { - texture: { - get() { - return c; - }, - }, - depthTexture: { - get() { - return I; - }, - }, - stage: { - get() { - return A; - }, - set(e) { - if (A != e) - if ( - (A && - O.prevStageUpdate && - ((A.update = O.prevStageUpdate), - (O.prevStageUpdate = null), - (O.prevStageExecute = null)), - (A = e)) - ) { - let o = A.update; - (O.prevStageUpdate = o), - (A.update = function (e, t) { - var i; - K(e), - o.call(A, e, t), - A.enabled && - ((!w && !b) || - ((i = A.selected || A.parentSelected) && i.length)) && - H(e, t); - }); - } - }, - }, - }); - } - function ir(e) { - (this._viewer = e), (this._core = new v()); - } - function or(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._scene = e.scene), - (this._core = new v()), - (this.tooltip = this._core.CreateTooltip()), - (this._getPosition = new C(e)), - (this.FlattenIsDraw = !1), - (this.wallArr = []), - (this.heightsort = []), - (this.FlattenPolygon = []), - (this.showWall = !0), - (this.deepth = 100), - (this.bottomImg = window.SmartEarthRootUrl + I.bottomplane), - (this.wallImg = window.SmartEarthRootUrl + I.wall); - } - function rr(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._scene = e.scene), - (this._core = new v()), - (this.currentSpeed = "1x"), - (this.currentTime = null), - (this.currentPlayMode = "1"), - (this.timer = null); - } - function nr(e, t) { - (this._viewer = e), (this._cesium = t); - } - function ar(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._getPosition = new C(e)); - } - function sr(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F), - (this._getPosition = new C(this._viewer, this._cesium)), - (this.tooltip = this._core.CreateTooltip()), - (this.sunshineOption = {}), - (this.loadingImg = window.SmartEarthRootUrl + I.loading); - } - (ir.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, - f = !1, - _ = new tr({ - 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 _.texture; - }, - maskDepthTexture() { - return _.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); - } - } - `, - }), - C = ((_.stage = e), this.createBlurStage(t + "Blur1", 4, 1, 0.75)), - y = this.createBlurStage(t + "Blur2", 4, 4, 0.5), - y = new o({ - name: t + "BlurComposite", - stages: [e, C, y], - inputPreviousStageTexture: !0, - }), - e = new i({ - name: t + "Additive", - uniforms: { - showGlow: function () { - return d; - }, - edgeGlow: function () { - return p; - }, - edgeStrength: function () { - return g; - }, - edgeOnly() { - return f; - }, - maskTexture() { - return _.texture; - }, - lineTexture: e.name, - edgeTexture1: C.name, - edgeTexture2: y.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 v = new o({ - name: t + "Composite", - stages: [y, 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 f; - }, - set(e) { - f = 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(v), - (v._uniforms = v._uniforms || {}), - w(v._uniforms), - (v.selected = [1]), - (v.enabled = !0), - this._viewer.postProcessStages.add(v), - (this.postProccessStage = v), - this - ); - }), - (ir.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 }); - }), - (ir.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 - ); - }), - (ir.prototype.clear = function () { - this.postProccessStage && - this._viewer.scene.postProcessStages.remove(this.postProccessStage), - (this.postProccessStage = void 0); - }), - (or.prototype.draw = function (e = 100, i = {}, o) { - if (!this.FlattenIsDraw) { - if ( - ((this.deepth = e || this.deepth), - (this.showWall = this._core.defaultValue(i.showWall, !0)), - (this.showBottom = this._core.defaultValue(i.showBottom, !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 + I.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(0.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(0.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 - ); - } - }), - (or.prototype.create = function (t) { - let i = Cesium.Cartesian3.fromDegreesArrayHeights(t); - if ( - ((this.boundingSphere = Cesium.BoundingSphere.fromPoints(i)), - i.push(i[0]), - this.showWall || this.showBottom) - ) { - this.originHeight = 1e5; - for (let e = 2; e < t.length; e += 3) - this.originHeight > t[e] && (this.originHeight = t[e]); - var e, o, r; - if ( - (this.showBottom && - ((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)), - this.showWall) - ) - 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); - }), - (or.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, 0.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, - })); - }), - (or.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) - ); - }), - (or.prototype.calculateWall = function (e, t, i, o) { - var r, - n, - a = Cesium.Math.lerp(e, i, 0.01) - e, - s = Cesium.Math.lerp(t, o, 0.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); - } - }); - }), - (or.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); - }), - (or.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); - }); - }), - (or.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; - }); - }), - (or.prototype.deleteObject = or.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); - }), - (rr.prototype.createAnalysis = function () { - return ( - (this.shadows = !0), - (this.currentSpeed = 1), - (this.currentPlayMode = "1"), - this.Forword(), - this - ); - }), - (rr.prototype.setCurrentTime = function (e) { - (e = new Date(e)), (e = this._cesium.JulianDate.fromDate(e)); - this._viewer.clock.currentTime = e.clone(); - }), - (rr.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)); - }), - (rr.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); - }), - (rr.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); - }), - (rr.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); - }), - (rr.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); - }), - (rr.prototype.Pause = function () { - this._viewer.animation.viewModel.pauseViewModel.command(); - }), - Object.defineProperties(rr.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)); - }, - }, - }), - (nr.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(); - }), - (nr.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: [0.7 * i.width + "px", 0.7 * i.height + 42 + "px"], - content: '<img src="' + o + '" style="height:100%;width:100%;">', - }); - }), - (ar.prototype.setPointFly = function (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; - var e = i.limitTime ? i.limitAngel : 360; - let c = i.time || 30, - h = (e || 360) / c, - m = function () { - var e = Cesium.JulianDate.secondsDifference( - o.clock.currentTime, - o.clock.startTime - ); - i.limitTime && e > c - ? r.end && r.end() - : ((e = Cesium.Math.toRadians(e * h) + 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(m)); - }, - d = (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(m), - 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 + I.mark - ), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })); - }; - return ( - i.position - ? d(i.position) - : (this.drawHandler && this.drawHandler.destroy(), - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.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)), - d(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(), - a && r._viewer.entities.remove(a), - (a = void 0), - r._core.mouse(r._viewer.container, 0), - o.clock.onTick.removeEventListener(m), - i.end && i.end(); - }), - this - ); - }), - (sr.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); - }), - (sr.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 - )), - (F.states = 1), - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.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(0.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 () { - F.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 - ); - }), - (sr.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 - )), - (F.states = 1), - []); - return ( - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.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(0.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(0.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(0.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 () { - F.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 - ); - }), - (sr.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()); - }), - (sr.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 = - (0.7 <= o - ? (r = this._cesium.Color.BLUE) - : o < 0.7 && 0.3 <= o - ? (r = this._cesium.Color.YELLOW) - : o < 0.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); - }), - (sr.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); - } - }), - (sr.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; - }), - (sr.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] }; - }), - (sr.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; - }), - (sr.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, - ]; - }), - (sr.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; - }), - (sr.prototype.SetTimeNow = function (e) { - e = new this._cesium.JulianDate.fromDate(e); - this._viewer.clock.currentTime = e; - }), - (sr.prototype.Sunshine = function (e, t) { - e = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height); - return this.pickFromRay(e, t); - }), - (sr.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, - 0.01 * (n + 1) - )), - (a.latitude = this._cesium.Math.lerp( - o.latitude, - r.latitude, - 0.01 * (n + 1) - )), - (a.czheight = - o.czheight - 0.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; - }), - (sr.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); - }), - (sr.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); - }), - (sr.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); - }), - (sr.prototype.isLoading = function (e) { - this.loading.style.display = e ? "block" : "none"; - }), - (sr.prototype.removeLoading = function () { - this.loading && this.loading.remove(), (this.loading = void 0); - }); - var lr, - ur = - "void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)\n{\nif(u_snow){\nvec3 normalEC = fsInput.attributes.normalEC;\nvec3 normalMC = czm_inverseNormal * normalEC;\nvec3 color = material.diffuse;\nvec3 white = vec3(1.0,1.0,1.0);\nfloat m = dot(normalMC, u_snowDirection);\nm = pow(m,5.0);\nmaterial.diffuse = mix(color, white, clamp(m,0.0,1.0) * u_snowAlpha);\n}\nif(u_effects){\nfloat vtxf_a11 = fract(czm_frameNumber / 240.0) * 3.14159265 * 2.0;\nfloat vtxf_a12 = fsInput.attributes.positionMC.z / (u_effectsMaxHeight / 2.0) + sin(vtxf_a11) * 0.1;\nmaterial.diffuse *= vec3(vtxf_a12);\nfloat vtxf_a13 = fract(czm_frameNumber / 240.0);\nfloat vtxf_h = clamp(fsInput.attributes.positionMC.z / u_effectsMaxHeight, 0.0, 1.0);\nvtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0;\nfloat vtxf_diff = step(0.005, abs(vtxf_h - vtxf_a13));\nmaterial.diffuse.rgb += material.diffuse.rgb * (1.0 - vtxf_diff);\n}\n}\n", - cr = - "void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {\nif(u_flatten){\nvec3 positionMC = vsOutput.positionMC.xyz;\nvec4 northEast = czm_inverseModel * vec4(u_flattenNorthEast, 1.0);\nvec4 southWest = czm_inverseModel * vec4(u_flattenSouthWest, 1.0);\nif(positionMC.x>=southWest.x && positionMC.x<=northEast.x && positionMC.y>=southWest.y && positionMC.y<=northEast.y){\nvec2 st;\nst.x = (positionMC.x - southWest.x)/(northEast.x - southWest.x);\nst.y = (positionMC.y - southWest.y)/(northEast.y - southWest.y);\nvec4 rgba_depth = texture2D(u_flattenTexture, st.xy);\nif(rgba_depth.r > 0.0)\n{\nvsOutput.positionMC.z = u_flattenHeight;\n}\n}\n}\n}\n"; - function A(e) { - (this._viewer = e), - (this._cesium = Cesium), - (this._core = new v()), - (this._tree = F), - (this._color = new m(this._viewer, this._cesium)), - (this._ModelEdit = new jt(this._viewer)), - (this.modelEditData = { - lon: 0, - lat: 0, - height: 0, - scale: 1, - heading: 0, - pitch: 0, - roll: 0, - rotate: !1, - rootTransform: void 0, - }), - (this.flattenData = new Map()); - } - function hr(e) { - (this._viewer = e), (this.tiltModel = { start: void 0, end: [] }); - } - function L(e, t) { - (this.objId = Number( - new Date().getTime() + "" + Number(1e3 * Math.random()).toFixed(0) - )), - (this._viewer = e), - (this._cesium = t), - (this._core = new v(e)), - (this._getPosition = new C(this._viewer, this._cesium)), - (this._tree = F), - (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 M(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._Color = new m(this._viewer, this._cesium)), - (this._core = new v(e)), - (this._getPosition = new C(this._viewer, this._cesium)), - (this._tree = F), - (this._points = []), - (this._lable = null), - (this._entity = null), - this.polygon1, - (this.id = "0"), - (this.curCanvas = "a"); - } - function mr(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 R(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._Color = new m(this._viewer, this._cesium)), - (this._core = new v(e)), - (this._getPosition = new C(this._viewer, this._cesium)), - (this._tree = F), - (this._points = []), - (this._polylines = []); - } - function dr(e) { - (this._viewer = e), - (this._scene = e.scene), - (this._core = new v(e)), - (this._tooltip = this._core.CreateTooltip()), - (this._getPosition = new C(this._viewer)), - (this._drawColor = { - point: Cesium.Color.BLUE, - polyline: Cesium.Color.YELLOW, - polygon: Cesium.Color.YELLOW.withAlpha(0.5), - }), - (this.selectDatum = !0), - (this.onlyTerrain = !0), - (this.tin = !1), - (this._volumeTin = []), - (this.loadingImg = window.SmartEarthRootUrl + I.loading); - } - function pr(e) { - (this._viewer = e), (this._core = new v()), (this.measureData = new Map()); - } - function gr(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 fr(e, t, i) { - e = gr(t, e) - gr(t, i); - return e < 0 && (e += 360), e; - } - function _r(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 += fr(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 Cr(e, t) { - (this._viewer = e), (this._cesium = t); - } - (A.prototype.create3DTilesets = function (e, t, i, o, r, n, a) { - var t = { url: t, preferLeaves: !0, skipLevelOfDetail: !0 }, - s = - ("string" == typeof i.lightColor && - ((c = i.lightColor.split(",")), - (i.lightColor = new this._cesium.Cartesian3(c[0], c[1], c[2]))), - (o.groundHeight = this._core.defaultValue(i.height, o.groundHeight)), - 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)), - (s.customShader = this.getCustomShader(o)), - new this._cesium.Cesium3DTileset(s)), - u = ((o.effects || o.snow) && (l.enableModelExperimental = !0), this), - c = s.id || u._core.getuid(), - t = - ((l.id = c), - (l.Level = s.Level), - (u.item = l), - o.flattenPositions && - (this.setFlatten(!0, { positions: o.flattenPositions }), - void 0 !== o.flattenHeight && (this.flattenHeight = o.flattenHeight)), - setTimeout(function () { - i.flyTo && u._viewer.flyTo(l); - var e = u._viewer.scene.primitives.add(l); - null != o.maximumscreenspaceerror && - (l.maximumScreenSpaceError = o.maximumscreenspaceerror), - 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)); - let t = l.readyPromise.then(function (e) { - null != s.geometricError && (e._geometricError = s.geometricError), - null != o.groundheight && u.setHeight(o.groundheight), - null != o.groundHeight && u.setHeight(o.groundHeight), - o.groundCenter && u.setPosition(o.groundCenter), - u.boundingSphereCenter || - (u.getCenter(), - (e = u._cesium.Cartographic.fromCartesian( - u.boundingSphereCenter - )), - (u.modelEditData.lon = u._cesium.Math.toDegrees(e.longitude)), - (u.modelEditData.lat = u._cesium.Math.toDegrees(e.latitude)), - (u.modelEditData.height = e.height)), - (o.heading || o.pitch || o.roll) && - u.setEditData({ - roll: o.roll, - pitch: o.pitch, - heading: o.heading, - }), - o.edit && u.setEditData(o.edit), - "function" == typeof a && a(u); - }); - t.catch && - t.catch(function (e) { - console.log(e); - }), - t.otherwise && - t.otherwise(function (e) { - console.log(e); - }), - l.Level && - ((u.Level = 0), - u._viewer.scene.preRender.addEventListener(function () { - u.isShow && - ((u.Level = u._core.getLevel(u._viewer)), - 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); - e = 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 - ); - }), - (A.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); - }), - (A.prototype.checkZero = function (e) { - e = parseFloat(e); - return 0 === e ? void 0 : e; - }), - (A.prototype.getVisibility = function () { - return this.item.show; - }), - (A.prototype.deleteObject = function () { - try { - this._viewer.scene.primitives.remove(this.item); - } catch (e) { - console.log(e.message); - } - }), - (A.prototype.restore = function () { - this.modelEditData = { - lon: 0, - lat: 0, - height: 0, - scale: 1, - heading: 0, - pitch: 0, - roll: 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); - }), - (A.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)))); - }), - (A.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], - })); - }), - (A.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)), - (i = this._cesium.Cartesian3.fromDegrees( - this.modelEditData.lon, - this.modelEditData.lat, - this.modelEditData.height - )), - (i = Cesium.Matrix4.fromTranslation(i)), - (t = new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(this.modelEditData.heading || 0), - Cesium.Math.toRadians(this.modelEditData.pitch || 0), - Cesium.Math.toRadians(this.modelEditData.roll || 0) - )), - (t = Cesium.Matrix3.fromHeadingPitchRoll(t)), - (t = Cesium.Matrix4.fromRotation(t, new Cesium.Matrix4())), - Cesium.Matrix4.multiply(t, e, e), - Cesium.Matrix4.multiply(i, e, e), - void (this.item.modelMatrix = e) - ); - var t = Cesium.Cartesian3.fromDegrees( - this.modelEditData.lon, - this.modelEditData.lat, - this.modelEditData.height - ), - i = Cesium.Transforms.eastNorthUpToFixedFrame(t), - e = new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(this.modelEditData.heading || 0), - Cesium.Math.toRadians(this.modelEditData.pitch || 0), - Cesium.Math.toRadians(this.modelEditData.roll || 0) - ), - t = Cesium.Matrix3.fromHeadingPitchRoll(e), - e = - (Cesium.Matrix4.multiplyByMatrix3(i, t, i), - Cesium.Matrix4.fromUniformScale(this.modelEditData.scale)); - Cesium.Matrix4.multiply(i, e, i), (this.item._root.transform = i); - } - }), - (A.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))); - }), - (A.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); - }), - (A.prototype.editModel = function (e = {}) { - this._ModelEdit.start(this, e); - }), - (A.prototype.endEdit = function () { - this._ModelEdit.end(); - }), - (A.prototype.clippingModel = function (t = {}) { - var i, - o = this, - r = this._viewer, - e = - (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 = [])), - t.direction || "z"), - n = - ((o.planeEntities = []), - this.targetY || - (t.start ? (this.targetY = t.start) : (this.targetY = 0)), - this.clippingPlanes || - ((this.clippingPlanes = new this._cesium.ClippingPlaneCollection({ - planes: [], - edgeWidth: 1, - })), - (this.item.clippingPlanes = this.clippingPlanes)), - this.clippingPlanes.removeAll(), - "z" === e - ? this.clippingPlanes.add( - new this._cesium.ClippingPlane( - new this._cesium.Cartesian3(0, 0, -1), - 0 - ) - ) - : "x" === e - ? this.clippingPlanes.add( - new this._cesium.ClippingPlane( - new this._cesium.Cartesian3(-1, 0, 0), - 0 - ) - ) - : "y" === e && - this.clippingPlanes.add( - new this._cesium.ClippingPlane( - new this._cesium.Cartesian3(0, -1, 0), - 0 - ) - ), - 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(0.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.enableModelExperimental = this.item.enableModelExperimental), - (this.item.enableModelExperimental = !1), - (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(0.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 += t * a * 0.001), - 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(0.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 = []), - (o.item.enableModelExperimental = o.enableModelExperimental); - }); - }), - (A.prototype.setFlatten = function (e, c = {}) { - if (((this.flatten = e), this.updateModelExperimental(), e)) { - let t = c.positions || []; - if (t[0] && t[0].lon && t[0].lat) - for (let e = 0; e < t.length; e++) - t[e] = Cesium.Cartesian3.fromDegrees(t[e].lon, t[e].lat); - let i, o; - t.length && - ((i = c.fid || this._core.getuid()), - this.flattenData.set(i, { - id: i, - modelId: this.item.id, - name: c.name || "鏂板缓鍘嬪钩", - show: this._core.defaultValue(c.show, !0), - boundingSphere: Cesium.BoundingSphere.fromPoints(t), - positions: t, - setVisibility: (e) => { - this.showFlattenById(i, e); - }, - deleteObject: () => { - this.removeFlattenById(i); - }, - }), - (o = Cesium.Rectangle.fromCartesianArray(t)), - this.flattenRectangle - ? (this.flattenRectangle = Cesium.Rectangle.union( - this.flattenRectangle, - o - )) - : (this.flattenRectangle = o)), - (o = this.flattenRectangle); - let r, - n, - a, - s = o.east - o.west, - l = o.north - o.south, - e = document.createElement("canvas"), - u = ((e.width = 1024), (e.height = 1024), e.getContext("2d")); - (u.fillStyle = "#000"), u.fillRect(0, 0, 1024, 1024); - for (var h of this.flattenData.values()) - if (h.show) { - let t = []; - h.positions.forEach((e) => { - (r = Cesium.Cartographic.fromCartesian(e)), - (n = ((r.longitude - o.west) / s) * 1024), - (a = 1024 - ((r.latitude - o.south) / l) * 1024), - t.push([n, a]); - }), - u.moveTo(t[0][0], t[0][1]); - for (let e = 0; e < t.length; e++) u.lineTo(t[e][0], t[e][1]); - (u.fillStyle = "#f00"), u.fill(); - } - return ( - (this.flattenTexture = new Cesium.TextureUniform({ - url: e.toDataURL("image/png"), - })), - i && this.flattenData.get(i) - ); - } - }), - (A.prototype.setFlattenByGeojson = function (n, t) { - if (t) { - let e = Cesium.GeoJsonDataSource.load(t); - return e.then((e) => { - var o = e.entities.values; - let r = []; - for (let i = 0; i < o.length; i++) { - let e = o[i], - t; - e.polyline - ? (t = e.polyline.positions.getValue()) - : e.polygon && (t = e.polygon.hierarchy.getValue().positions), - t && - r.push( - this.setFlatten(n, { fid: e.id, name: e.name, positions: t }) - ); - } - return r; - }); - } - (this.flatten = !!n), this.updateModelExperimental(); - }), - (A.prototype.removeFlattenById = function (e) { - this.flattenData.delete(e), - (this.flatten = !!this.flattenData.size), - this.setFlatten(this.flatten); - }), - (A.prototype.showFlattenById = function (e, t) { - let i = this.flattenData.get(e); - i && (i.show = t), this.setFlatten(this.flatten); - }), - (A.prototype.removeFlattenAll = function () { - this.flattenData.clear(), - (this.flattenRectangle = new Cesium.Rectangle()), - (this._flattenRectangle = void 0), - (this.flatten = !1), - (this.flattenTexture = new Cesium.TextureUniform({ url: "" })), - this.updateModelExperimental(); - }), - (A.prototype.updateModelExperimental = function () { - this.effects || this.flatten || this.snow - ? this.item && (this.item.enableModelExperimental = !0) - : this.item && (this.item.enableModelExperimental = !1); - }), - (A.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - Object.defineProperties(A.prototype, { - style: { - get: function () { - return this.item.style; - }, - }, - }), - (A.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 }, - }; - }), - (A.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (A.prototype.setItem = function (e) { - this.item = e; - }), - (A.prototype.setShowStyle = function (e) { - this.item.style, - (this.item.style = new this._cesium.Cesium3DTileStyle({ show: !0 })); - }), - (A.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 = `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(A.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 - ); - }, - }, - effects: { - get: function () { - return this.item.customShader.uniforms.u_effects.value; - }, - set: function (e) { - this.item.customShader.setUniform("u_effects", e), - (this.item.customShader.lightingModel = e ? 0 : void 0), - this.updateModelExperimental(); - }, - }, - effectsMaxHeight: { - get: function () { - return this.item.customShader.uniforms.u_effectsMaxHeight.value; - }, - set: function (e) { - this.item.customShader.setUniform("u_effectsMaxHeight", e); - }, - }, - snow: { - get: function () { - return this.item.customShader.uniforms.u_snow.value; - }, - set: function (e) { - this.item.customShader.setUniform("u_snow", e), - this.updateModelExperimental(); - }, - }, - snowAlpha: { - get: function () { - return this.item.customShader.uniforms.u_snowAlpha.value; - }, - set: function (e) { - this.item.customShader.setUniform("u_snowAlpha", e); - }, - }, - snowDirection: { - get: function () { - return this.item.customShader.uniforms.u_snowDirection.value; - }, - set: function (e) { - this.item.customShader.setUniform("u_snowDirection", e); - }, - }, - flatten: { - get: function () { - return this.item.customShader.uniforms.u_flatten.value; - }, - set: function (e) { - this.item.customShader.setUniform("u_flatten", e), - this.updateModelExperimental(); - }, - }, - flattenHeight: { - get: function () { - return this.item.customShader.uniforms.u_flattenHeight.value; - }, - set: function (e) { - this.item.customShader.setUniform("u_flattenHeight", e); - }, - }, - flattenRectangle: { - get: function () { - return this._flattenRectangle; - }, - set: function (e) { - (this._flattenRectangle = e), - this.item.customShader.setUniform( - "u_flattenSouthWest", - Cesium.Cartesian3.fromRadians(e.west, e.south) - ), - this.item.customShader.setUniform( - "u_flattenNorthEast", - Cesium.Cartesian3.fromRadians(e.east, e.north) - ); - }, - }, - flattenTexture: { - get: function () { - return this.item.customShader.uniforms.u_flattenTexture.value; - }, - set: function (e) { - this.item.customShader.setUniform("u_flattenTexture", e); - }, - }, - }), - (A.prototype.getCustomShader = function (e) { - return new Cesium.CustomShader({ - mode: Cesium.CustomShaderMode.MODIFY_MATERIAL, - lightingModel: - e.effects || e.removeLighting ? Cesium.LightingModel.UNLIT : void 0, - uniforms: { - u_flatten: { type: Cesium.UniformType.BOOL, value: !1 }, - u_flattenHeight: { type: Cesium.UniformType.FLOAT, value: 0 }, - u_flattenNorthEast: { - type: Cesium.UniformType.VEC3, - value: new Cesium.Cartesian3(), - }, - u_flattenSouthWest: { - type: Cesium.UniformType.VEC3, - value: new Cesium.Cartesian3(), - }, - u_flattenTexture: { - type: Cesium.UniformType.SAMPLER_2D, - value: new Cesium.TextureUniform({ url: "" }), - }, - u_effects: { type: Cesium.UniformType.BOOL, value: e.effects || !1 }, - u_effectsMaxHeight: { - type: Cesium.UniformType.FLOAT, - value: e.effectsMaxHeight || 150, - }, - u_snow: { type: Cesium.UniformType.BOOL, value: e.snow || !1 }, - u_snowAlpha: { - type: Cesium.UniformType.FLOAT, - value: e.snowAlpha || 0.8, - }, - u_snowDirection: { - type: Cesium.UniformType.VEC3, - value: e.snowDirection || new Cesium.Cartesian3(1, 1, 0), - }, - }, - vertexShaderText: this.getFlattenShader(), - fragmentShaderText: this.getEffectsShader(), - }); - }), - (A.prototype.getFlattenShader = function () { - return cr; - }), - (A.prototype.getEffectsShader = function () { - return ur; - }), - (A.prototype.getType = function () { - return { label: "妯″瀷", value: "3DTileset" }; - }), - (hr.prototype.play = function (t, i = {}) { - (this.start = i.start), - (this.end = i.end), - (this.attr = i.attr), - (this.attrType = i.attrType), - (this.palyType = i.type || "progress"), - (this.startPosition = i.startPosition), - (this.endPosition = i.endPosition), - (this.colors = i.colors || [ - "rgb(255,0,0)", - "rgb(255,152,0)", - "rgb(0,255,0)", - "rgb(0,0,255)", - ]); - let o; - if ( - ((this._useColor = i.useColor), - this.getCurrentProgressStyle(0), - "string" == typeof t) - ) { - (o = new A(this._viewer)), - (this.tiltModel.start = o.create3DTilesets( - "鎷嗚縼妯″瀷", - t, - {}, - { groundCenter: this.startPosition }, - "0", - !0, - (e) => { - this.getModelMinMaxTime(e), this.setModelStyle("start", e); - } - )); - i = (o = new A(this._viewer)).create3DTilesets( - "閲嶅缓妯″瀷", - t, - {}, - { groundCenter: this.endPosition }, - "0", - !0, - (e) => { - this.getModelMinMaxTime(e), this.setModelStyle("end", e); - } - ); - this.tiltModel.end.push(i); - } else { - i = t.start; - (o = new A(this._viewer)), - i && - (this.tiltModel.start = o.create3DTilesets( - "鎷嗚縼妯″瀷", - i.urls, - {}, - { - groundCenter: i.Center, - heading: i.heading, - pitch: i.pitch, - roll: i.roll, - }, - "0", - !0, - (e) => { - this.getModelMinMaxTime(e), this.setModelStyle("start", e); - } - )); - let e = t.end; - if (e) { - let t; - e.forEach((e) => { - (o = new A(this._viewer)), - (t = o.create3DTilesets( - "閲嶅缓妯″瀷", - e.urls, - { id: e.id }, - { - groundCenter: e.Center, - heading: e.heading, - pitch: e.pitch, - roll: e.roll, - }, - "0", - !0, - (e) => { - this.getModelMinMaxTime(e), this.setModelStyle("end", e); - } - )), - this.tiltModel.end.push(t); - }); - } - } - return this; - }), - (hr.prototype.getModelMinMaxTime = function (e) { - var t = e.item.properties; - (e.startTime = t[this.attr[0]].minimum - 1), - (e.endTime = t[this.attr[1]].maximum), - (e.allTime = e.endTime - e.startTime); - }), - (hr.prototype.useColor = function (e = !1) { - (this._useColor = e), this.currentProgress(this.progress); - }), - (hr.prototype.getCurrentProgressStyle = function (e) { - (this.progress = e), - "time" === this.palyType && - ((e = parseInt(e * this.time + this.start)), this.setTime(e)); - }), - (hr.prototype.setModelProgressStyle = function (e, t) { - let i, o; - (i = - 0.5 < this.progress - ? "start" === e - ? this._useColor - ? [["true", this.colors[3]]] - : [["true", "rgba(255, 255, 255, 0)"]] - : ((o = parseInt( - 2 * (this.progress - 0.5) * t.allTime + t.startTime - )), - this._useColor - ? [ - ["${" + this.attr[0] + "} > " + o, this.colors[0]], - ["${" + this.attr[1] + "} <= " + o, this.colors[2]], - ["true", this.colors[1]], - ] - : [ - [ - "${" + this.attr[1] + "} <= " + o, - "rgba(255, 255, 255, 1)", - ], - ["true", "rgba(255, 255, 255, 0)"], - ]) - : "end" === e - ? this._useColor - ? [["true", this.colors[0]]] - : [["true", "rgba(255, 255, 255, 0)"]] - : ((o = parseInt(2 * this.progress * t.allTime + t.startTime)), - this._useColor - ? [ - ["${" + this.attr[0] + "} > " + o, this.colors[0]], - ["${" + this.attr[1] + "} <= " + o, this.colors[3]], - ["true", this.colors[1]], - ] - : [ - ["${" + this.attr[1] + "} <= " + o, "rgba(255, 255, 255, 0)"], - ["true", "rgba(255, 255, 255, 1)"], - ])), - (t.item.style = new Cesium.Cesium3DTileStyle({ - color: { conditions: i }, - })); - }), - (hr.prototype.setTime = function (e) { - let t = [], - i = []; - (i = this._useColor - ? ((t = [ - ["${" + this.attr[0] + "} > " + e, this.colors[0]], - ["${" + this.attr[1] + "} <= " + e, this.colors[3]], - ["true", this.colors[1]], - ]), - [ - ["${" + this.attr[0] + "} > " + e, this.colors[0]], - ["${" + this.attr[1] + "} <= " + e, this.colors[2]], - ["true", this.colors[1]], - ]) - : ((t = [ - ["${" + this.attr[1] + "} <= " + e, "rgba(255, 255, 255, 0)"], - ["true", "rgba(255, 255, 255, 1)"], - ]), - [ - ["${" + this.attr[1] + "} <= " + e, "rgba(255, 255, 255, 1)"], - ["true", "rgba(255, 255, 255, 0)"], - ])), - (this.startStyle = new Cesium.Cesium3DTileStyle({ - color: { conditions: t }, - })), - (this.endStyle = new Cesium.Cesium3DTileStyle({ - color: { conditions: i }, - })); - }), - (hr.prototype.currentProgress = function (e) { - this.getCurrentProgressStyle(e), - this.setModelStyle("start", this.tiltModel.start), - this.tiltModel.end.forEach((e) => { - this.setModelStyle("end", e); - }); - }), - (hr.prototype.currentTime = function (e) { - this.setTime(e), - this.setModelStyle("start", this.tiltModel.start), - this.tiltModel.end.forEach((e) => { - this.setModelStyle("end", e); - }); - }), - (hr.prototype.setModelStyle = function (e, t) { - t && - ("time" === this.palyType - ? (t.item.style = "start" === e ? this.startStyle : this.endStyle) - : this.setModelProgressStyle(e, t)); - }), - (hr.prototype.setVisibility = function (t) { - this.tiltModel.start && this.tiltModel.start.setVisibility(t), - this.tiltModel.end.forEach((e) => { - e.setVisibility(t); - }); - }), - (hr.prototype.deleteObject = function () { - this.tiltModel.start && this.tiltModel.start.deleteObject(), - this.tiltModel.end.forEach((e) => { - e.deleteObject(); - }); - }), - Object.defineProperties(hr.prototype, { - time: { - get() { - return this.end - this.start; - }, - }, - }), - (L.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 - ); - }), - (L.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 - ); - }), - (L.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); - }), - (L.prototype.createRichTextPoint = function (t, i, o = {}) { - var m, - d, - p, - g, - f, - 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); - }), - ((f = document.createElement("img")).src = r._core.defaultValue( - s.url, - window.SmartEarthRootUrl + I.richtextpoint - )), - (d = parseFloat(d)), - (f.crossOrigin = "Anonymous"), - (f.onload = function () { - var e, - t, - i, - o, - r, - n, - a, - s, - l = document.createElement("canvas"), - u = l.getContext("2d"), - c = f.width, - h = f.height; - (l.width = c), - (l.height = h), - u.drawImage(f, 0, 0, c, h), - (u.shadowOffsetX = 1), - (u.shadowOffsetY = 0), - (u.shadowColor = "#fff"), - (u.shadowBlur = 1), - /^\</.test(m) && /\>$/.test(m) - ? ((a = - '<svg xmlns="http://www.w3.org/2000/svg" width="' + - c + - '" height="60"><foreignObject width="100%" height="100%">' + - m + - "</foreignObject></svg>"), - (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 - ); - }), - (L.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 - ); - }), - (L.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 - ); - }), - (L.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 - ); - }), - (L.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), - o.push({ point: e }), - (i.state = 1), - i.handler.destroy(), - "function" == typeof method && method(o), - (i.item = e)); - }, i._cesium.ScreenSpaceEventType.LEFT_CLICK), - this - ); - }), - (L.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)); - }), - (L.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; - }), - (L.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); - }), - (L.prototype.altitude = L.prototype.executePoint = - function (o, e) { - let t; - ("object" != typeof o && "function" != typeof e) || - ((t = e), (e = o), (o = t)), - (t = null), - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.draw - ); - var r = this, - n = - (this._tree.starttemporaryItem(this._viewer), - { point: r._cesium.Color.RED }); - 0 < Object.keys(e).length && - "" != e.point && - null != e.point && - (n.point = e.point), - this._tree.removeHandler(); - let a = this._core.CreateTooltip(); - return ( - (this._tree.handler = new r._cesium.ScreenSpaceEventHandler( - r._viewer.scene.canvas - )), - this._tree.handler.setInputAction(function (e) { - var e = r._getPosition.getMousePosition(e), - t = r._core.toDegrees(e), - t = - 1e3 <= t.height - ? (t.height / 1e3).toFixed(2) + "鍗冪背" - : t.height.toFixed(2) + "绫�", - i = r._core.getPointToCameraDistance(r._viewer, e), - e = r._viewer.entities.add({ - name: "楂樺害", - position: e, - point: { - color: n.point.withAlpha(0.5), - pixelSize: 5, - outlineColor: r._cesium.Color.WHITE.withAlpha(0.5), - outlineWidth: 2, - heightReference: r._cesium.HeightReference.none, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * i - ), - 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, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * i - ), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }), - i = (r._tree.temporaryItem.obj.push(e), { point: e, height: t }); - r._tree.endtemporaryItem(), - r._core.mouse(r._viewer.container, 0, "0"), - r._tree.handler.destroy(), - a.show(!1), - "function" == typeof o && o(i), - (r.item = e); - }, r._cesium.ScreenSpaceEventType.LEFT_CLICK), - this._tree.handler.setInputAction(function (e) { - a.showAt(e.endPosition, "鐐瑰嚮鎷惧彇楂樺害锛�"); - }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE), - this - ); - }), - (L.prototype.executePointp = function (t, e) { - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.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.withAlpha(0.5), - pixelSize: 5, - outlineColor: i._cesium.Color.WHITE.withAlpha(0.5), - 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 - ); - }), - (L.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) {} - }), - (L.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; - }), - (L.prototype.getVisibility = function () { - return this.item.show; - }), - (L.prototype.setPointAlpha = function (e) { - try { - this.item._point.material._value.alpha = e; - } catch (e) { - console.log(e); - } - return this; - }), - (L.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, - }, - }; - }), - (L.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (L.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; - }), - (L.prototype.setRadius = function (e) { - try { - this.item.ellipse = new this._cesium.EllipseGraphics({ - semiMinorAxis: e, - semiMajorAxis: e, - material: this._cesium.Color.RED.withAlpha(0.4), - }); - } catch (e) { - console.log(e); - } - return this; - }), - (L.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(L.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(L.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(L.prototype, { - pixelSize: { - get: function () { - return this.item.point.pixelSize._value; - }, - set: function (e) { - this.item.point.pixelSize = e; - }, - }, - }), - Object.defineProperties(L.prototype, { - rectangle: { - get: function () { - return this.item.rectangle; - }, - set: function (e) { - this.item.rectangle = e; - }, - }, - }), - (L.prototype.setItem = function (e) { - this.item = e; - }), - Object.defineProperties(L.prototype, { - polyline: { - get: function () { - return this.item.polyline; - }, - set: function (e) { - this.item.polyline = e; - }, - }, - }), - Object.defineProperties(L.prototype, { - polygon: { - get: function () { - return this.item.polygon; - }, - set: function (e) { - this.item.polygon = e; - }, - }, - }), - Object.defineProperties(L.prototype, { - point: { - get: function () { - return this.item.point; - }, - set: function (e) { - this.item.point = e; - }, - }, - }), - Object.defineProperties(L.prototype, { - label: { - get: function () { - return this.item.label; - }, - set: function (e) { - this.item.label = e; - }, - }, - }), - Object.defineProperties(L.prototype, { - position: { - get: function () { - return this._position || this.item.position; - }, - }, - }), - Object.defineProperties(L.prototype, { - model: { - get: function () { - return this.item.model; - }, - set: function (e) { - this.item.model = e; - }, - }, - }), - Object.defineProperties(L.prototype, { - wall: { - get: function () { - return this.item.wall; - }, - set: function (e) { - this.item.wall = e; - }, - }, - }), - Object.defineProperties(L.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, - }; - }, - }, - }), - (M.prototype.createPolygon = function (e, t, i, o, r) { - var n, - a = []; - if (Array.isArray(e)) { - if (e[0] instanceof Array) { - if (2 === e[0].length) { - for (var s = 0; s < e.length; s++) a.push(e[s][0], e[s][1]); - n = this._cesium.Cartesian3.fromDegreesArray(a); - } else if (3 === e[0].length) { - for (s = 0; s < e.length; s++) a.push(e[s][0], e[s][1], e[s][2]); - n = this._cesium.Cartesian3.fromDegreesArrayHeights(a); - } - } else if (e[0].z) { - for (s = 0; s < e.length; s++) a.push(e[s].x, e[s].y, e[s].z); - n = this._cesium.Cartesian3.fromDegreesArrayHeights(a); - } else { - for (s = 0; s < e.length; s++) a.push(e[s].x, e[s].y); - n = this._cesium.Cartesian3.fromDegreesArray(a); - } - "string" == typeof t && (t = { fillColor: t }), - (this.item = this._viewer.entities.add({ - name: r, - polygon: { - hierarchy: new this._cesium.PolygonHierarchy(n), - 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) - ), - }, - })); - } else - "object" == typeof e && - (e.points.forEach((e) => { - a.push(e.x, e.y); - }), - (n = Cesium.Cartesian3.fromDegreesArray(a)), - (i = this._core.defaultValue(e.alpha, 0.6)), - (this.item = this._viewer.entities.add({ - id: e.id, - name: r, - polygon: { - hierarchy: new Cesium.PolygonHierarchy(n), - material: Cesium.Color.fromCssColorString( - e.color || "#f00" - ).withAlpha(i), - heightReference: void 0 !== e.height ? 0 : 1, - height: e.height, - perPositionHeight: !1, - outline: !!e.outlineWidth, - outlineWidth: e.outlineWidth, - outlineColor: Cesium.Color.fromCssColorString( - e.outlineColor || "#f00" - ), - }, - })), - (this.item.objectType = "polygon")); - t = { - id: this.item.id, - name: r || "鏂板缓闈�" + this._core.getuid(), - pId: this._core.isnull(o) ? 0 : o, - type: "polygon", - 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.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 - ); - }), - (M.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 ? 0.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; - }), - (M.prototype.createSector = function (e, t, c, i, o) { - var r = { - fillColor: this._cesium.Color.YELLOW.withAlpha(0.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)), - f = u / (s * p), - _ = 2 * Math.PI; - for (; 1e-12 < Math.abs(f - _); ) { - var C = Math.cos(2 * m + f), - y = Math.sin(f), - v = Math.cos(f); - (_ = f), - (f = - u / (s * p) + - g * - y * - (C + - (g / 4) * - (v * (2 * C * C - 1) - - (g / 6) * C * (4 * y * y - 3) * (4 * C * C - 3)))); - } - (a = h * y - c * v * i), - (a = Math.atan2( - h * v + c * y * i, - (1 - o) * Math.sqrt(e * e + a * a) - )), - (t = Math.atan2(y * t, c * v - h * y * i)), - (c = (o / 16) * d * (4 + o * (4 - 3 * d))); - return { - lon: - l + - n( - t - - (1 - c) * o * e * (f + c * y * (C + c * v * (2 * C * C - 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 - ); - }), - (M.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 }); - }), - (M.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(0.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 + I.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; - }), - (M.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(0.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 + I.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 - ); - }), - (M.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(0.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('<div id="videoToolbar"></div>'), - (n = document.getElementById("videoToolbar"))), - '<video id="video' + - c + - '" style="display: none;" muted autoplay loop crossorigin controls><source src="' + - t.url + - '" type="video/mp4"></video>'), - 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 + I.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(0.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 - ); - }), - (M.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('<div id="videoToolbar"></div>'), - (n = document.getElementById("videoToolbar"))), - this._core.getuid()), - s = - '<video id="video' + - a + - '" style="display: none;" muted autoplay loop crossorigin controls><source src="' + - t.url + - '" type="video/mp4"></video>', - 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 - ); - }), - (M.prototype.addVideoPlane = 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('<div id="videoToolbar"></div>'), - (e = document.getElementById("videoToolbar"))), - this._core.getuid()), - r = - '<video id="video' + - o + - '" style="display: none;" muted autoplay loop crossorigin controls><source src="' + - t.url + - '" type="video/mp4"></video>', - 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) - ) - ), - plane: { - plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Y, 0), - dimensions: new Cesium.Cartesian2(t.width || 12.8, t.height || 7.2), - material: new Cesium.ImageMaterialProperty({ - image: e, - color: Cesium.Color.fromCssColorString(r), - }), - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - t.near, - t.far || 100 * (t.width || 12.8) - ), - }, - })), - this - ); - }), - (M.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; - }), - (M.prototype.planeArea = M.prototype.executePolygoncl = - function (t, e) { - let i; - ("object" != typeof t && "function" != typeof e) || - ((i = e), (e = t), (t = i)), - (i = null), - this._tree.removeHandler(), - this._tree.starttemporaryItem(this._viewer); - var o, - r, - n = this, - a = - (this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.draw - ), - (this._tree.handler = new this._cesium.ScreenSpaceEventHandler( - this._viewer.scene.canvas - )), - this._core.CreateTooltip()), - s = [], - l = {}, - u = [], - c = null, - h = null, - m = { - point: n._cesium.Color.RED, - polyline: n._cesium.Color.YELLOW, - polygon: n._cesium.Color.YELLOW.withAlpha(0.5), - }, - d = - (0 < Object.keys(e).length && - ("" != e.point && null != e.point && (m.point = e.point), - "" != e.polyline && - null != e.polyline && - (m.polyline = e.polyline), - "" != e.polygon && null != e.polygon && (m.polygon = e.polygon)), - { mj: 0, label: [], polygon: [] }); - let p, g; - this._tree.handler.setInputAction(function (e) { - var t, i; - 0 === s.length - ? a.showAt(e.endPosition, "宸﹂敭寮�濮嬬粯鍒讹紒") - : s.length <= 3 - ? a.showAt(e.endPosition, "鐐瑰嚮缁х画缁樺埗锛�") - : a.showAt(e.endPosition, "鍙抽敭缁撴潫缁樺埗锛�"), - (h = n._getPosition.getMousePosition(e)) && - ((e = n._cesium.Cartographic.fromCartesian(h)), - (t = n._cesium.Math.toDegrees(e.longitude)), - (i = n._cesium.Math.toDegrees(e.latitude)), - e.height, - 2 <= s.length && - (n._cesium.defined(c) - ? (s.pop(), - s.push(h), - (l = new n._cesium.PolygonHierarchy(s)), - u.pop(), - u.push([t, i])) - : ((l = new n._cesium.PolygonHierarchy(s)), (c = new f(l))), - (e = n._core.getArea(u, s)), - n._viewer.entities.remove(r), - (r = n._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: e, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -40), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * g), - }, - })), - n._tree.temporaryItem.obj.push(r), - (d.label = r))); - }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), - this._tree.handler.setInputAction(function (e) { - var t, i; - (h = n._getPosition.getMousePosition(e)) && - ((g = g || n._core.getPointToCameraDistance(n._viewer, h)), - (e = n._core.getArea(u, s)), - (i = n._cesium.Cartographic.fromCartesian(h)), - (t = n._cesium.Math.toDegrees(i.longitude)), - (i = n._cesium.Math.toDegrees(i.latitude)), - 0 == s.length && (s.push(h.clone()), u.push([t, i])), - s.push(h), - u.push([t, i]), - (l = new n._cesium.PolygonHierarchy(s)), - 2 === s.length && - (p = n._viewer.entities.add({ - name: "涓存椂绾�", - polyline: { - positions: new Cesium.CallbackProperty(() => s, !1), - clampToGround: !1, - material: m.polygon, - width: 3, - }, - })), - 3 <= s.length && - (p && n._viewer.entities.remove(p), - n._cesium.defined(c) || - ((l = new n._cesium.PolygonHierarchy(s)), (c = new f(l))), - n._viewer.entities.remove(r), - (r = n._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: e, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -40), - showBackground: !0, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * g), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - n._tree.temporaryItem.obj.push(r), - (d.label = r))); - }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), - this._tree.handler.setInputAction(function (e) { - n.end(); - }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), - (this.end = function (e) { - a.show(!1), - n._viewer.entities.remove(r), - n._tree.handler.destroy(), - (n.end = void 0), - n._core.mouse(n._viewer.container, 0, "0"), - p && n._viewer.entities.remove(p), - "cancel" === e || s.length < 3 - ? n.item && n._viewer.entities.remove(n.item) - : ((e = n._core.getArea(u, s)), - (o = e), - (e = n._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: e, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -40), - showBackground: !0, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * g), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - n._tree.endtemporaryItem(), - n._points.push(e), - (n._lable = e), - (d.mj = o), - (d.label = e), - "" != t && null != t && "function" == typeof t && t(d)); - }); - _.prototype._init = function () { - var e = this; - (this.options.polygon.hierarchy = new n._cesium.CallbackProperty( - function () { - return e.hierarchy; - }, - !1 - )), - (this.polygon = n._viewer.entities.add(this.options)), - (n.item = this.polygon), - (n._entity = this.polygon), - n._tree.temporaryItem.obj.push(this.polygon), - (d.polygon = this.polygon); - }; - var f = _; - function _(e) { - (this.options = { - name: "澶氳竟褰�", - polygon: { - hierarchy: [], - heightReference:Cesium.HeightReference.RELATIVE_TO_GROUND, - //perPositionHeight: !0, - material: m.polygon, - classificationType: n._cesium.ClassificationType.BOTH, - }, - }), - (this.hierarchy = e), - this._init(); - } - return this; - }), - (M.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.withAlpha(0.5), - outlineColor: o._cesium.Color.WHITE.withAlpha(0.5), - 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(F.selectedItem) || - "group" != F.selectedItem.type || - (e = F.selectedItem.id), - (t = { - id: (t = o._core.getuid()), - name: "鏂板缓闈�" + t, - pId: o._core.isnull(e) ? 0 : e, - type: "polygon", - item: o, - }), - o.setTreeobj(t), - F.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(0.4), - extrudedHeight: 0, - }, - }), - (this.hierarchy = e), - this._init(); - } - return this; - }), - (M.prototype.executePolygonymsd = function (f = {}, i) { - this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer); - var h, - _ = this, - C = - ((this._tree.handler = new _._cesium.ScreenSpaceEventHandler( - this._viewer.scene.canvas - )), - this._core.CreateTooltip()), - y = {}, - v = [], - w = null, - m = null, - o = "0", - b = 0, - T = 1e3, - r = 10, - E = !1, - S = []; - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.draw - ); - let P, x; - function D() { - _.end(); - let t = r / 20; - _.waterTimer = setInterval(function () { - var e; - b < T && - ((b += t), - _.item._polygon.extrudedHeight.setValue(b), - T <= b && - (clearInterval(_.waterTimer), - (_.waterTimer = void 0), - (b = T), - _._viewer.entities.remove(_.item), - (_.polygon1 = new _._cesium.PolygonGeometry({ - polygonHierarchy: new _._cesium.PolygonHierarchy(v), - extrudedHeight: T, - height: 0, - vertexFormat: - _._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, - })), - (e = new _._cesium.Primitive({ - geometryInstances: new _._cesium.GeometryInstance({ - geometry: _.polygon1, - }), - appearance: new Cesium.EllipsoidSurfaceAppearance({ - material: new Cesium.Material({ - fabric: { - type: "Water", - uniforms: { - baseWaterColor: - f.watherColor || Cesium.Color.SKYBLUE.withAlpha(0.6), - blendColor: - f.watherColor || Cesium.Color.SKYBLUE.withAlpha(0.6), - normalMap: f.url, - frequency: f.frequency || 1e3, - animationSpeed: f.watherSpeed || 0.01, - amplitude: f.amplitude || 10, - }, - }, - }), - }), - show: !0, - })), - _._viewer.scene.primitives.add(e), - (_.item = e), - "" != i && null != i && "function" == typeof i && i(b), - _._core.isnull(F.selectedItem) || - "group" != F.selectedItem.type || - (o = F.selectedItem.id), - (e = { - id: (e = _._core.getuid()), - name: "鏂板缓娣规病鍒嗘瀽" + e, - pId: _._core.isnull(o) ? 0 : o, - type: "polygon", - item: _, - }), - _.setTreeobj(e), - F.insertGroupId(e, _._core.isnull(o) ? 0 : o))); - }, 50); - } - this._tree.handler.setInputAction(function (e) { - if (E) - void 0 === b - ? C.showAt(e.endPosition, "鐐瑰嚮鎷惧彇鍒濆姘撮潰楂樺害") - : void 0 === T && C.showAt(e.endPosition, "鐐瑰嚮鎷惧彇鏈�澶ф饭娌¢珮搴�"); - else { - 4 <= v.length - ? C.showAt(e.endPosition, "鍙抽敭缁撴潫缁樺埗") - : C.showAt(e.endPosition, "鐐瑰嚮宸﹂敭缁樺埗娣规病鍖哄煙"); - e = _._viewer.camera.getPickRay(e.endPosition); - if ( - ((h = _._viewer.scene.globe.pick(e, _._viewer.scene)), - 2 <= v.length) - ) { - if (_._cesium.defined(w)) - if (f.rectangle) - (x = _._core.toDegrees(h)), - (v = [ - Cesium.Cartesian3.fromDegrees(P.lon, P.lat), - Cesium.Cartesian3.fromDegrees(P.lon, x.lat), - Cesium.Cartesian3.fromDegrees(x.lon, x.lat), - Cesium.Cartesian3.fromDegrees(x.lon, P.lat), - ]), - (y = new _._cesium.PolygonHierarchy(v)), - (w.hierarchy = y); - else { - for ( - var e = v[0], - e = - _._viewer.scene.globe.ellipsoid.cartesianToCartographic( - e - ), - t = Cesium.Math.toDegrees(e.latitude), - e = Cesium.Math.toDegrees(e.longitude), - i = v[v.length - 2], - i = - _._viewer.scene.globe.ellipsoid.cartesianToCartographic( - i - ), - o = Cesium.Math.toDegrees(i.latitude), - i = Cesium.Math.toDegrees(i.longitude), - r = - _._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 < S.length && 2 <= S.length; - u++ - ) { - var c = S[u]; - if (0 == u) { - if (Cesium_turf.lineIntersect(s, c).features.length) { - (l = !1), - (C.innerHTML = - '<span style="font-family:榛戜綋;color:white;font-weight: bolder;font-size: 14px">涓嶅厑璁稿嚭鐜颁氦鍙夐潰锛�</span>'); - break; - } - } else if (u == S.length - 1) { - if (Cesium_turf.lineIntersect(a, c).features.length) { - (l = !1), - (C.innerHTML = - '<span style="font-family:榛戜綋;color:white;font-weight: bolder;font-size: 14px">涓嶅厑璁稿嚭鐜颁氦鍙夐潰锛�</span>'); - break; - } - } else { - if (Cesium_turf.lineIntersect(a, c).features.length) - return ( - (l = !1), - void (C.innerHTML = - '<span style="font-family:榛戜綋;color:white;font-weight: bolder;font-size: 14px">涓嶅厑璁稿嚭鐜颁氦鍙夐潰锛�</span>') - ); - if (Cesium_turf.lineIntersect(s, c).features.length) { - (l = !1), - (C.innerHTML = - '<span style="font-family:榛戜綋;color:white;font-weight: bolder;font-size: 14px">涓嶅厑璁稿嚭鐜颁氦鍙夐潰锛�</span>'); - break; - } - } - } - if (!l) return; - v.pop(), v.push(h), (y = new _._cesium.PolygonHierarchy(v)); - } - else (y = new _._cesium.PolygonHierarchy(v)), (w = new d(y)); - m || - ((m = _._viewer.entities.add({ - polyline: { - positions: new Cesium.CallbackProperty(function () { - return v.concat([v[0]]); - }, !1), - clampToGround: !0, - width: 3, - }, - })), - _._points.push(m)); - } - } - }, _._cesium.ScreenSpaceEventType.MOUSE_MOVE), - this._tree.handler.setInputAction(function (e) { - e = _._getPosition.getMousePosition(e); - if (e) - if (E) { - var t = _._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) - ); - D(); - } - } else { - if ( - (0 == v.length && - (v.push(e.clone()), (y = new _._cesium.PolygonHierarchy(v))), - 2 <= v.length) - ) - if (0 == S.length) { - var i = v[0], - o = - _._viewer.scene.globe.ellipsoid.cartesianToCartographic( - i - ), - r = Cesium.Math.toDegrees(o.latitude), - n = Cesium.Math.toDegrees(o.longitude), - a = v[1], - s = - _._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], - ]); - S.push(c); - } else { - if (2 <= S.length) { - for ( - var i = v[0], - o = - _._viewer.scene.globe.ellipsoid.cartesianToCartographic( - i - ), - r = Cesium.Math.toDegrees(o.latitude), - n = Cesium.Math.toDegrees(o.longitude), - a = v[v.length - 2], - s = - _._viewer.scene.globe.ellipsoid.cartesianToCartographic( - a - ), - l = Cesium.Math.toDegrees(s.latitude), - u = Cesium.Math.toDegrees(s.longitude), - t = - _._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 < S.length && 2 <= S.length; - p++ - ) { - var g = S[p]; - if (0 == p) { - if (Cesium_turf.lineIntersect(m, g).features.length) { - (d = !1), - (C.innerHTML = - '<span style="font-family:榛戜綋;color:white;font-weight: bolder;font-size: 14px">涓嶅厑璁稿嚭鐜颁氦鍙夐潰锛�</span>'); - break; - } - } else if (p == S.length - 1) { - if (Cesium_turf.lineIntersect(h, g).features.length) { - (d = !1), - (C.innerHTML = - '<span style="font-family:榛戜綋;color:white;font-weight: bolder;font-size: 14px">涓嶅厑璁稿嚭鐜颁氦鍙夐潰锛�</span>'); - break; - } - } else { - if (Cesium_turf.lineIntersect(h, g).features.length) - return ( - (d = !1), - void (C.innerHTML = - '<span style="font-family:榛戜綋;color:white;font-weight: bolder;font-size: 14px">涓嶅厑璁稿嚭鐜颁氦鍙夐潰锛�</span>') - ); - if (Cesium_turf.lineIntersect(m, g).features.length) { - (d = !1), - (C.innerHTML = - '<span style="font-family:榛戜綋;color:white;font-weight: bolder;font-size: 14px">涓嶅厑璁稿嚭鐜颁氦鍙夐潰锛�</span>'); - break; - } - } - } - if (!d) return; - } - (i = v[v.length - 2]), - (o = - _._viewer.scene.globe.ellipsoid.cartesianToCartographic( - i - )), - (r = Cesium.Math.toDegrees(o.latitude)), - (n = Cesium.Math.toDegrees(o.longitude)), - (s = - _._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], - ])); - S.push(c); - } - v.push(e), - (y = new _._cesium.PolygonHierarchy(v)), - f.rectangle && - (P - ? ((x = _._core.toDegrees(e)), - (v = [ - Cesium.Cartesian3.fromDegrees(P.lon, P.lat), - Cesium.Cartesian3.fromDegrees(P.lon, x.lat), - Cesium.Cartesian3.fromDegrees(x.lon, x.lat), - Cesium.Cartesian3.fromDegrees(x.lon, P.lat), - ]), - (y = new _._cesium.PolygonHierarchy(v)), - (w.hierarchy = y), - f.pointSelect ? (E = !(T = b = void 0)) : D()) - : (P = _._core.toDegrees(e))); - (t = _._cesium.Cartographic.fromCartesian(v[v.length - 1])), - (a = - (_._cesium.Math.toDegrees(t.longitude), - _._cesium.Math.toDegrees(t.latitude), - t.height, - _._viewer.entities.add({ - name: "澶氳竟褰�", - position: e, - point: { - pixelSize: 5, - color: _._cesium.Color.RED.withAlpha(0.5), - outlineColor: _._cesium.Color.WHITE.withAlpha(0.5), - outlineWidth: 1, - heightReference: - _._cesium.HeightReference.CLAMP_TO_GROUND, - }, - }))); - _._tree.temporaryItem.obj.push(a), _._points.push(a); - } - }, _._cesium.ScreenSpaceEventType.LEFT_CLICK), - this._tree.handler.setInputAction(function (e) { - E || - v.length <= 3 || - (C.show(!1), - v.pop(), - (y = new _._cesium.PolygonHierarchy(v)), - f.pointSelect ? (E = !(T = b = void 0)) : D()); - }, _._cesium.ScreenSpaceEventType.RIGHT_CLICK), - (this.end = (e) => { - if ( - (C.show(!1), - _._core.mouse(_._viewer.container, 0), - _._tree.handler.destroy(), - _._tree.endtemporaryItem(), - (_.end = void 0), - "cancel" === e && - !this.waterTimer && - (_.item && _._viewer.entities.remove(_.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 _._cesium.CallbackProperty( - function () { - return e.hierarchy; - }, - !1 - )), - _._viewer.entities.add(this.options)); - (_.item = t), _._tree.temporaryItem.obj.push(t); - try { - null != f && - "" != f && - (0 < f.waterHeight && (b = f.waterHeight), - 0 < f.targetHeight && (T = f.targetHeight), - 0 < f.spood && (r = f.spood), - "" != f.GroupID && null != f.GroupID && (o = f.GroupID)); - } catch (e) { - console.log(e); - } - }; - var d = e; - function e(e) { - (this.options = { - name: "澶氳竟褰�", - polygon: { - hierarchy: [], - material: _._cesium.Color.SKYBLUE.withAlpha(0.5), - heightReference: _._cesium.HeightReference.NONE, - extrudedHeight: 0, - }, - }), - (this.hierarchy = e), - this._init(); - } - return this; - }), - (M.prototype.endWater = function () { - this.end && this.end(), - this.waterTimer && clearInterval(this.waterTimer), - this._tree.endtemporaryItem(), - this.deleteObject(); - }), - (M.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.withAlpha(0.5), - outlineColor: r._cesium.Color.WHITE.withAlpha(0.5), - 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: 0.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(F.selectedItem) || - "group" != F.selectedItem.type || - (t = F.selectedItem.id), - r._core.getuid()), - i = { - id: i, - name: "鏂板缓姘撮潰" + i, - pId: r._core.isnull(t) ? 0 : t, - type: "polyline", - item: r, - }; - r.setTreeobj(i), F.insertGroupId(i, r._core.isnull(t) ? 0 : t); - }), - s); - function s(e) { - (this.options = { - name: "澶氳竟褰�", - polygon: { - hierarchy: [], - material: r._cesium.Color.SKYBLUE.withAlpha(0.4), - heightReference: r._cesium.HeightReference.NONE, - extrudedHeight: 0, - }, - }), - (this.hierarchy = e), - this._init(); - } - return this; - }), - (M.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 + I.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(0.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); - let p; - 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(f(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, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * p - ), - 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 g; - this._tree.handler.setInputAction(function (e) { - var e = r._getPosition.getMousePosition(e, [n.polygon, n.label]); - e && - ((p = p || r._core.getPointToCameraDistance(r._viewer, 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 && - (g = 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) && - (g && r._viewer.entities.remove(g), (l = new y(i, r._cesium))), - 3 <= s.length && - ((e = (e = String(f(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, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * p - ), - 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"), - g && r._viewer.entities.remove(g), - "cancel" === e - ? r.deleteObject() - : (s.length < 3 && r.deleteObject(), - "" != t && null != t && "function" == typeof t && t(n)); - }); - var f = 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(C(t)); - }, - _ = function (e) { - return ( - (e.longitude = (e.longitude / Math.PI) * 180), - (e.latitude = (e.latitude / Math.PI) * 180), - e - ); - }, - C = 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; - }), - (M.prototype.surfaceArea = function (r = {}, n) { - var i, - o = this, - a = - (this._tree.removeHandler(), - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.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(0.5), - }, - t = this._core.CreateTooltip(); - this._tree.handler = new o._cesium.ScreenSpaceEventHandler(e.canvas); - let h = !1, - m; - 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 d; - this._tree.handler.setInputAction((e) => { - h = !0; - let t = this._getPosition.getMousePosition(e, [a.polygon, a.label]); - t && - ((m = m || o._core.getPointToCameraDistance(o._viewer, 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 && - (d = 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) && - (d && this._viewer.entities.remove(d), (u = new p(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"), - d && o._viewer.entities.remove(d), - "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()); - l.forEach((e) => { - Cesium.Cartesian3.add(o, { x: e[0], y: e[1], z: e[2] }, o); - }); - (e = Cesium.Cartesian3.divideByScalar( - o, - l.length, - new Cesium.Cartesian3() - )), - (e = this._viewer.entities.add({ - name: "澶氳竟褰㈤潰绉�", - position: Cesium.Cartesian3.fromDegrees(e.x, e.y, e.z), - label: { - text: t, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -40), - showBackground: !0, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * m), - 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, - heightReference:Cesium.HeightReference.RELATIVE_TO_GROUND, - // perPositionHeight: !0, - outline: !0, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * m), - 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); - } - }); - g.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 p = g; - function g(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; - }), - (M.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 && (this.item.show = e); - }), - (M.prototype.getVisibility = function () { - return this.item.show; - }), - (M.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(0.4), - })); - } 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.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, - }, - }; - }), - (M.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (M.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; - }), - (M.prototype.setPolygonAlpha = function (e) { - try { - this.item._polygon.material.color._value.alpha = e; - } catch (e) { - console.log(e); - } - return this; - }), - (M.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; - }), - (M.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; - }), - (M.prototype.setPolygonImage = function (e) { - try { - this.item._polygon.material = new this._cesium.ImageMaterialProperty({ - image: e, - }); - } catch (e) { - console.log(e); - } - return this; - }), - (M.prototype.setPolygonRepeat = function (e, t) { - try { - this.item._polygon.material.repeat = new this._cesium.Cartesian2(e, t); - } catch (e) { - console.log(e); - } - return this; - }), - (M.prototype.setOutlineColor = function (e) { - try { - this.item._polygon.outlineColor = new m( - this._viewer, - this._cesium - ).colorFromHtmlColor(e); - } catch (e) { - console.log(e); - } - return this; - }), - (M.prototype.setOutline = function (e) { - try { - this.item._polygon.outline = e; - } catch (e) { - console.log(e); - } - return this; - }), - (M.prototype.setExtrudedHeight = function (e) { - try { - this.item._polygon.extrudedHeight = e; - } catch (e) { - console.log(e); - } - return this; - }), - (M.prototype.setHeight = function (e) { - try { - this.item._polygon.height = e; - } catch (e) { - console.log(e); - } - return this; - }), - (M.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(M.prototype, { - rectangle: { - get: function () { - return this.item.rectangle; - }, - set: function (e) { - this.item.rectangle = e; - }, - }, - }), - Object.defineProperties(M.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: f.debounce(function (e) { - this.item.polygon.show = e; - }, 500), - get: function () { - return this.item.polygon.b; - }, - }, - polygonHeight: { - set: f.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: f.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: f.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: f.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: f.debounce(function (e) { - this.item.polygon.fill = e; - }, 500), - get: function () { - var e = this.item.polygon.fill; - if (e) return e._value; - }, - }, - polygonMaterial: { - set: f.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: f.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: f.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: f.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: f.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; - }, - }, - }), - (M.prototype.setItem = function (e) { - this.item = 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; - }, - }, - }), - Object.defineProperties(M.prototype, { - wall: { - get: function () { - return this.item.wall; - }, - set: function (e) { - this.item.wall = e; - }, - }, - }), - Object.defineProperties(M.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(M.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; - }, - }, - }), - (M.prototype.forceEndHanlder = function () { - this._tree.handler && - (this._tree.handler.destroy(), (this._tree.handler = void 0)); - }), - (R.prototype.createPolyline = function (e, t, i, o, r) { - var n = []; - if (Array.isArray(e)) { - 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 ? !1 : !0; - 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, - }, - }); - } else - "object" == typeof e && - ((t = this._core.defaultValue(e.alpha, 0.6)), - e.points.forEach((e) => { - n.push(Cesium.Cartesian3.fromDegrees(e.x, e.y, e.z)); - }), - (this.item = this._viewer.entities.add({ - id: e.id, - polyline: { - positions: n, - width: e.width || 4, - material: Cesium.Color.fromCssColorString( - e.color || "#f00" - ).withAlpha(t), - clampToGround: e.clampToGround, - }, - })), - (this.item.objectType = "polyline")); - i = { - id: this.item.id, - name: r, - pId: this._core.isnull(o) ? 0 : o, - type: "polyline", - item: this, - }; - return ( - this.setTreeobj(i), - this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), - this - ); - }), - (R.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 - ); - }), - (R.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: 0.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)), - (v = Cesium.Cartesian3.fromDegrees(l[0].x, l[1].y, 0)), - (n = this._core.getSpaceDistancem([t, v], 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, - f = l[0].y + (e + 1) * m, - _ = l[0].z + (e + 1) * d; - p.push(this._cesium.Cartesian3.fromDegrees(g, f, _)); - } - p.push(s[1]); - var C = this._core.defaultValue(i.speed, 1), - y = 0, - v = - (this._viewer.clock.onTick.addEventListener(function () { - (y += C), - (((y = parseInt(y)) >= p.length - 1 && 0 < C) || - (y <= 0 && C < 0)) && - (C = -C), - (u = p[y]); - }), - { - id: this.item.id, - name: "鏂板缓閾捐矾", - pId: 0, - type: "polyline", - item: this, - }); - return this.setTreeobj(v), this._tree.insertGroupId(v, 0), this; - }), - (R.prototype.createLinkPros = function (o) { - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.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; - }), - (R.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; - }), - (R.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; - }), - (R.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 + I.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] = mr(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 - ); - }), - (R.prototype.spaceDistance = R.prototype.executePolyline1 = - function (t, e) { - let i; - ("object" != typeof t && "function" != typeof e) || - ((i = e), (e = t), (t = i)), - (i = null); - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.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 = null, - s = "0绫�", - l = null, - u = this, - c = "", - h = this._core.CreateTooltip(), - m = { name: "", spot: [], distance: [], label: [], ployline: [] }, - d = { point: u._cesium.Color.RED, polyline: u._cesium.Color.YELLOW }; - 0 < Object.keys(e).length && - ("" != e.point && null != e.point && (d.point = e.point), - "" != e.polyline && null != e.polyline && (d.polyline = e.polyline)); - let p; - this._tree.handler.setInputAction(function (e) { - (l = u._getPosition.getMousePosition(e)) && - (0 === n.length - ? h.showAt(e.endPosition, "宸﹂敭寮�濮嬬粯鍒讹紒") - : h.showAt(e.endPosition, "鍙抽敭缁撴潫缁樺埗锛�"), - 2 <= n.length && - (u._cesium.defined(a) - ? (n.length > u._points.length && n.pop(), n.push(l)) - : (a = new g(n)), - (s = u._core.getSpaceDistance(n, u._cesium))), - r && (u._viewer.entities.remove(r), (r = void 0)), - (r = u._viewer.entities.add({ - name: "绌洪棿鐩寸嚎璺濈", - position: n[n.length - 1], - label: { - text: "鎬婚暱锛�" + s, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -20), - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * p - ), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - u._tree.temporaryItem.obj.push(r)); - }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), - this._tree.handler.setInputAction(function (e) { - u._viewer.camera.getPickRay(e.position), - (l = u._getPosition.getMousePosition(e)) && - ((p = p || u._core.getPointToCameraDistance(u._viewer, l)), - 0 != n.length && n.length > u._points.length - ? (n.pop(), n.push(l)) - : n.push(l, l), - 2 <= n.length && - (u._cesium.defined(a) || (a = new g(n)), - (s = u._core.getSpaceDistance(n, u._cesium))), - r && (u._viewer.entities.remove(r), (r = void 0)), - (c = "鎬婚暱锛�" + (e = s)), - (o = u._viewer.entities.add({ - name: "绌洪棿鐩寸嚎璺濈", - position: n[n.length - 1], - point: { - pixelSize: 5, - color: d.point.withAlpha(0.5), - outlineColor: u._cesium.Color.WHITE.withAlpha(0.5), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - outlineWidth: 2, - clampToGround: !0, - }, - label: { - text: e, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -20), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - u._tree.temporaryItem.obj.push(o), - u._points.push(o), - m.spot.push(l), - m.distance.push(s), - m.label.push(o)); - }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), - this._tree.handler.setInputAction(function (e) { - u.end(); - }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), - (this.end = function (e) { - h.show(!1), - u._tree && u._tree.endtemporaryItem(), - (u.end = void 0), - r && (u._viewer.entities.remove(r), (r = void 0), n.pop()), - u._points[u._points.length - 1] && - (u._points[u._points.length - 1].label.text = c), - u._tree && u._tree.handler.destroy(), - u._core.mouse(u._viewer.container, 0, "0"), - "cancel" === e - ? u.deleteObject() - : (n.length < 2 && u.deleteObject(), - "" != t && null != t && "function" == typeof t && t(m)); - }); - f.prototype._init = function () { - var e = this, - t = - ((this.options.polyline.positions = - new u._cesium.CallbackProperty(function () { - return e.positions; - }, !1)), - u._viewer.entities.add(this.options)), - t = - ((u.item = t), - u._tree.temporaryItem.obj.push(t), - m.ployline.push(t), - u._core.getuid()); - m.name = "鏂板缓绌洪棿璺濈" + t; - }; - var g = f; - function f(e) { - (this.options = { - name: "鐩寸嚎", - polyline: { - show: !0, - positions: [], - material: d.polyline, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * p - ), - width: 3, - clampToGround: !1, - }, - }), - (this.positions = e), - this._init(); - } - return this; - }), - (R.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 }; - 0 < Object.keys(e).length && - ("" != e.point && null != e.point && (m.point = e.point), - "" != e.polyline && null != e.polyline && (m.polyline = e.polyline)); - let d; - 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 g(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, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * d - ), - 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 = d || c._core.getPointToCameraDistance(c._viewer, s)), - p(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.withAlpha(0.5), - outlineColor: c._cesium.Color.WHITE.withAlpha(0.5), - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * d - ), - outlineWidth: 2, - clampToGround: !0, - }, - label: { - text: e, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -20), - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * d - ), - 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); - var p = 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 - ); - } - }, - g = - (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), - (f.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); - }), - f); - function f(e) { - (this.options = { - name: "鐩寸嚎", - polyline: { - show: !0, - positions: [], - material: m.polyline, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * d - ), - width: 3, - clampToGround: !1, - }, - }), - (this.positions = e), - this._init(); - } - return this; - }), - (R.prototype.horizontalDistance = R.prototype.executeHorizontals = - function (t, e) { - let i; - ("object" != typeof t && "function" != typeof e) || - ((i = e), (e = t), (t = i)), - (i = null), - this._tree.removeHandler(), - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.draw - ), - this._tree.starttemporaryItem(this._viewer); - var h, - m = this, - d = [], - p = "", - g = [], - f = void 0, - o = m._viewer.scene, - l = o.globe.ellipsoid, - _ = { name: "", spot: [], distance: [], label: [], polyline: [] }, - C = { point: m._cesium.Color.RED, polyline: m._cesium.Color.YELLOW }, - e = - (0 < Object.keys(e).length && - ("" != e.point && null != e.point && (C.point = e.point), - "" != e.polyline && - null != e.polyline && - (C.polyline = e.polyline)), - new m._cesium.BillboardCollection()), - u = (o.primitives.add(e), new m._cesium.WebMercatorProjection()), - r = - ((this._tree.handler = new m._cesium.ScreenSpaceEventHandler( - o.canvas - )), - this._core.CreateTooltip()), - y = []; - let v; - this._tree.handler.setInputAction(function (e) { - 0 === d.length - ? r.showAt(e.endPosition, "宸﹂敭寮�濮嬬粯鍒讹紒") - : r.showAt(e.endPosition, "鍙抽敭缁撴潫缁樺埗锛�"), - (e = m._getPosition.getMousePosition( - e, - _.polyline.concat(_.label) - )) && - m._cesium.Ellipsoid.WGS84.cartesianToCartographic(e) && - ((e = e), - d.length < 1 || - (m._cesium.defined(f) - ? (f.path.pop(), f.path.push(e), y.pop(), y.push(e)) - : (f = new b(d, m._cesium)), - (e = w(y)), - h && (m._viewer.entities.remove(h), (h = void 0)), - (h = m._viewer.entities.add({ - name: "绌洪棿鐩寸嚎璺濈", - position: f.path[f.path.length - 1], - label: { - text: "鎬婚暱锛�" + e, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -20), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * v), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })))); - }, m._cesium.ScreenSpaceEventType.MOUSE_MOVE); - this._tree.handler.setInputAction(function (e) { - e = m._getPosition.getMousePosition(e, _.polyline.concat(_.label)); - if ( - (n = e ? m._cesium.Ellipsoid.WGS84.cartesianToCartographic(e) : n) - ) { - v = v || m._core.getPointToCameraDistance(m._viewer, e); - 0 < y.length && y.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 - ); - y.push(c); - } - 0 === d.length ? d.push(e, e) : d.push(e), - m._cesium.defined(f) || (f = new b(d, m._cesium)), - h && (m._viewer.entities.remove(h), (h = void 0)); - (n = "0绫�"), - (a = - (f && (n = w(y)), - y.push(e), - (p = "鎬婚暱锛�" + n), - _.spot.push(e), - _.distance.push(n), - m._viewer.entities.add({ - position: e, - point: { - pixelSize: 5, - color: C.point.withAlpha(0.5), - outlineColor: m._cesium.Color.WHITE.withAlpha(0.5), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * v), - outlineWidth: 1, - clampToGround: !0, - }, - label: { - text: n, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -20), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * v), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }))); - _.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(), - r.show(!1), - "cancel" === e - ? m.deleteObject() - : (d.length < 2 && m.deleteObject(), - "" != t && null != t && "function" == typeof t && t(_)); - }); - var w = 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) - ); - }, - b = - ((n.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), - _.polyline.push(this.lineEntity), - m._core.getuid()); - _.name = "鏂板缓姘村钩璺濈" + i; - }), - n); - function n(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, 0.5)), - (this.options = { - name: "鐩寸嚎", - polyline: { - show: !0, - positions: [], - material: C.polyline, - width: 3, - clampToGround: !0, - }, - }), - (this.path = e), - this._init(m._cesium); - } - return this; - }), - (R.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) + "鍗冪背"); - }), - (R.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; - let 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 u(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)) && - ((l = l || r._core.getPointToCameraDistance(r._viewer, s)), - (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.withAlpha(0.5), - outlineColor: r._cesium.Color.WHITE.withAlpha(0.5), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * l), - outlineWidth: 2, - clampToGround: !0, - heightReference: r._cesium.HeightReference.none, - }, - label: { - text: e, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * l), - 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.withAlpha(0.5), - outlineColor: r._cesium.Color.WHITE.withAlpha(0.5), - outlineWidth: 2, - clampToGround: !0, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * l - ), - heightReference: r._cesium.HeightReference.none, - }, - label: { - text: t, - font: "16px 瀹嬩綋", - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * l - ), - 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); - }; - var u = 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(0.5), - clampToGround: !0, - outline: !0, - }, - }), - (this.positions = e), - this._init3(); - } - return this; - }), - (R.prototype.verticalHeight = R.prototype.executeHeightTe = - function (t, e) { - let i; - ("object" != typeof t && "function" != typeof e) || - ((i = e), (e = t), (t = i)), - (i = null); - var r, - o = { point: Cesium.Color.RED, polyline: Cesium.Color.YELLOW }, - n = - (0 < Object.keys(e).length && - ("" != e.point && null != e.point && (o.point = e.point), - "" != e.polyline && - null != e.polyline && - (o.polyline = e.polyline)), - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.draw - ), - this._tree.removeHandler(), - this._tree.starttemporaryItem(this._viewer), - (this._tree.handler = new this._cesium.ScreenSpaceEventHandler( - this._viewer.scene.canvas - )), - []), - a = null, - s = null, - l = this, - u = { - name: "", - spot: [], - kjdistance: "", - spdistance: "", - gddistance: "", - point: [], - polyline: [], - }, - c = this._core.CreateTooltip(); - let h; - function m(e) { - var t, - i, - o = l._cesium.Cartographic.fromCartesian(e[0]), - r = l._cesium.Cartographic.fromCartesian(e[1]); - return ( - r.height, - r.height, - o.height, - (r = - 0 < r.height - o.height - ? ((t = l._cesium.Cartesian3.fromDegrees( - l._cesium.Math.toDegrees(o.longitude), - l._cesium.Math.toDegrees(o.latitude), - r.height - )), - (i = [e[1], t]), - [e[0], t]) - : ((t = l._cesium.Cartesian3.fromDegrees( - l._cesium.Math.toDegrees(r.longitude), - l._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 === n.length - ? c.showAt(e.endPosition, "宸﹂敭寮�濮嬬粯鍒讹紒") - : c.showAt(e.endPosition, "鍙抽敭缁撴潫锛�"), - (s = l._getPosition.getMousePosition( - e, - u.polyline.concat(u.point) - )) && - 2 <= n.length && - (l._cesium.defined(a) - ? (n.pop(), n.push(s.clone()), (r = m(n))) - : ((a = new d(n)), - (e = l._viewer.entities.add({ - name: "楂樺害娴嬮噺", - position: new l._cesium.CallbackProperty(function () { - return n[1]; - }, !1), - point: { - pixelSize: 5, - color: o.point.withAlpha(0.5), - outlineColor: l._cesium.Color.WHITE.withAlpha(0.5), - outlineWidth: 2, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - heightReference: l._cesium.HeightReference.none, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - l._tree.temporaryItem.obj.push(e), - u.point.push(e), - l._points.push(e), - (r = m(n)), - (e = l._viewer.entities.add({ - position: new l._cesium.CallbackProperty(function () { - return l._cesium.Cartesian3.midpoint( - r.eq_lon_lat[0], - r.eq_lon_lat[1], - new l._cesium.Cartesian3() - ); - }, !1), - name: "绛夌粡绾害", - polyline: { - show: !0, - positions: new l._cesium.CallbackProperty(function () { - return r.eq_lon_lat; - }, !1), - material: o.polyline, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - width: 2, - }, - label: { - text: new l._cesium.CallbackProperty(function () { - var e = "绫�", - t = (i = l.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 (u.gddistance = i = "楂樺害锛�" + i); - }, !1), - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -20), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - u.polyline.push(e), - l._polylines.push(e), - (e = l._viewer.entities.add({ - position: new l._cesium.CallbackProperty(function () { - return l._cesium.Cartesian3.midpoint( - r.eq_height[0], - r.eq_height[1], - new l._cesium.Cartesian3() - ); - }, !1), - name: "绛夐珮搴︾洿绾�", - polyline: { - show: !0, - positions: new l._cesium.CallbackProperty(function () { - return r.eq_height; - }, !1), - material: o.polyline, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - width: 2, - }, - label: { - text: new l._cesium.CallbackProperty(function () { - var e = l._core.getHorizontalDistance( - r.eq_height, - l._cesium - ); - return (u.spdistance = "姘村钩璺濈锛�" + e); - }, !1), - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - pixelOffset: new Cesium.Cartesian2(20, -20), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - u.polyline.push(e), - l._polylines.push(e))); - }, l._cesium.ScreenSpaceEventType.MOUSE_MOVE), - this._tree.handler.setInputAction(function (e) { - (s = l._getPosition.getMousePosition( - e, - u.polyline.concat(u.point) - )) && - ((h = h || l._core.getPointToCameraDistance(l._viewer, s)), - 0 == n.length - ? (n.push(s.clone()), - n.push(s.clone()), - (r = m(n)), - (e = l._viewer.entities.add({ - name: "楂樺害娴嬮噺", - position: n[0], - point: { - pixelSize: 5, - color: o.point.withAlpha(0.5), - outlineColor: l._cesium.Color.WHITE.withAlpha(0.5), - outlineWidth: 2, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - heightReference: l._cesium.HeightReference.none, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - l._tree.temporaryItem.obj.push(e), - u.point.push(e), - l._points.push(e)) - : 2 <= n.length && - (l._cesium.defined(a) - ? (n.pop(), n.push(s.clone()), (r = m(n))) - : ((a = new d(n)), - (e = l._viewer.entities.add({ - name: "楂樺害娴嬮噺", - position: new l._cesium.CallbackProperty(function () { - return n[1]; - }, !1), - point: { - pixelSize: 5, - color: o.point.withAlpha(0.5), - outlineColor: l._cesium.Color.WHITE.withAlpha(0.5), - outlineWidth: 2, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - heightReference: l._cesium.HeightReference.none, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - l._tree.temporaryItem.obj.push(e), - u.point.push(e), - l._points.push(e), - (r = m(n)), - (e = l._viewer.entities.add({ - position: new l._cesium.CallbackProperty(function () { - return l._cesium.Cartesian3.midpoint( - r.eq_lon_lat[0], - r.eq_lon_lat[1], - new l._cesium.Cartesian3() - ); - }, !1), - name: "绛夌粡绾害", - polyline: { - show: !0, - positions: new l._cesium.CallbackProperty( - function () { - return r.eq_lon_lat; - }, - !1 - ), - material: o.polyline, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - width: 2, - }, - label: { - text: new l._cesium.CallbackProperty(function () { - var e = "绫�", - t = (i = l.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 (u.gddistance = i = "楂樺害锛�" + i); - }, !1), - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -20), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - u.polyline.push(e), - l._polylines.push(e), - (e = l._viewer.entities.add({ - position: new l._cesium.CallbackProperty(function () { - return l._cesium.Cartesian3.midpoint( - r.eq_height[0], - r.eq_height[1], - new l._cesium.Cartesian3() - ); - }, !1), - name: "绛夐珮搴︾洿绾�", - polyline: { - show: !0, - positions: new l._cesium.CallbackProperty( - function () { - return r.eq_height; - }, - !1 - ), - material: o.polyline, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - width: 2, - }, - label: { - text: new l._cesium.CallbackProperty(function () { - var e = l._core.getHorizontalDistance( - r.eq_height, - l._cesium - ); - return (u.spdistance = "姘村钩璺濈锛�" + e); - }, !1), - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -20), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * h), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - u.polyline.push(e), - l._polylines.push(e)))); - }, l._cesium.ScreenSpaceEventType.LEFT_CLICK), - this._tree.handler.setInputAction(function (e) { - l.end(); - }, l._cesium.ScreenSpaceEventType.RIGHT_CLICK), - this._tree.handler.setInputAction(function (e) { - l.end(); - }, l._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), - (this.end = function (e) { - l._tree.handler.destroy(), - c.show(!1), - (l.end = void 0), - l._tree.endtemporaryItem(), - l._core.mouse(l._viewer.container, 0, "0"), - "cancel" === e - ? l.deleteObject() - : "" != t && null != t && "function" == typeof t && t(u); - }); - p.prototype._init = function () { - var o = this, - e = - ((this.options.polyline.positions = - new l._cesium.CallbackProperty(function () { - return o.positions; - }, !1)), - (this.options.position = new l._cesium.CallbackProperty( - function () { - return l._cesium.Cartesian3.midpoint( - r.eq_height[0], - r.eq_height[1], - new l._cesium.Cartesian3() - ); - }, - !1 - )), - (this.options.label.text = new l._cesium.CallbackProperty( - function () { - (i = o.positions), - (e = l._cesium.Cartographic.fromCartesian(i[0])), - (i = l._cesium.Cartographic.fromCartesian(i[1])), - (t = new l._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 (u.kjdistance = "绌洪棿璺濈锛�" + i); - }, - !1 - )), - l._viewer.entities.add(this.options)), - e = - ((l.item = e), - l._tree.temporaryItem.obj.push(e), - u.polyline.push(e), - l._core.getuid()); - u.name = "鏂板缓鍨傜洿楂樺害" + e; - }; - var d = p; - function p(e) { - (this.options = { - name: "鐩寸嚎", - polyline: { - show: !0, - positions: [], - material: o.polyline, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * h - ), - width: 2, - }, - label: { - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * h - ), - pixelOffset: new Cesium.Cartesian2(20, 20), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }), - (this.positions = e), - this._init(); - } - return this; - }), - (R.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.withAlpha(0.5), - outlineColor: s._cesium.Color.WHITE.withAlpha(0.5), - 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; - }), - (R.prototype.measureAngle = R.prototype.executeAngle = - function (t, e) { - let i; - ("object" != typeof t && "function" != typeof e) || - ((i = e), (e = t), (t = i)), - (i = null); - var o, - r, - n, - a, - s = { point: Cesium.Color.RED, polyline: Cesium.Color.YELLOW }, - l = - (0 < Object.keys(e).length && - ("" != e.point && null != e.point && (s.point = e.point), - "" != e.polyline && - null != e.polyline && - (s.polyline = e.polyline)), - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.draw - ), - this._tree.removeHandler(), - this._tree.starttemporaryItem(this._viewer), - (this._tree.handler = new this._cesium.ScreenSpaceEventHandler( - this._viewer.scene.canvas - )), - []), - u = null, - c = null, - h = this, - m = { - name: "", - spot: [], - kjdistance: "", - spdistance: "", - gddistance: "", - point: [], - polyline: [], - labels: [], - }, - d = this._core.CreateTooltip(); - let p; - function g(e) { - var t, - i, - o = h._cesium.Cartographic.fromCartesian(e[0]), - r = h._cesium.Cartographic.fromCartesian(e[1]); - return ( - r.height, - r.height, - o.height, - (r = - 0 < r.height - o.height - ? ((t = h._cesium.Cartesian3.fromDegrees( - h._cesium.Math.toDegrees(o.longitude), - h._cesium.Math.toDegrees(o.latitude), - r.height - )), - (i = [e[1], t]), - [e[0], t]) - : ((t = h._cesium.Cartesian3.fromDegrees( - h._cesium.Math.toDegrees(r.longitude), - h._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 === l.length - ? d.showAt(e.endPosition, "宸﹂敭寮�濮嬬粯鍒讹紒") - : d.showAt(e.endPosition, "鍙抽敭缁撴潫锛�"), - (c = h._getPosition.getMousePosition( - e, - m.polyline.concat(m.point) - )) && - 2 <= l.length && - ((e = h._core.ElevationAngle(n, c, h._cesium)), - (i = t = ""), - (i = - n.z <= c.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), - h._cesium.defined(u) - ? (a.position.setValue(c), (a.label.text = i)) - : ((a = h._viewer.entities.add({ - position: c, - name: "绛夌粡绾害", - label: { - text: i, - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - pixelOffset: new Cesium.Cartesian2(20, -20), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - m.labels.push(a), - h._points.push(a)), - h._cesium.defined(u) - ? (l.pop(), l.push(c.clone()), (o = g(l))) - : ((u = new f(l)), - (e = h._viewer.entities.add({ - name: "瑙掑害娴嬮噺", - position: new h._cesium.CallbackProperty(function () { - return l[1]; - }, !1), - point: { - pixelSize: 5, - color: s.point.withAlpha(0.5), - outlineColor: h._cesium.Color.WHITE.withAlpha(0.5), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - outlineWidth: 2, - heightReference: h._cesium.HeightReference.none, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - h._tree.temporaryItem.obj.push(e), - m.point.push(e), - h._points.push(e), - (o = g(l)), - (t = h._viewer.entities.add({ - position: new h._cesium.CallbackProperty(function () { - return l[0]; - }, !1), - name: "绛夌粡绾害", - polyline: { - show: !0, - positions: new h._cesium.CallbackProperty(function () { - return o.eq_lon_lat; - }, !1), - material: s.polyline, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - width: 2, - }, - })), - m.polyline.push(t), - h._polylines.push(t), - (i = h._viewer.entities.add({ - position: new h._cesium.CallbackProperty(function () { - return l[1]; - }, !1), - name: "绛夐珮搴︾洿绾�", - polyline: { - show: !0, - positions: new h._cesium.CallbackProperty(function () { - return o.eq_height; - }, !1), - material: s.polyline, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - width: 2, - }, - })), - m.polyline.push(i), - h._polylines.push(i))); - }, h._cesium.ScreenSpaceEventType.MOUSE_MOVE), - this._tree.handler.setInputAction(function (e) { - var t; - (c = h._getPosition.getMousePosition( - e, - m.polyline.concat(m.point) - )) && - ((p = p || h._core.getPointToCameraDistance(h._viewer, c)), - 0 == l.length - ? ((n = c), - (r = h._viewer.entities.add({ - position: c, - name: "绛夌粡绾害", - label: { - text: "0", - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(20, -20), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - m.labels.push(r), - (t = h._viewer.entities.add({ - position: new h._cesium.CallbackProperty(function () { - return h._cesium.Cartesian3.midpoint( - o.eq_lon_lat[0], - o.eq_lon_lat[1], - new h._cesium.Cartesian3() - ); - }, !1), - label: { - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - pixelOffset: new Cesium.Cartesian2(20, -20), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - l.push(c.clone()), - l.push(c.clone()), - (o = g(l)), - (e = h._viewer.entities.add({ - name: "楂樺害娴嬮噺", - position: l[0], - point: { - pixelSize: 5, - color: s.point.withAlpha(0.5), - outlineColor: h._cesium.Color.WHITE.withAlpha(0.5), - outlineWidth: 2, - heightReference: h._cesium.HeightReference.none, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - h._tree.temporaryItem.obj.push(e), - m.point.push(e), - h._points.push(r, e)) - : 2 <= l.length && - (h._cesium.defined(u) - ? (l.pop(), l.push(c.clone()), (o = g(l))) - : ((u = new f(l)), - (e = h._viewer.entities.add({ - name: "楂樺害娴嬮噺", - position: new h._cesium.CallbackProperty(function () { - return l[1]; - }, !1), - point: { - pixelSize: 5, - color: s.point.withAlpha(0.5), - outlineColor: h._cesium.Color.WHITE.withAlpha(0.5), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - outlineWidth: 2, - heightReference: h._cesium.HeightReference.none, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - h._tree.temporaryItem.obj.push(e), - m.point.push(e), - h._points.push(e), - (o = g(l)), - (t = h._viewer.entities.add({ - position: new h._cesium.CallbackProperty(function () { - return h._cesium.Cartesian3.midpoint( - o.eq_lon_lat[0], - o.eq_lon_lat[1], - new h._cesium.Cartesian3() - ); - }, !1), - name: "绛夌粡绾害", - polyline: { - show: !0, - positions: new h._cesium.CallbackProperty( - function () { - return o.eq_lon_lat; - }, - !1 - ), - material: s.polyline, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - width: 2, - }, - label: { - text: new h._cesium.CallbackProperty(function () { - var e = "绫�", - t = (i = h.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 (m.gddistance = i = "楂樺害锛�" + i); - }, !1), - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - pixelOffset: new Cesium.Cartesian2(20, -20), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - m.polyline.push(t), - h._polylines.push(t), - (e = h._viewer.entities.add({ - position: new h._cesium.CallbackProperty(function () { - return h._cesium.Cartesian3.midpoint( - o.eq_height[0], - o.eq_height[1], - new h._cesium.Cartesian3() - ); - }, !1), - name: "绛夐珮搴︾洿绾�", - polyline: { - show: !0, - positions: new h._cesium.CallbackProperty( - function () { - return o.eq_height; - }, - !1 - ), - material: s.polyline, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - width: 2, - }, - label: { - text: new h._cesium.CallbackProperty(function () { - var e = - "瑙掑害锛�" + - (e = h._core.ElevationAngle( - firtP, - c, - h._cesium - )).toFixed(2); - return (m.spdistance = e); - }, !1), - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(60, -20), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition(0, 1.5 * p), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - m.polyline.push(e), - h._polylines.push(e)))); - }, h._cesium.ScreenSpaceEventType.LEFT_CLICK), - this._tree.handler.setInputAction(function (e) { - h.end(); - }, h._cesium.ScreenSpaceEventType.RIGHT_CLICK), - this._tree.handler.setInputAction(function (e) { - h.end(); - }, h._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), - (this.end = function (e) { - h._tree.handler.destroy(), - d.show(!1), - h._tree.endtemporaryItem(), - (h.end = void 0), - h._core.mouse(h._viewer.container, 0, "0"), - "cancel" === e - ? h.deleteObject() - : "" != t && - null != t && - "function" == typeof t && - ((this.labels = m.labels), t(m)); - }); - _.prototype._init = function () { - var e = this, - t = - ((this.options.polyline.positions = - new h._cesium.CallbackProperty(function () { - return e.positions; - }, !1)), - (this.options.position = new h._cesium.CallbackProperty( - function () { - return h._cesium.Cartesian3.midpoint( - e.positions[0], - e.positions[1], - new h._cesium.Cartesian3() - ); - }, - !1 - )), - h._viewer.entities.add(this.options)), - t = - ((h.item = t), - h._tree.temporaryItem.obj.push(t), - m.polyline.push(t), - h._core.getuid()); - m.name = "鏂板缓鍨傜洿楂樺害" + t; - }; - var f = _; - function _(e) { - (this.options = { - name: "鐩寸嚎", - polyline: { - show: !0, - positions: [], - material: s.polyline, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * p - ), - width: 2, - }, - label: { - font: "16px 瀹嬩綋", - fillColor: Cesium.Color.GOLD, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * p - ), - pixelOffset: new Cesium.Cartesian2(20, -20), - showBackground: !0, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }), - (this.positions = e), - this._init(); - } - return this; - }), - (R.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.withAlpha(0.5), - outlineColor: n._cesium.Color.WHITE.withAlpha(0.5), - 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(); - } - }), - (R.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; - }), - (R.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 f(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), - f = - (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(F.selectedItem) || - "group" != F.selectedItem.type || - F.selectedItem.id, - r._core.getuid()), - t = { - id: t, - name: "鏂板缓鍓栭潰鍒嗘瀽" + t, - pId: r._core.isnull(u) ? 0 : u, - type: "polyline", - item: r, - }; - r.setTreeobj(t), F.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; - }), - (R.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 + I.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(F.selectedItem) || - "group" != F.selectedItem.type || - F.selectedItem.id, - i._core.getuid()), - t = { - id: t, - name: "鏂板缓鍓栭潰鍒嗘瀽" + t, - pId: i._core.isnull(a) ? 0 : a, - type: "polyline", - item: i, - }; - i.setTreeobj(t), F.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; - }), - (R.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; - }), - (R.prototype.executeAngeSd = function (o) { - this._tree.removeHandler(); - var r = [], - n = - (this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.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 - ); - }), - (R.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 = []; - } - }), - (R.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; - }), - (R.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, - }, - }; - }), - (R.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; - }), - (R.prototype.getVisibility = function () { - return this.item.show; - }), - (R.prototype.setOutlinewidth = function (e) { - this.item._polyline.material.outlineWidth = e; - }), - (R.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; - }), - (R.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; - }), - (R.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(0.4), - heightReference: this._cesium.HeightReference.none, - })); - } catch (e) { - console.log(e); - } - return this; - }), - (R.prototype.setGlow = function (e) { - try { - (this.item._polyline.material = e - ? new this._cesium.PolylineGlowMaterialProperty({ - glowPower: 0.2, - taperPower: 0.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; - }), - (R.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; - }), - (R.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; - }), - (R.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; - }), - (R.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; - }), - (R.prototype.setClampToGround = function (e) { - try { - this.item._polyline.clampToGround = e; - } catch (e) { - console.log(e); - } - return this; - }), - (R.prototype.setWidth = function (e) { - try { - this.item._polyline.width = e; - } catch (e) { - console.log(e); - } - return this; - }), - (R.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(R.prototype, { - HighLight: { - set: function (e) { - e && (this.item.material = this.item.polyline.material), - (this.item.polyline.material = e - ? new this._cesium.PolylineGlowMaterialProperty({ - glowPower: 0.8, - color: this._cesium.Color.ORANGERED.withAlpha(0.9), - }) - : this.item.material); - }, - }, - polylinemMterial: { - set: f.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: f.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: f.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(R.prototype, { - rectangle: { - get: function () { - return this.item.rectangle; - }, - set: function (e) { - this.item.rectangle = e; - }, - }, - }), - Object.defineProperties(R.prototype, { - polyline: { - get: function () { - return this.item.polyline; - }, - set: function (e) { - this.item.polyline = e; - }, - }, - }), - Object.defineProperties(R.prototype, { - polygon: { - get: function () { - return this.item.polygon; - }, - set: function (e) { - this.item.polygon = e; - }, - }, - }), - Object.defineProperties(R.prototype, { - point: { - get: function () { - return this.item.point; - }, - set: function (e) { - this.item.point = e; - }, - }, - }), - Object.defineProperties(R.prototype, { - label: { - get: function () { - return this.item.label; - }, - set: function (e) { - this.item.label = e; - }, - }, - }), - Object.defineProperties(R.prototype, { - model: { - get: function () { - return this.item.model; - }, - set: function (e) { - this.item.model = e; - }, - }, - }), - (R.prototype.setItem = function (e) { - this.item = e; - }), - (R.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - Object.defineProperties(R.prototype, { - wall: { - get: function () { - return this.item.wall; - }, - set: function (e) { - this.item.wall = e; - }, - }, - }), - Object.defineProperties(R.prototype, { - polylineTempOptions: { - get: function () { - return { - positions: [], - arcType: ArcType.GEODESIC, - clampToGround: !1, - width: 1, - show: !0, - material: this._cesium.Color.WHITE, - }; - }, - }, - }), - Object.defineProperties(R.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; - }, - }, - }), - (R.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 - ); - }), - (R.prototype.forceEndHanlder = function () { - this.handler && (this.handler.destroy(), (this.handler = void 0)), - this._tree.handler && - (this._tree.handler.destroy(), (this._tree.handler = void 0)); - }), - (dr.prototype.deleteObject = dr.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); - }), - (dr.prototype.startDrawing = function (e = {}, t = "auto", a) { - var s, - i = this._scene, - r = this._tooltip, - l = [], - u = [], - c = [], - h = - ((this._positions = u), - (this._degreesArr = c), - (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(i.canvas)); - (this._mouseHandler = e), - this.cleanUp(), - this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.draw - ); - let m; - function d() { - return new Cesium.PolygonHierarchy( - Cesium.Cartesian3.fromDegreesArray(l) - ); - } - return ( - e.setInputAction( - function (e) { - if (null != e.position) { - var t = h._getPosition.getMousePosition(e); - if (t) { - var i = Cesium.Cartographic.fromCartesian(t), - o = Cesium.Math.toDegrees(i.longitude), - i = Cesium.Math.toDegrees(i.latitude); - if ( - (0 === l.length && - (l.push(o, i), c.push([o, i]), u.push(t), (s = t)), - 4 <= u.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 ( - l.splice(l.length - 2, 2), - u.pop(), - void this.stopDrawing(a) - ); - } - } - l.push(o, i), - c.push([o, i]), - u.push(t), - 2 !== u.length || - m || - (m = this._viewer.entities.add({ - name: "涓存椂绾�", - polyline: { - positions: new Cesium.CallbackProperty(function () { - return u; - }, !1), - clampToGround: !0, - material: h._drawColor.polygon, - width: 3, - }, - })), - 3 === u.length && - (m && this._viewer.entities.remove(m), - (this._prevEntity = this._viewer.entities.add({ - polygon: { - hierarchy: new Cesium.PolygonHierarchy( - Cesium.Cartesian3.fromDegreesArray(l) - ), - material: h._drawColor.polygon, - fill: !0, - }, - })), - (this._prevEntity.polygon.hierarchy = - new Cesium.CallbackProperty(d, !1))); - } - } - }.bind(this), - Cesium.ScreenSpaceEventType.LEFT_CLICK - ), - e.setInputAction( - function (e) { - var t, - i, - o = e.endPosition; - null != o && - (0 === u.length - ? r.showAt(o, "鐐瑰嚮寮�濮嬬粯鍒剁涓�涓偣") - : (e = h._getPosition.getMousePosition(e)) && - ((i = Cesium.Cartographic.fromCartesian(e)), - (t = Cesium.Math.toDegrees(i.longitude)), - (i = Cesium.Math.toDegrees(i.latitude)), - l.splice(l.length - 2, 2), - c.pop(), - u.pop(), - l.push(t, i), - c.push([t, i]), - u.push(e), - r.showAt(o, "鍙抽敭缁撴潫缁樺埗"), - 3 <= u.length && - 4 <= u.length && - void 0 !== - (t = Cesium.SceneTransforms.wgs84ToWindowCoordinates( - this._viewer.scene, - s - )) && - ((i = t.x - o.x), - (e = t.y - o.y), - (document.body.style.cursor = - i * i + e * e < 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), - m && this._viewer.entities.remove(m), - (this.end = void 0), - u.length < 3 || - (this._prevEntity && - (this._prevEntity.polygon.hierarchy = - Cesium.Cartesian3.fromDegreesArray(l)), - "cancel" === e - ? this._prevEntity && - this._viewer.entities.remove(this._prevEntity) - : this.stopDrawing(t, a)); - }), - this - ); - }), - (dr.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(0.2), - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition( - 0, - 1.5 * this.viewDistance - ), - 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); - }), - (dr.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); - }), - (dr.prototype.computeCutVolume = function (u, e) { - var c = 15e3, - h = -15e3, - t = Cesium.BoundingSphere.fromPoints(this._positions); - (this.viewDistance = - 1.5 * this._core.getPointToCameraDistance(this._viewer, t.center)), - "auto" === u && (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, - distanceDisplayCondition: - new Cesium.DistanceDisplayCondition( - 0, - 1.5 * this.viewDistance - ), - 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, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * this.viewDistance - ), - 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, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0, - 1.5 * this.viewDistance - ), - 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() - ); - }), - (dr.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); - }), - (dr.prototype.isLoading = function (e) { - this.loading.style.display = e ? "block" : "none"; - }), - (dr.prototype.removeLoading = function () { - this.loading && this.loading.remove(), (this.loading = void 0); - }), - (dr.prototype.addPoint = function (i) { - if ( - (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._getPosition.getMousePosition(e)) && - ((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 - ); - let e; - this.addPointHandle.setInputAction( - function (t) { - clearTimeout(e), - (e = setTimeout(() => { - var e = this._viewer.scene.pick(t.endPosition); - e && e.id && e.id.id === this._prevEntity1.id - ? this._tooltip.showAt(t.endPosition, "鐐瑰嚮淇敼鍩哄噯闈㈤珮搴�") - : this._tooltip.show(!1); - }, 50)); - }.bind(this), - Cesium.ScreenSpaceEventType.MOUSE_MOVE - ); - } - }), - (dr.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)); - }); - }), - (dr.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 })); - }), - (pr.prototype.clearMeasure = function (t) { - if (t) { - let e = this.measureData.get(t); - e && e.deleteObject && e.deleteObject(), - e && e.cleanUp && e.cleanUp(), - this.measureData.delete(t); - } else - this.measureData.forEach((e) => { - e.deleteObject && e.deleteObject(), e.cleanUp && e.cleanUp(); - }), - this.measureData.clear(); - }), - (pr.prototype.horizontalDistance = function (e = {}, t) { - let i = this.Polyline.horizontalDistance(e, (e) => { - (e.id = this._core.getuid()), - this.measureData.set(e.id, i), - t && "function" == typeof t && t(e); - }); - }), - (pr.prototype.spaceDistance = function (e = {}, t) { - let i = this.Polyline.spaceDistance(e, (e) => { - (e.id = this._core.getuid()), - this.measureData.set(e.id, i), - t && "function" == typeof t && t(e); - }); - }), - (pr.prototype.altitude = function (e = {}, t) { - let i = this.Point.altitude(e, (e) => { - (e.id = this._core.getuid()), - this.measureData.set(e.id, i), - t && "function" == typeof t && t(e); - }); - }), - (pr.prototype.verticalHeight = function (e = {}, t) { - let i = this.Polyline.verticalHeight(e, (e) => { - (e.id = this._core.getuid()), - this.measureData.set(e.id, i), - t && "function" == typeof t && t(e); - }); - }), - (pr.prototype.surfaceArea = function (e = {}, t) { - let i = this.Polygon.surfaceArea(e, (e) => { - (e.id = this._core.getuid()), - this.measureData.set(e.id, i), - t && "function" == typeof t && t(e); - }); - }), - (pr.prototype.planeArea = function (e = {}, t) { - let i = this.Polygon.planeArea(e, (e) => { - (e.id = this._core.getuid()), - this.measureData.set(e.id, i), - t && "function" == typeof t && t(e); - }); - }), - (pr.prototype.measureAngle = function (e = {}, t) { - let i = this.Polyline.measureAngle(e, (e) => { - (e.id = this._core.getuid()), - this.measureData.set(e.id, i), - t && "function" == typeof t && t(e); - }); - }), - (pr.prototype.analysisVolume = function (e = {}, t) { - let i = new dr(this._viewer, Cesium); - i.startDrawing(e, e.spacing || "auto", (e) => { - i.value || - ((e.id = this._core.getuid()), this.measureData.set(e.id, i)), - (i.value = - `濉柟锛�${e.volume.fill.toFixed(4) + e.unit.fill}<br>鎸栨柟锛歚 + - (e.volume.dig.toFixed(4) + e.unit.dig)), - t && "function" == typeof t && t(e); - }); - }), - Object.defineProperties(pr.prototype, { - Point: { - get: function () { - return new L(this._viewer, Cesium); - }, - }, - Polyline: { - get: function () { - return new R(this._viewer, Cesium); - }, - }, - Polygon: { - get: function () { - return new M(this._viewer, Cesium); - }, - }, - }), - (Cr.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; - }), - (Cr.prototype.measureTerrainArea = function (e) { - return _r(e).toFixed(1); - }), - (Cr.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) - ); - }), - (Cr.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 = mr(t.y, t.z, e.y, e.z); - return Math.sqrt(i * i + t * t); - }), - (Cr.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), mr(t.y, t.x, e.y, e.x); - }); - var yr, - vr = (1e-5 * Math.PI) / 180; - function wr(e, t) { - (lr = t), - (this._cesium = t), - (this._viewer = e), - (this._core = new v()), - (this._polylines = []), - (this._points = []), - (this._tree = F), - (this._interval = 20); - } - function br(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F), - (this._indoormode = new vo(e)), - (this._model = null), - (this._relativeHeight = -100), - (this._groundHeightAtCameraPosition = 0), - this._startMousePosition, - this._mousePosition, - this._cameraHeight, - this._originalOption, - (this._alpha = 0.5), - (this._brightness = 0.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 Tr(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 O(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._elevationContour = new Nt(this._viewer, this._cesium)), - (this._createcurtaincontrast = new fo(this._viewer, this._cesium)), - (this._createindoormode = new vo(this._viewer, this._cesium)), - (this._createWeather = new wo(this._viewer, this._cesium)), - (this._UndergroundGrid = new To(this._viewer)), - (this._StreetView = new Eo(this._viewer, this._cesium)), - (this._depthTestAgainstTerrain = new Vo(this._viewer, this._cesium)), - (this._create3DViewshed = new No(this._viewer, this._cesium)), - (this._skylineAnalysis = new Xo(this._viewer, this._cesium)), - (this._EdgeStage = new ir(this._viewer, this._cesium)), - (this._bufferAnalysis = new Si(this._viewer, this._cesium)), - (this._shadowsAnalysis = new rr(this._viewer, this._cesium)), - (this._screenshot = new nr(this._viewer, this._cesium)), - (this._PointFly = new ar(this._viewer, this._cesium)), - (this._SunshineAnalysis = new sr(this._viewer, this._cesium)), - (this._measure = new pr(this._viewer)), - (this._Deprecated = new Cr(this._viewer, this._cesium)), - (this._UndergroundMode = new br(this._viewer, this._cesium)); - } - function Er(e, t) { - (this._viewer = e), (this._cesium = t); - } - function Sr(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F); - } - function B(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F); - } - function Pr(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F); - } - function H(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F), - (this._viewEvent = null), - (this.positions = []), - (this._getPosition = new C(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 V(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._getPosition = new C(this._viewer, this._cesium)), - (this._tree = F), - (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 G(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._tree = F), - (this._core = new v()), - (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 k(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._getPosition = new C(this._viewer, this._cesium)), - (this._tree = F), - (this._entityFly = null); - } - (wr.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 + I.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 = [], - f = - (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 = lr.Math.toDegrees(cartograhphic.latitude)), - (i = lr.Math.toDegrees(cartograhpinc.longitude)), - (o = n.height), - (e = lr.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), - _ = 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 - ? ((f = s[o].cartesian[0].leftX), - (_ = 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 - ); - }), - (wr.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, - f = s.Math.lerp(h, d, 1 / p) - h, - _ = s.Math.lerp(m, u, 1 / p) - m, - C = (s.Math.lerp(t, o, 1 / p), s.Math.lerp(i, r, 1 / p), !0), - y = 0; - y < p - 2; - y++ - ) { - var v = m + (y + 1) * _, - w = s.Cartesian3.fromDegrees(c + (y + 1) * g, h + (y + 1) * f, v), - 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))), - (v = parseFloat(v.toFixed(1))) < b) - ) - return (C = !1); - } - return C; - }), - (wr.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]); - } - }), - (wr.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 lr.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 : vr; - if (r <= i) - return o.push(new lr.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 lr.Cartographic(u, c)); - } - return o.push(new lr.Cartographic(t.longitude, t.latitude, t.height)), o; - }), - (wr.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 lr.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 : vr; - if (r <= i) - return o.push(new lr.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 lr.Cartographic(c, h, m)); - } - return o.push(new lr.Cartographic(t.longitude, t.latitude, t.height)), o; - }), - (wr.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 lr.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 <= vr) - return ( - i.push(new lr.Cartographic(t.longitude, t.latitude, t.height)), i - ); - for ( - var r = o / vr, - 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 lr.Cartographic(u, c, h)); - } - return i.push(new lr.Cartographic(t.longitude, t.latitude, t.height)), i; - }), - (wr.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 lr.Cartographic(i, r, n); - }), - (wr.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 lr.Cartographic(i, r, n); - }), - (wr.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 lr.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 lr.Cartographic(u, c, h)); - } - return r; - }), - (wr.prototype.CartographicPointsTerrainData = function (e, t) { - e.length && - 0 < e.length && - ((e = lr.sampleTerrain(this._viewer.terrainProvider, 11, e)), - lr.when(e, function (e) { - t(e); - })); - }), - (wr.prototype.setVisibility = function (e) { - if (0 < this._polylines.length) - for (var t = 0; t < this._polylines.length; t++) - this._polylines[t].show = e; - }), - (wr.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(wr.prototype, { - sight: { - get: function () { - return this.item.sight; - }, - set: function (e) { - this.item.sight = sight; - }, - }, - }), - (br.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)); - }), - (br.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, 0.5)), - (this._brightness = this._cesium.defaultValue(e.brightness, 0.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 = 0.5), - (this._brightness = 0.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 - ); - }), - (br.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), - (yr = void 0), - this._viewer.camera.positionCartographic, - Tr(this), - !this.isFlyToSky || 500 < this._relativeHeight || this.flyToSky()); - }), - (br.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); - }), - (br.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 () {}, - }); - }), - (br.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, - }, - }); - }), - (br.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); - }), - (br.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(0.3)), - (i.uniforms.cellAlpha = 0.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; - }), - (br.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 - : 0.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); - }), - (br.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, 0.001 * t), - r.lookUp(0.001 * i))); - }), - (br.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 ? 0.25 : t < 100 ? 0.5 : t < 150 ? 0.75 : 1)) - : this._tree.handler && !this.isIndoor && Tr(this), - (yr = yr || e.position.clone()), - 1e4 < this._core.getSpaceDistancem([yr, e.position], this._cesium) && - ((yr = e.position.clone()), this.refreshGridLines()), - this._relativeHeight < 0 - ? this._model && (this._model.show = !0) - : this._model && (this._model.show = !1); - }), - (br.prototype.isHaveTerrain = function () { - return !!( - this._viewer.scene && - this._viewer.scene.terrainProvider && - this._viewer.scene.terrainProvider._layers - ); - }), - (br.prototype.setCesiumFov = function (e) { - this._viewer.camera.frustum.fov = this._cesium.Math.toRadians(e); - }), - (O.prototype.clearMeasure = function (e) { - this._measure.clearMeasure(e); - }), - (O.prototype.horizontalDistance = function (e, t) { - this._measure.horizontalDistance(e, t); - }), - (O.prototype.spaceDistance = function (e, t) { - this._measure.spaceDistance(e, t); - }), - (O.prototype.altitude = function (e, t) { - this._measure.altitude(e, t); - }), - (O.prototype.verticalHeight = function (e, t) { - this._measure.verticalHeight(e, t); - }), - (O.prototype.surfaceArea = function (e, t) { - this._measure.surfaceArea(e, t); - }), - (O.prototype.planeArea = function (e, t) { - this._measure.planeArea(e, t); - }), - (O.prototype.measureAngle = function (e, t) { - this._measure.measureAngle(e, t); - }), - (O.prototype.analysisVolume = function (e, t) { - this._measure.analysisVolume(e, t); - }), - (O.prototype.measureTerrainPerimeter = function (e) { - return this._Deprecated.measureTerrainPerimeter(e); - }), - (O.prototype.depthTestAgainstTerrain = function (e) { - return this._depthTestAgainstTerrain.depthTestAgainstTerrain(e); - }), - (O.prototype.DrawPointBuffer = function (e, t, i) { - return this._bufferAnalysis.DrawPoint(e, t, i); - }), - (O.prototype.DrawPolylineBuffer = function (e, t, i) { - return this._bufferAnalysis.DrawPolyline(e, t, i); - }), - (O.prototype.DrawPolygonBuffer = function (e, t, i) { - return this._bufferAnalysis.DrawPolygon(e, t, i); - }), - (O.prototype.TerrainExcavation = function (e = 100, t, i) { - let o = new or(this._viewer, this._cesium); - return o.draw(e, t, i); - }), - (O.prototype.ShadowsAnalysis = function () { - return this._shadowsAnalysis.createAnalysis(); - }), - (O.prototype.createSkylineAnalysis = function (e) { - return this._skylineAnalysis.createSkylineAnalysis(e); - }), - (O.prototype.createEdgeStage = function (e) { - return this._EdgeStage.createEdgeStage(e); - }), - (O.prototype.clearSkylineAnalysis = function () { - return this._skylineAnalysis.clear(); - }), - (O.prototype.createScreenshot = function (e) { - return this._screenshot.createScreenshot(e); - }), - (O.prototype.ScreenshotCompared = function (e) { - return this._screenshot.createScreenshotCompared(e); - }), - (O.prototype.setPointFly = function (e) { - return this._PointFly.setPointFly(e); - }), - (O.prototype.createCircleScan = function (e, t, i, o, r) { - return new Ho(this._viewer, this._cesium).createCircleScan(e, t, i, o, r); - }), - (O.prototype.createMultiCircleScan = function (e, t, i, o, r) { - return new Ho(this._viewer, this._cesium).createMultiCircleScan( - e, - t, - i, - o, - r - ); - }), - (O.prototype.createSectorScan = function (e, t, i, o, r, n, a) { - return new Ho(this._viewer, this._cesium).createSectorScan( - e, - t, - i, - o, - r, - n, - a - ); - }), - (O.prototype.createRadarScan = function (e, t, i, o, r) { - return new Ho(this._viewer, this._cesium).createRadarScan(e, t, i, o, r); - }), - (O.prototype.UndergroundModelOpen = function (e, t) { - return this._UndergroundMode.UndergroundModelOpen(e, t); - }), - (O.prototype.UndergroundModelClose = function () { - return this._UndergroundMode.close(); - }), - (O.prototype.UndergroundMode = function (e, o) { - 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 !== o ? o : 0.5); - let t = this._viewer, - i = this._UndergroundGrid; - return ( - i.show && i.add(), - { - get alpha() { - return t.scene.globe.translucency.frontFaceAlpha; - }, - set alpha(e) { - t.scene.globe.translucency.frontFaceAlpha = e; - }, - get grid() { - return i.show; - }, - set grid(e) { - (i.show = e) ? i.add() : i.destroy(); - }, - get depth() { - return i._depth; - }, - set depth(e) { - (i._depth = e), i.show && i.refreshGridLines(); - }, - } - ); - } - 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._UndergroundGrid.destroy(), - this.undergroundValue("get")); - }), - (O.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)); - }), - (O.prototype.StreetViewOpen = function (e, t, i) { - return this._StreetView.StreetViewOpen(e, t, i); - }), - (O.prototype.ExitStreetView = function () { - return this._StreetView.exit(); - }), - (O.prototype.createWeather = function (e, t, i) { - return this._createWeather.createWeather(e, t, i); - }), - (O.prototype.createParticleEffect = function (e, t, i, o) { - let r = new bo(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) - ); - }), - (O.prototype.removeParticleEffect = function (e) { - this._Particle && - (this._Particle[e] && - this._Particle[e].forEach((e) => { - e.deleteObject(); - }), - (this._Particle[e] = [])); - }), - (O.prototype.demolition = function (e, t) { - let i = new hr(this._viewer); - return i.play(e, t); - }), - (O.prototype.measureTerrainHeight = function (e) { - return this._Deprecated.measureTerrainHeight(e); - }), - (O.prototype.createindoormode = function (e) { - return this._createindoormode.createIndoormode(e); - }), - (O.prototype.Indoormodeclose = function () { - return this._createindoormode.Indoormodeclose(); - }), - (O.prototype.createIndoormode = function () { - return this._createindoormode.createIndoormode(); - }), - (O.prototype.closeIndoormode = function () { - return this._createindoormode.close(); - }), - (O.prototype.setTime = function (e = 9) { - e = new Date().setHours(e); - this._viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date(e)); - }), - (O.prototype.terrainExaggeration = function (e) { - return (this._viewer.scene.globe.terrainExaggeration = e); - }), - (O.prototype.createCurtainContrast = function (e, t) { - return this._createcurtaincontrast.curtainContrast(e, t); - }), - (O.prototype.curtainContrast = function (e) { - return this._createcurtaincontrast.curtainContrastPro(e); - }), - (O.prototype.clearCurtainContrast = function () { - return this._createcurtaincontrast.close(); - }), - (O.prototype.measureTerrainArea = function (e) { - return this._Deprecated.measureTerrainArea(e); - }), - (O.prototype.measureTerrainkPerimeter = function (e) { - return this._Deprecated.measureTerrainkPerimeter(e); - }), - (O.prototype.createElevationContour = function (e, t, i) { - return this._elevationContour.createElevationContour(e, t, i); - }), - (O.prototype.createTerrainProfile = function (e) { - return this._Deprecated.createTerrainProfile(e); - }), - (O.prototype.create3DViewshed = function (e) { - return this._create3DViewshed.startDraw(e), this._create3DViewshed; - }), - (O.prototype.set3DViewshedOptions = function (e) { - return this._create3DViewshed.setOptions(e), this._create3DViewshed; - }), - (O.prototype.create3DViewshedPoss = function (e) { - let t = new qo(this._viewer, this._cesium); - return t.createViewshed(e); - }), - (O.prototype.add3DViewshedPoss = function (e) { - let t = new qo(this._viewer, this._cesium); - return t.addViewshed(e); - }), - (O.prototype.add3DViewshed = function (e) { - return this._create3DViewshed.addViewshed(e), this._create3DViewshed; - }), - (O.prototype.close3DViewshed = function () { - return this._create3DViewshed.close(); - }), - (O.prototype.createlineOfSight = function (e, t) { - return new wr(this._viewer, this._cesium).createlineOfSight(e, t); - }), - (O.prototype.createSightLine = function (e) { - let t = new po(this._viewer); - return t.createSightLine(e); - }), - (O.prototype.floodAnalysis = function (e, t) { - let i = new M(this._viewer, Cesium); - return i.executePolygonymsd(e, t); - }), - (O.prototype.SunshineAnalysisPoint = function (e, t) { - return this._SunshineAnalysis.sunshineAnalysisPoint(e, t); - }), - (O.prototype.SunshineAnalysisPolygon = function (e, t) { - return this._SunshineAnalysis.sunshineAnalysisPolygon(e, t); - }), - (Er.prototype.Highvolume = function (e = []) { - var t = this._cesium.PostProcessStageLibrary.createEdgeDetectionStage(); - (t.uniforms.color = this._cesium.Color.BLUE), - (t.uniforms.length = 0.01), - (t.selected = e), - this._viewer.scene.postProcessStages.add( - this._cesium.PostProcessStageLibrary.createSilhouetteStage([t]) - ); - }), - (Sr.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; - }), - (Sr.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; - }), - (Sr.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; - }), - (Sr.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; - }), - (Sr.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); - }), - (Sr.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); - }), - (Sr.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); - }), - (Sr.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(0.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(), - f = new n.Cartesian3(), - _ = 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 ( - (f.x = t.x - e.x), - (f.y = t.y - e.y), - (f.z = t.z - e.z), - n.Cartesian3.normalize(f, f), - f - ); - }, - 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 = - ((f.x = t.x - e.x), - (f.y = t.y - e.y), - (f.z = t.z - e.z), - n.Cartesian3.normalize(f, f), - (_.x = i.x - e.x), - (_.y = i.y - e.y), - (_.z = i.z - e.z), - ((new Date().getTime() - m) % o) / o); - return ( - n.Quaternion.fromAxisAngle(f, t * n.Math.PI * 2, c), - n.Matrix3.fromQuaternion(c, h), - n.Matrix3.multiplyByVector(h, _, _), - n.Cartesian3.normalize(_, _), - _ - ); - }, - u_scanColor: i, - }, - }); - return r.scene.postProcessStages.add(a); - }), - (Sr.prototype.remove = function () { - this._viewer.scene.postProcessStages.remove(this.item); - }), - (Sr.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Sr.prototype.deleteObject = function () { - this.item && this._viewer.scene.postProcessStages.remove(this.item); - }), - (Sr.prototype.setVisibility = function (e) { - this.item && (this.item.enabled = e); - }), - (B.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(0.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 - ); - }), - (B.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 - ); - }), - (B.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(0.5), - fill: !0, - outline: !0, - outlineColor: o._cesium.Color.RED, - }, - })), - (o.item = o.box)), - 0), - e = - (o._core.isnull(F.selectedItem) || - "group" != F.selectedItem.type || - (t = F.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 - ); - }), - (B.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(0.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(F.selectedItem) || - "group" != F.selectedItem.type || - (e = F.selectedItem.id), - n._core.getuid()), - i = { - id: t, - name: "鏂板缓绔嬫柟浣�" + t, - pId: n._core.isnull(e) ? 0 : e, - type: "box", - item: n, - }; - n.setTreeobj(i), - F.insertGroupId(i, n._core.isnull(e) ? 0 : e), - "function" == typeof r && - r({ polyline: {}, positions: [], distance: [] }), - a.destroy(); - }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), - this - ); - }), - (B.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(0.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 - ); - }), - (B.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, - }, - }; - }), - (B.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (B.prototype.setVisibility = function (e) { - this.item.show = e; - }), - (B.prototype.setShow = function (e) { - try { - this.item._box.show = e; - } catch (e) { - console.log(e); - } - return this; - }), - (B.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; - }), - (B.prototype.setBoxImage = function (e) { - try { - this.item._box.material = new this._cesium.ImageMaterialProperty({ - image: e, - }); - } catch (e) { - console.log(e); - } - return this; - }), - (B.prototype.setBoxRepeat = function (e, t) { - try { - this.item._box.material.repeat = new this._cesium.Cartesian2(e, t); - } catch (e) { - console.log(e); - } - return this; - }), - (B.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; - }), - (B.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; - }), - (B.prototype.setFill = function (e) { - try { - this.item._box.fill = e; - } catch (e) { - console.log(e); - } - return this; - }), - (B.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; - }), - (B.prototype.setOutlineColor = function (e) { - try { - this.item._box.outlineColor = new m( - this._viewer, - this._cesium - ).colorFromHtmlColor(e); - } catch (e) { - console.log(e); - } - return this; - }), - (B.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; - }), - (B.prototype.setItem = function (e) { - this.item = e; - }), - (B.prototype.deleteObject = function () { - this._viewer.entities.remove(this.item); - }), - Object.defineProperties(B.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 + - ")" - ); - }, - }, - }), - (B.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(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); - } - }, - }, - }, - }), - (Pr.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 - ); - }), - (Pr.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 - ); - }), - (Pr.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 = mr(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(F.selectedItem) || - "group" != F.selectedItem.type || - (t = F.selectedItem.id), - r._core.getuid()), - i = { - id: e, - name: "鏂板缓鐞�" + e, - pId: r._core.isnull(t) ? 0 : t, - type: "ellipsoid", - item: r, - }; - r.setTreeobj(i), - F.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 = mr( - 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 - ); - }), - (Pr.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; - }), - (Pr.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, - }, - }; - }), - (Pr.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Pr.prototype.setVisibility = function (e) { - this.item.show = e; - }), - (Pr.prototype.deleteObject = function () { - this._viewer.entities.remove(this.item); - }), - (Pr.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; - }), - (Pr.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; - }), - (Pr.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; - }), - (Pr.prototype.setEllipsoidImage = function (e) { - try { - this.item._ellipsoid.material = new this._cesium.ImageMaterialProperty({ - image: e, - }); - } catch (e) { - console.log(e); - } - return this; - }), - (Pr.prototype.setEllipsoidRepeat = function (e, t) { - try { - this.item._ellipsoid.material.repeat = new this._cesium.Cartesian2( - e, - t - ); - } catch (e) { - console.log(e); - } - return this; - }), - (Pr.prototype.setMaterial = function (e) { - try { - this.item._ellipsoid.show = e; - } catch (e) { - console.log(e); - } - return this; - }), - (Pr.prototype.setRadii = function (e) { - try { - this.item._ellipsoid.radii = new this._cesium.Cartesian3(e, e, e); - } catch (e) { - console.log(e); - } - return this; - }), - (Pr.prototype.setItem = function (e) { - this.item = e; - }), - (Pr.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(Pr.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); - } - }, - }, - }, - }), - (H.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(0.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 + I.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(F.selectedItem) || - "group" != F.selectedItem.type || - (e = F.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), F.insertGroupId(t, s._core.isnull(e) ? 0 : e), this - ); - }), - (H.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 - ); - }), - (H.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(0.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.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(F.selectedItem) || - "group" != F.selectedItem.type || - (e = F.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), F.insertGroupId(t, a._core.isnull(e) ? 0 : e), this - ); - }), - (H.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); - } - }), - (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.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; - }), - (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.CreateRectangle = function (e, t, i, o, r) { - var n = this._core.getuid(), - a = { - outlineColor: this._cesium.Color.RED, - material: this._cesium.Color.YELLOW.withAlpha(0.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(F.selectedItem) || - "group" != F.selectedItem.type || - (o = F.selectedItem.id), - { - id: n, - name: "鏂板缓鐭╁舰" + n, - pId: this._core.isnull(o) ? 0 : o, - type: "rectangle", - item: this.item, - }); - return ( - this.setTreeobj(i), - F.insertGroupId(i, this._core.isnull(o) ? 0 : o), - this - ); - }), - (H.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); - }), - (H.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(F.selectedItem) || - "group" != F.selectedItem.type || - F.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), F.insertGroupId(e, a._core.isnull(t) ? 0 : t), this - ); - }), - (H.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, - }, - }; - }), - (H.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (H.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 = 0.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 = 0.001), - this._viewer.scene.camera.changed.addEventListener(d.flyListener); - }), - (H.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"); - }), - (H.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 - ); - }), - (H.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); - }), - (H.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(0.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 - ); - }), - (H.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(0.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(0.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(F.selectedItem) || - "group" != F.selectedItem.type || - (t = F.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), - F.insertGroupId(s, r._core.isnull(t) ? 0 : t), - "function" == typeof e && e(ploylinejl), - this - ); - }), - (H.prototype.deleteObject = function () { - this._viewer.entities.remove(this.item), - null != this._viewEvent && - (this._tree.handler.destroy(), - this._viewer.scene.camera.changed.removeEventListener( - this._viewEvent - )); - }), - (H.prototype.setVisibility = function (e) { - this.item.show = e; - }), - (H.prototype.getVisibility = function () { - return this.item.show; - }), - (H.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; - }), - (H.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; - }), - (H.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; - }), - (H.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; - }), - (H.prototype.setPolygonImage = function (e) { - try { - this.item._rectangle.material = new this._cesium.ImageMaterialProperty({ - image: e, - }); - } catch (e) { - console.log(e); - } - return this; - }), - (H.prototype.setRectangleRepeat = function (e, t) { - try { - this.item._rectangle.material.repeat = new this._cesium.Cartesian2( - e, - t - ); - } catch (e) { - console.log(e); - } - return this; - }), - (H.prototype.setOutlineColor = function (e) { - try { - this.item._rectangle.outlineColor = new m( - this._viewer, - this._cesium - ).colorFromHtmlColor(e); - } catch (e) { - console.log(e); - } - return this; - }), - (H.prototype.setOutline = function (e) { - try { - this.item._rectangle.outline = e; - } catch (e) { - console.log(e); - } - return this; - }), - (H.prototype.setExtrudedHeight = function (e) { - try { - this.item._rectangle.extrudedHeight = e; - } catch (e) { - console.log(e); - } - return this; - }), - (H.prototype.setHeight = function (e) { - try { - this.item._rectangle.height = e; - } catch (e) { - console.log(e); - } - return this; - }), - Object.defineProperties(H.prototype, { - rectangle: { - get: function () { - return this.item.rectangle; - }, - set: function (e) { - this.item.rectangle = e; - }, - }, - }), - (H.prototype.setItem = function (e) { - this.item = e; - }), - Object.defineProperties(H.prototype, { - polyline: { - get: function () { - return this.item.polyline; - }, - set: function (e) { - this.item.polyline = e; - }, - }, - }), - Object.defineProperties(H.prototype, { - polygon: { - get: function () { - return this.item.polygon; - }, - set: function (e) { - this.item.polygon = e; - }, - }, - }), - Object.defineProperties(H.prototype, { - point: { - get: function () { - return this.item.point; - }, - set: function (e) { - this.item.point = e; - }, - }, - }), - Object.defineProperties(H.prototype, { - label: { - get: function () { - return this.item.label; - }, - set: function (e) { - this.item.label = e; - }, - }, - }), - Object.defineProperties(H.prototype, { - model: { - get: function () { - return this.item.model; - }, - set: function (e) { - this.item.model = e; - }, - }, - }), - Object.defineProperties(H.prototype, { - wall: { - get: function () { - return this.item.wall; - }, - set: function (e) { - this.item.wall = e; - }, - }, - }), - Object.defineProperties(H.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, - }; - }, - }, - }), - (V.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 - ); - }), - (V.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 - ); - }), - (V.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 = mr(o, i, a, n)), - (s.circle = s.createCircle(s.style)), - (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 = mr(o, i, a, n)))); - }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE); - }), - (V.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 = mr(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 = mr(e, t, o, i))), - (a.modifyPoint = null), - a.forbidDrawWorld(!1), - (n = "鎷栧姩淇敼浣嶇疆")); - }, Cesium.ScreenSpaceEventType.LEFT_UP); - } - }), - (V.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); - }), - (V.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; - }), - (V.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(0.5), - outline: e.outline || !0, - }, - }); - }), - (V.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, - }); - }), - (V.prototype.executeClircle = function (e) { - var i = [], - o = this, - r = - (this._core.mouse( - this._viewer.container, - 1, - window.SmartEarthRootUrl + I.draw - ), - new this._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas)); - function n() { - return mr(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: 0.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 - ); - }), - (V.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, 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(0.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() {} - }), - (V.prototype.setSemiMajorAxis = function (e) { - try { - this.item._ellipse.semiMajorAxis = e; - } catch (e) { - console.log(e); - } - return this; - }), - (V.prototype.setSemiMinorAxis = function (e) { - try { - this.item._ellipse.semiMinorAxis = e; - } catch (e) { - console.log(e); - } - return this; - }), - (V.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, - }, - }; - }), - (V.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (V.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; - }), - (V.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; - }), - (V.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; - }), - (V.prototype.setEllipseImage = function (e) { - try { - this.item._ellipse.material.uniforms.image = e; - } catch (e) { - console.log(e); - } - return this; - }), - (V.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; - }), - (V.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; - }), - (V.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; - }), - (V.prototype.setItem = function (e) { - this.item = e; - }), - (V.prototype.setExtrudedHeight = function (e) { - try { - this.item._ellipse.extrudedHeight = e; - } catch (e) { - console.log(e); - } - return this; - }), - (V.prototype.deleteObject = function () { - this._viewer.entities.remove(this.item); - }), - (V.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 - ); - }), - (V.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(V.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); - } - }, - }, - }, - }), - (G.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( - 0.165, - 0.165, - 0.165, - 1 - ), - fillColor: new m(this._viewer, this._cesium).createColor( - 0.9411764705882353, - 0.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 - ); - }), - (G.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 - ); - }), - (G.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(F.selectedItem) || - "group" != F.selectedItem.type || - (e = F.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 - ); - }), - (G.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) {} - }), - (G.prototype.setVisibility = function (e) { - this.item.show = e; - }), - (G.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 - ? '<div id="' + - e.id + - '" style="position: absolute; width: 200px; height: 157px;left: 0px; top: 0px; pointer-events:none; background: url(' + - window.SmartEarthRootUrl + - I.divpoint + - ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)"></div>\n <div class="content" style="position: inherit;font-size: 14px;top: 50px;left: 50px;width: 140px;text-align: left;color: rgba(255,255,255,1);">' + - e.description + - "</div> \n </div>" - : '<div id="' + - e.id + - '" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url(' + - window.SmartEarthRootUrl + - I.divpoint1 + - ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">' + - e.name + - "</div>\n </div>"), - $(".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 - ); - }), - (G.prototype.getVisibility = function () { - return this.item.show; - }), - (G.prototype.setRadius = function (e) { - try { - (this.item._label.outlineWidth = e), - (this.item._label.outlineColor = - this._cesium.Color.RED.withAlpha(0.4)); - } catch (e) { - console.log(e); - } - return this; - }), - (G.prototype.setText = function (e) { - try { - this.item._label.text = e; - } catch (e) { - console.log(e); - } - return this; - }), - (G.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; - }), - (G.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; - }), - (G.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); - } - }), - (G.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); - } - }), - (G.prototype.setFillColorAlpha = function (e) { - try { - this.item._label.fillColor._value.alpha = e; - } catch (e) { - console.log(e); - } - }), - (G.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); - } - }), - (G.prototype.setBackgroundColorHtml = function (e) { - try { - this.item._label.backgroundColor = new m( - this._viewer, - this._cesium - ).colorFromHtmlColor(e); - } catch (e) { - console.log(e); - } - }), - (G.prototype.setBackgroundColorAlpha = function (e) { - try { - this.item._label.backgroundColor._value.alpha = e; - } catch (e) { - console.log(e); - } - }), - (G.prototype.setFontSize = function (e) { - try { - this.item._label.font = parseFloat(e) + "px sans-serif"; - } catch (e) { - console.log(e); - } - }), - (G.prototype.setFillColorAlpha = function (e) { - try { - this.item._label.fillColor._value.alpha = e; - } catch (e) { - console.log(e); - } - }), - (G.prototype.showBackground = function (e) { - try { - this.item._label.showBackground = e; - } catch (e) { - console.log(e); - } - }), - (G.prototype.setOutlineWidth = function (e) { - try { - this.item._label.outlineWidth = e; - } catch (e) { - console.log(e); - } - }), - (G.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); - } - }), - (G.prototype.setOutlineColorHtml = function (e) { - try { - this.item._label.outlineColor = new m( - this._viewer, - this._cesium - ).colorFromHtmlColor(e); - } catch (e) { - console.log(e); - } - }), - (G.prototype.setOutlineColorAlpha = function (e) { - try { - this.item._label.outlineColor._value.alpha = e; - } catch (e) { - console.log(e); - } - }), - (G.prototype.setStyle_LabelStyle_FILL = function (e) { - try { - this.item._label.style = this.LabelStyle_FILL; - } catch (e) { - console.log(e); - } - }), - (G.prototype.setStyle_LabelStyle_FILL_AND_OUTLINE = function () { - try { - this.item._label.style = this.LabelStyle_FILL_AND_OUTLINE; - } catch (e) { - console.log(e); - } - }), - (G.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; - }), - (G.prototype.setStyle_LabelStyle_OUTLINE = function () { - try { - this.item._label.style = this.LabelStyle_OUTLINE; - } catch (e) { - console.log(e); - } - }), - (G.prototype.setItem = function (e) { - this.item = e; - }), - (G.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 - ); - }), - (G.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, - }, - }; - }), - (G.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - Object.defineProperties(G.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: f.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: f.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: f.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) {}, - }, - }, - }), - (k.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: 0.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 + I.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 - ); - }), - (k.prototype.getFlyData = function (e, t) { - let i = []; - "object" == typeof e[0] - ? e.forEach((e) => { - i.push(Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height)); - }) - : "number" == typeof e[0] && - (i = Cesium.Cartesian3.fromDegreesArrayHeights(e)); - e = this._core.getSpaceDistancem(i, Cesium); - return this.setFlycesium({ positions: i, distance: e }, t); - }), - (k.prototype.setFlycesium = function (e, t) { - for (var i = [], o = 0; o < e.positions.length; o++) { - var r = this._cesium.Cartographic.fromCartesian(e.positions[o]), - r = [ - (r.longitude / Math.PI) * 180, - (r.latitude / Math.PI) * 180, - r.height, - ]; - i.push(r); - } - var n = (e.distance / 50.5).toFixed(1), - n = { - id: this._core.getuid(), - name: "鏂板缓璺嚎", - distance: e.distance, - showPoint: !1, - showLine: !0, - showModel: !0, - isLoop: !1, - Totaltime: Math.round(n), - speed: 50.5, - height: 10, - perPositionHeight: !1, - pitch: -20, - range: 100, - mode: 0, - url: window.SmartEarthRootUrl + I.testModel, - geojson: { geometry: { type: "LineString", coordinates: i } }, - }; - return t && t(n), n; - }), - (k.prototype.Start = function (e, t, i) { - var o = this; - return ( - e.geojson, - e.Totaltime || (e.Totaltime = 3e3), - o._entityFly && o.exit(), - (Fr = i), - setTimeout(function () { - o.executeFly3D(e, t); - }, 200), - this - ); - }); - var xr, - Dr, - Ir, - Ar, - Lr, - Mr, - Rr, - Or = null, - Br = null, - Fr = null, - N = { - start: null, - time: null, - longitude: 0, - latitude: 0, - cameraHeight: 10, - speed: 50.5, - multiplier: 1, - position: 0, - }, - Hr = 0, - Vr = - ((k.prototype.executeFly3D = function (e, t) { - var l = this, - i = e.geojson; - if ( - ((xr = new l._cesium.Cartesian3()), - (Ar = new l._cesium.SampledProperty(Number)), - (Lr = 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 || - e.perPositionHeight || - (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 = this._core.defaultValue(e.height, 10)), - (N.lineHeight = e.lineHeight), - (N.perPositionHeight = e.perPositionHeight), - (N.pitch = e.pitch), - (N.range = e.range), - (N.speed = e.speed || 50.5), - (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), - (Ir = 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)), - (Rr = function () {}), - (Or = 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 && !N.perPositionHeight, - positions: Cesium.Cartesian3.fromDegreesArrayHeights(n), - show: l._cesium.defaultValue(e.showLine, !0), - material: new l._cesium.PolylineGlowMaterialProperty({ - glowPower: 0.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 = Vr.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 || - N.perPositionHeight || - ((i = l._viewer.scene.sampleHeight(n, [Br, Vr])), - (o = l._viewer.scene.globe.getHeight(n)), - (Br.position = l._cesium.Cartesian3.fromRadians( - n.longitude, - n.latitude, - i < o ? o : i - ))); - } catch (e) {} - try { - Dr.getValue(e, xr), Rr(e); - var a = l._cesium.Cartesian3.magnitude(xr), - 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 != Fr && "function" == typeof Fr && Fr(N); - } catch (e) {} - return ""; - } - (Or.label.text = ""), - (N.time = N.Totaltime), - (N.ratio = 1), - (N.distanceTraveled = N.distance), - l.exit(), - null != Fr && "function" == typeof Fr && Fr(N, "end"), - (Rr = function () {}); - }, !1), - font: "20px sans-serif", - showBackground: !1, - distanceDisplayCondition: - new l._cesium.DistanceDisplayCondition(0, 100), - eyeOffset: new l._cesium.Cartesian3(0, 3.5, 0), - }, - })), - (Br = l._viewer.entities.add({ - availability: new l._cesium.TimeIntervalCollection([ - new l._cesium.TimeInterval({ start: N.start, stop: N.stop }), - ]), - position: i, - orientation: Ir, - 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), - })), - (Vr = Or), - (l._viewer.trackedEntity = Br), - (l._entityFly = Or), - e.mode && l.changeFlyMode(e.mode); - } - } - }), - null); - function Gr(e) { - (Hr = Ar.getValue(e)), (N.heading = Hr); - } - function kr(e) { - var e = Cesium.Cartographic.fromCartesian(e), - t = Cesium.Math.toDegrees(e.longitude), - i = Cesium.Math.toDegrees(e.latitude); - return Cesium.Cartesian3.fromDegrees(t, i, e.height + N.cameraHeight); - } - function j(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F), - (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 Nr(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._polyline = void 0), - (this._polygon = void 0), - (this._box = new B(e, t)), - (this._ellipsoid = new Pr(e, t)), - (this._rectangle = new H(e, t)), - (this._circle = new V(e, t)), - (this._point = void 0), - (this._label = new G(e, t)), - (this._dynamicObject = new k(e, t)), - (this._elevationContour = new Nt(e, t)), - (this._cone = new j(e, t)); - } - function jr(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._execute = new Nr(this._viewer, this._cesium)); - } - (k.prototype.showPoint = function (e) { - Br && Br.point && (Br.point.show = e); - }), - (k.prototype.showLine = function (e) { - Or && Or.polyline && (Or.polyline.show = e); - }), - (k.prototype.showModel = function (e) { - Br && Br.model && (Br.model.show = e); - }), - (k.prototype.setFlyHeight = function (e) { - N.cameraHeight = e; - }), - (k.prototype.setFlyDistance = function (e) { - N.range = e; - }), - (k.prototype.setFlyPitch = function (e) { - N.pitch = e; - }), - (k.prototype.changeFlyMode = function (e) { - var t = this; - switch (e) { - case 0: - (Rr = function () {}), t.BindingModel(!0); - break; - case 1: - this.BindingModel(!1), - (Rr = function (e) { - Gr(e), - t.exeuteVisualAngle( - t._cesium.Math.toRadians(N.heading), - t._cesium.Math.toRadians(N.pitch), - N.range - ); - }); - break; - case 2: - this.BindingModel(!1), - (Rr = function (e) { - Gr(e), - (Mr = t._entityFly.position.getValue( - t._viewer.clock.currentTime - )) && - ((Mr = kr(Mr)), - t._viewer.camera.setView({ - destination: Mr, - orientation: { - heading: t._cesium.Math.toRadians(N.heading), - pitch: t._cesium.Math.toRadians(-90), - roll: 0, - }, - })); - }); - } - }), - (k.prototype.faster = function () { - this._viewer.animation.viewModel.faster(); - }), - (k.prototype.slower = function () { - this._viewer.animation.viewModel.slower(); - }), - (k.prototype.setMultiplier = function (e) { - this._viewer.clock.multiplier = parseFloat(e); - }), - (k.prototype.isPause = function (e) { - this._viewer.clockViewModel.shouldAnimate = !e; - }), - (k.prototype.exit = function () { - this.isPause(!0), - (this._viewer.clock.multiplier = 1), - this.executeSignout(), - this.BindingModel(!1), - this._viewer.entities.remove(Or), - this._viewer.entities.remove(Br), - (Br = Or = null), - (this._entityFly = null); - }), - (k.prototype.updateSpeedLabel = function (e, t) {}), - (k.prototype.computeCirclularFlight = function (e) { - var t = this; - Dr = new t._cesium.VelocityVectorProperty(Lr, !1); - for (var i, o, r, n, a, s = 0; s < e.length; s++) { - 0 === s && - ((n = t._cesium.JulianDate.addSeconds( - N.start, - 0, - new t._cesium.JulianDate() - )), - (i = t._cesium.Cartesian3.fromDegrees( - e[0].x, - e[0].y, - t._cesium.defaultValue(N.lineHeight, e[s].z) - )), - Lr.addSample(n, i), - (Hr = t._core.TwoPointAzimuth(e[0].x, e[0].y, e[1].x, e[1].y)), - Ar.addSample(n, Hr)); - try { - 0 < s && - ((i = new t._cesium.Cartesian3( - Lr._property._values[3 * s - 3], - Lr._property._values[3 * s - 2], - Lr._property._values[3 * s - 1] - )), - (o = t._cesium.Cartesian3.fromDegrees( - e[s].x, - e[s].y, - t._cesium.defaultValue(N.lineHeight, e[s].z) - )), - (r = Cesium.Cartesian3.distance(i, o)), - (n = t._cesium.JulianDate.addSeconds( - Lr._property._times[s - 1], - 0.5, - new t._cesium.JulianDate() - )), - (a = t._cesium.JulianDate.addSeconds( - Lr._property._times[s - 1], - r / N.speed, - new t._cesium.JulianDate() - )), - Lr.addSample(a, o), - (Hr = t._core.TwoPointAzimuth( - e[s - 1].x, - e[s - 1].y, - e[s].x, - e[s].y - )), - Ar.addSample(n, Hr), - Ar.addSample(a, Hr)); - } catch (e) { - console.log(e); - } - } - return Lr; - }), - (k.prototype.executePauseFly3DPaths = function () { - var e = this._viewer.clockViewModel; - e.shouldAnimate - ? (e.shouldAnimate = !1) - : this._viewer.clockViewModel.canAnimate && (e.shouldAnimate = !0); - }), - (k.prototype.changeModel = function (e) { - Br.model.uri = e; - }), - (k.prototype.PointView = function () { - return { - position: Viewer.camera.position.clone(), - orientation: { - heading: Viewer.camera.heading, - pitch: Viewer.camera.pitch, - roll: Viewer.camera.roll, - }, - }; - }), - (k.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); - }), - (k.prototype.BindingModel = function (e) { - e - ? (this._viewer.trackedEntity = Br) - : ((this._viewer.trackedEntity = void 0), - this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)); - }), - (k.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 = kr(e)), - (t = new this._cesium.HeadingPitchRange(o.heading, o.pitch, o.range)), - this._viewer.camera.lookAt(e, t)); - }), - (k.prototype.Pathshow = function (e) { - this._entityFly.polyline.show = e; - }), - (k.prototype.Pointshow = function (e) { - Br._point.show = e; - }), - (k.prototype.Modelshow = function (e) { - Br._model.show = e; - }), - (k.prototype.executePlayForwardFly3DPaths = function () { - var e = this._viewer.clockViewModel, - t = e.multiplier; - t < 0 && (e.multiplier = -t), (e.shouldAnimate = !0); - }), - (k.prototype.executePlayReverseFly3DPaths = function () { - var e = this._viewer.clockViewModel, - t = e.multiplier; - 0 < t && (e.multiplier = -t), (e.shouldAnimate = !0); - }), - (k.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(); - }), - (k.prototype.forceEndHanlder = function () { - this.handler && (this.handler.destroy(), (this.handler = void 0)); - }), - (j.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 - ); - }), - (j.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 - ); - }), - (j.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(0.3), - outline: !0, - outlineColor: this._cesium.Color.AQUAMARINE.withAlpha(0.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(0.5) - ), - outline: !0, - outlineColor: this._core.defaultValue( - t.wallOutlineColor && - this._cesium.Color.fromCssColorString(t.wallOutlineColor), - this._cesium.Color.RED.withAlpha(0.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(0.5) - ), - outline: !0, - outlineColor: this._core.defaultValue( - t.wallOutlineColor && - this._cesium.Color.fromCssColorString(t.wallOutlineColor), - this._cesium.Color.RED.withAlpha(0.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(0.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 += 0.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 - ); - }), - (j.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; - }), - (j.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); - }), - (j.prototype.createRadarMaskScan = function (e, t, a, i) { - var o = this, - s = ((a = a || {}), this._core.defaultValue(a.radius, 100)), - r = this._core.defaultValue(a.yaw, 0), - n = this._core.defaultValue(a.angle, 60), - l = a.innerOutline, - u = { - subdivisions: 6, - stackPartitions: 30, - slicePartitions: 30, - innerRadii: new this._cesium.Cartesian3(0.5, 0.5, 0.5), - radii: new Cesium.CallbackProperty(function () { - return new Cesium.Cartesian3(s, s, s); - }, !1), - maximumCone: this._cesium.Math.toRadians( - this._core.defaultValue(a.maxLat, 105) - ), - minimumCone: this._cesium.Math.toRadians( - this._core.defaultValue(a.minLat, 75) - ), - minimumClock: new Cesium.CallbackProperty(function () { - return Cesium.Math.toRadians(r); - }, !1), - maximumClock: new Cesium.CallbackProperty(function () { - return Cesium.Math.toRadians(r + n); - }, !1), - material: this._cesium.Color.AQUAMARINE.withAlpha(0.3), - outline: !l, - outlineColor: this._cesium.Color.AQUAMARINE.withAlpha(0.5), - outlineWidth: 1, - }, - u = this._core.extend(u, a, !0); - "string" == typeof a.color && - (u.material = this._cesium.Color.fromCssColorString(a.color)), - "string" == typeof a.outlineColor && - (u.outlineColor = this._cesium.Color.fromCssColorString( - a.outlineColor - )); - let c, - h, - m = t instanceof Cesium.Entity ? t : void 0; - if ( - (m - ? ((c = new Cesium.CallbackProperty(() => { - let t = m.position.getValue( - this._viewer.clock.currentTime.clone() - ); - if (a.offset) { - var i = m.orientation.getValue( - this._viewer.clock.currentTime.clone() - ); - let e; - i && - ((i = Cesium.Matrix3.fromQuaternion(i)), - (i = Cesium.Matrix4.fromRotationTranslation(i, t)), - (e = Cesium.Transforms.fixedFrameToHeadingPitchRoll(i))), - (t = o._core.setPositionOffset(t, a.offset, e)); - } - return t; - }, !1)), - (h = new Cesium.CallbackProperty( - () => - m.orientation.getValue(this._viewer.clock.currentTime.clone()), - !1 - ))) - : (c = Cesium.Cartesian3.fromDegrees(t[0], t[1], t[2])), - a.trackedEntity) - ) { - let e, - t, - i, - o, - r, - n = (u.maximumCone - u.minimumCone) / 2; - h = new Cesium.CallbackProperty( - () => ( - (t = a.trackedEntity.position.getValue( - this._viewer.clock.currentTime.clone() - )), - (e = c.getValue ? c.getValue() : c), - (r = this._core.twoPointsHeadingPitchRoll(this._viewer, e, t)), - (s = r.radius), - (i = r.heading - Math.PI / 2), - (o = r.pitch - n), - Cesium.Transforms.headingPitchRollQuaternion( - e, - new Cesium.HeadingPitchRoll(i, o, 0) - ) - ), - !1 - ); - } - var d = 0, - p = this._core.defaultValue(a.scanAngle, 15), - g = - ((this._scan = this._viewer.entities.add({ - position: c, - orientation: h, - ellipsoid: { - ...u, - minimumClock: new Cesium.CallbackProperty(function () { - return Cesium.Math.toRadians(r + d); - }, !1), - maximumClock: new Cesium.CallbackProperty(function () { - return Cesium.Math.toRadians(r + d + p); - }, !1), - outline: l, - material: this._core.defaultValue( - a.scanColor && - this._cesium.Color.fromCssColorString(a.scanColor), - this._cesium.Color.RED.withAlpha(0.5) - ), - }, - })), - (this.item = this._viewer.entities.add({ - position: c, - orientation: h, - ellipsoid: u, - })), - this._core.defaultValue(u.speed, 1)); - function f() { - (d += 0.1 * g) <= 0 && g < 0 - ? ((d = 0), (g = -g)) - : n - p <= d && 0 < g && ((d = n - p), (g = -g)); - } - this._viewer.clock.onTick.addEventListener(f), - (this.setRadarMaskValue = (e, t) => { - "yaw" === e - ? (r = t) - : "angle" === e - ? (n = 360 < t ? 360 : t) - : "radius" === e - ? (s = t) - : "scanAngle" === e - ? (p = n < t ? n : t) - : "speed" === e && (g = t); - }), - (this.deleteObject = () => { - let e = this._viewer; - e.entities.remove(this.item), - e.entities.remove(this._scan), - this._viewer.clock.onTick.removeEventListener(f); - }); - t = { - id: this.item.id, - name: e, - pId: this._core.isnull(i) ? 0 : i, - type: "ellipsoid", - item: this, - }; - return ( - this.setTreeobj(t), - this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), - this - ); - }), - (j.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(0.2), - outlineColor: Cesium.Color.WHITE.withAlpha(0.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 - ); - }), - (j.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(0.3), - outline: !1, - outlineColor: this._cesium.Color.AQUAMARINE.withAlpha(0.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 - ); - }), - (j.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] + 0.01 && r.lat < o[1] + 0.005 - ? (r.lat += 1e-5) - : r.lat > o[1] + 0.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; - }), - (j.prototype.setLength = function (e) { - try { - this.item._cylinder.length = e; - } catch (e) { - console.log(e); - } - return this; - }), - (j.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 = mr(o, i, a, n)), - (s.bottomRadius = mr(o, i, a, n)), - (s.circle = s.createCylinder(s.style)), - (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 = mr(o, i, a, n)), - (s.bottomRadius = mr(o, i, a, n)))); - }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE); - }), - (j.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 = mr(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 = mr(s, a, c, u)), - (d.bottomRadius = mr(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); - } - }), - (j.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); - }), - (j.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; - }), - (j.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, - }, - }) - ); - }), - (j.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, - }); - }), - (j.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, 0.5), - outlineWidth: 2, - outlineColor: Cesium.Color.fromAlpha(Cesium.Color.WHITE, 0.5), - heightReference: Cesium.HeightReference.NONE, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - show: t, - }) - ); - }), - (j.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, - }, - }; - }), - (j.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (j.prototype.setVisibility = function (t) { - (this.item.show = t), - this._scan && (this._scan.show = t), - this.wall && - this.wall.forEach((e) => { - e.show = t; - }); - }), - (j.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; - }), - (j.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 = mr(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(F.selectedItem) || - "group" != F.selectedItem.type || - (t = F.selectedItem.id), - (i = { - id: (e = r._core.getuid()), - name: "鏂板缓鍦嗛敟" + e, - pId: r._core.isnull(t) ? 0 : t, - type: "cylinder", - item: r, - }), - this.setTreeobj(i), - F.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 - ); - }), - (j.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 = mr(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(F.selectedItem) || - "group" != F.selectedItem.type || - (t = F.selectedItem.id), - (i = { - id: (e = r._core.getuid()), - name: "鏂板缓鍦嗘煴" + e, - pId: r._core.isnull(t) ? 0 : t, - type: "cylinder", - item: r, - }), - r.setTreeobj(i), - F.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 - ); - }), - (j.prototype.setTopRadius = function (e) { - try { - this.item._cylinder.topRadius = e; - } catch (e) { - console.log(e); - } - return this; - }), - (j.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; - }), - (j.prototype.deleteObject = function () { - let t = this._viewer; - t.entities.remove(this.item), - this.wall && - (this.wall.forEach((e) => { - t.entities.remove(e); - }), - (this.wall = [])); - }), - (j.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; - }), - (j.prototype.setCylinderImage = function (e) { - try { - this.item._cylinder.material = new this._cesium.ImageMaterialProperty({ - image: e, - }); - } catch (e) { - console.log(e); - } - return this; - }), - (j.prototype.setCylinderRepeat = function (e, t) { - try { - this.item._cylinder.material.repeat = new this._cesium.Cartesian2(e, t); - } catch (e) { - console.log(e); - } - return this; - }), - (j.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; - }), - (j.prototype.setBottomRadius = function (e) { - try { - this.item._cylinder.bottomRadius = e; - } catch (e) { - console.log(e); - } - return this; - }), - (j.prototype.setShow = function (e) { - try { - this.item._cylinder.show = e; - } catch (e) { - console.log(e); - } - return this; - }), - (j.prototype.setMaterial = function (e) { - try { - this.item._cylinder.material = e; - } catch (e) { - console.log(e); - } - return this; - }), - (j.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; - }), - (j.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; - }), - (j.prototype.setItem = function (e) { - this.item = e; - }), - (j.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 - ); - }), - (j.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(j.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); - } - }, - }, - }, - }), - (Nr.prototype.execute = function (e, t, i = {}, o) { - var r = this._viewer, - n = this._cesium; - if ( - ((this._point = new L(r, n)), - (this._polyline = new R(r, n)), - (this._polygon = new M(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.surfaceArea(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 M(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, - } - ); - } - } - }), - (jr.prototype.execute = function (e, t, i, o) { - return this._execute.execute(e, t, i, o); - }); - var zr = 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 Ur(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, 0.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, 0.1)), - (this.maxOpacity = this.defaultValue(t.maxOpacity, 0.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 v()), - (this.tooltip = this._core.CreateTooltip()), - t.tooltip && this.showTooltip(!0); - } - function Wr(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); - } - (Ur.prototype.defaultValue = function (e, t) { - return Cesium.defaultValue(e, t); - }), - (Ur.prototype.create = function (e) { - this.setData(e), this.flyTo && this.flyToBounding(); - }), - (Ur.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, - })); - } - let h = []; - 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 - )); - t = Cesium.BoundingSphere.fromRectangle3D(this.rectangle); - (this.boundingRadius = t.radius), (this.extent = u); - }), - (Ur.prototype.flyToBounding = function () { - this._viewer.camera.flyTo({ destination: this.rectangle }); - }), - (Ur.prototype.destroy = function () { - this.dynamicAdjust(!1), - this._viewer.scene.primitives.remove(this._worldRectangle), - this.heatmapcanvas.remove(), - this.showTooltip(!1); - }), - (Ur.prototype.dynamicAdjust = function (e) { - e - ? this._viewer.clock.onTick.addEventListener( - this.dynamicAdjustEvent, - this - ) - : this._viewer.clock.onTick.removeEventListener( - this.dynamicAdjustEvent, - this - ); - }), - (Ur.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); - } - }), - (Ur.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(); - }), - (Ur.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); - } - }), - (Ur.prototype.create3DHeatmap = function (t) { - let e = document.createElement("canvas"), - i = this._3DOption; - var o = i.width + 1, - r = i.height + 1; - (e.width = o), - (e.height = r), - (t.onload = () => { - var e = new Cesium.GeometryInstance({ - geometry: this.create3DGeometry(i), - }), - 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); - }); - }), - (Ur.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), - }); - }), - (Ur.prototype.construct3DRectangle = function (i) { - var o = i.xMax - i.xMin, - r = i.yMax - i.yMin, - e = i.width, - t = i.height, - n = o / e, - a = r / t, - s = e, - l = t + 1; - let u = [], - c = [], - h = []; - for (let t = 0; t < l; t++) - for (let e = 0; e < s; e++) { - var m = i.xMin + n * e, - d = i.yMin + a * t, - m = Cesium.Cartesian3.fromDegrees( - m, - d, - (this.getValueFromDegrees({ lon: m, lat: d }) || 0) * i.scale + - i.z - ); - u.push(m.x, m.y, m.z), - c.push((n * e) / o, (a * t) / r), - 0 != t && - 0 != e && - (h.push((t - 1) * s + (e - 1), (t - 1) * s + e, t * s + e - 1), - h.push((t - 1) * s + e, t * s + e, t * s + e - 1)); - } - return { positions: u, st: c, indexs: h }; - }), - (Ur.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 "; - }), - (Ur.prototype.getValueFromDegrees = function (e) { - if (this.heatmapInstance && this.extent && e) { - var t = - ((e.lon - this.extent.xMin) / - (this.extent.xMax - this.extent.xMin)) * - this.heatmapcanvas.width, - e = - (-(e.lat - this.extent.yMin) / - (this.extent.yMax - this.extent.yMin) + - 1) * - this.heatmapcanvas.height; - if ( - t <= this.heatmapcanvas.width && - (0 <= t) & (e <= this.heatmapcanvas.height) && - 0 <= e - ) - return this.heatmapInstance.getValueAt({ - x: Math.round(t), - y: Math.round(e), - }); - } - }), - (Ur.prototype.showTooltip = function (e) { - e - ? ((this.tooltipHandler = new Cesium.ScreenSpaceEventHandler( - this._viewer.scene.canvas - )), - this.tooltipHandler.setInputAction((e) => { - var t = this._viewer.scene.pickPosition(e.endPosition); - t - ? ((t = this._core.toDegrees(t)), - void 0 !== (t = this.getValueFromDegrees(t)) - ? 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)); - }), - (Ur.prototype.updateHeatmap = function () { - this.heatmapcanvas = this.heatmapInstance._renderer.canvas; - var e = this.convertCanvasToImage(this.heatmapcanvas); - this._worldRectangle.appearance.material.uniforms.image = e.src; - }), - (Ur.prototype.show = function (e) { - this._worldRectangle && (this._worldRectangle.show = e); - }), - (Ur.prototype.setAlpha = function (e) { - this._worldRectangle && - (this._worldRectangle.appearance.material.uniforms.color.alpha = e); - }), - (Ur.prototype.config = function (e) { - this.heatmapInstance.configure(e), this.updateHeatmap(); - }), - (Ur.prototype.convertCanvasToImage = function (e) { - let t = new Image(); - return (t.src = e.toDataURL("image/png")), t; - }), - (Wr.prototype.defaultValue = function (e, t) { - return Cesium.defaultValue(e, t); - }), - (Wr.prototype.create = function (e) { - this.setData(e), this.flyTo && this.flyToBounding(); - }), - (Wr.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; - }), - (Wr.prototype.flyToBounding = function () { - this._viewer.camera.flyTo({ destination: this.rectangle }); - }), - (Wr.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); - }), - (Wr.prototype.destroy = function () { - this.dynamicAdjust(!1), - this._viewer.scene.primitives.remove(this._worldRectangle), - this._heatmap.clear(), - this._heatmap.canvas.remove(); - }), - (Wr.prototype.dynamicAdjust = function (e) { - e - ? this._viewer.clock.onTick.addEventListener( - this.dynamicAdjustEvent, - this - ) - : this._viewer.clock.onTick.removeEventListener( - this.dynamicAdjustEvent, - this - ); - }), - (Wr.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); - } - }), - (Wr.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; - }), - (Wr.prototype.multiply = function (e) { - this._heatmap.multiply(e), this.updateHeatmap(); - }), - (Wr.prototype.changeRadius = function (t) { - (this.radius = t), - this.datas.forEach((e) => { - e.size = t; - }), - this._heatmap.clear(), - this._heatmap.addPoints(this.datas), - this.updateHeatmap(); - }), - (Wr.prototype.clamp = function (e, t) { - this._heatmap.clamp(e, t), this.updateHeatmap(); - }), - (Wr.prototype.blur = function () { - this._heatmap.blur(), this.updateHeatmap(); - }), - (Wr.prototype.show = function (e) { - this._worldRectangle && (this._worldRectangle.show = e); - }), - (Wr.prototype.setAlpha = function (e) { - this._worldRectangle && - (this._worldRectangle.appearance.material.uniforms.color.alpha = e); - }), - (Wr.prototype.convertCanvasToImage = function (e) { - var t = new Image(); - return (t.src = e.toDataURL("image/png")), t; - }); - const Yr = 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 Jr(e) { - return (e >> 1) ^ -(1 & e); - } - function Kr(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 Qr(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 qr = { - header: 0, - vertices: 1, - triangleIndices: 2, - edgeIndices: 3, - extensions: 4, - }, - Xr = { maxDecodingStep: qr.extensions }; - function Zr(e, t) { - var t = Object.assign({}, Xr, t), - e = new DataView(e), - { header: i, headerEndPosition: o } = (function (e) { - let t = 0; - const i = {}; - for (var [o, r] of Yr) { - 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 < qr.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 += Jr(t.getUint16(a + r * e, !0))), - (c += Jr(t.getUint16(s + r * e, !0))), - (h += Jr(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 < qr.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 = Kr(e.buffer, o, t, i)), - { triangleIndicesEndPosition: (o += t * i), triangleIndices: e } - ); - })(e, o, r); - if (t.maxDecodingStep < qr.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 = Kr(a.buffer, n, s, l, !1)), - (s = a.getUint32((n += s * l), !0)), - (n += Uint32Array.BYTES_PER_ELEMENT), - (c = Kr(a.buffer, n, s, l, !1)), - (s = a.getUint32((n += s * l), !0)), - (n += Uint32Array.BYTES_PER_ELEMENT), - (h = Kr(a.buffer, n, s, l, !1)), - (s = a.getUint32((n += s * l), !0)), - (n += Uint32Array.BYTES_PER_ELEMENT), - (a = Kr(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 < qr.extensions) - return { - header: i, - vertexData: o, - triangleIndices: r, - westIndices: s, - northIndices: u, - eastIndices: n, - southIndices: l, - }; - var h = Qr(e, c)["extensions"]; - return { - header: i, - vertexData: o, - triangleIndices: r, - westIndices: s, - northIndices: u, - eastIndices: n, - southIndices: l, - extensions: h, - }; - } - function $r(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); - } - ($r.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); - }), - ($r.prototype.setContourColor = function (e) { - (this.contourColor = e), - this.Contour && this.Contour.setMaterialColor(this.contourColor); - }), - ($r.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); - }), - ($r.prototype.setWidth = function (e) { - (this.width = e), this.Contour && this.Contour.setWidth(this.width); - }), - ($r.prototype.setSpacing = function (e) { - (this.spacing = e), this.Contour && this.Contour.setSpacing(this.spacing); - }), - ($r.prototype.setStartColor = function (e) { - (this.startColor = e), - (this.colorArr = this.sgworld.Core.gradientColor( - this.startColor, - this.endColor, - 7 - )), - this.render(); - }), - ($r.prototype.setEndColor = function (e) { - (this.endColor = e), - (this.colorArr = this.sgworld.Core.gradientColor( - this.startColor, - this.endColor, - 7 - )), - this.render(); - }), - ($r.prototype.setMin = function (e) { - (this.min[this.type] = e), - "elevation" === this.type - ? (this.shadingUniforms.minimumHeight = this.min[this.type]) - : this.render(); - }), - ($r.prototype.setMax = function (e) { - (this.max[this.type] = e), - "elevation" === this.type - ? (this.shadingUniforms.maximumHeight = this.max[this.type]) - : this.render(); - }), - ($r.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 z = { version: "1.0.0" }, - en = "doublearrow", - tn = 0.25, - on = 0.3, - rn = 0.85, - nn = 0.15, - an = { - headHeightFactor: 0.18, - headWidthFactor: 0.3, - neckHeightFactor: 0.85, - neckWidthFactor: 0.15, - tailWidthFactor: 0.1, - headTailFactor: 0.8, - swallowTailFactor: 1, - }, - sn = { - tailWidthFactor: 0.15, - neckWidthFactor: 0.2, - headWidthFactor: 0.25, - headAngle: Math.PI / 8.5, - neckAngle: Math.PI / 13, - }, - U = - ((z.algorithm = {}), - (z.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 ? z.algorithm.getTempPoint4(i, o, r) : this.points[3]), - (this.connPoint = - 3 == n || 4 == n ? U.PlotUtils.mid(i, o) : this.points[4]), - (e = U.PlotUtils.isClockWise(i, o, r) - ? ((u = z.algorithm.getArrowPoints( - i, - this.connPoint, - this.tempPoint4, - !1 - )), - z.algorithm.getArrowPoints(this.connPoint, o, r, !0)) - : ((u = z.algorithm.getArrowPoints(o, this.connPoint, r, !1)), - z.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 = U.PlotUtils.getBezierPoints(c), - a = U.PlotUtils.getBezierPoints(e.concat(s.slice(1))), - u = U.PlotUtils.getBezierPoints(u), - n = c.concat(h, a, l, u), - e = z.algorithm.array2Dto1D(n); - (t.controlPoint = [i, o, r, this.tempPoint4, this.connPoint]), - (t.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(e)); - } - return t; - }), - (z.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 = z.algorithm.getTempPoint4(i, o, r)), - (this.tempPoint5 = U.PlotUtils.mid(r, this.tempPoint4))) - : ((this.tempPoint4 = this.points[3]), - (this.tempPoint5 = this.points[4])), - (this.connPoint = n < 6 ? U.PlotUtils.mid(i, o) : this.points[5]), - (e = U.PlotUtils.isClockWise(i, o, r) - ? ((u = z.algorithm.getArrowPoints( - i, - this.connPoint, - this.tempPoint4, - !1 - )), - z.algorithm.getArrowPoints(this.connPoint, o, r, !0)) - : ((u = z.algorithm.getArrowPoints(o, this.connPoint, r, !1)), - z.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 = U.PlotUtils.getBezierPoints(c), - a = U.PlotUtils.getBezierPoints(e.concat(s.slice(1))), - u = U.PlotUtils.getBezierPoints(u), - n = c.concat(h, a, l, u), - e = z.algorithm.array2Dto1D(n); - (t.controlPoint = [ - i, - o, - r, - this.tempPoint4, - this.tempPoint5, - this.connPoint, - ]), - (t.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(e)); - } - return t; - }), - (z.algorithm.array2Dto1D = function (e) { - var t = []; - return ( - e.forEach(function (e) { - t.push(e[0]), t.push(e[1]); - }), - t - ); - }), - (z.algorithm.getArrowPoints = function (e, t, i, o) { - (this.type = en), - (this.headHeightFactor = tn), - (this.headWidthFactor = on), - (this.neckHeightFactor = rn), - (this.neckWidthFactor = nn); - var r = U.PlotUtils.mid(e, t), - n = U.PlotUtils.distance(r, i), - a = U.PlotUtils.getThirdPoint(i, r, 0, 0.3 * n, !0), - s = U.PlotUtils.getThirdPoint(i, r, 0, 0.5 * n, !0), - a = [ - r, - U.PlotUtils.getThirdPoint(r, a, U.Constants.HALF_PI, n / 5, o), - U.PlotUtils.getThirdPoint(r, s, U.Constants.HALF_PI, n / 4, o), - i, - ], - r = z.algorithm.getArrowHeadPoints( - a, - this.headHeightFactor, - this.headWidthFactor, - this.neckHeightFactor, - this.neckWidthFactor - ), - s = r[0], - n = r[4], - o = U.PlotUtils.distance(e, t) / U.PlotUtils.getBaseLength(a) / 2, - i = z.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) - ); - }), - (z.algorithm.getArrowHeadPoints = function (e, t, i) { - (this.type = en), - (this.headHeightFactor = tn), - (this.headWidthFactor = on), - (this.neckHeightFactor = rn), - (this.neckWidthFactor = nn); - var o = U.PlotUtils.getBaseLength(e) * this.headHeightFactor, - r = e[e.length - 1], - t = (U.PlotUtils.distance(t, i), o * this.headWidthFactor), - i = o * this.neckWidthFactor, - n = o * this.neckHeightFactor, - o = U.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, o, !0), - e = U.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, n, !0), - n = U.PlotUtils.getThirdPoint(r, o, U.Constants.HALF_PI, t, !1), - o = U.PlotUtils.getThirdPoint(r, o, U.Constants.HALF_PI, t, !0); - return [ - U.PlotUtils.getThirdPoint(r, e, U.Constants.HALF_PI, i, !1), - n, - r, - o, - U.PlotUtils.getThirdPoint(r, e, U.Constants.HALF_PI, i, !0), - ]; - }), - (z.algorithm.getArrowBodyPoints = function (e, t, i, o) { - for ( - var r = U.PlotUtils.wholeDistance(e), - n = U.PlotUtils.getBaseLength(e) * o, - a = (n - U.PlotUtils.distance(t, i)) / 2, - s = 0, - l = [], - u = [], - c = 1; - c < e.length - 1; - c++ - ) { - var h = - U.PlotUtils.getAngleOfThreePoints(e[c - 1], e[c], e[c + 1]) / 2, - m = - (n / 2 - ((s += U.PlotUtils.distance(e[c - 1], e[c])) / r) * a) / - Math.sin(h), - d = U.PlotUtils.getThirdPoint(e[c - 1], e[c], Math.PI - h, m, !0), - h = U.PlotUtils.getThirdPoint(e[c - 1], e[c], h, m, !1); - l.push(d), u.push(h); - } - return l.concat(u); - }), - (z.algorithm.getTempPoint4 = function (e, t, i) { - var o, - r, - n, - t = U.PlotUtils.mid(e, t), - a = U.PlotUtils.distance(t, i), - i = U.PlotUtils.getAngleOfThreePoints(e, t, i), - a = - i < U.Constants.HALF_PI - ? ((o = a * Math.sin(i)), - (r = a * Math.cos(i)), - (n = U.PlotUtils.getThirdPoint( - e, - t, - U.Constants.HALF_PI, - o, - !1 - )), - U.PlotUtils.getThirdPoint(t, n, U.Constants.HALF_PI, r, !0)) - : i >= U.Constants.HALF_PI && i < Math.PI - ? ((o = a * Math.sin(Math.PI - i)), - (r = a * Math.cos(Math.PI - i)), - (n = U.PlotUtils.getThirdPoint( - e, - t, - U.Constants.HALF_PI, - o, - !1 - )), - U.PlotUtils.getThirdPoint(t, n, U.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 = U.PlotUtils.getThirdPoint( - e, - t, - U.Constants.HALF_PI, - o, - !0 - )), - U.PlotUtils.getThirdPoint(t, n, U.Constants.HALF_PI, r, !0)) - : ((o = a * Math.sin(2 * Math.PI - i)), - (r = a * Math.cos(2 * Math.PI - i)), - (n = U.PlotUtils.getThirdPoint( - e, - t, - U.Constants.HALF_PI, - o, - !0 - )), - U.PlotUtils.getThirdPoint(t, n, U.Constants.HALF_PI, r, !1)); - return a; - }), - (z.algorithm.tailedAttackArrow = function (e) { - (e = z.algorithm.dereplication(e)), - (this.tailWidthFactor = an.tailWidthFactor), - (this.swallowTailFactor = an.swallowTailFactor), - (this.swallowTailPnt = an.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]; - U.PlotUtils.isClockWise(e[0], e[1], e[2]) && ((i = e[1]), (o = e[0])); - var e = [U.PlotUtils.mid(i, o)].concat(e.slice(2)), - r = z.algorithm.getAttackArrowHeadPoints(e, i, o, an), - n = r[0], - a = r[4], - s = U.PlotUtils.distance(i, o), - l = U.PlotUtils.getBaseLength(e), - u = l * this.tailWidthFactor * this.swallowTailFactor; - this.swallowTailPnt = U.PlotUtils.getThirdPoint(e[1], e[0], 0, u, !0); - (u = z.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 = U.PlotUtils.getQBSplinePoints(s)), - (l = U.PlotUtils.getQBSplinePoints(l)), - (i = z.algorithm.array2Dto1D( - s.concat(r, l.reverse(), [this.swallowTailPnt, s[0]]) - )), - (t.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(i)); - } - return t; - }), - (z.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 = U.PlotUtils.getBaseLength(e) * this.headHeightFactor, - r = e[e.length - 1], - n = U.PlotUtils.distance(r, e[e.length - 2]), - t = U.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 = U.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, o, !0), - e = U.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, n, !0), - n = U.PlotUtils.getThirdPoint(r, o, U.Constants.HALF_PI, i, !1), - o = U.PlotUtils.getThirdPoint(r, o, U.Constants.HALF_PI, i, !0); - return [ - U.PlotUtils.getThirdPoint(r, e, U.Constants.HALF_PI, t, !1), - n, - r, - o, - U.PlotUtils.getThirdPoint(r, e, U.Constants.HALF_PI, t, !0), - ]; - }), - (z.algorithm.getAttackArrowBodyPoints = function (e, t, i, o) { - for ( - var r = U.PlotUtils.wholeDistance(e), - n = U.PlotUtils.getBaseLength(e) * o, - a = (n - U.PlotUtils.distance(t, i)) / 2, - s = 0, - l = [], - u = [], - c = 1; - c < e.length - 1; - c++ - ) { - var h = - U.PlotUtils.getAngleOfThreePoints(e[c - 1], e[c], e[c + 1]) / 2, - m = - (n / 2 - ((s += U.PlotUtils.distance(e[c - 1], e[c])) / r) * a) / - Math.sin(h), - d = U.PlotUtils.getThirdPoint(e[c - 1], e[c], Math.PI - h, m, !0), - h = U.PlotUtils.getThirdPoint(e[c - 1], e[c], h, m, !1); - l.push(d), u.push(h); - } - return l.concat(u); - }), - (z.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; - }), - (z.algorithm.fineArrow = function (t, o) { - var m, f, _, C, y, v; - if (!(t.length < 2 || o.length < 2)) - return ( - (m = sn.tailWidthFactor), - (f = sn.neckWidthFactor), - (_ = sn.headWidthFactor), - (C = sn.headAngle), - (y = sn.neckAngle), - (v = []), - (v[0] = t), - (v[1] = o), - (e = v[0]), - (r = v[1]), - (n = U.PlotUtils.getBaseLength(v)), - (g = n * m), - (i = n * f), - (s = n * _), - (a = U.PlotUtils.getThirdPoint(r, e, U.Constants.HALF_PI, g, !0)), - (l = U.PlotUtils.getThirdPoint(r, e, U.Constants.HALF_PI, g, !1)), - (u = U.PlotUtils.getThirdPoint(e, r, C, s, !1)), - (c = U.PlotUtils.getThirdPoint(e, r, C, s, !0)), - (p = U.PlotUtils.getThirdPoint(e, r, y, i, !1)), - (h = U.PlotUtils.getThirdPoint(e, r, y, 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 ln(i) { - return new Promise((t, e) => { - hn({ - type: "get", - url: i + "/licenseEncryption/getLicenseSecret", - success(e) { - hn({ - type: "post", - url: i + "/licenseEncryption/getLicenseDecrypt", - headers: { "Content-Type": "application/json" }, - data: JSON.stringify({ data: e.data }), - success(e) { - t(e.data); - }, - error() { - t({ success: !1, message: "鏆傛棤璁稿彲鏉冮檺" }); - }, - }); - }, - error() { - t({ success: !1, message: "鏆傛棤璁稿彲鏉冮檺" }); - }, - }); - }); - } - function un(e) { - return e.replace(/\\x(\w{2})/g, function (e, t) { - return String.fromCharCode(parseInt(t, 16)); - }); - } - function cn(i) { - setInterval(() => { - let t = document.getElementById("sdkwarning"); - if (!t) { - let e = document.getElementById(i); - ((t = document.createElement("div")).id = "sdkwarning"), - (t.style.cssText = ` - position: absolute; - top: 0; - width: 100%; - height: 100%; - z-index: 9999999; - background: rgba(0,0,0,0.8); - color: #f00; - font-size: 30px; - text-align: center; - padding-top: ${e.offsetHeight / 2 - 30}px; - `), - (t.innerHTML = "鏆傛棤璁稿彲鏉冮檺锛�"), - e.append(t), - setTimeout(console.log.bind(console, "鏆傛棤璁稿彲鏉冮檺锛�"), 0); - } - }, 100); - } - function hn(e) { - let t = new XMLHttpRequest(), - i = !0; - if ( - ((i = null == e.async || null == e.async || e.async), - t.open(e.type, e.url, i), - e.headers) - ) - for (const o in e.headers) t.setRequestHeader(o, e.headers[o]); - t.send(e.data || {}), - (t.onreadystatechange = function () { - 4 === this.readyState && 200 === this.status - ? e.success && - "function" == typeof e.success && - e.success( - e.isXml ? this.responseXML : JSON.parse(this.responseText) - ) - : 200 !== this.status && - e.error && - "function" == typeof e.error && - e.error(t), - e.complete && "function" == typeof e.complete && e.complete(); - }); - } - function mn(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 dn(t = 8, i = 16) { - var o = - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split( - "" - ); - let r = []; - if (((i = i || o.length), t)) - for (let e = 0; e < t; e++) r[e] = o[0 | (Math.random() * i)]; - else { - (r[8] = r[13] = r[18] = r[23] = "-"), (r[14] = "4"); - for (let e = 0, t; e < 36; e++) - r[e] || - ((t = 0 | (16 * Math.random())), - (r[e] = o[19 == e ? (3 & t) | 8 : t])); - } - return r.join(""); - } - function pn(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 gn() { - (this._core = new v()), - (this.level = 0), - (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.tileLevel = {}), - (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), - gn.prototype.ready || - Object.defineProperties(gn.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 fn(i, e, o) { - $.each(e._primitives, function (e, t) { - if (t instanceof Cesium.BillboardCollection) - return ( - (e = Tn.indexOf((t = t))), - (t._parentCollection._primitiveOld = o), - -1 !== e - ? (i.scene.primitives.remove(Tn[e]._parentCollection), (Tn[e] = t)) - : Tn.push(t), - !1 - ); - }); - } - function _n(e, t, i) { - e.scene.primitives.remove(i), - (t._onDestroyTilePrimitive = function () { - e.scene.primitives.remove(i), (this._onDestroyTilePrimitive = void 0); - }); - } - function Cn(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 yn(e, t, i) { - Cn( - e, - $.map(t._primitives, function (e) { - return e.readyPromise; - }), - t, - i - ); - } - function vn(e, t, i) { - Cn( - e, - $.map(t._primitives[0]._primitives, function (e) { - return e.readyPromise; - }), - t, - i - ); - } - function wn(e, t, i) { - e.scene.primitives.remove(i); - } - function bn(e, t, i) { - Cn(e, [t.readyPromise], t, i); - } - (U.PlotUtils = {}), - (U.PlotUtils.distance = function (e, t) { - return Math.sqrt(Math.pow(e[0] - t[0], 2) + Math.pow(e[1] - t[1], 2)); - }), - (U.PlotUtils.wholeDistance = function (e) { - for (var t = 0, i = 0; i < e.length - 1; i++) - t += U.PlotUtils.distance(e[i], e[i + 1]); - return t; - }), - (U.PlotUtils.getBaseLength = function (e) { - return Math.pow(U.PlotUtils.wholeDistance(e), 0.99); - }), - (U.PlotUtils.mid = function (e, t) { - return [(e[0] + t[0]) / 2, (e[1] + t[1]) / 2]; - }), - (U.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 U.PlotUtils.getIntersectPoint(o, t, r, e); - }), - (U.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, - ]); - }), - (U.PlotUtils.getAzimuth = function (e, t) { - var i, - o = Math.asin(Math.abs(t[1] - e[1]) / U.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 = U.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 - ); - }), - (U.PlotUtils.getAngleOfThreePoints = function (e, t, i) { - e = U.PlotUtils.getAzimuth(t, e) - U.PlotUtils.getAzimuth(t, i); - return e < 0 ? e + U.Constants.TWO_PI : e; - }), - (U.PlotUtils.isClockWise = function (e, t, i) { - return (i[1] - e[1]) * (t[0] - e[0]) > (t[1] - e[1]) * (i[0] - e[0]); - }), - (U.PlotUtils.getPointOnLine = function (e, t, i) { - return [t[0] + e * (i[0] - t[0]), t[1] + e * (i[1] - t[1])]; - }), - (U.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], - ]; - }), - (U.PlotUtils.getThirdPoint = function (e, t, i, o, r) { - (e = U.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]; - }), - (U.PlotUtils.getArcPoints = function (e, t, i, o) { - for ( - var r = [], n = (n = o - i) < 0 ? n + U.Constants.TWO_PI : n, a = 0; - a <= U.Constants.FITTING_COUNT; - a++ - ) { - var s = i + (n * a) / U.Constants.FITTING_COUNT, - l = e[0] + t * Math.cos(s), - s = e[1] + t * Math.sin(s); - r.push([l, s]); - } - return r; - }), - (U.PlotUtils.getBisectorNormals = function (e, t, i, o) { - var r, - n, - a = U.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 = U.PlotUtils.distance(t, i), - c = U.PlotUtils.distance(i, o), - s = - s > U.Constants.ZERO_TOLERANCE - ? U.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]; - }), - (U.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)]; - }), - (U.PlotUtils.getCurvePoints = function (e, t) { - for ( - var i = [U.PlotUtils.getLeftMostControlPoint(t)], o = 0; - o < t.length - 2; - o++ - ) - var r = t[o], - n = t[o + 1], - a = t[o + 2], - a = U.PlotUtils.getBisectorNormals(e, r, n, a), - i = i.concat(a); - for ( - var s = U.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 < U.Constants.FITTING_COUNT; e++) { - var u = U.PlotUtils.getCubicValue( - e / U.Constants.FITTING_COUNT, - r, - i[2 * o], - i[2 * o + 1], - n - ); - l.push(u); - } - l.push(n); - } - return l; - }), - (U.PlotUtils.getLeftMostControlPoint = function (e) { - var i, - o, - r, - n, - a, - s = e[0], - l = e[1], - e = e[2], - u = U.PlotUtils.getBisectorNormals(0, s, l, e)[0], - e = U.PlotUtils.getNormal(s, l, e), - e = - Math.sqrt(e[0] * e[0] + e[1] * e[1]) > U.Constants.ZERO_TOLERANCE - ? ((e = U.PlotUtils.mid(s, l)), - (r = s[0] - e[0]), - (i = s[1] - e[1]), - (o = U.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]; - }), - (U.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 = U.PlotUtils.getBisectorNormals(0, l, u, e)[1], - l = U.PlotUtils.getNormal(l, u, e), - l = - Math.sqrt(l[0] * l[0] + l[1] * l[1]) > U.Constants.ZERO_TOLERANCE - ? ((l = U.PlotUtils.mid(u, e)), - (r = e[0] - l[0]), - (i = e[1] - l[1]), - (o = U.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]; - }), - (U.PlotUtils.getBezierPoints = function (e) { - if (e.length <= 2) return e; - for (var t = [], i = e.length - 1, o = 0; o <= 1; o += 0.01) { - for (var r = 0, n = 0, a = 0; a <= i; a++) { - var s = U.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; - }), - (U.PlotUtils.getBinomialFactor = function (e, t) { - return ( - U.PlotUtils.getFactorial(e) / - (U.PlotUtils.getFactorial(t) * U.PlotUtils.getFactorial(e - t)) - ); - }), - (U.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; - }), - (U.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 += 0.05) { - for (var n = 0, a = 0, s = 0; s <= 2; s++) { - var l = U.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; - }), - (U.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; - }), - (U.Constants = { - TWO_PI: 2 * Math.PI, - HALF_PI: Math.PI / 2, - FITTING_COUNT: 100, - ZERO_TOLERANCE: 1e-4, - }), - Object.defineProperties(mn.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; - }, - }, - }), - (mn.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(pn.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; - }, - }, - }), - (pn.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; - }), - (pn.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; - }), - (pn.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; - }), - (pn.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, - ]; - }, - }), - (pn.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; - }), - (pn.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; - }), - (gn.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 Tn = [], - En = 0, - Sn = - ((gn.prototype.onPreFrame = function (e, t) { - if ((En++, !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 && - En % 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(Tn, function (e, t) { - t.ready && - this.viewer.scene.primitives.remove( - t._parentCollection._primitiveOld - ); - }); - } - }), - (gn.prototype.updateForPick = function (e) {}), - Math.PI, - (gn.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 - - 0.99 * TerraExplorer.internal.Navigate.HeightAboveGround, - }), - attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor(t), - }, - }), - appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }), - }); - e.data.primitive.add(t); - }), - (gn.prototype.getTile = function (e) { - return this._tileCache[e]; - }), - (gn.prototype.getAllTiles = function () { - var e, - t = []; - for (e in this._tileCache) t.push(this._tileCache[e]); - return t; - }), - (gn.prototype.addToScene = function (e) { - this._primitivesWaitingToBeAddedToTheScene.push(e); - }), - (gn.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); - }), - (gn.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": - fn(this.viewer, t, e); - break; - case "labels": - _n(this.viewer, t, e); - break; - case "polygons": - yn(this.viewer, t, e); - break; - case "models": - vn(this.viewer, t, e); - break; - case "polylines": - bn(this.viewer, t, e); - break; - case "points": - wn(this.viewer, 0, e); - break; - default: - console.log("Error updating layer"), - this.viewer.scene.primitives.remove(e); - } - }), - { - billboards: fn, - labels: _n, - polygons: yn, - models: vn, - polylines: bn, - points: wn, - }), - Pn = - ((gn.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 = Sn[i]) - ? i(t, e) - : (console.log("Error updating layer"), - this.viewer.scene.primitives.remove(e))); - }), - !(gn.prototype.update = function (e) { - this.level = this._core.getLevel(this.viewer); - let t = this.getAllTiles(), - i, - o; - t.forEach((e) => { - for (var t in e.data.wfsLayerData) - (o = e.data.wfsLayerData[t] && e.data.wfsLayerData[t].primitive), - (i = this.tileLevel[t].level), - o && - i && - this.tileLevel[t].visible && - (this.level <= i.max && this.level >= i.min - ? (o.show = !0) - : (o.show = !1)); - }), - this._quadtree.beginFrame(e), - this._quadtree.render(e), - this._quadtree.endFrame(e); - })); - function xn() {} - function Dn(e) { - return "string" == typeof e - ? e.replace(/^\s+/g, "").replace(/\s+$/g, "") - : e; - } - function In(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 Dn(e.replace(new RegExp("######", "g"), t)); - })); - } - function An(e) { - for (var t = "#", i = e.length, o = 0; o < i; o++) t += e[o] + "#"; - return t; - } - function Ln(e) { - for (var t = "", i = e.length, o = 1; o < i; o += 2) t += e[o]; - return t; - } - function Mn(e) { - (this.source = e), - (this.cursor = 0), - (this.currentChar = ""), - this.readNextChar(); - } - function Rn(e) { - (this.lexer = new Mn(e)), (this.currentToken = ""), this.readNextToken(); - } - function On(e, t) { - var i = ""; - return ( - void 0 !== e.logic - ? ((i = (i = e.terms.map(function (e) { - return On(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 Bn(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 Fn(e, t) { - (this._style = e || {}), - (this._core = new v()), - (this._bufferAnalysis = new Si(t, Cesium)), - (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 Hn(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 Vn(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 Gn(t) { - return function (e) { - e = Number( - t.applyConditionalClassification( - t._style.altitudeOffset || t._style.height, - e.attributes - ) - ); - return (e = isNaN(e) ? 0 : e); - }; - } - function kn(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 Nn(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 ll(e) { - return isNaN(e) ? e : parseFloat(e); - } - function ul(e, i) { - var t, - o = []; - return ( - $.each(e.attributeNames, function (e, t) { - o.push(ll(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 cl(e, t, i) { - return e.replace( - new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"), "g"), - i - ); - } - (gn.prototype.initialize = function (e) { - Pn || - (this.viewer.scene.preRender.addEventListener(this.onPreFrame, this), - (Pn = !0)); - }), - (gn.prototype.beginUpdate = function (e) { - this.quadtree.beginFrame(e); - }), - (gn.prototype.endUpdate = function (e) { - var t = this; - e.afterRender.push(function () { - t.quadtree.endFrame(e); - }); - }), - (gn.prototype.getLevelMaximumGeometricError = function (e) { - return this._levelZeroMaximumError / (1 << e); - }), - (gn.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)); - }), - (gn.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; - }), - (gn.prototype.canRefine = function (e, t, i) { - return e.level < 16; - }), - (gn.prototype.showTileThisFrame = function (e, t, i, o) { - e.data.geometryPrimitive && e.data.geometryPrimitive.update(t, i, o); - }), - (gn.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; - }), - (gn.prototype.isDestroyed = function () { - return !1; - }), - (gn.prototype.destroy = function () { - return Cesium.destroyObject(this); - }), - (gn.prototype.remove = function () { - this.destroy(); - }), - (gn.prototype.getInstance = function (e) { - var t; - return ( - 0 == Cesium.defined(e.TileManager) && - ((t = new gn()), - ((e.TileManager = t).viewer = e), - (t = new Cesium.QuadtreePrimitive({ - tileProvider: e.TileManager, - maximumScreenSpaceError: 2, - })), - e.scene.primitives.add(t)), - e.TileManager - ); - }), - (xn.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"), An); - })), - []), - 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(An)).join("|")), - r.split(new RegExp(a.join("|"), "i"))), - h = - ((r = r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function (e) { - return e.replace(new RegExp(u, "gi"), Ln); - })), - (c = c.map(function (e) { - return e.replace( - /\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, - function (e) { - return e.replace(new RegExp(u, "gi"), Ln); - } - ); - })), - []), - m = - ((h.SELECT = function (e) { - return In(",", e) - .filter(function (e) { - return "" !== e; - }) - .map(function (e) { - return { name: e }; - }); - }), - (h.SET = function (e) { - return In(",", 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(Dn)).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 = Dn(t[0])), - (i.as = Dn(t[1]) || ""), - (i.cond = Dn(e[1])), - i - ); - }), - (h.WHERE = Dn), - (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 = Dn(i[1])), - (e.order = Dn(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 = Dn(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(Dn(t[3]), 10)), - (e.from = parseInt(Dn(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 = Dn(t[1])), - void 0 !== t[3] && - ((e.columns = t[3].split(",")), - (e.columns = e.columns.map(Dn))), - e - ); - }), - (h.VALUES = function (e) { - var e = In(",", (e = "(" != (e = Dn(e))[0] ? "(" + e : e)), - t = []; - return ( - e.forEach(function (e) { - (e = In(",", (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 = Rn.parse(m.WHERE)), - void 0 !== m.JOIN && - m.JOIN.forEach(function (e, t) { - m.JOIN[t].cond = Rn.parse(e.cond); - })), - m - ); - }), - (Mn.prototype = { - constructor: Mn, - 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 } - ); - }, - }), - (Mn.tokenize = function (e) { - var t = new Mn(e), - i = []; - do { - var o = t.readNextToken(); - } while (("empty" != o.type && i.push(o), t.currentChar)); - return i; - }), - (Rn.prototype = { - constructor: Rn, - 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 - ); - }, - }), - (Rn.parse = function (e) { - return new Rn(e).parseExpressionsRecursively(); - }), - (xn.ast2sql = function (e) { - function t(e) { - return void 0 !== e.WHERE ? " WHERE " + On(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 " + On(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; - }), - (xn.trim = Dn), - (xn.protect = An), - (xn.unprotect = Ln), - (xn.protect_split = In), - (xn.CondLexer = Mn), - (xn.CondParser = Rn); - var hl, - ml = function (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; - }, - dl = function (e, t, i, o) { - for (var r = 0, n = 0; n < e.length; n++) - for ( - var a = o ? pl : 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++; - } - }, - pl = 1, - gl = - (Object.defineProperties(Fn.prototype, { - style: { - get: function () { - return this._style; - }, - set: function (e) { - this._style = e; - }, - }, - }), - (Fn.prototype.clonePartOfMultiFeature = function (e, t) { - var i = e.geometryType.includes("multi") ? e.fid + "." + t : e.fid; - return { - positions: e.positions[t], - attributes: e.attributes, - fid: i, - geometryType: e.geometryType, - }; - }), - (Fn.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)); - }), - (Fn.prototype.createPolygonPrimitive = function (g) { - function f(t) { - if (t.isQuery) t.onFinishedQuery(e); - else { - var o = "", - e = [], - r = [], - n = [], - a = [], - s = [], - l = b.style.polygon, - u = - l.clampToGround || - (!l.perPositionHeight && !l.extrudedHeight && !l.height); - let i; - l.text && (i = new Cesium.LabelCollection()); - for (var c, h, m, d = 0; d < t.features.length; d++) { - var p = t.features[d]; - if (Vn(t, p.fid)) { - var g, - f = p.absoluteHeightPositions || p.positions, - _ = b.createPolygonOptions(f, p.attributes), - f = b.createCommonOptions(p.attributes), - C = Cesium.BoundingSphere.fromPoints(_.hierarchy.positions); - if ( - (p.absoluteHeightPositions && - delete p.absoluteHeightPositions, - e.push(C), - !t.isQuery) - ) { - let e; - if ( - (_.randomColor && (e = Cesium.Color.fromRandom()), - _.outline && !u - ? ((g = b.createPolygonGeometryHelper( - "outline", - p, - _.outlineColor, - _ - )), - n.push(g)) - : _.outline && - n.push( - new Cesium.GeometryInstance({ - geometry: new Cesium.GroundPolylineGeometry({ - positions: _.hierarchy.positions, - width: _.outlineWidth, - }), - }) - ), - _.text) - ) { - var y = b._core.getCenterOfMass(_.hierarchy.positions); - let t = b.createPointOptions(y, p.attributes); - if ( - (u || - null != b.style.pointHeight || - (!_.extrudedHeight && !_.height) || - (t.position = Cesium.Cartesian3.fromDegrees( - y[0], - y[1], - _.extrudedHeight - ? (_.height || 0) + _.extrudedHeight - : _.height - )), - (_.labelNear || _.labelFar) && - (t.label.distanceDisplayCondition = - new Cesium.DistanceDisplayCondition( - _.labelNear || 0, - _.labelFar || 1 / 0 - )), - _.offsetPoint && _.offsetPoint[t.label.text]) - ) { - let e = b._core.toDegrees(t.position); - b._core.getCenterOfMass(_.hierarchy.positions); - y = _.offsetPoint[t.label.text]; - y[0] && (e.lon = y[0]), - y[1] && (e.lat = y[1]), - void 0 !== y[2] && (e.height = y[2]), - (t.position = Cesium.Cartesian3.fromDegrees( - e.lon, - e.lat, - e.height - )); - } - let e = i.add({ id: p, position: t.position, ...t.label }); - delete e.id.positions, (e.id.boundingSphere = C); - } - if (_.colorConfig) { - let e; - for (var v in _.colorConfig) { - for (var w in _.colorConfig[v]) - if (p.attributes[v] == w) { - e = _.colorConfig[v][w]; - break; - } - if (e) break; - _.colorConfig[v]["#"] && (e = _.colorConfig[v]["#"]); - } - e && (_.material = Cesium.Color.fromCssColorString(e)); - } - _.fill && - 0 < _.material.alpha && - ((g = b.createPolygonGeometryHelper( - "fill", - p, - e || _.material, - _ - )), - r.push(g)), - t.parentLayer.addRenderedFeatureId(p.fid), - (o += p.fid + ";"), - a.push(p.fid), - s.push(f.tooltip); - } - } - } - "" != o && - ((l = new Cesium.PrimitiveCollection()), - (h = new Cesium.PerInstanceColorAppearance({ - flat: 0 == _.material.alpha, - translucent: _.material.alpha < 1, - })), - i && l.add(i), - 0 < r.length && - (_.water && - ((c = { - color: _.water.color || "rgba(135,206,235,0.6)", - image: _.water.image || window.SmartEarthRootUrl + I.water, - frequency: _.water.frequency || 1e3, - speed: _.water.speed || 10, - amplitude: _.water.amplitude || 10, - }), - (m = Cesium.Color.fromCssColorString(c.color)), - (h = new Cesium.EllipsoidSurfaceAppearance({ - material: new Cesium.Material({ - fabric: { - type: "Water", - uniforms: { - baseWaterColor: m, - blendColor: m, - normalMap: c.image, - frequency: c.frequency, - animationSpeed: c.speed / 1e3, - amplitude: c.amplitude, - }, - }, - }), - }))), - ((m = u - ? new Cesium.GroundPrimitive({ - geometryInstances: r, - appearance: h, - classificationType: _.classificationType, - }) - : new Cesium.Primitive({ - geometryInstances: r, - appearance: h, - }))._parentCollection = l).add(m)), - 0 < n.length && - (_.clampToGround - ? l.add( - new Cesium.GroundPolylinePrimitive({ - geometryInstances: n, - appearance: new Cesium.PolylineMaterialAppearance({ - material: new Cesium.Material({ - fabric: { - type: "Color", - uniforms: { color: _.outlineColor }, - }, - }), - }), - }) - ) - : ((m = new Cesium.Primitive({ - geometryInstances: n, - appearance: h, - }))._parentCollection = l).add(m)), - (l.ID = "polygons:" + Bn(o)), - (l._instanceIds = a), - (l._tooltips = s), - t.onFinishedCreatePrimitive(l, e)); - } - } - var e, - b = this; - 3 == this.style.altitudeMethod - ? ((g.features = Hn(g.features, Gn(b))), 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 == b._style.altitudeMethod, - i = g.features, - o = e, - r = Gn(b), - n = t, - a = 0, - s = 0; - s < i.length; - s++ - ) { - var l = i[s], - u = n ? pl : 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++; - } - } - f(g); - })); - }), - (Fn.prototype.createPolygonGeometryHelper = function (e, t, i, o) { - var r = o.hierarchy, - n = o.perPositionHeight, - a = o.extrudedHeight, - s = o.height, - l = o.water, - u = - null != a || void 0 !== s - ? Cesium.PerInstanceColorAppearance.VERTEX_FORMAT - : Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT; - l && (u = Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT), - void 0 !== a && void 0 !== s && (a += s); - let c; - return ( - (l = o.bulidingWall - ? new (c = - "fill" === e - ? Cesium.CorridorGeometry - : Cesium.CorridorOutlineGeometry)({ - positions: r.positions, - width: o.bulidingWallWidth || 0.8, - vertexFormat: u, - extrudedHeight: a, - height: s, - cornerType: Cesium.CornerType.MITERED, - }) - : new (c = - "fill" === e - ? Cesium.PolygonGeometry - : Cesium.PolygonOutlineGeometry)({ - polygonHierarchy: r, - vertexFormat: u, - perPositionHeight: void 0 !== s ? void 0 : n, - extrudedHeight: a, - height: s, - })), - new Cesium.GeometryInstance({ - geometry: l, - id: t, - attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor(i), - }, - }) - ); - }), - (Fn.prototype.createLinestringPrimitive = function (e) { - var t = this, - o = - (t && - t.style && - void 0 !== t.style.height && - (e.features = Hn(e.features, Gn(t))), - e); - if (o.isQuery) o.onFinishedQuery(a); - else { - var r, - n = "", - a = [], - s = [], - l = []; - let i = new Cesium.PrimitiveCollection(); - for (var u = 0; u < o.features.length; u++) { - var c = o.features[u]; - if (Vn(o, c.fid)) { - var h = c.absoluteHeightPositions || c.positions, - h = t.createLinestringOptions(h, c.attributes), - m = t.createCommonOptions(c.attributes); - if ( - ((h.vertexFormat = ( - r - ? Cesium.PerInstanceColorAppearance - : Cesium.PolylineColorAppearance - ).VERTEX_FORMAT), - c.absoluteHeightPositions && delete c.absoluteHeightPositions, - a.push(Cesium.BoundingSphere.fromPoints(h.positions)), - !o.isQuery) - ) { - d = h.clampToGround - ? new Cesium.GroundPolylineGeometry({ - positions: h.positions, - width: h.width, - }) - : new Cesium.PolylineGeometry(h); - var d = new Cesium.GeometryInstance({ - id: c, - geometry: d, - attributes: { - color: new Cesium.ColorGeometryInstanceAttribute.fromColor( - h.material - ), - }, - }); - o.parentLayer.addRenderedFeatureId(c.fid), - (n += c.fid + ";"), - s.push(c.fid), - l.push(m.tooltip); - let e = null, - t; - (t = h.dash - ? new Cesium.PolylineMaterialAppearance({ - material: Cesium.Material.fromType( - Cesium.Material.PolylineDashType, - { - color: h.material, - gapColor: h.gapColor || Cesium.Color.TRANSPARENT, - dashLength: h.dashLength || 20, - } - ), - }) - : new Cesium.PolylineMaterialAppearance({ - material: new Cesium.Material({ - fabric: { - type: "PolylineOutline", - uniforms: { - color: h.material, - outlineColor: h.outlineColor || h.material, - outlineWidth: h.outlineWidth || 0, - }, - }, - }), - })), - (e = h.clampToGround - ? new Cesium.GroundPolylinePrimitive({ - geometryInstances: d, - appearance: t, - classificationType: h.classificationType, - }) - : new Cesium.Primitive({ - geometryInstances: d, - appearance: t, - })), - i.add(e); - } - } - } - "" != n && - (((e = i).ID = "polylines:" + Bn(n)), - e._instanceIds && - 0 === e._instanceIds.length && - (e._instanceIds = s), - (e._tooltips = l), - o.onFinishedCreatePrimitive(e, a)); - } - }), - (Fn.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: v.viewer.scene }), - l = new Cesium.PointPrimitiveCollection({ - scene: v.viewer.scene, - }), - u = new Cesium.BillboardCollection({ scene: v.viewer.scene }), - c = new Cesium.PrimitiveCollection(), - h = new Cesium.PolylineCollection(), - m = 0; - m < e.features.length; - m++ - ) { - var d, - p, - f, - _, - C, - y = e.features[m]; - Vn(e, y.fid) && - ((d = y.absoluteHeightPositions || y.positions), - (d = v.createPointOptions(d, y.attributes)), - (p = v.createCommonOptions(y.attributes)), - (y.clampToGround = d.clampToGround), - d.sgsPointPosition && - ((y.sgsPointPosition = d.sgsPointPosition), - delete d.sgsPointPosition), - y.absoluteHeightPositions && delete y.absoluteHeightPositions, - n.push(Cesium.BoundingSphere.fromPoints([d.position])), - e.isQuery || - (d.label && - ((d.label.position = d.position), - (d.label.id = y), - v.setEyeOffset(d.label), - null != d.label.imageFile && - ((d.label.image = v.applyConditionalClassification( - d.label.imageFile, - y.attributes - )), - (d.label.label = d.label), - u.add(d.label), - v.setEyeOffset(d.label, -5)), - null != d.label.imageFile && - null != d.label.showText && - d.label.showText && - (v.viewer.scene.onHoverShowTextArray[d.label.id] = !0), - null != d.label.isBold && d.label.isBold - ? s.add(g) - : null != d.label.isUnderline && d.label.isUnderline - ? ((_ = - null != d.label.text.match(/[iljf1]/g) - ? d.label.text.match(/[iljf1]/g) - : []), - (f = d.label.text.length), - (f = Array(Math.ceil(f - 0.5 * _.length)).join("_")), - (_ = $.extend({}, d.label)), - null != d.label.image && delete d.label.image, - (_.position = d.label.position), - (_.id = d.label.id), - (_.text = f), - (_.alignment = - null != d.label.alignment - ? d.label.alignment - : void 0), - (_.underline = !0), - (_.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]), - (_.pixelOffset = new Cesium.Cartesian2(0, -45)), - s.add(_)) - : s.add(d.label)), - d.billboard && - ((d.billboard.position = d.position), - (d.billboard.id = y), - v.setEyeOffset(d.billboard), - u.add(d.billboard)), - d.model && - ((d.model.url = d.model.uri), - (d.model.id = y), - c.add(Cesium.Model.fromGltf(d.model))), - d.point && - ((d.point.position = d.position), - (d.point.id = y), - v.setEyeOffset(d.point), - l.add(d.point)), - 0 != d.lineToGround && - ((f = Cesium.Cartographic.fromCartesian(d.position)), - (_ = Cesium.Cartesian3.fromRadians( - f.longitude, - f.latitude, - 0 - )), - 2 == d.lineToGround && - ((C = - d.lineToGroundLength / - Cesium.Cartesian3.distance(d.position, _)), - Cesium.Cartesian3.lerp(d.position, _, C, _)), - h.add({ - show: !0, - width: 1, - positions: [d.position, _], - material: Cesium.Material.fromType("Color", { - color: d.lineToGroundColor, - }), - })), - e.parentLayer.addRenderedFeatureId(y.fid), - (o += y.fid + ";"), - r.push(y.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 + ":" + Bn(o)), - (i._instanceIds = r), - (i._tooltips = a), - e.onFinishedCreatePrimitive(i, n)); - } - } - var e, - v = this; - 3 == this.style.altitudeMethod - ? ((i.features = Hn(i.features, Gn(v))), o(i)) - : ((e = ml(i.features)), - (e = Cesium.sampleRenderedData(e)), - Cesium.when(e, function (e) { - var t = 2 == v._style.altitudeMethod; - dl(i.features, e, Gn(v), t), o(i); - }).otherwise(function (e) {})); - }), - (Fn.prototype.createCommonOptions = function (e) { - var t = {}; - return ( - (t.tooltip = this.applyConditionalClassification( - this.style.tooltip, - e - )), - t - ); - }), - (Fn.prototype.createPolygonOptions = function (e, t) { - var i = this.getPolygonStyle(this.style); - i.preLoad && i.preLoad(i.polygon, t), - (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 = kn(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.height && - (i.polygon.height = Number( - this.getValueFromProp(i.polygon.height, t) - )), - 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)), - i.polygon.extrudedHeight && - (i.polygon.extrudedHeight = Number(i.polygon.extrudedHeight)), - 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 = kn(n)), - i.polygon - ); - }), - (Fn.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 *= 0.8), - 0 < e.polyline.backgroundOpacity && (t *= 0.8)) - : (t = 1 < t ? 2 : 1) - : t < 0 - ? (t = Math.min(5, Math.abs(t))) - : 0 == t && (t = 1), - t - ); - }), - (Fn.prototype.createLinestringOptions = function (e, t) { - var i = this.getLinestringStyle(this.style), - e = - (i.preLoad && i.preLoad(i.polyline, t), - (i.id = t), - (i.polyline.positions = - Cesium.Cartesian3.fromDegreesArrayHeights(e)), - this.applyConditionalClassification(i.polyline.material, t)); - return ( - (i.polyline.material = kn(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 - ); - }), - (Fn.prototype.getValueFromProp = function (e, i) { - let o = e && e.defaultValue ? e.defaultValue : e; - if (o && o.indexOf) - if (-1 < o.indexOf("[") && -1 < o.indexOf("]")) - (o = o.replace("[", "").replace("]", "")), - (o = this.getPropValue(i, o)); - else if (-1 < o.indexOf("{") && -1 < o.indexOf("}")) { - let e = o.match(/\{[^\}]+\}/g); - e.forEach((e) => { - var t = this.getPropValue(i, e.substring(1, e.length - 1)); - o = o.replace(e, t); - }), - (o = o.replaceAll("\\n", "\n")); - } - return o; - }), - (Fn.prototype.getPropValue = function (e, t) { - return e[t] || (t.includes(":") ? e[t.split(":")[1]] : void 0); - }), - (Fn.prototype.applyConditionalClassification = function (e, i) { - if (null != e) { - if (null == e.defaultValue) return e; - var o = ll(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 = cl(o, "[" + name + "]", i[name]); - else o = cl(o, t, i[e.attributeName]); - return o; - } - if (void 0 !== e.classification) return (o = ul(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 ll(e.value); - var i = void 0; - return (i = !0 === ul(e, t) ? ll(e.value) : i); - } - })(r[t], i); - t && (o = t); - }), - o - ); - } - }), - (Fn.prototype.createLineToGroundOptions = function (e, t) { - var i = this.applyConditionalClassification(e.lineToGround, t); - null != i && 0 != Number(i) - ? ((e.lineToGround = i), - (i = Nn( - (i = this.applyConditionalClassification(e.lineToGroundColor, t)) - )), - (e.lineToGroundColor = i), - "string" == - typeof (i = this.applyConditionalClassification( - e.lineToGroundLength, - t - )) && - -1 < i.indexOf("[") && - -1 < i.indexOf("]") && - (i = t[i.substring(1, i.length - 1)] || 0), - (e.lineToGroundLength = Number(i))) - : ((e.lineToGround = 0), - (e.lineToGroundColor = 0), - (e.lineToGroundLength = 0)); - }), - (Fn.prototype.createPointOptions = function (e, t) { - var i, - o, - r, - n, - a, - s = this.getPointStyle(this.style); - return ( - s.pointHeight - ? ((o = s.pointHeight), - (o = this.getValueFromProp(o, t) || 0), - (s.position = Cesium.Cartesian3.fromDegrees(e[0], e[1], o)), - (e[2] = o)) - : (s.position = Array.isArray(e) - ? Cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]) - : e), - (s.sgsPointPosition = e), - (s.id = t), - s.label && - ((s.label.text = this.getValueFromProp(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 && - ((o = this.applyConditionalClassification(s.label.family, t)), - (e = this.applyConditionalClassification(s.label.font, t)), - (s.label.font = - 0 <= e - ? ((3 * e) / 4).toString() + "pt " + o - : ((3 * (-1 * ((72 * e) / 96))) / 4).toString() + "pt " + o)), - (s.label.fillColor = Nn( - this.applyConditionalClassification(s.label.fillColor, t) - )), - (s.label.backgroundColor = Nn( - this.applyConditionalClassification(s.label.backgroundColor, t) - )), - null == s.label.backgroundColor && - (s.label.backgroundColor = new Cesium.Color( - 0.165, - 0.165, - 0.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 && - ((e = Nn( - (e = this.applyConditionalClassification( - s.billboard.imageColor, - t - )) - )), - (s.billboard.color = e)), - 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 && - ((o = 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 = o(this.applyClassification(s.model.scale, t))), - (e = o(this.applyClassification(s.model.heading, t))), - (r = o(this.applyClassification(s.model.pitch, t))), - (n = o(this.applyClassification(s.model.roll, t))), - (a = new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(e), - Cesium.Math.toRadians(r), - Cesium.Math.toRadians(n) - )), - (s.model.modelMatrix = - Cesium.Transforms.headingPitchRollToFixedFrame(s.position, a))), - this.createLineToGroundOptions(s, t), - s - ); - }), - (Fn.prototype.s = function (e) { - return e.split("").reverse().join(""); - }), - (Fn.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; - }), - (Fn.prototype.o = function (e) { - if (!e) return e; - return new RegExp("^[^A-Za-z脌-脰脴-枚酶-矢虁-謵酄�-峥库皜-铿滐肪-锕唤-锟縘*[謶-呖铿�-锓斤拱-锘糫").test( - e[0] - ); - }), - (Fn.prototype.applyClassification = function (e, t) { - if ("string" !== $.type(e)) return e; - if (null != /(\[([^\]]+)\])/g.exec(e)) - for (var i in t) e = cl(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; - }), - (Fn.prototype.getPolygonStyle = function (e) { - return $.extend(!0, {}, gl.DEFAULT_POLYGON_STYLE, e); - }), - (Fn.prototype.getLinestringStyle = function (e) { - return $.extend(!0, {}, gl.DEFAULT_POLYLINE_STYLE, e); - }), - (Fn.prototype.getPointStyle = function (e) { - return null != e.label - ? $.extend(!0, {}, gl.DEFAULT_LABEL_STYLE, e) - : null != e.billboard - ? $.extend(!0, {}, gl.DEFAULT_BILLBOARD_STYLE, e) - : null != e.model - ? $.extend(!0, {}, gl.DEFAULT_MODEL_STYLE, e) - : null != e.point - ? $.extend(!0, {}, gl.DEFAULT_POINT_STYLE, e) - : gl.DEFAULT_POINT_STYLE; - }), - (Fn.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 W(e, t, i, o, r, n, a, s, l) { - 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(d(t, i), function (e) { - o.resolve(e); - }) - : setTimeout(e, 10); - })(), - o.promise - ); - } - function u(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 d(e, t) { - for (var i = 0; i < t.length; ++i) { - var o = t[i], - r = u(e, o); - o.height = r.data.terrainData.interpolateHeight( - r.rectangle, - o.longitude, - o.latitude - ); - } - return t; - } - function p(e) { - this.value = new Float32Array([e]); - } - (this._viewer = e), - (this._Viewer = e), - (c.G = 65535), - (hl = new gn()), - (wl = new de({ - workerPath: SmartEarthRootUrl + "Workers/featurefetcherworker.js", - })), - 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)), - (p.fromZBias = function (e) { - if (Cesium.defined(e)) return new p(e); - throw new DeveloperError("zbias is required."); - }), - (p.toValue = function (e, t) { - if (Cesium.defined(e)) - return Cesium.defined(t) ? color.toBytes(t) : new Float32Array(e); - throw new DeveloperError("zbias is required."); - }), - (p.equals = function (e, t) { - return ( - e === t || - (Cesium.defined(e) && - Cesium.defined(t) && - e.value[0] === t.value[0]) - ); - }), - (p.defaultBias = function () { - return p.fromZBias(15e-6); - }), - (Cesium.ZBiasGeometryInstanceAttribute = p), - (Cesium.ZBiasGeometryInstanceAttribute = p), - (Cesium.SampleRenderedDataFlags = { TERRAIN: 2, MESH: 4, FLOOR: 8 }), - (Cesium.DynamicEyeOffset = function (e) { - return ( - void 0 === e && (e = 0), new Cesium.Cartesian3(0.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(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 - ); - }), - (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 - ); - }), - (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(d(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._visible = !0), - (this._gmlParser = new pn(!0, null, null, !0)); - var g, - o = !this._viewer.TileManager; - (this._tileManager = hl.getInstance(e)), - (this._tileManager.tileLevel[this._guid] = { - level: this._level, - visible: this._visible, - }), - this._tileManager._loadTileEvent.addEventListener( - W.prototype.loadTile, - this - ), - (this._useWorkers = !0), - (this._layerDisplayName = n), - (this._showAttributesAsMessage = r.showAttributesAsMessage), - delete r.showAttributesAsMessage, - (this._entityCreator = new Fn(r, e)), - (this._featuresMap = {}), - (this._boundingBox = void 0), - (this._geometryFieldName = void 0), - (this._operations = {}), - (this._subdomains = a), - (this.latLon = !0), - (this._addedFeatures = []), - (this.simpleSqlParser = xn), - (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; - }, - }), - (t = (g = this) - .cleanUrl(g._url) - .replace( - "{s}", - g.sTag(g._layerName.length, g._layerName.length, g._level) - )), - (t = - (t += Cl(t)) + - ("SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName=" + - g._layerName)), - (i = Cesium.TrustedServers.contains(fl(g._url, g._subdomains))), - $.ajax({ - dataType: "xml", - xhrFields: { withCredentials: i }, - url: encodeURI(t), - success: function (e) { - var i, o; - (o = g), - _l(e, "FeatureType", "wfs").each(function (e, t) { - return ( - _l(t, "Name", "wfs").text() != o._layerName || - (1 === (t = _l(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 = g), - $(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) - ); - }); - }, - }), - yl(this), - void 0 !== s && this.setVisibility(s), - o || this.refresh(); - } - function fl(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 _l(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 Cl(e) { - return -1 < e.indexOf("?") ? "&" : "?"; - } - function yl(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 += Cl(e)) + - ("SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName=" + - i._layerName)), - Cesium.TrustedServers.contains(fl(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 vl(e) { - return null == e - ? void 0 - : e.parentLayer - ? e - : e._parentCollection || - (e.primitive && e.primitive._parentCollection - ? e.primitive._parentCollection - : void 0); - } - Object.defineProperties(gl, { - 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.withAlpha(0.5), - pixelSize: 5, - outlineColor: Cesium.Color.WHITE.withAlpha(0.5), - 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(W.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 wl, - bl = 180 / Math.PI; - function Tl(e) { - (this.Viewer = e), - (this._core = new v()), - (this.colorTool = this._core.gradientColor()); - } - function El(e, t) { - (this._viewer = e), (this._cesium = t); - } - (W.prototype.getRequestMaxFeatures = function () { - return 1e3; - }), - (W.prototype.isAttributeField = function (e, t) { - return ( - !(!t || !e || "" == e.toLowerCase() || "fid" == e.toLowerCase()) && - ("string" == t.toLowerCase() || - "integer" == t.toLowerCase() || - "double" == t.toLowerCase()) - ); - }), - (W.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:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>"), - (n = ""), - $(e).each(function () { - var e = this, - t = '<wfs:Update typeName="{lyaer_id}">'.replace( - "{lyaer_id}", - this.layerId - ); - $(i).each(function () { - t += - "<wfs:Property><wfs:Name>" + - this + - "</wfs:Name><wfs:Value>" + - e[this] + - "</wfs:Value></wfs:Property>"; - }), - (t += - '<ogc:Filter><ogc:FeatureId fid="' + - e.originFid + - '"/></ogc:Filter>'), - (n += t += "</wfs:Update>"); - }), - (r = - "<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>".replace( - "{wfs_updates}", - n - )), - (a = "Failed to save changes to server"), - (e = fl(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, - })); - }), - (W.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:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>"), - a = - ((n = (n = n.replace("{layer_name}", this._layerName)).replace( - "{REQUEST_MAX_FEATURES}", - 1e3 - )), - ""), - e = - ("" != e.replace(/[ ]/g, "") && - (a = - (a = - "<ogc:Filter xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>") + - (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 = - "<ogc:" + - o + - ("like" == t.operator.toLowerCase() - ? ' wildCard="*" singleChar="*" escape="*"' - : "") + - ">"; - n += "<ogc:PropertyName>" + r + "</ogc:PropertyName>"; - var a = - null == - (r = (r = - -1 != i.indexOf(t.right) ? t.left : t.right).replace( - /^'|'$$/g, - "" - )).match(/^[%]|[%]$$/); - return (n = - n + - ("<ogc:Literal>" + - (r = - "like" == t.operator.toLowerCase() && a - ? "%" + r + "%" - : r)) + - "</ogc:Literal></ogc:" + - o + - ">"); - } - (a = "and" == t.logic.toLowerCase() ? "And" : "Or"), - (n = "<ogc:" + a + ">"); - 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) + "</ogc:" + a + ">") - ); - })( - i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE " + e).WHERE, - o - ) + - "</ogc:Filter>"), - (n = n.replace("{wfs_filter}", a)), - fl(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, - }); - }), - (W.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 - ); - }), - (W.prototype.refresh = function (e) { - let t = this._tileManager.getAllTiles(); - if (t) { - var i = t.length; - for (let e = 0; e < i; e++) - t[e].data.wfsLayerData[this._guid] && - t[e].data.wfsLayerData[this._guid].freeResources(), - this.loadTile(t[e]); - e && yl(this); - } - }), - (W.prototype.setVisibility = function (e) { - if (this._visible != e) - if ( - ((this._visible = e), - 0 == (this._tileManager.tileLevel[this._guid].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])); - }), - (W.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)); - }), - (W.prototype.isDestroyed = function () { - return !1; - }), - (W.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( - W.prototype.loadTile, - this - ), - Cesium.destroyObject(this) - ); - }), - (W.prototype.sTag = function (e, t, i) { - if (null == this._subdomains) return ""; - e = (e + t + i) % this._subdomains.length; - return this._subdomains[e]; - }), - (W.prototype.cleanUrl = function (e) { - return -1 != e.indexOf("?") ? e.split("?")[0] : e; - }), - (W.prototype.beginLoadWFSData = function (t) { - if ( - (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)) - ) { - var e = [ - bl * t.rectangle.west, - bl * t.rectangle.south, - bl * t.rectangle.east, - bl * t.rectangle.north, - ], - i = this, - o = this.cleanUrl(this._url).replace( - "{s}", - this.sTag(t.x, t.y, t.level) - ); - o += Cl(o); - o += - "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName=" + - this._layerName + - "&srsName=EPSG:4326&BBOX=" + - e.join(","); - e = Cesium.TrustedServers.contains(fl(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, "GML2"); - }, - 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; - }, - }); - } - }), - (W.prototype.processWFSData = function (e, t, i) { - var o; - (e.data.wfsLayerData[this._guid].xhr = void 0), - this._useWorkers - ? wl - .queueWorkItem({ - id: e.data.id, - text: t, - format: i, - geometryFieldName: (o = this)._geometryFieldName, - }) - .then(function (e) { - o.addFeaturesToTile(e); - }) - : ((i = this._gmlParser.read(t)), - this.addFeaturesToTile({ id: e.data.id, features: i })); - }), - (W.prototype.boundingSphereFromGML = function (e, i) { - var t = viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel, - o = this; - wl.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); - }); - }), - (W.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 - ); - }), - (W.prototype.addRenderedFeatureId = function (e) { - null == this._addedFeatures[e] && (this._addedFeatures[e] = 0), - this._addedFeatures[e]++; - }), - (W.prototype.removeRenderedFeatureId = function (i, o) { - if (o && o.geometryType && o.geometryType.includes("multi")) - for (let e = 0, t; e < o.positions.length; e++) - (t = i + "." + e), - null != this._addedFeatures[t] && this._addedFeatures[t]--, - 0 == this._addedFeatures[t] && (this._addedFeatures[t] = void 0); - else - null != this._addedFeatures[i] && this._addedFeatures[i]--, - 0 == this._addedFeatures[i] && (this._addedFeatures[i] = void 0); - }), - (W.prototype.isExistRenderedFeatureId = function (e) { - return null != this._addedFeatures[e]; - }), - (W.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)); - }), - (W.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++; - }), - (W.prototype.removeFeaturesFromLayer = function (e) { - (this._statistics.numberOfDeletedFeatures += e.length), - (this._statistics.numberOfDeletedPositions += Cesium.defaultValue( - e.numPositions, - 0 - )); - for (var t, i = e.length, o = 0; o < i; o++) - (t = e[o].fid), - !1 !== Object.prototype.hasOwnProperty.call(this._featuresMap, t) && - (this._featuresMap[t].refCount--, - 0 === this._featuresMap[t].refCount && delete this._featuresMap[t], - this.removeRenderedFeatureId(t, e[o])); - }), - (W.prototype.getFeature = function (e) { - return !1 === Object.prototype.hasOwnProperty.call(this._featuresMap, e) - ? null - : this._featuresMap[e]; - }), - (W.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)); - }), - (W.blockRequestPrimitiveFromPrimitive = function (e) { - var t; - if (null != e) - return ( - (t = vl(e)), - null == t && - (e._labelCollection && e._labelCollection._billboardCollection - ? (t = vl(e._labelCollection._billboardCollection)) - : e._billboardCollection && (t = vl(e._billboardCollection))), - t - ); - }), - (W.prototype.resetAttributesTable = function () { - (this.lastEditedCell = null), (this.attrTblDialogMemo = null); - }), - (Tl.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 = { - preLoad: t.preLoad, - lineToGround: { - defaultValue: t.lineToGround - ? t.lineToGroundLength - ? "2" - : "1" - : "0", - }, - lineToGroundLength: { defaultValue: t.lineToGroundLength || 0 }, - lineToGroundColor: { - defaultValue: { red: 1, green: 1, blue: 1, alpha: 1 }, - }, - altitudeMethod: 0, - altitudeOffset: { defaultValue: "0" }, - clampToGround: this._core.defaultValue(t.clampToGround, !1), - pointHeight: this._core.defaultValue(t.height, void 0), - }), - 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: 0.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) - : ((o = this.colorTool.colorRgb( - this._core.defaultValue(t.color, "#ffff00") - )), - { - preLoad: t.preLoad, - polyline: { - material: { - red: o[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), - classificationType: t.classificationType, - dash: t.dash, - gapColor: - t.gapColor && Cesium.Color.fromCssColorString(t.gapColor), - dashLength: t.dashLength, - }, - height: t.height, - })) - : "polygon" === e && - (t.sgStyleJSON - ? (i = this.getSGStyle("polygon", t.sgStyleJSON, t.name)) - : ((o = this.colorTool.colorRgb( - this._core.defaultValue(t.color, "#6bbeef") - )), - (r = this.colorTool.colorRgb( - this._core.defaultValue(t.outlineColor, "#ffffff") - )), - (i = { - preLoad: t.preLoad, - pointHeight: this._core.defaultValue(t.pointHeight, void 0), - polygon: { - text: !!t.text, - labelNear: t.labelNear, - labelFar: t.labelFar, - offsetPoint: t.offsetPoint, - outlineColor: { - defaultValue: { - red: r[0] / 255, - green: r[1] / 255, - blue: r[2] / 255, - alpha: 1, - }, - }, - outlineWidth: t.outlineWidth, - 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 - ), - classificationType: t.classificationType, - water: t.water, - bulidingWall: t.bulidingWall, - bulidingWallWidth: t.bulidingWallWidth, - randomColor: t.randomColor, - colorConfig: t.colorConfig, - 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, - }, - }), - t.text && - (i.label = { - style: Cesium.LabelStyle.FILL_AND_OUTLINE, - text: { defaultValue: t.text }, - scaleMPP: { defaultValue: "15000" }, - fillColor: { - defaultValue: Cesium.Color.fromCssColorString( - this._core.defaultValue( - t.labelColor || t.color, - "#ffffff" - ) - ), - }, - scaleByDistance: { - near: 150, - nearValue: 1, - far: 8e5, - farValue: 0.5, - }, - minViewingHeight: { defaultValue: "0" }, - font: { defaultValue: "12" }, - family: { - defaultValue: this._core.defaultValue(t.font, "Arial"), - }, - backgroundColor: { - defaultValue: { red: 0, green: 0, blue: 0, alpha: 0 }, - }, - 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.labelOutlineColor || t.outlineColor, - "#ffffff" - ) - ), - outlineWidth: this._core.defaultValue(t.scale, 2), - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - disableDepthTestDistance: - "Infinity" === t.disableDepthTestDistance - ? Number.POSITIVE_INFINITY - : t.disableDepthTestDistance, - }))), - i || !t.sgStyleJSON) - ) - return ( - i.position_x && - ((t.lon = i.position_x), - (t.lat = i.position_y), - (t.height = i.position_z)), - new W( - 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 + "鑾峰彇鏍峰紡澶辫触锛�"); - }), - (Tl.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)) - ); - }), - (Tl.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(/<Value>(\S*)<\/Value>/)[1], - t.Text.match(/<DefaultValue>(\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), - classificationType: option.classificationType, - }, - 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, - classificationType: option.classificationType, - 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 - ); - }); - Xt = function (e, t, i) { - return t && Sl(e.prototype, t), i && Sl(e, i), e; - }; - function Sl(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 Pl() { - var e = - arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0], - t = this, - i = Pl; - 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 xl(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F); - } - function Dl(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F); - } - (El.prototype.BaiduImageryProvider = - (Xt(Pl, [ - { 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; - }, - }, - ]), - Pl)), - (xl.prototype.createBillboard = function (e = {}) { - var t = this._core.defaultValue(e.id, this._core.getuid()), - i = { - horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, - verticalOrigin: this._cesium.VerticalOrigin.BOTTOM, - scale: e.scale || 1, - image: e.image, - color: this._cesium.Color.WHITE, - disableDepthTestDistance: 1 / 0, - distanceDisplayCondition: e.distanceDisplayCondition, - }; - let o; - if (e.text) - switch ( - ((o = { - text: e.text, - font: `${e.fontSize || 12}px 寰蒋闆呴粦`, - pixelOffset: e.fontOffset, - fillColor: Cesium.Color.fromCssColorString(e.fontColor || "#fff"), - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.CENTER, - disableDepthTestDistance: 1 / 0, - distanceDisplayCondition: e.distanceDisplayCondition, - }), - e.textLocation) - ) { - case "left": - o.horizontalOrigin = Cesium.HorizontalOrigin.LEFT; - break; - case "right": - o.horizontalOrigin = Cesium.HorizontalOrigin.RIGHGT; - break; - case "up": - o.verticalOrigin = Cesium.VerticalOrigin.TOP; - break; - case "down": - o.verticalOrigin = Cesium.VerticalOrigin.BOTTOM; - } - return ( - (this.item = this._viewer.entities.add({ - id: t, - show: e.visibility, - position: Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), - label: o, - billboard: i, - })), - (this.item.objectType = "Billboard"), - e.data && (this.item.data = e.data), - this - ); - }), - (xl.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; - }), - (xl.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, - }, - }; - }), - (xl.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (xl.prototype.setVisibility = function (e) { - this.item && (this.item.show = b); - }), - (xl.prototype.deleteObject = function () { - this.item && this._viewer.entities.remove(this.item), - (this.item = void 0); - }), - (Dl.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 Il = new v(); - function Al(e, t) { - (this._viewer = e), - (this.videoContainer = - t.videoContainer || (t.video && t.video.container)), - (this.prop = t.prop), - (this.cameraPosition = - t.cameraPosition.x && t.cameraPosition.y && t.cameraPosition.z - ? t.cameraPosition - : Cesium.Cartesian3.fromDegrees( - t.cameraPosition.lon, - t.cameraPosition.lat, - t.cameraPosition.height - )), - (this.position = - t.position && - (t.position instanceof Cesium.Cartesian3 - ? t.position - : Cesium.Cartesian3.fromDegrees( - t.position.lon, - t.position.lat, - t.position.height - ))), - (this.heading = t.heading || 0), - (this.pitch = t.pitch || 0), - (this.alpha = t.alpha || 0.9), - (this.horizonAngle = t.horizonAngle || 60), - (this.verticalAngle = t.verticalAngle || 40), - (this.far = t.far || 30), - (this.showFarScale = t.showFarScale || 5), - (this.show = !0), - (this.useLine = Cesium.defaultValue(t.useLine, !0)), - this._viewer.scene.primitives.add(this), - this.init(); - } - (Al.prototype.createViewCone = function () { - this.line && - (this._viewer.scene.primitives.remove(this.line), (this.line = null)), - this.useLine && - ((this.line = new Cesium.Primitive({ - geometryInstances: new Cesium.GeometryInstance({ - geometry: new Cesium.FrustumOutlineGeometry(this.cameraData), - attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), - }, - }), - appearance: new Cesium.PerInstanceColorAppearance({ - translucent: !1, - flat: !0, - }), - asynchronous: !1, - allowPicking: !1, - })), - this._viewer.scene.primitives.add(this.line)); - }), - (Al.prototype.createVideoPlane = function () { - var t = new Float64Array(24); - Cesium.FrustumGeometry._computeNearFarPlanes( - this.cameraData.origin, - this.cameraData.orientation, - 0, - this.cameraData.frustum, - t - ); - let i = []; - for (let e = 12; e < t.length; e += 3) i.push(t[e], t[e + 1], t[e + 2]); - this.plan && this.plan.destroy(); - let e = Cesium.Material.fromType("Image"); - (e.uniforms.image = this.videoContainer), - (e.uniforms.color.alpha = this.alpha), - (this.plan = new Cesium.Primitive({ - geometryInstances: new Cesium.GeometryInstance({ - geometry: new Cesium.Geometry({ - attributes: { - position: new Cesium.GeometryAttribute({ - componentDatatype: Cesium.ComponentDatatype.DOUBLE, - componentsPerAttribute: 3, - values: i, - }), - st: new Cesium.GeometryAttribute({ - componentDatatype: Cesium.ComponentDatatype.FLOAT, - componentsPerAttribute: 2, - values: [0, 0, 1, 0, 1, 1, 0, 1], - }), - }, - indices: [0, 1, 2, 0, 2, 3], - primitiveType: Cesium.PrimitiveType.TRIANGLES, - boundingSphere: Cesium.BoundingSphere.fromVertices(i), - }), - id: this.prop, - }), - appearance: new Cesium.MaterialAppearance({ flat: !0, material: e }), - })); - }), - (Al.prototype.isShow = function () { - return ( - this.show && - Il.getPointToCameraDistance(this._viewer, this.cameraPosition) < - this.far * this.showFarScale - ); - }), - (Al.prototype.init = function () { - this.plan || - (this.createCamera(), this.createVideoPlane(), this.createViewCone()); - }), - (Al.prototype.createCamera = function () { - let e = this.videoCamera || new Cesium.Camera(this._viewer.scene); - (e.frustum.fov = Cesium.Math.toRadians(this.horizonAngle)), - (e.frustum.aspectRatio = this.horizonAngle / this.verticalAngle), - (e.frustum.near = 1), - (e.frustum.far = this.far), - this.position - ? ((e.position = this.cameraPosition), - (e.direction = Cesium.Cartesian3.subtract( - this.position, - this.cameraPosition, - new Cesium.Cartesian3(0, 0, 0) - )), - (e.up = Cesium.Cartesian3.normalize( - this.cameraPosition, - new Cesium.Cartesian3(0, 0, 0) - )), - (t = Cesium.Cartesian3.normalize( - Cesium.Cartesian3.subtract( - this.position, - this.cameraPosition, - new Cesium.Cartesian3() - ), - new Cesium.Cartesian3() - )), - (e.direction = t), - (this.heading = Cesium.Math.toDegrees(e.heading)), - (this.pitch = Cesium.Math.toDegrees(e.pitch)), - (this.position = null)) - : e.setView({ - destination: this.cameraPosition, - orientation: { - heading: Cesium.Math.toRadians(this.heading), - pitch: Cesium.Math.toRadians(this.pitch), - roll: 0, - }, - }); - var t = new Cesium.Cartesian3(), - i = new Cesium.Matrix3(), - o = new Cesium.Quaternion(), - r = e.positionWC, - n = e.upWC, - a = e.rightWC, - a = Cesium.Cartesian3.negate(a, t), - t = i, - i = - (Cesium.Matrix3.setColumn(t, 0, a, t), - Cesium.Matrix3.setColumn(t, 1, n, t), - Cesium.Matrix3.setColumn(t, 2, e.direction, t), - Cesium.Quaternion.fromRotationMatrix(t, o)); - (this.videoCamera = e), - (this.cameraData = { orientation: i, origin: r, frustum: e.frustum }); - }), - (Al.prototype.flyTo = function () { - this.videoCamera && - this._viewer.camera.flyTo({ - destination: this.videoCamera.position, - orientation: { - heading: this.videoCamera.heading, - pitch: this.videoCamera.pitch, - roll: 0, - }, - }); - }), - (Al.prototype.updatePost = function (e) { - e.cameraPosition && - (this.cameraPosition = - e.cameraPosition instanceof Cesium.Cartesian3 - ? e.cameraPosition - : Cesium.Cartesian3.fromDegrees( - e.cameraPosition.lon, - e.cameraPosition.lat, - e.cameraPosition.height - )), - e.position && - (this.position = - e.position instanceof Cesium.Cartesian3 - ? e.position - : Cesium.Cartesian3.fromDegrees( - e.position.lon, - e.position.lat, - e.position.height - )), - isNaN(e.heading) || - "number" != typeof e.heading || - (this.heading = e.heading), - isNaN(e.pitch) || "number" != typeof e.pitch || (this.pitch = e.pitch), - isNaN(e.alpha) || "number" != typeof e.alpha || (this.alpha = e.alpha), - isNaN(e.horizonAngle) || - "number" != typeof e.horizonAngle || - (this.horizonAngle = e.horizonAngle), - isNaN(e.verticalAngle) || - "number" != typeof e.verticalAngle || - (this.verticalAngle = e.verticalAngle), - isNaN(e.far) || "number" != typeof e.far || (this.far = e.far), - isNaN(e.showFarScale) || - "number" != typeof e.showFarScale || - (this.showFarScale = e.showFarScale), - void 0 !== e.useLine && (this.useLine = e.useLine), - e.prop && (this.prop = e.prop), - this.createCamera(), - this.createVideoPlane(), - this.createViewCone(); - }), - (Al.prototype.update = function (e) { - var t; - this.plan && - this.show && - ((t = this.isShow()), - this.plan && (this.plan.show = t), - this.line && (this.line.show = t), - this.plan.update(e)); - }), - (Al.prototype.setVisibility = function (e) { - (this.show = e), - this.plan && (this.plan.show = e), - this.line && (this.line.show = e); - }), - (Al.prototype.destroy = function () { - return ( - this.plan && (this.plan.destroy(), (this.plan = void 0)), - this._viewer.scene.primitives.remove(this), - this.line && - (this._viewer.scene.primitives.remove(this.line), (this.line = null)), - Cesium.destroyObject(this) - ); - }); - let Y = { - 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 Ll, - Ml = !1, - Rl = !1, - Ol = Math.floor(204), - Bl = [NaN, NaN, null], - Fl = null, - Hl = null, - Vl = [], - Gl = [ - [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 kl() { - for (var a = {}, e = Math.round(7 * Ll.width), s = [], t = 0; t < e; t++) - s.push(Ql({ age: Kl(0, 100) })); - var i = Ll.valMax - Ll.valMin; - i /= Fl.length - 1; - for (t = 0; t < Fl.length; t++) Fl[t][0] = Ll.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 - ); - }; - })(Fl); - (Ml = !1), - Y.oceanCtx.clearRect(0, 0, Y.oceanCanvas.width, Y.oceanCanvas.height), - (function e() { - try { - if (!Ml && !Rl) { - if ( - ((a = []), - s.forEach(function (e) { - 100 < e.age && - ((e.xt = void 0), (e.yt = void 0), (Ql(e).age = 0)), - e.xt && e.yt && ((e.x = e.xt), (e.y = e.yt)); - var t = e.x, - i = e.y, - o = Yl(t, i), - r = o[2]; - null === r - ? (e.age = 100) - : Jl((t = t + o[0]), (i = i + o[1])) - ? ((e.xt = t), - (e.yt = i), - (r = - "rgba(" + - (o = l(r, Ol))[0] + - ", " + - o[1] + - ", " + - o[2] + - ", " + - Ol + - ")"), - null == a[r] && (a[r] = []), - a[r].push(e)) - : ((e.x = t), (e.y = i)), - (e.age += 1); - }), - !Rl) - ) { - var t, - i = Y.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, Y.oceanCanvas.width, Y.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"); - } - } - } - Hl = setTimeout(e, 30); - } - } catch (e) {} - })(); - } - function Nl(e) { - (Fl = e.color || Gl), - (Y.oceanWorker = new Worker( - SmartEarthRootUrl + "Workers/field/oceanWorker.js" - )), - (Y.oceanWorker.onmessage = function (e) { - var t = e.data; - switch (t.type) { - case "success": - break; - case "draw": - (Ll = t.data), (Vl = Ll.drawData), kl(); - } - }), - Y.oceanWorker.postMessage(e.message); - } - function jl(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 != Y.canvas && (Y.canvas.remove(), (Y.canvas = null)), - (Y.canvas = document.createElement("canvas")), - (Y.canvas.width = n), - (Y.canvas.height = t); - for ( - var t, - i, - o, - r, - n = Y.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 = Y.cesium.Rectangle.fromDegrees(i, o, r, t)), - (o = new Y.cesium.ImageMaterialProperty({ - image: Y.canvas, - transparent: !0, - })), - (mlayer = Y.viewer.entities.add({ - show: !0, - rectangle: { coordinates: i, material: o }, - })), - (Y.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 zl(e) { - var t = { x: 0, y: 0, z: 0 }; - return (t.x = e.x), (t.y = e.y), (t.z = e.z), t; - } - function Ul() { - for ( - var e = Y.viewer.scene, - t = e.camera, - i = [], - o = [], - r = zl(t.positionWC), - n = zl(t.directionWC), - a = zl(t.rightWC), - s = zl(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 Wl(t, i) { - switch (t.type) { - case "single": - jl( - { id: 0, ncpath: t.ncpath, variable: t.variable, depth: t.depth }, - i - ); - break; - case "mfile": - jl( - { - 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++) - jl({ - 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 = Ul()), - null == Y.oceanCanvas - ? ((Y.oceanCanvas = document.createElement("canvas")), - (Y.oceanCanvas.width = o.width), - (Y.oceanCanvas.height = o.height), - (Y.oceanCanvas.id = "animation"), - (Y.oceanCanvas.style = - "position: absolute;left: 0px;top: 0px;pointer-events: none;"), - document - .getElementsByClassName("cesium-widget")[0] - .appendChild(Y.oceanCanvas), - (Y.oceanCtx = Y.oceanCanvas.getContext("2d")), - Nl({ - message: { - id: e.id, - type: "init", - upath: e.upath, - vpath: e.vpath, - scene: o, - }, - callback: function (e) {}, - }), - Y.viewer.scene.camera.moveStart.addEventListener(function () { - Hl && clearTimeout(Hl), - (Hl = null) != Y.oceanWorker && - (Y.oceanWorker.postMessage({ type: "stop" }), - (Rl = !0), - (Vl = []), - Y.oceanCtx.clearRect( - 0, - 0, - Y.oceanCanvas.width, - Y.oceanCanvas.height - )); - }), - Y.viewer.scene.camera.moveEnd.addEventListener(function () { - null != Y.oceanWorker && - ((Rl = !1), - Y.oceanWorker.postMessage({ type: "update", scene: Ul() })); - })) - : Nl({ - message: { - id: e.id, - type: "init", - upath: e.upath, - vpath: e.vpath, - scene: o, - }, - callback: function (e) {}, - }); - break; - default: - jl({ id: 0, ncpath: t.ncpath, variable: t.variable, depth: t.depth }); - } - var e, o; - } - function Yl(e, t) { - e = Vl[Math.round(e)]; - return (e && e[Math.round(t)]) || Bl; - } - function Jl(e, t) { - return null !== Yl(e, t)[2]; - } - function Kl(e, t) { - return ( - null == t && ((t = e), (e = 0)), - e + Math.floor(Math.random() * (t - e + 1)) - ); - } - function Ql(e) { - for ( - var t, i, o = 0; - !Jl( - (t = Math.round(Kl(0, Y.viewer.scene.canvas.clientWidth))), - (i = Math.round(Kl(0, Y.viewer.scene.canvas.clientHeight))) - ) && o++ < 30; - - ); - return (e.x = t), (e.y = i), e; - } - function ql(e, t) { - (Y.viewer = e), (Y.cesium = t); - } - function Xl(e, t = {}) { - for (var i in ((this._viewer = e), - (this._cache = {}), - (this.option = { - id: dn(), - size: 18, - pixelRange: 40, - gradient: { - 1e-4: "rgb(0,191,255)", - 0.001: "rgb(0,128,0)", - 0.01: "rgb(255,165,0)", - 0.1: "rgb(255,0,0)", - }, - fontSize: 12, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - fontColor: "rgb(0,0,0)", - style: "circle", - ...t, - }), - this.option.gradient)) - this.option.gradient[i] = Cesium.Color.fromCssColorString( - this.option.gradient[i] - ); - (this.dataSource = new Cesium.CustomDataSource(this.option.id)), - (this.dataSource.clustering.enabled = !0), - (this.dataSource.clustering.pixelRange = this.option.pixelRange), - this.dataSource.clustering.clusterEvent.addEventListener( - this._clusterEventHandler, - this - ), - this._viewer.dataSources.add(this.dataSource); - } - (Y.hide = function () { - (Y.showid || 0 == Y.showid) && - Y.layers[Y.showid] && - (Y.layers[Y.showid].show = !1); - }), - (Y.show = function (e) { - (Y.showid || 0 == Y.showid) && - Y.layers[Y.showid] && - (Y.layers[Y.showid].show = !1), - (e || 0 == e) && - Y.layers[e] && - ((Y.layers[e].show = !0), (Y.showid = e)); - }), - (Y.draw = function (e, t) { - Wl(e, t); - }), - (Y.destroy = function () { - try { - for (var e = 0; e < Y.layers.length; e++) - Y.viewer.entities.remove(Y.layers[e]); - Y.layers = []; - } catch (e) {} - try { - for (e = 0; e < Y.workers.length; e++) - try { - Y.workers[e].terminate(); - } catch (e) {} - Y.workers = []; - } catch (e) {} - try { - Hl && clearTimeout(Hl), (Hl = null); - } catch (e) {} - try { - Y.oceanWorker.terminate(), - (Y.oceanWorker = null), - Y.oceanCtx.clearRect(0, 0, Y.oceanCanvas.width, Y.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; - }), - (ql.prototype.createField = function (e, t) { - return Y.draw(e, t), this; - }), - (ql.prototype.destroy = function () { - Y.destroy(); - }), - (ql.prototype.remove = function () { - Y.destroy(); - }), - (Xl.prototype.add = function (e, t = {}) { - return this.dataSource.entities.add({ - id: t.id || dn(), - name: t.name, - position: Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), - billboard: { - image: t.image || window.SmartEarthRootUrl + I.mark1, - scale: t.scale || 1, - horizontalOrigin: this.option.horizontalOrigin, - verticalOrigin: this.option.verticalOrigin, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - }), - (Xl.prototype._drawCircle = function (i, o) { - var r = o.length, - n = this.option.size * (r + 1), - a = i.toCssColorString() + "-" + n, - r = n / 2 - (r * this.option.fontSize) / 3, - s = (n + this.option.fontSize) / 2; - if (!this._cache[a]) { - let e = document.createElement("canvas"), - t = ((e.width = n), (e.height = n), e.getContext("2d")); - t.save(), - t.scale(n / 24, n / 24), - (t.fillStyle = i.withAlpha(0.2).toCssColorString()), - t.beginPath(), - t.arc(12, 12, 9, 0, 2 * Math.PI), - t.closePath(), - t.fill(), - t.beginPath(), - t.arc(12, 12, 6, 0, 2 * Math.PI), - (t.fillStyle = i.toCssColorString()), - t.fill(), - t.closePath(), - t.restore(), - (t.font = `bold ${this.option.fontSize}px sans-serif`), - (t.fillStyle = this.option.fontColor), - t.fillText(o, r, s), - (this._cache[a] = e.toDataURL()); - } - return this._cache[a]; - }), - (Xl.prototype._drawClustering = function (i, o) { - var r = o.length, - n = this.option.size * (r + 1), - a = i.toCssColorString() + "-" + n, - r = n / 2 - (r * this.option.fontSize) / 3, - s = (n + this.option.fontSize) / 2; - let l = -Math.PI / 12; - var u = Math.PI / 2, - c = Math.PI / 6; - if (!this._cache[a]) { - let e = document.createElement("canvas"), - t = ((e.width = n), (e.height = n), e.getContext("2d")); - t.save(), - t.scale(n / 24, n / 24), - t.beginPath(), - t.arc(12, 12, 6, 0, 2 * Math.PI), - (t.fillStyle = i.toCssColorString()), - t.fill(), - t.closePath(), - (t.lineWidth = 2); - for (let e = 0; e < 3; e++) - t.beginPath(), - t.arc(12, 12, 8, l, l + u, !1), - (t.strokeStyle = i.withAlpha(0.4).toCssColorString()), - t.stroke(), - t.arc(12, 12, 11, l, l + u, !1), - (t.strokeStyle = i.withAlpha(0.2).toCssColorString()), - t.stroke(), - t.closePath(), - (l = l + u + c); - t.restore(), - (t.font = `bold ${this.option.fontSize}px sans-serif`), - (t.fillStyle = this.option.fontColor), - t.fillText(o, r, s), - (this._cache[a] = e.toDataURL()); - } - return this._cache[a]; - }), - (Xl.prototype._clusterEventHandler = function (e, t) { - if ( - this.dataSource.clustering.enabled && - ((t.billboard.show = !0), - (t.label.show = !1), - (t.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY), - this.dataSource.entities.values.length) - ) { - var i, - o, - r = this.dataSource.entities.values.length || 0; - for (i in this.option.gradient) - e.length >= r * i && - ((o = String(e.length)), - "circle" === this.option.style - ? (t.billboard.image = this._drawCircle( - this.option.gradient[i], - o - )) - : (t.billboard.image = this._drawClustering( - this.option.gradient[i], - o - ))); - } - }), - (Xl.prototype.clear = function () { - this.dataSource.entities.removeAll(), (this._cache = {}); - }), - (Xl.prototype.setVisibility = function (e) { - this.dataSource && (this.dataSource.show = e); - }), - (Xl.prototype.deleteObject = function () { - this.clear(), - this._viewer.dataSources.remove(this.dataSource), - Cesium.destroyObject(this); - }), - Object.defineProperties(Xl.prototype, { - enableCluster: { - set: function (e) { - this.dataSource.clustering.enabled = e; - }, - get: function () { - return this.dataSource.clustering.enabled; - }, - }, - }); - var Zl = - "uniform sampler2D colorTexture;\nuniform float brightness;\nuniform float contrast;\nuniform float saturation;\nvarying vec2 v_textureCoordinates;\nvec3 lerp(vec3 from, vec3 to, float t)\n{\nvec3 tmp;\ntmp.r = from.r + ( to.r - from.r ) * t;\ntmp.g = from.g + ( to.g - from.g ) * t;\ntmp.b = from.b + ( to.b - from.b ) * t;\nreturn tmp;\n}\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 adjustment = rgb * brightness;\nfloat gray = 0.2125 * adjustment.r + 0.7154 * adjustment.g + 0.0721 * adjustment.b;\nvec3 grayColor = vec3(gray);\nadjustment = lerp(grayColor, adjustment, saturation);\nvec3 avgColor = vec3(0.5);\nadjustment = lerp(avgColor, adjustment, contrast);\ngl_FragColor = vec4(adjustment, 1.0);\n}\n"; - function $l(e) { - return ( - e.scene.colorAdjustment || - ((this.item = new Cesium.PostProcessStage({ - name: "czm_colorAdjustment", - fragmentShader: Zl, - uniforms: { brightness: 1, contrast: 1, saturation: 1 }, - })), - (this.item.enabled = !0), - e.scene.postProcessStages.add(this.item), - (e.scene.colorAdjustment = this)) - ); - } - function eu(e) { - (this._viewer = e), (this._core = new v()), (this._tree = F); - } - function tu(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F); - } - function iu(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 ou() { - (this._core = new v()), - (this.level = 0), - (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.tileLevel = {}), - (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), - ou.prototype.ready || - Object.defineProperties(ou.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 ru(i, e, o) { - $.each(e._primitives, function (e, t) { - if (t instanceof Cesium.BillboardCollection) - return ( - (e = hu.indexOf((t = t))), - (t._parentCollection._primitiveOld = o), - -1 !== e - ? (i.scene.primitives.remove(hu[e]._parentCollection), (hu[e] = t)) - : hu.push(t), - !1 - ); - }); - } - function nu(e, t, i) { - e.scene.primitives.remove(i), - (t._onDestroyTilePrimitive = function () { - e.scene.primitives.remove(i), (this._onDestroyTilePrimitive = void 0); - }); - } - function au(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 su(e, t, i) { - au( - e, - $.map(t._primitives, function (e) { - return e.readyPromise; - }), - t, - i - ); - } - function lu(e, t, i) { - au( - e, - $.map(t._primitives[0]._primitives, function (e) { - return e.readyPromise; - }), - t, - i - ); - } - function uu(e, t, i) { - e.scene.primitives.remove(i); - } - function cu(e, t, i) { - au(e, [t.readyPromise], t, i); - } - Object.defineProperties($l.prototype, { - brightness: { - get: function () { - return this.item.uniforms.brightness; - }, - set: function (e) { - this.item.uniforms.brightness = e; - }, - }, - contrast: { - get: function () { - return this.item.uniforms.contrast; - }, - set: function (e) { - this.item.uniforms.contrast = e; - }, - }, - saturation: { - get: function () { - return this.item.uniforms.saturation; - }, - set: function (e) { - this.item.uniforms.saturation = e; - }, - }, - }), - (eu.prototype.create = function (e, t, i = {}) { - (this.angle = (i.angle || 10) / 2), - (this.heading = this.pitch = this.roll = 0); - let o = { - subdivisions: 6, - stackPartitions: 30, - slicePartitions: 30, - 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(0.2), - outlineColor: Cesium.Color.WHITE.withAlpha(0.2), - maximumCone: new Cesium.CallbackProperty( - () => Cesium.Math.toRadians(-this.angle), - !1 - ), - minimumCone: new Cesium.CallbackProperty( - () => Cesium.Math.toRadians(this.angle), - !1 - ), - }, - r = - (i.color && (o.material = Cesium.Color.fromCssColorString(i.color)), - i.outlineColor && - (o.outlineColor = Cesium.Color.fromCssColorString(i.outlineColor)), - e instanceof Cesium.Entity ? e : void 0), - n = t instanceof Cesium.Entity ? t : void 0; - r - ? (this.startPosition = r.position.getValue( - this._viewer.clock.currentTime.clone() - )) - : (this.startPosition = e), - (this.degrees1 = this._core.toDegrees(this.startPosition)), - n - ? (this.endPosition = n.position.getValue( - this._viewer.clock.currentTime.clone() - )) - : (this.endPosition = t), - (this.degrees2 = this._core.toDegrees(this.endPosition)), - (this.item = this._viewer.entities.add({ - position: new Cesium.CallbackProperty( - () => ( - r && - ((this.startPosition = r.position.getValue( - this._viewer.clock.currentTime.clone() - )), - (this.degrees1 = this._core.toDegrees(this.startPosition))), - n && - ((this.endPosition = n.position.getValue( - this._viewer.clock.currentTime.clone() - )), - (this.degrees2 = this._core.toDegrees(this.endPosition))), - (r || n) && - ((this.radius = Cesium.Cartesian3.distance( - this.startPosition, - this.endPosition - )), - this.updateOrientation()), - this.startPosition - ), - !1 - ), - ellipsoid: o, - })), - (this.radius = Cesium.Cartesian3.distance( - this.startPosition, - this.endPosition - )), - this.updateOrientation(); - i = { - id: this.item.id, - name: "閿ュ舰浼犳劅鍣�", - pId: 0, - type: "ellipsoid", - item: this, - }; - return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this; - }), - (eu.prototype.getOrientation = function () { - var e = this._core.twoPointsHeadingPitchRoll( - this._viewer, - this.startPosition, - this.endPosition - ); - (this.heading = Cesium.Math.toDegrees(e.heading) + 90), - (this.pitch = 90 - Cesium.Math.toDegrees(e.pitch)); - }), - (eu.prototype.updateOrientation = function () { - this.getOrientation(), - (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)) - ) - )); - }), - (eu.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(); - }), - (eu.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(); - }), - (eu.prototype.changeAngle = function (e) { - this.angle = e / 2; - }), - (eu.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (eu.prototype.setVisibility = function (e) { - this.item && (this.item.show = e); - }), - (eu.prototype.deleteObject = function () { - this._viewer.entities.remove(this.item); - }), - (tu.prototype.createCorridor = function (e, t, i, o) { - var r = { - show: !0, - material: this._cesium.Color.RED.withAlpha(0.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"); - }), - (tu.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 - ); - }), - (tu.prototype.setVisibility = function (e) { - this.item.show = e; - }), - (tu.prototype.getVisibility = function () { - return this.item.show; - }), - (tu.prototype.deleteObject = function () { - this._viewer.entities.remove(this.item); - }), - (tu.prototype.setItem = function (e) { - this.item = e; - }), - (tu.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - Object.defineProperties(iu.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; - }, - }, - }), - (iu.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; - }), - (iu.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; - }), - (iu.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; - }), - (iu.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, - ]; - }, - }), - (iu.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; - }), - (iu.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; - }), - (ou.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 hu = [], - mu = 0, - du = - ((ou.prototype.onPreFrame = function (e, t) { - if ((mu++, !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 && - mu % 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(hu, function (e, t) { - t.ready && - this.viewer.scene.primitives.remove( - t._parentCollection._primitiveOld - ); - }); - } - }), - (ou.prototype.updateForPick = function (e) {}), - Math.PI, - (ou.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 - - 0.99 * TerraExplorer.internal.Navigate.HeightAboveGround, - }), - attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor(t), - }, - }), - appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }), - }); - e.data.primitive.add(t); - }), - (ou.prototype.getTile = function (e) { - return this._tileCache[e]; - }), - (ou.prototype.getAllTiles = function () { - var e, - t = []; - for (e in this._tileCache) t.push(this._tileCache[e]); - return t; - }), - (ou.prototype.addToScene = function (e) { - this._primitivesWaitingToBeAddedToTheScene.push(e); - }), - (ou.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); - }), - (ou.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": - ru(this.viewer, t, e); - break; - case "labels": - nu(this.viewer, t, e); - break; - case "polygons": - su(this.viewer, t, e); - break; - case "models": - lu(this.viewer, t, e); - break; - case "polylines": - cu(this.viewer, t, e); - break; - case "points": - uu(this.viewer, 0, e); - break; - default: - console.log("Error updating layer"), - this.viewer.scene.primitives.remove(e); - } - }), - { - billboards: ru, - labels: nu, - polygons: su, - models: lu, - polylines: cu, - points: uu, - }), - pu = - ((ou.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 = du[i]) - ? i(t, e) - : (console.log("Error updating layer"), - this.viewer.scene.primitives.remove(e))); - }), - !(ou.prototype.update = function (e) { - this.level = this._core.getLevel(this.viewer); - let t = this.getAllTiles(), - i, - o; - t.forEach((e) => { - for (var t in e.data.wfsLayerData) - (o = e.data.wfsLayerData[t] && e.data.wfsLayerData[t].primitive), - (i = this.tileLevel[t].level), - o && - i && - this.tileLevel[t].visible && - (this.level <= i.max && this.level >= i.min - ? (o.show = !0) - : (o.show = !1)); - }), - this._quadtree.beginFrame(e), - this._quadtree.render(e), - this._quadtree.endFrame(e); - })); - function gu() {} - function fu(e) { - return "string" == typeof e - ? e.replace(/^\s+/g, "").replace(/\s+$/g, "") - : e; - } - function _u(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 fu(e.replace(new RegExp("######", "g"), t)); - })); - } - function Cu(e) { - for (var t = "#", i = e.length, o = 0; o < i; o++) t += e[o] + "#"; - return t; - } - function yu(e) { - for (var t = "", i = e.length, o = 1; o < i; o += 2) t += e[o]; - return t; - } - function vu(e) { - (this.source = e), - (this.cursor = 0), - (this.currentChar = ""), - this.readNextChar(); - } - function wu(e) { - (this.lexer = new vu(e)), (this.currentToken = ""), this.readNextToken(); - } - function bu(e, t) { - var i = ""; - return ( - void 0 !== e.logic - ? ((i = (i = e.terms.map(function (e) { - return bu(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 Tu(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 Eu(e, t) { - (this._style = e || {}), - (this._core = new v()), - (this._bufferAnalysis = new Si(t, Cesium)), - (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 Su(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 Pu(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 xu(t) { - return function (e) { - e = Number( - t.applyConditionalClassification( - t._style.altitudeOffset || t._style.height, - e.attributes - ) - ); - return (e = isNaN(e) ? 0 : e); - }; - } - function Du(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 Iu(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 Au(e) { - return isNaN(e) ? e : parseFloat(e); - } - function Lu(e, i) { - var t, - o = []; - return ( - $.each(e.attributeNames, function (e, t) { - o.push(Au(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 Mu(e, t, i) { - return e.replace( - new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"), "g"), - i - ); - } - (ou.prototype.initialize = function (e) { - pu || - (this.viewer.scene.preRender.addEventListener(this.onPreFrame, this), - (pu = !0)); - }), - (ou.prototype.beginUpdate = function (e) { - this.quadtree.beginFrame(e); - }), - (ou.prototype.endUpdate = function (e) { - var t = this; - e.afterRender.push(function () { - t.quadtree.endFrame(e); - }); - }), - (ou.prototype.getLevelMaximumGeometricError = function (e) { - return this._levelZeroMaximumError / (1 << e); - }), - (ou.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)); - }), - (ou.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; - }), - (ou.prototype.canRefine = function (e, t, i) { - return e.level < 16; - }), - (ou.prototype.showTileThisFrame = function (e, t, i, o) { - e.data.geometryPrimitive && e.data.geometryPrimitive.update(t, i, o); - }), - (ou.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; - }), - (ou.prototype.isDestroyed = function () { - return !1; - }), - (ou.prototype.destroy = function () { - return Cesium.destroyObject(this); - }), - (ou.prototype.remove = function () { - this.destroy(); - }), - (ou.prototype.getInstance = function (e) { - var t; - return ( - 0 == Cesium.defined(e.TileManager) && - ((t = new ou()), - ((e.TileManager = t).viewer = e), - (t = new Cesium.QuadtreePrimitive({ - tileProvider: e.TileManager, - maximumScreenSpaceError: 2, - })), - e.scene.primitives.add(t)), - e.TileManager - ); - }), - (gu.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"), Cu); - })), - []), - 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(Cu)).join("|")), - r.split(new RegExp(a.join("|"), "i"))), - h = - ((r = r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function (e) { - return e.replace(new RegExp(u, "gi"), yu); - })), - (c = c.map(function (e) { - return e.replace( - /\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, - function (e) { - return e.replace(new RegExp(u, "gi"), yu); - } - ); - })), - []), - m = - ((h.SELECT = function (e) { - return _u(",", e) - .filter(function (e) { - return "" !== e; - }) - .map(function (e) { - return { name: e }; - }); - }), - (h.SET = function (e) { - return _u(",", 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(fu)).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 = fu(t[0])), - (i.as = fu(t[1]) || ""), - (i.cond = fu(e[1])), - i - ); - }), - (h.WHERE = fu), - (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 = fu(i[1])), - (e.order = fu(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 = fu(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(fu(t[3]), 10)), - (e.from = parseInt(fu(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 = fu(t[1])), - void 0 !== t[3] && - ((e.columns = t[3].split(",")), - (e.columns = e.columns.map(fu))), - e - ); - }), - (h.VALUES = function (e) { - var e = _u(",", (e = "(" != (e = fu(e))[0] ? "(" + e : e)), - t = []; - return ( - e.forEach(function (e) { - (e = _u(",", (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 = wu.parse(m.WHERE)), - void 0 !== m.JOIN && - m.JOIN.forEach(function (e, t) { - m.JOIN[t].cond = wu.parse(e.cond); - })), - m - ); - }), - (vu.prototype = { - constructor: vu, - 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 } - ); - }, - }), - (vu.tokenize = function (e) { - var t = new vu(e), - i = []; - do { - var o = t.readNextToken(); - } while (("empty" != o.type && i.push(o), t.currentChar)); - return i; - }), - (wu.prototype = { - constructor: wu, - 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 - ); - }, - }), - (wu.parse = function (e) { - return new wu(e).parseExpressionsRecursively(); - }), - (gu.ast2sql = function (e) { - function t(e) { - return void 0 !== e.WHERE ? " WHERE " + bu(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 " + bu(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; - }), - (gu.trim = fu), - (gu.protect = Cu), - (gu.unprotect = yu), - (gu.protect_split = _u), - (gu.CondLexer = vu), - (gu.CondParser = wu); - var Ru, - Ou = function (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; - }, - Bu = function (e, t, i, o) { - for (var r = 0, n = 0; n < e.length; n++) - for ( - var a = o ? Fu : 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++; - } - }, - Fu = 1, - Hu = - (Object.defineProperties(Eu.prototype, { - style: { - get: function () { - return this._style; - }, - set: function (e) { - this._style = e; - }, - }, - }), - (Eu.prototype.clonePartOfMultiFeature = function (e, t) { - var i = e.geometryType.includes("multi") ? e.fid + "." + t : e.fid; - return { - positions: e.positions[t], - attributes: e.attributes, - fid: i, - geometryType: e.geometryType, - }; - }), - (Eu.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)); - }), - (Eu.prototype.createPolygonPrimitive = function (g) { - function f(t) { - if (t.isQuery) t.onFinishedQuery(e); - else { - var o = "", - e = [], - r = [], - n = [], - a = [], - s = [], - l = b.style.polygon, - u = - l.clampToGround || - (!l.perPositionHeight && !l.extrudedHeight && !l.height); - let i; - l.text && (i = new Cesium.LabelCollection()); - for (var c, h, m, d = 0; d < t.features.length; d++) { - var p = t.features[d]; - if (Pu(t, p.fid)) { - var g, - f = p.absoluteHeightPositions || p.positions, - _ = b.createPolygonOptions(f, p.attributes), - f = b.createCommonOptions(p.attributes), - C = Cesium.BoundingSphere.fromPoints(_.hierarchy.positions); - if ( - (p.absoluteHeightPositions && - delete p.absoluteHeightPositions, - e.push(C), - !t.isQuery) - ) { - let e; - if ( - (_.randomColor && (e = Cesium.Color.fromRandom()), - _.outline && !u - ? ((g = b.createPolygonGeometryHelper( - "outline", - p, - _.outlineColor, - _ - )), - n.push(g)) - : _.outline && - n.push( - new Cesium.GeometryInstance({ - geometry: new Cesium.GroundPolylineGeometry({ - positions: _.hierarchy.positions, - width: _.outlineWidth, - }), - }) - ), - _.text) - ) { - var y = b._core.getCenterOfMass(_.hierarchy.positions); - let t = b.createPointOptions(y, p.attributes); - if ( - (u || - null != b.style.pointHeight || - (!_.extrudedHeight && !_.height) || - (t.position = Cesium.Cartesian3.fromDegrees( - y[0], - y[1], - _.extrudedHeight - ? (_.height || 0) + _.extrudedHeight - : _.height - )), - (_.labelNear || _.labelFar) && - (t.label.distanceDisplayCondition = - new Cesium.DistanceDisplayCondition( - _.labelNear || 0, - _.labelFar || 1 / 0 - )), - _.offsetPoint && _.offsetPoint[t.label.text]) - ) { - let e = b._core.toDegrees(t.position); - b._core.getCenterOfMass(_.hierarchy.positions); - y = _.offsetPoint[t.label.text]; - y[0] && (e.lon = y[0]), - y[1] && (e.lat = y[1]), - void 0 !== y[2] && (e.height = y[2]), - (t.position = Cesium.Cartesian3.fromDegrees( - e.lon, - e.lat, - e.height - )); - } - let e = i.add({ id: p, position: t.position, ...t.label }); - delete e.id.positions, (e.id.boundingSphere = C); - } - if (_.colorConfig) { - let e; - for (var v in _.colorConfig) { - for (var w in _.colorConfig[v]) - if (p.attributes[v] == w) { - e = _.colorConfig[v][w]; - break; - } - if (e) break; - _.colorConfig[v]["#"] && (e = _.colorConfig[v]["#"]); - } - e && (_.material = Cesium.Color.fromCssColorString(e)); - } - _.fill && - 0 < _.material.alpha && - ((g = b.createPolygonGeometryHelper( - "fill", - p, - e || _.material, - _ - )), - r.push(g)), - t.parentLayer.addRenderedFeatureId(p.fid), - (o += p.fid + ";"), - a.push(p.fid), - s.push(f.tooltip); - } - } - } - "" != o && - ((l = new Cesium.PrimitiveCollection()), - (h = new Cesium.PerInstanceColorAppearance({ - flat: 0 == _.material.alpha, - translucent: _.material.alpha < 1, - })), - i && l.add(i), - 0 < r.length && - (_.water && - ((c = { - color: _.water.color || "rgba(135,206,235,0.6)", - image: _.water.image || window.SmartEarthRootUrl + I.water, - frequency: _.water.frequency || 1e3, - speed: _.water.speed || 10, - amplitude: _.water.amplitude || 10, - }), - (m = Cesium.Color.fromCssColorString(c.color)), - (h = new Cesium.EllipsoidSurfaceAppearance({ - material: new Cesium.Material({ - fabric: { - type: "Water", - uniforms: { - baseWaterColor: m, - blendColor: m, - normalMap: c.image, - frequency: c.frequency, - animationSpeed: c.speed / 1e3, - amplitude: c.amplitude, - }, - }, - }), - }))), - ((m = u - ? new Cesium.GroundPrimitive({ - geometryInstances: r, - appearance: h, - classificationType: _.classificationType, - }) - : new Cesium.Primitive({ - geometryInstances: r, - appearance: h, - }))._parentCollection = l).add(m)), - 0 < n.length && - (_.clampToGround - ? l.add( - new Cesium.GroundPolylinePrimitive({ - geometryInstances: n, - appearance: new Cesium.PolylineMaterialAppearance({ - material: new Cesium.Material({ - fabric: { - type: "Color", - uniforms: { color: _.outlineColor }, - }, - }), - }), - }) - ) - : ((m = new Cesium.Primitive({ - geometryInstances: n, - appearance: h, - }))._parentCollection = l).add(m)), - (l.ID = "polygons:" + Tu(o)), - (l._instanceIds = a), - (l._tooltips = s), - t.onFinishedCreatePrimitive(l, e)); - } - } - var e, - b = this; - 3 == this.style.altitudeMethod - ? ((g.features = Su(g.features, xu(b))), 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 == b._style.altitudeMethod, - i = g.features, - o = e, - r = xu(b), - n = t, - a = 0, - s = 0; - s < i.length; - s++ - ) { - var l = i[s], - u = n ? Fu : 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++; - } - } - f(g); - })); - }), - (Eu.prototype.createPolygonGeometryHelper = function (e, t, i, o) { - var r = o.hierarchy, - n = o.perPositionHeight, - a = o.extrudedHeight, - s = o.height, - l = o.water, - u = - null != a || void 0 !== s - ? Cesium.PerInstanceColorAppearance.VERTEX_FORMAT - : Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT; - l && (u = Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT), - void 0 !== a && void 0 !== s && (a += s); - let c; - return ( - (l = o.bulidingWall - ? new (c = - "fill" === e - ? Cesium.CorridorGeometry - : Cesium.CorridorOutlineGeometry)({ - positions: r.positions, - width: o.bulidingWallWidth || 0.8, - vertexFormat: u, - extrudedHeight: a, - height: s, - cornerType: Cesium.CornerType.MITERED, - }) - : new (c = - "fill" === e - ? Cesium.PolygonGeometry - : Cesium.PolygonOutlineGeometry)({ - polygonHierarchy: r, - vertexFormat: u, - perPositionHeight: void 0 !== s ? void 0 : n, - extrudedHeight: a, - height: s, - })), - new Cesium.GeometryInstance({ - geometry: l, - id: t, - attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor(i), - }, - }) - ); - }), - (Eu.prototype.createLinestringPrimitive = function (e) { - var t = this, - o = - (t && - t.style && - void 0 !== t.style.height && - (e.features = Su(e.features, xu(t))), - e); - if (o.isQuery) o.onFinishedQuery(a); - else { - var r, - n = "", - a = [], - s = [], - l = []; - let i = new Cesium.PrimitiveCollection(); - for (var u = 0; u < o.features.length; u++) { - var c = o.features[u]; - if (Pu(o, c.fid)) { - var h = c.absoluteHeightPositions || c.positions, - h = t.createLinestringOptions(h, c.attributes), - m = t.createCommonOptions(c.attributes); - if ( - ((h.vertexFormat = ( - r - ? Cesium.PerInstanceColorAppearance - : Cesium.PolylineColorAppearance - ).VERTEX_FORMAT), - c.absoluteHeightPositions && delete c.absoluteHeightPositions, - a.push(Cesium.BoundingSphere.fromPoints(h.positions)), - !o.isQuery) - ) { - d = h.clampToGround - ? new Cesium.GroundPolylineGeometry({ - positions: h.positions, - width: h.width, - }) - : new Cesium.PolylineGeometry(h); - var d = new Cesium.GeometryInstance({ - id: c, - geometry: d, - attributes: { - color: new Cesium.ColorGeometryInstanceAttribute.fromColor( - h.material - ), - }, - }); - o.parentLayer.addRenderedFeatureId(c.fid), - (n += c.fid + ";"), - s.push(c.fid), - l.push(m.tooltip); - let e = null, - t; - (t = h.dash - ? new Cesium.PolylineMaterialAppearance({ - material: Cesium.Material.fromType( - Cesium.Material.PolylineDashType, - { - color: h.material, - gapColor: h.gapColor || Cesium.Color.TRANSPARENT, - dashLength: h.dashLength || 20, - } - ), - }) - : new Cesium.PolylineMaterialAppearance({ - material: new Cesium.Material({ - fabric: { - type: "PolylineOutline", - uniforms: { - color: h.material, - outlineColor: h.outlineColor || h.material, - outlineWidth: h.outlineWidth || 0, - }, - }, - }), - })), - (e = h.clampToGround - ? new Cesium.GroundPolylinePrimitive({ - geometryInstances: d, - appearance: t, - classificationType: h.classificationType, - }) - : new Cesium.Primitive({ - geometryInstances: d, - appearance: t, - })), - i.add(e); - } - } - } - "" != n && - (((e = i).ID = "polylines:" + Tu(n)), - e._instanceIds && - 0 === e._instanceIds.length && - (e._instanceIds = s), - (e._tooltips = l), - o.onFinishedCreatePrimitive(e, a)); - } - }), - (Eu.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: v.viewer.scene }), - l = new Cesium.PointPrimitiveCollection({ - scene: v.viewer.scene, - }), - u = new Cesium.BillboardCollection({ scene: v.viewer.scene }), - c = new Cesium.PrimitiveCollection(), - h = new Cesium.PolylineCollection(), - m = 0; - m < e.features.length; - m++ - ) { - var d, - p, - f, - _, - C, - y = e.features[m]; - Pu(e, y.fid) && - ((d = y.absoluteHeightPositions || y.positions), - (d = v.createPointOptions(d, y.attributes)), - (p = v.createCommonOptions(y.attributes)), - (y.clampToGround = d.clampToGround), - d.sgsPointPosition && - ((y.sgsPointPosition = d.sgsPointPosition), - delete d.sgsPointPosition), - y.absoluteHeightPositions && delete y.absoluteHeightPositions, - n.push(Cesium.BoundingSphere.fromPoints([d.position])), - e.isQuery || - (d.label && - ((d.label.position = d.position), - (d.label.id = y), - v.setEyeOffset(d.label), - null != d.label.imageFile && - ((d.label.image = v.applyConditionalClassification( - d.label.imageFile, - y.attributes - )), - (d.label.label = d.label), - u.add(d.label), - v.setEyeOffset(d.label, -5)), - null != d.label.imageFile && - null != d.label.showText && - d.label.showText && - (v.viewer.scene.onHoverShowTextArray[d.label.id] = !0), - null != d.label.isBold && d.label.isBold - ? s.add(g) - : null != d.label.isUnderline && d.label.isUnderline - ? ((_ = - null != d.label.text.match(/[iljf1]/g) - ? d.label.text.match(/[iljf1]/g) - : []), - (f = d.label.text.length), - (f = Array(Math.ceil(f - 0.5 * _.length)).join("_")), - (_ = $.extend({}, d.label)), - null != d.label.image && delete d.label.image, - (_.position = d.label.position), - (_.id = d.label.id), - (_.text = f), - (_.alignment = - null != d.label.alignment - ? d.label.alignment - : void 0), - (_.underline = !0), - (_.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]), - (_.pixelOffset = new Cesium.Cartesian2(0, -45)), - s.add(_)) - : s.add(d.label)), - d.billboard && - ((d.billboard.position = d.position), - (d.billboard.id = y), - v.setEyeOffset(d.billboard), - u.add(d.billboard)), - d.model && - ((d.model.url = d.model.uri), - (d.model.id = y), - c.add(Cesium.Model.fromGltf(d.model))), - d.point && - ((d.point.position = d.position), - (d.point.id = y), - v.setEyeOffset(d.point), - l.add(d.point)), - 0 != d.lineToGround && - ((f = Cesium.Cartographic.fromCartesian(d.position)), - (_ = Cesium.Cartesian3.fromRadians( - f.longitude, - f.latitude, - 0 - )), - 2 == d.lineToGround && - ((C = - d.lineToGroundLength / - Cesium.Cartesian3.distance(d.position, _)), - Cesium.Cartesian3.lerp(d.position, _, C, _)), - h.add({ - show: !0, - width: 1, - positions: [d.position, _], - material: Cesium.Material.fromType("Color", { - color: d.lineToGroundColor, - }), - })), - e.parentLayer.addRenderedFeatureId(y.fid), - (o += y.fid + ";"), - r.push(y.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 + ":" + Tu(o)), - (i._instanceIds = r), - (i._tooltips = a), - e.onFinishedCreatePrimitive(i, n)); - } - } - var e, - v = this; - 3 == this.style.altitudeMethod - ? ((i.features = Su(i.features, xu(v))), o(i)) - : ((e = Ou(i.features)), - (e = Cesium.sampleRenderedData(e)), - Cesium.when(e, function (e) { - var t = 2 == v._style.altitudeMethod; - Bu(i.features, e, xu(v), t), o(i); - }).otherwise(function (e) {})); - }), - (Eu.prototype.createCommonOptions = function (e) { - var t = {}; - return ( - (t.tooltip = this.applyConditionalClassification( - this.style.tooltip, - e - )), - t - ); - }), - (Eu.prototype.createPolygonOptions = function (e, t) { - var i = this.getPolygonStyle(this.style); - i.preLoad && i.preLoad(i.polygon, t), - (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 = Du(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.height && - (i.polygon.height = Number( - this.getValueFromProp(i.polygon.height, t) - )), - 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)), - i.polygon.extrudedHeight && - (i.polygon.extrudedHeight = Number(i.polygon.extrudedHeight)), - 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 = Du(n)), - i.polygon - ); - }), - (Eu.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 *= 0.8), - 0 < e.polyline.backgroundOpacity && (t *= 0.8)) - : (t = 1 < t ? 2 : 1) - : t < 0 - ? (t = Math.min(5, Math.abs(t))) - : 0 == t && (t = 1), - t - ); - }), - (Eu.prototype.createLinestringOptions = function (e, t) { - var i = this.getLinestringStyle(this.style), - e = - (i.preLoad && i.preLoad(i.polyline, t), - (i.id = t), - (i.polyline.positions = - Cesium.Cartesian3.fromDegreesArrayHeights(e)), - this.applyConditionalClassification(i.polyline.material, t)); - return ( - (i.polyline.material = Du(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 - ); - }), - (Eu.prototype.getValueFromProp = function (e, i) { - let o = e && e.defaultValue ? e.defaultValue : e; - if (o && o.indexOf) - if (-1 < o.indexOf("[") && -1 < o.indexOf("]")) - (o = o.replace("[", "").replace("]", "")), - (o = this.getPropValue(i, o)); - else if (-1 < o.indexOf("{") && -1 < o.indexOf("}")) { - let e = o.match(/\{[^\}]+\}/g); - e.forEach((e) => { - var t = this.getPropValue(i, e.substring(1, e.length - 1)); - o = o.replace(e, t); - }), - (o = o.replaceAll("\\n", "\n")); - } - return o; - }), - (Eu.prototype.getPropValue = function (e, t) { - return e[t] || (t.includes(":") ? e[t.split(":")[1]] : void 0); - }), - (Eu.prototype.applyConditionalClassification = function (e, i) { - if (null != e) { - if (null == e.defaultValue) return e; - var o = Au(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 = Mu(o, "[" + name + "]", i[name]); - else o = Mu(o, t, i[e.attributeName]); - return o; - } - if (void 0 !== e.classification) return (o = Lu(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 Au(e.value); - var i = void 0; - return (i = !0 === Lu(e, t) ? Au(e.value) : i); - } - })(r[t], i); - t && (o = t); - }), - o - ); - } - }), - (Eu.prototype.createLineToGroundOptions = function (e, t) { - var i = this.applyConditionalClassification(e.lineToGround, t); - null != i && 0 != Number(i) - ? ((e.lineToGround = i), - (i = Iu( - (i = this.applyConditionalClassification(e.lineToGroundColor, t)) - )), - (e.lineToGroundColor = i), - "string" == - typeof (i = this.applyConditionalClassification( - e.lineToGroundLength, - t - )) && - -1 < i.indexOf("[") && - -1 < i.indexOf("]") && - (i = t[i.substring(1, i.length - 1)] || 0), - (e.lineToGroundLength = Number(i))) - : ((e.lineToGround = 0), - (e.lineToGroundColor = 0), - (e.lineToGroundLength = 0)); - }), - (Eu.prototype.createPointOptions = function (e, t) { - var i, - o, - r, - n, - a, - s = this.getPointStyle(this.style); - return ( - s.pointHeight - ? ((o = s.pointHeight), - (o = this.getValueFromProp(o, t) || 0), - (s.position = Cesium.Cartesian3.fromDegrees(e[0], e[1], o)), - (e[2] = o)) - : (s.position = Array.isArray(e) - ? Cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]) - : e), - (s.sgsPointPosition = e), - (s.id = t), - s.label && - ((s.label.text = this.getValueFromProp(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 && - ((o = this.applyConditionalClassification(s.label.family, t)), - (e = this.applyConditionalClassification(s.label.font, t)), - (s.label.font = - 0 <= e - ? ((3 * e) / 4).toString() + "pt " + o - : ((3 * (-1 * ((72 * e) / 96))) / 4).toString() + "pt " + o)), - (s.label.fillColor = Iu( - this.applyConditionalClassification(s.label.fillColor, t) - )), - (s.label.backgroundColor = Iu( - this.applyConditionalClassification(s.label.backgroundColor, t) - )), - null == s.label.backgroundColor && - (s.label.backgroundColor = new Cesium.Color( - 0.165, - 0.165, - 0.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 && - ((e = Iu( - (e = this.applyConditionalClassification( - s.billboard.imageColor, - t - )) - )), - (s.billboard.color = e)), - 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 && - ((o = 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 = o(this.applyClassification(s.model.scale, t))), - (e = o(this.applyClassification(s.model.heading, t))), - (r = o(this.applyClassification(s.model.pitch, t))), - (n = o(this.applyClassification(s.model.roll, t))), - (a = new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(e), - Cesium.Math.toRadians(r), - Cesium.Math.toRadians(n) - )), - (s.model.modelMatrix = - Cesium.Transforms.headingPitchRollToFixedFrame(s.position, a))), - this.createLineToGroundOptions(s, t), - s - ); - }), - (Eu.prototype.s = function (e) { - return e.split("").reverse().join(""); - }), - (Eu.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; - }), - (Eu.prototype.o = function (e) { - if (!e) return e; - return new RegExp("^[^A-Za-z脌-脰脴-枚酶-矢虁-謵酄�-峥库皜-铿滐肪-锕唤-锟縘*[謶-呖铿�-锓斤拱-锘糫").test( - e[0] - ); - }), - (Eu.prototype.applyClassification = function (e, t) { - if ("string" !== $.type(e)) return e; - if (null != /(\[([^\]]+)\])/g.exec(e)) - for (var i in t) e = Mu(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; - }), - (Eu.prototype.getPolygonStyle = function (e) { - return $.extend(!0, {}, Hu.DEFAULT_POLYGON_STYLE, e); - }), - (Eu.prototype.getLinestringStyle = function (e) { - return $.extend(!0, {}, Hu.DEFAULT_POLYLINE_STYLE, e); - }), - (Eu.prototype.getPointStyle = function (e) { - return null != e.label - ? $.extend(!0, {}, Hu.DEFAULT_LABEL_STYLE, e) - : null != e.billboard - ? $.extend(!0, {}, Hu.DEFAULT_BILLBOARD_STYLE, e) - : null != e.model - ? $.extend(!0, {}, Hu.DEFAULT_MODEL_STYLE, e) - : null != e.point - ? $.extend(!0, {}, Hu.DEFAULT_POINT_STYLE, e) - : Hu.DEFAULT_POINT_STYLE; - }), - (Eu.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 J(e, t, i, o, r, n, a, s, l) { - 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(d(t, i), function (e) { - o.resolve(e); - }) - : setTimeout(e, 10); - })(), - o.promise - ); - } - function u(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 d(e, t) { - for (var i = 0; i < t.length; ++i) { - var o = t[i], - r = u(e, o); - o.height = r.data.terrainData.interpolateHeight( - r.rectangle, - o.longitude, - o.latitude - ); - } - return t; - } - function p(e) { - this.value = new Float32Array([e]); - } - (this._viewer = e), - (this._Viewer = e), - (c.G = 65535), - (Ru = new ou()), - (zu = new de({ - workerPath: SmartEarthRootUrl + "Workers/featurefetcherworker.js", - })), - 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)), - (p.fromZBias = function (e) { - if (Cesium.defined(e)) return new p(e); - throw new DeveloperError("zbias is required."); - }), - (p.toValue = function (e, t) { - if (Cesium.defined(e)) - return Cesium.defined(t) ? color.toBytes(t) : new Float32Array(e); - throw new DeveloperError("zbias is required."); - }), - (p.equals = function (e, t) { - return ( - e === t || - (Cesium.defined(e) && - Cesium.defined(t) && - e.value[0] === t.value[0]) - ); - }), - (p.defaultBias = function () { - return p.fromZBias(15e-6); - }), - (Cesium.ZBiasGeometryInstanceAttribute = p), - (Cesium.ZBiasGeometryInstanceAttribute = p), - (Cesium.SampleRenderedDataFlags = { TERRAIN: 2, MESH: 4, FLOOR: 8 }), - (Cesium.DynamicEyeOffset = function (e) { - return ( - void 0 === e && (e = 0), new Cesium.Cartesian3(0.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(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 - ); - }), - (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 - ); - }), - (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(d(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._visible = !0), - (this._gmlParser = new iu(!0, null, null, !0)); - var g, - o = !this._viewer.TileManager; - (this._tileManager = Ru.getInstance(e)), - (this._tileManager.tileLevel[this._guid] = { - level: this._level, - visible: this._visible, - }), - this._tileManager._loadTileEvent.addEventListener( - J.prototype.loadTile, - this - ), - (this._useWorkers = !0), - (this._layerDisplayName = n), - (this._showAttributesAsMessage = r.showAttributesAsMessage), - delete r.showAttributesAsMessage, - (this._entityCreator = new Eu(r, e)), - (this._featuresMap = {}), - (this._boundingBox = void 0), - (this._geometryFieldName = void 0), - (this._operations = {}), - (this._subdomains = a), - (this.latLon = !0), - (this._addedFeatures = []), - (this.simpleSqlParser = gu), - (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; - }, - }), - (t = (g = this) - .cleanUrl(g._url) - .replace( - "{s}", - g.sTag(g._layerName.length, g._layerName.length, g._level) - )), - (t = - (t += ku(t)) + - ("SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName=" + - g._layerName)), - (i = Cesium.TrustedServers.contains(Vu(g._url, g._subdomains))), - $.ajax({ - dataType: "xml", - xhrFields: { withCredentials: i }, - url: encodeURI(t), - success: function (e) { - var i, o; - (o = g), - Gu(e, "FeatureType", "wfs").each(function (e, t) { - return ( - Gu(t, "Name", "wfs").text() != o._layerName || - (1 === (t = Gu(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 = g), - $(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) - ); - }); - }, - }), - Nu(this), - void 0 !== s && this.setVisibility(s), - o || this.refresh(); - } - function Vu(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 Gu(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 ku(e) { - return -1 < e.indexOf("?") ? "&" : "?"; - } - function Nu(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 += ku(e)) + - ("SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName=" + - i._layerName)), - Cesium.TrustedServers.contains(Vu(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 ju(e) { - return null == e - ? void 0 - : e.parentLayer - ? e - : e._parentCollection || - (e.primitive && e.primitive._parentCollection - ? e.primitive._parentCollection - : void 0); - } - Object.defineProperties(Hu, { - 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.withAlpha(0.5), - pixelSize: 5, - outlineColor: Cesium.Color.WHITE.withAlpha(0.5), - 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(J.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 zu, - Uu = 180 / Math.PI; - function Wu() { - (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 Yu(e, i) { - $.each(e._primitives, function (e, t) { - if (t instanceof Cesium.BillboardCollection) - return ( - (e = ec.indexOf((t = t))), - (t._parentCollection._primitiveOld = i), - -1 !== e - ? (viewer.scene.primitives.remove(ec[e]._parentCollection), - (ec[e] = t)) - : ec.push(t), - !1 - ); - }); - } - function Ju(e, t) { - viewer.scene.primitives.remove(t), - (e._onDestroyTilePrimitive = function () { - viewer.scene.primitives.remove(t), - (this._onDestroyTilePrimitive = void 0); - }); - } - function Ku(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 Qu(e, t) { - Ku( - $.map(e._primitives, function (e) { - return e.readyPromise; - }), - e, - t - ); - } - function qu(e, t) { - Ku( - $.map(e._primitives[0]._primitives, function (e) { - return e.readyPromise; - }), - e, - t - ); - } - function Xu(e, t) { - viewer.scene.primitives.remove(t); - } - function Zu(e, t) { - Ku([e.readyPromise], e, t); - } - (J.prototype.getRequestMaxFeatures = function () { - return 1e3; - }), - (J.prototype.isAttributeField = function (e, t) { - return ( - !(!t || !e || "" == e.toLowerCase() || "fid" == e.toLowerCase()) && - ("string" == t.toLowerCase() || - "integer" == t.toLowerCase() || - "double" == t.toLowerCase()) - ); - }), - (J.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:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>"), - (n = ""), - $(e).each(function () { - var e = this, - t = '<wfs:Update typeName="{lyaer_id}">'.replace( - "{lyaer_id}", - this.layerId - ); - $(i).each(function () { - t += - "<wfs:Property><wfs:Name>" + - this + - "</wfs:Name><wfs:Value>" + - e[this] + - "</wfs:Value></wfs:Property>"; - }), - (t += - '<ogc:Filter><ogc:FeatureId fid="' + - e.originFid + - '"/></ogc:Filter>'), - (n += t += "</wfs:Update>"); - }), - (r = - "<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>".replace( - "{wfs_updates}", - n - )), - (a = "Failed to save changes to server"), - (e = Vu(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, - })); - }), - (J.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:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>"), - a = - ((n = (n = n.replace("{layer_name}", this._layerName)).replace( - "{REQUEST_MAX_FEATURES}", - 1e3 - )), - ""), - e = - ("" != e.replace(/[ ]/g, "") && - (a = - (a = - "<ogc:Filter xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>") + - (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 = - "<ogc:" + - o + - ("like" == t.operator.toLowerCase() - ? ' wildCard="*" singleChar="*" escape="*"' - : "") + - ">"; - n += "<ogc:PropertyName>" + r + "</ogc:PropertyName>"; - var a = - null == - (r = (r = - -1 != i.indexOf(t.right) ? t.left : t.right).replace( - /^'|'$$/g, - "" - )).match(/^[%]|[%]$$/); - return (n = - n + - ("<ogc:Literal>" + - (r = - "like" == t.operator.toLowerCase() && a - ? "%" + r + "%" - : r)) + - "</ogc:Literal></ogc:" + - o + - ">"); - } - (a = "and" == t.logic.toLowerCase() ? "And" : "Or"), - (n = "<ogc:" + a + ">"); - 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) + "</ogc:" + a + ">") - ); - })( - i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE " + e).WHERE, - o - ) + - "</ogc:Filter>"), - (n = n.replace("{wfs_filter}", a)), - Vu(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, - }); - }), - (J.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 - ); - }), - (J.prototype.refresh = function (e) { - let t = this._tileManager.getAllTiles(); - if (t) { - var i = t.length; - for (let e = 0; e < i; e++) - t[e].data.wfsLayerData[this._guid] && - t[e].data.wfsLayerData[this._guid].freeResources(), - this.loadTile(t[e]); - e && Nu(this); - } - }), - (J.prototype.setVisibility = function (e) { - if (this._visible != e) - if ( - ((this._visible = e), - 0 == (this._tileManager.tileLevel[this._guid].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])); - }), - (J.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)); - }), - (J.prototype.isDestroyed = function () { - return !1; - }), - (J.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( - J.prototype.loadTile, - this - ), - Cesium.destroyObject(this) - ); - }), - (J.prototype.sTag = function (e, t, i) { - if (null == this._subdomains) return ""; - e = (e + t + i) % this._subdomains.length; - return this._subdomains[e]; - }), - (J.prototype.cleanUrl = function (e) { - return -1 != e.indexOf("?") ? e.split("?")[0] : e; - }), - (J.prototype.beginLoadWFSData = function (t) { - if ( - (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)) - ) { - var e = [ - Uu * t.rectangle.west, - Uu * t.rectangle.south, - Uu * t.rectangle.east, - Uu * t.rectangle.north, - ], - i = this, - o = this.cleanUrl(this._url).replace( - "{s}", - this.sTag(t.x, t.y, t.level) - ); - o += ku(o); - o += - "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName=" + - this._layerName + - "&srsName=EPSG:4326&BBOX=" + - e.join(","); - e = Cesium.TrustedServers.contains(Vu(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, "GML2"); - }, - 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; - }, - }); - } - }), - (J.prototype.processWFSData = function (e, t, i) { - var o; - (e.data.wfsLayerData[this._guid].xhr = void 0), - this._useWorkers - ? zu - .queueWorkItem({ - id: e.data.id, - text: t, - format: i, - geometryFieldName: (o = this)._geometryFieldName, - }) - .then(function (e) { - o.addFeaturesToTile(e); - }) - : ((i = this._gmlParser.read(t)), - this.addFeaturesToTile({ id: e.data.id, features: i })); - }), - (J.prototype.boundingSphereFromGML = function (e, i) { - var t = viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel, - o = this; - zu.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); - }); - }), - (J.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 - ); - }), - (J.prototype.addRenderedFeatureId = function (e) { - null == this._addedFeatures[e] && (this._addedFeatures[e] = 0), - this._addedFeatures[e]++; - }), - (J.prototype.removeRenderedFeatureId = function (i, o) { - if (o && o.geometryType && o.geometryType.includes("multi")) - for (let e = 0, t; e < o.positions.length; e++) - (t = i + "." + e), - null != this._addedFeatures[t] && this._addedFeatures[t]--, - 0 == this._addedFeatures[t] && (this._addedFeatures[t] = void 0); - else - null != this._addedFeatures[i] && this._addedFeatures[i]--, - 0 == this._addedFeatures[i] && (this._addedFeatures[i] = void 0); - }), - (J.prototype.isExistRenderedFeatureId = function (e) { - return null != this._addedFeatures[e]; - }), - (J.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)); - }), - (J.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++; - }), - (J.prototype.removeFeaturesFromLayer = function (e) { - (this._statistics.numberOfDeletedFeatures += e.length), - (this._statistics.numberOfDeletedPositions += Cesium.defaultValue( - e.numPositions, - 0 - )); - for (var t, i = e.length, o = 0; o < i; o++) - (t = e[o].fid), - !1 !== Object.prototype.hasOwnProperty.call(this._featuresMap, t) && - (this._featuresMap[t].refCount--, - 0 === this._featuresMap[t].refCount && delete this._featuresMap[t], - this.removeRenderedFeatureId(t, e[o])); - }), - (J.prototype.getFeature = function (e) { - return !1 === Object.prototype.hasOwnProperty.call(this._featuresMap, e) - ? null - : this._featuresMap[e]; - }), - (J.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)); - }), - (J.blockRequestPrimitiveFromPrimitive = function (e) { - var t; - if (null != e) - return ( - (t = ju(e)), - null == t && - (e._labelCollection && e._labelCollection._billboardCollection - ? (t = ju(e._labelCollection._billboardCollection)) - : e._billboardCollection && (t = ju(e._billboardCollection))), - t - ); - }), - (J.prototype.resetAttributesTable = function () { - (this.lastEditedCell = null), (this.attrTblDialogMemo = null); - }), - Object.defineProperties(Wu.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; - }, - }, - }), - (Wu.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 $u, - ec = [], - tc = 0, - ic = !(Wu.prototype.onPreFrame = function (e, t) { - if ((tc++, !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 && - tc % 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(ec, function (e, t) { - t.ready && - viewer.scene.primitives.remove(t._parentCollection._primitiveOld); - }); - } - }), - oc = - ((Wu.prototype.initialize = function (e) { - ic || - (viewer.scene.preRender.addEventListener(this.onPreFrame, this), - (ic = !0)); - }), - (Wu.prototype.beginUpdate = function (e) { - this.quadtree.beginFrame(e); - }), - (Wu.prototype.endUpdate = function (e) { - var t = this; - e.afterRender.push(function () { - t.quadtree.endFrame(e); - }); - }), - (Wu.prototype.updateForPick = function (e) {}), - (Wu.prototype.getLevelMaximumGeometricError = function (e) { - return ( - (this._levelZeroMaximumError / (1 << e)) * - this._quadtree.maximumScreenSpaceError - ); - }), - Math.PI, - (Wu.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 - - 0.99 * TerraExplorer.internal.Navigate.HeightAboveGround, - }), - attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor(t), - }, - }), - appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }), - }); - e.data.primitive.add(t); - }), - (Wu.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)); - }), - (Wu.prototype.getTile = function (e) { - return this._tileCache[e]; - }), - (Wu.prototype.getAllTiles = function () { - var e, - t = []; - for (e in this._tileCache) t.push(this._tileCache[e]); - return t; - }), - (Wu.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)) - ); - }), - (Wu.prototype.showTileThisFrame = function (e, t) { - e.data.primitive.update(t); - }), - (Wu.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 - ); - }), - (Wu.prototype.isDestroyed = function () { - return !1; - }), - (Wu.prototype.destroy = function () { - return Cesium.destroyObject(this); - }), - (Wu.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 - ); - }), - (Wu.prototype.addToScene = function (e) { - this._primitivesWaitingToBeAddedToTheScene.push(e); - }), - (Wu.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); - }), - (Wu.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": - Yu(t, e); - break; - case "labels": - Ju(t, e); - break; - case "polygons": - Qu(t, e); - break; - case "models": - qu(t, e); - break; - case "polylines": - Zu(t, e); - break; - case "points": - Xu(0, e); - break; - default: - console.log("Error updating layer"), - viewer.scene.primitives.remove(e); - } - }), - { - billboards: Yu, - labels: Ju, - polygons: Qu, - models: qu, - polylines: Zu, - points: Xu, - }); - function rc(e, t) { - (this._viewer = e), (this._cesium = t), ($u = new Wu()); - } - function nc(e) { - (this._viewer = e), - (this._cesium = Cesium), - (this._core = new v()), - (this._tree = F); - } - function ac(e, t) { - (this._viewer = e), (this._cesium = t); - } - function sc(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._tree = F), - (this._core = new v()), - (this._Color = new m(this._viewer, this._cesium)); - } - function lc(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F); - } - (Wu.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 = oc[i]) - ? i(t, e) - : (console.log("Error updating layer"), - viewer.scene.primitives.remove(e))); - }), - (rc.prototype.CreateWfsFeatureLayer = function (e, t, i, o, r, n, a, s, l) { - return new J(e, t, i, o, r, n, a, s, l); - }), - (rc.prototype.initTileManager = function () { - this._viewer.scene; - var i = this._viewer; - i.scene.preRender.addEventListener(function (e, t) { - $u.getInstance(i).streamSpeed = 2; - }); - }), - (nc.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"); - }), - (nc.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 - ); - }), - (nc.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(f.clone(e)), a.push(f.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); - }), - (nc.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; - }), - (nc.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; - }), - (nc.prototype.setVisibility = function (e) { - this.item.polylineVolume.show = e; - }), - (nc.prototype.getVisibility = function () { - return this.item.polylineVolume.show; - }), - (nc.prototype.deleteObject = function () { - this._viewer.entities.remove(this.item); - }), - Object.defineProperties(nc.prototype, { - rectangle: { - get: function () { - return this.item.rectangle; - }, - set: function (e) { - this.item.rectangle = e; - }, - }, - }), - Object.defineProperties(nc.prototype, { - polyline: { - get: function () { - return this.item.polyline; - }, - set: function (e) { - this.item.polyline = e; - }, - }, - }), - (nc.prototype.setItem = function (e) { - this.item = e; - }), - (nc.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - Object.defineProperties(nc.prototype, { - polygon: { - get: function () { - return this.item.polygon; - }, - set: function (e) { - this.item.polygon = e; - }, - }, - }), - Object.defineProperties(nc.prototype, { - point: { - get: function () { - return this.item.point; - }, - set: function (e) { - this.item.point = e; - }, - }, - }), - Object.defineProperties(nc.prototype, { - label: { - get: function () { - return this.item.label; - }, - set: function (e) { - this.item.label = e; - }, - }, - }), - Object.defineProperties(nc.prototype, { - model: { - get: function () { - return this.item.model; - }, - set: function (e) { - this.item.model = e; - }, - }, - }), - Object.defineProperties(nc.prototype, { - wall: { - get: function () { - return this.item.wall; - }, - set: function (e) { - this.item.wall = e; - }, - }, - }), - Object.defineProperties(nc.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, - }; - }, - }, - }), - (ac.prototype.createPosition = function (e, t, i) { - return new this.Cartesian3.fromDegrees(e, t, i); - }), - (ac.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, - }; - }), - (sc.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 - ); - }), - (sc.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 - ); - }), - (sc.prototype.deleteObject = function () { - this._viewer.entities.remove(this.item); - }), - (sc.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; - }), - (sc.prototype.setUrl = function (e) { - this.item._billboard.image = e; - }), - (sc.prototype.setVisibility = function (e) { - this.item.show = e; - }), - (sc.prototype.getVisibility = function () { - return this.item.show; - }), - (sc.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; - }), - (sc.prototype.setWidth = function (e) { - try { - this.item._billboard.width = e; - } catch (e) { - console.log(e); - } - return this; - }), - (sc.prototype.setColorAlpha = function (e) { - try { - this.item._billboard.color._value.alpha = e; - } catch (e) { - console.log(e); - } - return this; - }), - (sc.prototype.setHeight = function (e) { - try { - this.item._billboard.height = e; - } catch (e) { - console.log(e); - } - return this; - }), - (sc.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; - }), - (sc.prototype.setRotation = function (e) { - try { - this.item._billboard.rotation = this._cesium.Math.toRadians(e); - } catch (e) { - console.log(e); - } - return this; - }), - (sc.prototype.setItem = function (e) { - this.item = e; - }), - (sc.prototype.setScale = function (e) { - try { - this.item._billboard.scale = e; - } catch (e) { - console.log(e); - } - return this; - }), - (sc.prototype.CreateImageLabel = function (e, t, i, o, r) { - (i = { - id: this._core.getuid(), - image: sc, - 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 - ); - }), - (sc.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, - }, - }; - }), - (sc.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - Object.defineProperties(sc.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: f.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) {}, - }, - }, - }), - (sc.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(sc.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: f.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: f.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: f.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) {}, - }, - }, - }), - (lc.prototype.createWall = function (t, e, i, o) { - var r = []; - if ("object" == typeof t) { - let e = t; - var n = this._core.defaultValue(e.alpha, 0.6); - e.points.forEach((e) => { - r.push(Cesium.Cartesian3.fromDegrees(e.x, e.y)); - }), - (this.item = this._viewer.entities.add({ - name: e.name, - id: e.id || this._core.getuid(), - wall: { - positions: r, - material: Cesium.Color.fromCssColorString( - e.color || "#f00" - ).withAlpha(n), - minimumHeights: new Array(r.length).fill(e.bottomHeight), - maximumHeights: new Array(r.length).fill(e.topHeight), - }, - })), - (this.item.objectType = "wall"); - } else { - n = { - 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)) - return void console.log("options is required"); - i = this._core.extend(n, i, !0); - n = new v(); - if ( - (i && "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 - )), - e[0].x || e[0].y) - ) - if (void 0 !== e[0].z) - for (a = 0; a < e.length; a++) - r.push( - this._cesium.Cartesian3.fromDegrees(e[a].x, e[a].y, e[a].z) - ); - else - for (a = 0; a < e.length; a++) - r.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++) - r.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++) - r.push( - this._cesium.Cartesian3.fromDegrees(e[a][0], e[a][1], e[a][2]) - ); - (i.positions = r), - 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 - )), - (this.item = this._viewer.entities.add({ - name: t, - id: this._core.getuid(), - wall: i, - })), - (this.item.positions = i.positions); - } - return ( - this._tree.insertGroupId( - { - id: this.item.id, - name: t, - pId: this._core.isnull(o) ? 0 : o, - type: "wall", - item: this, - }, - this._core.isnull(o) ? 0 : o - ), - this - ); - }), - (lc.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(f.clone(e)), a.push(f.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 uc = "a", - cc = 0; - function hc(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F), - (this._BaiduImageryProvider = new El(e, t)); - } - (lc.prototype.drawCanvasImage = function (e, t) { - var i = document.getElementById("canvas-" + uc), - o = i.getContext("2d"), - r = new Image(); - return ( - (r.src = "img/arrow.png"), - o.clearRect(0, 0, 700, 100), - (r.onload = function () { - cc <= 700 - ? (o.drawImage(r, cc, 0), o.drawImage(r, cc + 100, 0)) - : (cc = 0), - (cc += 5); - }), - (uc = "a" === uc ? "b" : "a"), - i - ); - }), - (lc.prototype.setVisibility = function (e) { - this.item.wall.show = e; - }), - (lc.prototype.getVisibility = function () { - return this.item.wall.show; - }), - (lc.prototype.deleteObject = function () { - this._viewer.entities.remove(this.item); - }), - Object.defineProperties(lc.prototype, { - rectangle: { - get: function () { - return this.item.rectangle; - }, - set: function (e) { - this.item.rectangle = e; - }, - }, - }), - Object.defineProperties(lc.prototype, { - polyline: { - get: function () { - return this.item.polyline; - }, - set: function (e) { - this.item.polyline = e; - }, - }, - }), - (lc.prototype.setItem = function (e) { - this.item = e; - }), - (lc.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - Object.defineProperties(lc.prototype, { - polygon: { - get: function () { - return this.item.polygon; - }, - set: function (e) { - this.item.polygon = e; - }, - }, - }), - Object.defineProperties(lc.prototype, { - point: { - get: function () { - return this.item.point; - }, - set: function (e) { - this.item.point = e; - }, - }, - }), - Object.defineProperties(lc.prototype, { - label: { - get: function () { - return this.item.label; - }, - set: function (e) { - this.item.label = e; - }, - }, - }), - Object.defineProperties(lc.prototype, { - model: { - get: function () { - return this.item.model; - }, - set: function (e) { - this.item.model = e; - }, - }, - }), - Object.defineProperties(lc.prototype, { - wall: { - get: function () { - return this.item.wall; - }, - set: function (e) { - this.item.wall = e; - }, - }, - }), - Object.defineProperties(lc.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, - }; - }, - }, - }), - (hc.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(",")) || Array.isArray(e) - ? (e.split && (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 - ); - }), - (hc.prototype.createImageryLayerGrid = function (e) { - e = this._viewer.imageryLayers.addImageryProvider( - new this._cesium.GridImageryProvider(e) - ); - return (this.item = e), this; - }), - (hc.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(",")) || Array.isArray(e) - ? (e.split && (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 - ); - }), - (hc.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 - ); - }), - (hc.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(",")) || Array.isArray(e) - ? (e.split && (e = e.split(",")), - (l.maximumTerrainLevel = e[1]), - (l.minimumTerrainLevel = e[0])) - : (l.minimumTerrainLevel = e); - } - (a = s.TD_SD - ? new mn( - 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 - ); - }), - (hc.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(",")) || Array.isArray(e) - ? (e.split && (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 - ); - }), - (hc.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(",")) || Array.isArray(e) - ? (e.split && (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 - ); - }), - (hc.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(",")) || Array.isArray(e) - ? ((e = e.split ? e.split(",") : e)[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 - ); - }), - (hc.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 - ); - }), - (hc.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 - ); - }), - (hc.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 }, - }; - }), - (hc.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (hc.prototype.getLevel = function () { - var e, - t, - i, - o = this._viewer.camera; - try { - i = - o && o.positionCartographic && o.positionCartographic.height - ? ((e = - (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; - }), - (hc.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); - }), - (hc.prototype.getVisibility = function () { - return this.item.show; - }), - (hc.prototype.getType = function () { - return { label: "褰卞儚", value: "ImageryProvider" }; - }), - (hc.prototype.deleteObject = function () { - return this._viewer.imageryLayers.remove(this.item); - }), - Object.defineProperties(hc.prototype, { - url: { set: function (e) {}, get: function () {} }, - }), - (hc.prototype.setItem = function (e) { - this.item = e; - }); - var mc = 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" - ); - }, - dc = - "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 pc(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 gc(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 fc(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (this._Provider = void 0), - (this.labelCollections1 = []), - (this.labelCollections2 = []), - (this.labelCollections = this._cesium.PointPrimitiveCollection()), - (this.gd = 0), - (this.model = []), - (this.Legend = []), - (this.sj = !0); - } - (gc.prototype._serialize = function (e) { - var t, - i = [], - o = window.encodeURIComponent; - for (t in e) { - var r = e[t]; - "object" === (void 0 === r ? "undefined" : dc(r)) - ? i.push(o(t) + "=" + o(JSON.stringify(r))) - : i.push(o(t) + "=" + o(e[t])); - } - return i.join("&"); - }), - (gc.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); - }); - }), - (gc.prototype._lonLatToTileInWGS84 = function (e, t) { - var e = mc(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), - ]; - }), - (gc.prototype._radianToDegree = function (e) { - return (e / Math.PI) * 180; - }), - (gc.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; - } - }), - (gc.prototype._cameraMoveStartHandler = function () { - this._isCameraMoving = !0; - }), - (gc.prototype._loadTile = function (e, t) { - var r = [], - n = new this._Cesium.ColorGeometryInstanceAttribute( - 0.75, - 0.75, - 0.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, pc(e)); - }) - : (t = o[i]).push.apply(t, pc(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, - }) - ); - }), - (gc.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, pc(s))), - (i = Math.max.apply(Math, pc(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; - })); - }), - (gc.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 - ); - }), - (gc.prototype._removeObsoletePrimitives = function (e, t) { - var i, - o = []; - for (i in (0 < t.length && (o = t), e)) - o.includes(i) || (removed && delete e[i]); - }), - (gc.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(); - }), - (gc.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); - } - }), - (gc.prototype.setStatus = function (e) { - this._stop = e; - }), - (gc.prototype.isRemoved = function () { - return this._isRemoved; - }), - (gc.prototype.filterBy = function (e, t, i) { - (this._propertyToBeFiltered = e), (this._valuesToBeFiltered = t); - }), - (gc.prototype.removeFilter = function () { - (this._propertyToBeFiltered = null), (this._valuesToBeFiltered = null); - }), - (fc.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( - 0.165, - 0.165, - 0.165, - 0.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 - ); - }), - (fc.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(0.165, 0.165, 0.165, 0.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 - ); - }), - (fc.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 - ); - }), - (fc.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); - } - }), - (fc.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); - }), - (fc.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 gc(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 - ); - }), - (fc.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 y(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(0.165, 0.165, 0.165, 0.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 - ); - }), - (fc.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 = - '<div id="' + - e.id + - '" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url(' + - window.SmartEarthRootUrl + - I.divpoint1 + - ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">' + - d.optiontext[i] + - "</div>\n </div>"), - $(".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 - ); - }), - (fc.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 y(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 = - '<div id="' + - e.id + - '" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url(' + - window.SmartEarthRootUrl + - I.divpoint1 + - ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">' + - u.optiontext[i] + - "</div>\n </div>"), - $(".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 - ); - }), - (fc.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 y(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 - ); - }), - (fc.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 y(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(0.165, 0.165, 0.165, 0.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 - ); - }), - (fc.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 y(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(0.165, 0.165, 0.165, 0.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 - ); - }), - (fc.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (fc.prototype.getLegend = function () { - var e = []; - return (e = null != this.Legend ? this._core.unique(this.Legend) : e); - }), - (fc.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) {} - }), - (fc.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 }, - }; - }), - (fc.prototype.setRefresh = function (e) { - try { - this._Provider && this._Provider.setStatus(!e); - } catch (e) {} - }), - (fc.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(fc.prototype, { - labelText: { - set: f.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( - 0.165, - 0.165, - 0.165, - 0.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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( - 0.165, - 0.165, - 0.165, - 0.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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: f.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 _c(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 : Cc.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 Cc, - yc = 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 = _c(e, o, 32, 32), - n = "#FF0000", - r = 32, - t = 32; - (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 vc(e, t) { - return Math.floor(Math.random() * (t - e + 1)) + e; - } - function wc(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()), - ((vc = yc(e.vertices, t, e.heights[0])).timeStamp = e.timeStamp), - (vc.mtHeight = e.heights), - (vc.mtType = e.mtType), - (vc.fromKML = e.fromKML), - (vc.rect = e.rectangle), - (vc.level = e.level), - i.resolve(vc), - 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 === vc && i[t] !== vc && (o[t] = i[t]); - }); - }), - t.resolve(o)); - }), - t - ); - } - function bc(e, t) { - if (((Cc = 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." + (t.cacheFormat || "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}/{reverseY}." + (t.cacheFormat || "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 de({ - workerPath: SmartEarthRootUrl + "Workers/ParseElevationWorker.js", - })), - (this._pendingRequests = 0), - (this._requestGridSize = 8), - (this._requestsCache = {}), - (this._requestsCacheKeys = []), - this.errorEvent.addEventListener(function (e) {}, this); - } - (bc._geometricErrorFactor = 2), - Object.defineProperties(bc.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; - }, - }, - }), - (bc.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 - )))); - }), - (bc.prototype.getLevelMaximumGeometricError = function (e) { - return ( - (this._levelZeroMaximumGeometricError / (1 << e)) * - bc._geometricErrorFactor - ); - }), - (bc.prototype.createKeyFromTile = function (e, t, i) { - return e + "_" + t + "_" + i; - }), - (bc.prototype.getTileDataAvailable = function (e, t, i) { - var o = Math.min(this._maxTerrainLevel, 25); - return !!this._isMPT || i < o; - }), - (bc.prototype.requestFactorForLevel = function (e) { - var t = Math.log(this._requestGridSize) / Math.log(2), - t = Math.min(t, e); - return Math.pow(2, t); - }), - (bc.prototype.getRequestBaseTerrainUrl = function (e, t, i, o) { - return this.getRequestUrl(e, t, i, o); - }), - (bc.prototype.getRequestElevationLayer = function (e, t, i) { - return this.getRequestUrl(e, t, i, !1, !0); - }), - (bc.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 ( - (s = this.tilingScheme.getNumberOfYTilesAtLevel(i) - t - 1), - this._cacheUrl - .replace("{x}", e) - .replace("{reverseY}", s) - .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 - ); - }), - (bc.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 - ); - }), - (bc.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()); - }), - (bc.prototype.sTag = function (e, t, i) { - if (null == this._subdomains) return ""; - e = (e + t + i) % this._subdomains.length; - return this._subdomains[e]; - }), - (bc.prototype.refreshElevationLayer = function (e) { - e.rectangle && - void 0 !== Cc.scene.globe._surface._levelZeroTiles && - this.findDirectParent(e.rectangle, !0).freeResources(); - }), - (bc.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 < Cc.scene.globe._surface._levelZeroTiles.length; i++) { - var o = a(Cc.scene.globe._surface._levelZeroTiles[i], e, t); - if (o) return o; - } - return null; - }), - (bc.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; - }), - (bc.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; - }); - }), - (bc.prototype.requestBaseTerrainTileGeometry = function (e, t, i, o) { - return this.requestTileGeometryBuffers(e, t, i, o); - }), - (bc.prototype.requestElevationLayerTileGeometry = function (e, t, i, o, r) { - return this.requestTileGeometryBuffers(e, t, i, o, r); - }), - (bc.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); - }), - (bc.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 - ); - }), - (bc.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); - }), - (bc.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 = Cc.terrainProvider.tilingScheme.tileXYToRectangle(u, c, h)), - (e = Cc.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 = wc(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")), - Cc.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 f, - s = this._requestsCache[i]; - if ( - void 0 !== s.dataLoaded || - ((s.dataLoaded = Cesium.Resource.fetchArrayBuffer(i)), - Cesium.defined(s.dataLoaded)) - ) - return ( - (f = this)._pendingRequests++, - Cesium.when(s.dataLoaded, function (e) { - void 0 === s.workerFinished && - (s.workerFinished = f._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 = f.heightMapWidth * f.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 = f.extractTileHeightBuffer(e[0].buffer, u, c, h); - if ((f._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 = f.heightMapWidth * f.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 () { - f._pendingRequests--, g.reject(); - }), - g - ); - } - }), - (bc.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; - }), - (bc.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 Tc(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 : Ec.scene.globe.ellipsoid.cartesianToCartographic(e), - e = Sc(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 Ec, - Sc = 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 Pc(e, t) { - if (((Ec = 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: t.cacheUrl - ? t.cacheUrl + "/0/0/0." + (t.cacheFormat || "mpt") - : 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, - }), - t.cacheUrl && - ((this.isCache = !0), - (this.cacheLevel = t.cacheLevel || 16), - (this._cacheUrl = - t.cacheUrl + "/{z}/{x}/{reverseY}." + (t.cacheFormat || "mpt"))); - (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 de({ - workerPath: SmartEarthRootUrl + "Workers/ParseElevationWorker.js", - })), - (this._pendingRequests = 0), - (this._requestGridSize = 8), - (this._requestsCache = {}), - (this._requestsCacheKeys = []), - this.errorEvent.addEventListener(function (e) {}, this); - } - function xc(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 Dc(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 y, - v, - 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 = []), - E = "", - S = [], - P = 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, - I - )) - ); - 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, - I - )) - ); - 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: 0.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, - I - )) - ); - var a, - s = e.tiles, - l = e.maxzoom; - if ( - ((P = Math.max(P, 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, - I - )) - ); - 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, - I - )) - ); - (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(S[m]) || (S[m] = []); - for (var g = 0; g < d.length; ++g) { - var f = d[g], - _ = p - f.endY - 1, - C = p - f.startY - 1; - S[m].push([f.startX, _, f.endX, C]), - h.addAvailableTileRange(m, f.startX, _, f.endX, C); - } - } - else - Cesium.defined(u) && - ((a = new Cesium.TileAvailability(b._tilingScheme, l)), - (h = new Cesium.TileAvailability(b._tilingScheme, l)), - (S[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 < E.length && (E += " "), (E += e.attribution)), - T.push( - new xc({ - resource: y, - 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() - ); - (y = y.getDerivedResource({ url: l })).appendForwardSlash(); - n = (v = y.getDerivedResource({ url: "layer.json" })).fetchJson(); - return Cesium.when(n, x, D); - } - return Cesium.when.resolve(); - } - function D(e) { - var t = "An error occurred while accessing " + v.url + "."; - w = Cesium.TileProviderError.handleError( - w, - b, - b._errorEvent, - t, - void 0, - void 0, - void 0, - I - ); - } - function o(e) { - x(e).then(function () { - if (!Cesium.defined(w)) { - var e, - t = S.length; - if (0 < t) - for ( - var i = (b._availability = new Cesium.TileAvailability( - b._tilingScheme, - P - )), - o = 0; - o < t; - ++o - ) - for (var r = S[o], n = 0; n < r.length; ++n) { - var a = r[n]; - i.addAvailableTileRange(o, a[0], a[1], a[2], a[3]); - } - 0 < E.length && - ((e = new Cesium.Credit(E)), - 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 I() { - Cesium.when(v.fetchJson()).then(o).otherwise(r); - } - Cesium.when(e.url) - .then(function (e) { - e = Cesium.Resource.createIfNeeded(e); - e.appendForwardSlash(), - (v = (y = e).getDerivedResource({ url: "layer.json" })), - (b._tileCredits = e.credits), - I(); - }) - .otherwise(function (e) { - i.reject(e); - }); - } - (Pc._geometricErrorFactor = 2), - Object.defineProperties(Pc.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; - }, - }, - }), - (Pc.prototype.getLevelMaximumGeometricError = function (e) { - return ( - (this._levelZeroMaximumGeometricError / (1 << e)) * - Pc._geometricErrorFactor - ); - }), - (Pc.prototype.createKeyFromTile = function (e, t, i) { - return e + "_" + t + "_" + i; - }), - (Pc.prototype.getTileDataAvailable = function (e, t, i) { - return this._isMPT ? void 0 : i < 16; - }), - (Pc.prototype.requestFactorForLevel = function (e) { - var t = Math.log(this._requestGridSize) / Math.log(2), - t = Math.min(t, e); - return Math.pow(2, t); - }), - (Pc.prototype.getRequestUrl = function (e, t, i, o) { - var r = this.requestFactorForLevel(i); - if ( - ((e = (e - (e % r)) / r), - (t = (t - (t % r)) / r), - (i -= Math.log(r) / Math.log(2)), - this.isCache && 0 !== i && i <= this.cacheLevel) - ) - return ( - (n = this.tilingScheme.getNumberOfYTilesAtLevel(i) - t - 1), - this._cacheUrl - .replace("{x}", e) - .replace("{reverseY}", n) - .replace("{z}", i) - ); - var n = 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)); - }), - (Pc.prototype.sTag = function (e, t, i) { - if (null == this._subdomains) return ""; - e = (e + t + i) % this._subdomains.length; - return this._subdomains[e]; - }), - (Pc.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 < Ec.scene.globe._surface._levelZeroTiles.length; t++) { - var i = n(Ec.scene.globe._surface._levelZeroTiles[t], e); - if (i) return i; - } - return null; - }), - (Pc.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; - }), - (Pc.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; - }); - }), - (Pc.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 - ); - }), - (Pc.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 = Ec.terrainProvider.tilingScheme.tileXYToRectangle(l, u, c)), - (r = Ec.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 = Tc((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 - ); - } - }), - (Pc.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; - }), - (Pc.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 Ic = { OCT_VERTEX_NORMALS: 1, WATER_MASK: 2, METADATA: 4 }; - function Ac(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 Lc(k, N, 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 = - k._scheme && "tms" !== k._scheme - ? j - : k._tilingScheme.getNumberOfYTilesAtLevel(z) - j - 1; - var i, - o, - r = [], - t = - (k._requestVertexNormals && - U.hasVertexNormals && - r.push( - U.littleEndianExtensionSize ? "octvertexnormals" : "vertexnormals" - ), - k._requestWaterMask && U.hasWaterMask && r.push("watermask"), - k._requestMetadata && U.hasMetadata && r.push("metadata"), - t[(N + i + z) % t.length]), - n = U.resource, - r = - Cesium.defined(n._ionEndpoint) && - !Cesium.defined(n._ionEndpoint.externalType) - ? (0 !== r.length && (o = { extensions: r.join("-") }), Ac(void 0)) - : Ac(r), - n = n - .getDerivedResource({ - url: t, - templateValues: { version: U.version, z: z, x: N, y: i }, - queryParameters: o, - headers: r, - request: e, - }) - .fetchArrayBuffer(); - if (Cesium.defined(n)) - return n - .then(function (e) { - if (Cesium.defined(k._heightmapStructure)) - return ( - (h = k), - (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 = k, - i = e, - o = z, - r = N, - 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), - F = 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)), - H = - ((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) - )), - f = d.getUint32((l += u), !0), - u = - ((l += Uint32Array.BYTES_PER_ELEMENT), - new Uint16Array(i, l, 3 * f)), - h = - ((l += f * h), - 65536 < f && (m = 3 * (e = Uint32Array.BYTES_PER_ELEMENT)), - u.subarray(0, f)), - _ = u.subarray(f, 2 * f), - C = u.subarray(2 * f, 3 * f), - h = - (Cesium.AttributeCompression.zigZagDeltaDecode(h, _, C), - l % e != 0 && (l += e - (l % e)), - d.getUint32(l, !0)), - y = - ((l += Uint32Array.BYTES_PER_ELEMENT), - Cesium.IndexDatatype.createTypedArrayFromArrayBuffer( - f, - i, - l, - 3 * h - )), - v = ((l += h * m), 0), - V = y.length, - w = 0; - w < V; - ++w - ) { - var b = y[w]; - (y[w] = v - b), 0 === b && ++v; - } - var T, - E, - u, - c, - _ = d.getUint32(l, !0), - C = - ((l += Uint32Array.BYTES_PER_ELEMENT), - Cesium.IndexDatatype.createTypedArrayFromArrayBuffer( - f, - i, - l, - _ - )), - h = d.getUint32((l += _ * e), !0), - m = - ((l += Uint32Array.BYTES_PER_ELEMENT), - Cesium.IndexDatatype.createTypedArrayFromArrayBuffer( - f, - i, - l, - h - )), - _ = d.getUint32((l += h * e), !0), - h = - ((l += Uint32Array.BYTES_PER_ELEMENT), - Cesium.IndexDatatype.createTypedArrayFromArrayBuffer( - f, - i, - l, - _ - )), - _ = d.getUint32((l += _ * e), !0), - G = - ((l += Uint32Array.BYTES_PER_ELEMENT), - Cesium.IndexDatatype.createTypedArrayFromArrayBuffer( - f, - i, - l, - _ - )); - for (l += _ * e; l < d.byteLength; ) { - var S = d.getUint8(l, !0), - P = ((l += Uint8Array.BYTES_PER_ELEMENT), d.getUint32(l, s)); - if ( - ((l += Uint32Array.BYTES_PER_ELEMENT), - S === Ic.OCT_VERTEX_NORMALS && t._requestVertexNormals) - ) - T = new Uint8Array(i, l, 2 * f); - else if (S === Ic.WATER_MASK && t._requestWaterMask) - E = new Uint8Array(i, l, P); - else if (S === Ic.METADATA && t._requestMetadata) { - S = d.getUint32(l, !0); - if (0 < S) { - var x = Cesium.getJsonFromTypedArray( - new Uint8Array(i), - l + Uint32Array.BYTES_PER_ELEMENT, - S - ).available; - if (Cesium.defined(x)) - for (var D = 0; D < x.length; ++D) - for ( - var I = o + D + 1, - A = x[D], - L = t._tilingScheme.getNumberOfYTilesAtLevel(I), - M = 0; - M < A.length; - ++M - ) { - var R = A[M], - O = L - R.endY - 1, - B = L - R.startY - 1; - t.availability.addAvailableTileRange( - I, - R.startX, - O, - R.endX, - B - ), - a.availability.addAvailableTileRange( - I, - R.startX, - O, - R.endX, - B - ); - } - } - a.availabilityTilesLoaded.addAvailableTileRange(o, r, n, r, n); - } - l += P; - } - return ( - (_ = 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: F, - minimumHeight: p, - maximumHeight: g, - boundingSphere: H, - orientedBoundingBox: e, - horizonOcclusionPoint: c, - quantizedVertices: u, - encodedNormals: T, - indices: y, - westIndices: C, - southIndices: m, - eastIndices: h, - northIndices: G, - westSkirtHeight: _, - southSkirtHeight: _, - eastSkirtHeight: _, - northSkirtHeight: _, - childTileMask: t.availability.computeChildMaskForTile(o, r, n), - waterMask: E, - credits: t._tileCredits, - }) - ); - }) - .otherwise(function (e) { - return Cesium.when.resolve( - new Cesium.HeightmapTerrainData({ - buffer: new Uint8Array(256), - width: 16, - height: 16, - }) - ); - }); - } - } - function Mc(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 Rc(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 = Mc(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 = Lc(e, m.x, m.y, m.level, r, a)), - Cesium.defined(s) && - (r.availabilityPromiseCache[l] = s).then(u))), - { result: !0, promise: s } - ); - m = Mc(r, m.x, m.y, m.level); - } - return { result: !1 }; - } - (Dc.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 Lc(this, e, t, i, r, o); - }), - Object.defineProperties(Dc.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; - }, - }, - }), - (Dc.prototype.getLevelMaximumGeometricError = function (e) { - return this._levelZeroMaximumGeometricError / (1 << e); - }), - (Dc.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 (Rc(this, e, t, i, o[n], 0 === n).result) return; - return !1; - } - }), - (Dc.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 = Rc(this, e, t, i, o[n], 0 === n); - if (Cesium.defined(a.promise)) return a.promise; - } - }), - (Dc._getAvailabilityTile = Mc); - const Oc = 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 Bc { - constructor(e = {}) { - if ( - ((this.ready = !1), - (this.dummyTile = Zr(Oc.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) => Zr(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 Fc(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F), - (this._url = ""), - (this._show = !0); - } - function Hc(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (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); - } - (Fc.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); - }), - (Fc.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 - ); - F.setVisibility(i, !1, this._viewer, this._cesium); - var n = new ("vector" === r.type ? Dc : 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 - ); - }), - (Fc.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 - ); - F.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 - ); - }), - (Fc.prototype.createSFSTerrain = function (e, t, i, o, r) { - var n = new bc(this._viewer, t); - 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 - ); - F.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 - ); - }), - (Fc.prototype.createSFSTerrain71 = function (e, t, i, o, r) { - var n = new Pc(this._viewer, t); - 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 - ); - F.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 - ); - }), - (Fc.prototype.createWMTSTerrain = function (e, t, i, o, r) { - var n = new Bc({ 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 - ); - F.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 - ); - }), - (Fc.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 - ); - F.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 - ); - }), - (Fc.prototype.getType = function () { - return { label: "褰卞儚", value: "TerrainProvider" }; - }), - (Fc.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 }, - }; - }), - (Fc.prototype.setVisibility = function (e) { - var t, i; - e - ? (F.setVisibility(this.GroupID, !1, this._viewer, this._cesium), - (i = - "SGS" === this.type - ? ((t = this.option), new bc(this._viewer, t)) - : "SGS71" === this.type - ? ((t = this.option), new Pc(this._viewer, t)) - : "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); - }), - (Fc.prototype.getVisibility = function () { - return this._show; - }), - (Fc.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Fc.prototype.deleteObject = function () { - try { - (this.item = new this._cesium.EllipsoidTerrainProvider({})), - (this._viewer.scene.terrainProvider = this.item); - } catch (e) { - console.log(e.message); - } - }), - Object.defineProperties(Fc.prototype, {}), - (Hc.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; - (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 = f.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); - } - (f.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 = f.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.primitives.add(this._primitive); - }), - (Hc.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("/]/", "") - : f.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 - ); - }), - (Hc.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; - }), - (Hc.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 y(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); - }), - (Hc.prototype.createVolumeGeoJsonFeatureLayerProvider = function ( - e, - t, - w, - i, - o, - r - ) { - var n, - a = this, - s = { - 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, - }, - 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, - }, - 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({ ...s }, w, !0)); - "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)), - (m = b.radius / 2), - (d = b.radius / 2), - (b.shape1 = [ - new this._cesium.Cartesian2(-m, -d), - new this._cesium.Cartesian2(m, -d), - new this._cesium.Cartesian2(m, d), - new this._cesium.Cartesian2(-m, d), - ])) - : "1" == b.slttype || 1 == b.slttype - ? (b.shape = this._core.starPositions(b.number, b.exradius, b.inradius)) - : ("2" != b.slttype && 2 != b.slttype) || - ((m = b.orth_width / 2), - (d = b.orth_height / 2), - (b.shape = [ - new this._cesium.Cartesian2(-m, -d), - new this._cesium.Cartesian2(m, -d), - new this._cesium.Cartesian2(m, d), - new this._cesium.Cartesian2(-m, d), - ])); - let u = -1 < t.url.indexOf("/gisserver/"); - (n = u - ? t.url + - `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent( - "{x}" - )}/${window.encodeURIComponent("{y}")}.json` - : t.url + "?" + this._serialize(l.urlParams)), - (this._urlTemplate = n), - (this._Provider = new T( - this._viewer, - this._cesium, - u ? new Cesium.WebMercatorTilingScheme() : void 0 - )), - (this._Provider._normalTile = w.level_max - 1), - (this._Provider._minimumHeight = parseFloat(w.height || 0)), - (this.item.show = o), - (this.initThisProvider = () => { - (this.initThisProvider = void 0), - (this._Provider.loadTile = function (e, t) { - var C = e, - y = t, - v = a; - if (y.state === Cesium.QuadtreeTileLoadState.START) { - if ( - ((y.data = { lines: [], geometryPrimitive: void 0 }), - !( - y.level >= w.level_min && - y.level < w.level_max && - v.item.show - )) - ) - return void ((y.state = Cesium.QuadtreeTileLoadState.DONE), - (y.renderable = !0)); - if ( - (u && - (y.reverseY = - v._Provider.tilingScheme.getNumberOfYTilesAtLevel( - y.level - ) - - y.y - - 1), - v.TileMatrixLimits) - ) { - var i = v.TileMatrixLimits[y.level]; - if ( - !i || - y.x > i.maxCol || - y.x < i.minCol || - y.y > i.maxRow || - y.y < i.minRow - ) - return void ((y.state = Cesium.QuadtreeTileLoadState.DONE), - (y.renderable = !0)); - } - i = n - .replace(window.encodeURIComponent("{x}"), y.x) - .replace(window.encodeURIComponent("{y}"), y.reverseY || y.y) - .replace(window.encodeURIComponent("{z}"), y.level); - v._cache && (i += "&" + v._core.getuid()), - v._core.xhr({ - url: i, - type: "get", - dataType: "json", - success: function (t) { - if (null == t) - return ( - (y.state = Cesium.QuadtreeTileLoadState.DONE), - void (y.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")), - (f = parseFloat(e[0]) * b.radiusScale), - (_ = parseFloat(e[1]) * b.radiusScale), - (b.shape = [ - new v._cesium.Cartesian2(-f, -_), - new v._cesium.Cartesian2(f, -_), - new v._cesium.Cartesian2(f, _), - new v._cesium.Cartesian2(-f, _), - ])) - : (b.shape = v._core.computeCircle( - e * b.radiusScale - )) - : (b.shape = v._core.computeCircle(0.5)); - } - v.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]), - v._core.isHtmlColor(b.material) - ? (b.material = v._color.colorFromHtmlColor( - b.material - )) - : (/^rgb/.test(b.material) && - (b.material = - v._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 = v._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 = v._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 = v._cesium.Cartesian3.fromDegrees( - l[0], - l[1], - b.height - ); - r.push(h), n.push(b.material); - } - } - (y._minimumHeight = a), - (b.position = r), - (o.positions = r); - var m, - d = "", - p = "", - g = - ((p = - ("0" != b.slttype && 0 != b.slttype) || - (y.level >= parseFloat(w.level_max) - 8 && - 19 < parseFloat(w.level_max)) || - (y.level >= parseFloat(w.level_max) - 4 && - 16 < parseFloat(w.level_max)) || - y.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 v._cesium.PolylineVolumeGeometry(m)) - : ((d = ""), - (m = { - positions: b.position, - width: 1, - vertexFormat: - v._cesium.PolylineColorAppearance - .VERTEX_FORMAT, - colors: n, - }), - new v._cesium.PolylineGeometry(m))), - new v._cesium.GeometryInstance({ - id: o, - geometry: p, - attributes: { - color: - new v._cesium.ColorGeometryInstanceAttribute.fromColor( - b.material - ), - }, - })); - "" == d && - (g = new v._cesium.GeometryInstance({ - id: o, - geometry: p, - })), - e.push(g); - } - var f = - "material:" + - 255 * b.material.red + - "," + - 255 * b.material.green + - "," + - 255 * b.material.blue, - _ = - (v.Legend.push(f), - 0 == e.length && - ((y.state = Cesium.QuadtreeTileLoadState.DONE), - (y.renderable = !0)), - null), - _ = - "" == d - ? new v._cesium.Primitive({ - appearance: - new v._cesium.PolylineColorAppearance(), - geometryInstances: e, - }) - : new v._cesium.Primitive({ - allowPicking: !0, - appearance: - new v._cesium.PerInstanceColorAppearance({ - translucent: !1, - vertexShaderSource: - v._core.Shaders("vertexShaderSource"), - fragmentShaderSource: v._core.Shaders( - "fragmentShaderSource" - ), - }), - shadows: b.shadows, - geometryInstances: e, - }); - (y.data.geometryPrimitive = _), - (y.state = Cesium.QuadtreeTileLoadState.LOADING), - y.state === Cesium.QuadtreeTileLoadState.LOADING && - (y.data.geometryPrimitive.update(C, []), - (y.state = Cesium.QuadtreeTileLoadState.DONE), - (y.renderable = !0)); - }, - error: function () { - (y.state = Cesium.QuadtreeTileLoadState.DONE), - (y.renderable = !0); - }, - }), - (y.state = Cesium.QuadtreeTileLoadState.LOADING); - } - }), - "function" == typeof r && r(this.item); - }); - let c, h; - (this.saveDefaultVectorData = () => { - h = a._core.extend({}, w, !0); - }), - (this.restoreVector = () => { - h && - ((w = h), - (b = a._core.extend({ ...s }, w, !0)), - (a._Provider._normalTile = w.level_max - 1), - a._primitive && - a._primitive._tilesToRender && - a._primitive._tilesToRender.length && - (a._primitive._tilesToRender.forEach((e) => { - e.data.geomeitryPrimitive && - e.data.geomeitryPrimitive.destroy(), - (e.state = Cesium.QuadtreeTileLoadState.START); - }), - a._primitive._tileToUpdateHeights.forEach((e) => { - e.data.geomeitryPrimitive && - e.data.geomeitryPrimitive.destroy(), - (e.state = Cesium.QuadtreeTileLoadState.START); - }), - (a._primitive._tileToUpdateHeights = []), - (a._primitive._tilesToRender = []))), - (h = void 0); - }), - (this.updataVector = (e = {}) => { - var t, i; - e.material && - e.material && - (e.material = Cesium.Color.fromCssColorString(e.material)), - (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)), - "string" == typeof e.radius && - -1 < e.radius.indexOf("[") && - -1 < e.radius.indexOf("]") - ? ((b.radius = b.radius.replace("[", "")), - (b.radius = b.radius.replace("]", "")), - (b.shape = void 0)) - : e.radius && - ("0" == b.slttype || 0 == b.slttype - ? ((b.shape = this._core.computeCircle(b.radius)), - (t = b.radius / 2), - (i = b.radius / 2), - (b.shape1 = [ - new this._cesium.Cartesian2(-t, -i), - new this._cesium.Cartesian2(t, -i), - new this._cesium.Cartesian2(t, i), - new this._cesium.Cartesian2(-t, i), - ])) - : "1" == b.slttype || 1 == b.slttype - ? (b.shape = this._core.starPositions( - b.number, - b.exradius, - b.inradius - )) - : ("2" != b.slttype && 2 != b.slttype) || - ((t = b.orth_width / 2), - (i = b.orth_height / 2), - (b.shape = [ - new this._cesium.Cartesian2(-t, -i), - new this._cesium.Cartesian2(t, -i), - new this._cesium.Cartesian2(t, i), - new this._cesium.Cartesian2(-t, i), - ]))), - (w = a._core.extend(w, e, !0)), - (b = a._core.extend(b, w, !0)), - (a._Provider._normalTile = w.level_max - 1), - a._primitive && - a._primitive._tilesToRender && - a._primitive._tilesToRender.length && - (clearTimeout(c), - (c = setTimeout(() => { - a._primitive._tilesToRender.forEach((e) => { - e.data.geomeitryPrimitive && - e.data.geomeitryPrimitive.destroy(), - (e.state = Cesium.QuadtreeTileLoadState.START); - }), - a._primitive._tileToUpdateHeights.forEach((e) => { - e.data.geomeitryPrimitive && - e.data.geomeitryPrimitive.destroy(), - (e.state = Cesium.QuadtreeTileLoadState.START); - }), - (a._primitive._tileToUpdateHeights = []), - (a._primitive._tilesToRender = []); - }, 100))); - }), - (this._primitive = new this._cesium.QuadtreePrimitivezh({ - tileProvider: this._Provider, - tileCacheSize: 1, - maximumScreenSpaceError: 3, - })); - var m = this._viewer.scene.primitives, - d = - (w && - w.time && - ((this._Provider._availability = - new a._cesium.TimeIntervalCollection([ - new a._cesium.TimeInterval({ - start: w.time.start - ? a._cesium.JulianDate.fromDate(new Date(w.time.start)) - : a._cesium.Iso8601.MINIMUM_VALUE, - stop: w.time.end - ? a._cesium.JulianDate.fromDate(new Date(w.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); - })), - m.add(this._primitive), - this._core.getWMTSData( - { - url: t.url, - layer: t.layer, - srs: t.srs || "EPSG:4490", - gisserverTMS: u, - }, - (e) => { - (a.item.boundingSphere = e.boundingSphere), - (a.TileMatrixLimits = e.TileMatrixLimits), - a.initThisProvider(); - } - ), - o || this.setVisibility(!1), - this._core.isnull(b.id) && (b.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + b.id), - { - 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(d), - this._tree.insertGroupId(d, this._core.isnull(i) ? 0 : i), - this - ); - }); - var Vc = - "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 Gc(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (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); - } - (Hc.prototype._serialize = function (e) { - var t, - i = [], - o = window.encodeURIComponent; - for (t in e) { - var r = e[t]; - "object" === (void 0 === r ? "undefined" : Vc(r)) - ? i.push(o(t) + "=" + o(JSON.stringify(r))) - : i.push(o(t) + "=" + o(e[t])); - } - return i.join("&"); - }), - (Hc.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization = function ( - e, - t, - h, - i, - o, - r - ) { - var n, - 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, - }, - 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(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(a, h, !0), - l = - ("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) || - ((a = d.orth_width / 2), - (n = d.orth_height / 2), - (d.shape = [ - new m._cesium.Cartesian2(-a, -n), - new m._cesium.Cartesian2(a, -n), - new m._cesium.Cartesian2(a, n), - new m._cesium.Cartesian2(-a, n), - ])), - null == t && console.log("geoOptions is required"), - null == e && console.log("layername is required"), - []); - (this._urlTemplate = t.url + "?" + this._serialize(s.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 () { - l = f.remove(l, 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.primitives.add(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); - a = { - 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(a), - this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), - "function" == typeof r && r(this.item); - }), - (Hc.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Hc.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]); - }), - (Hc.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 }, - }; - }), - (Hc.prototype.deleteObject = function () { - this._viewer.scene.primitives.remove(this.item); - try { - this._Provider.remove(); - } catch (e) {} - }), - (Hc.prototype.getLegend = function () { - var e = []; - return (e = null != this.Legend ? this._core.unique(this.Legend) : e); - }), - (Hc.prototype.setRefresh = function (e) { - try { - this._Provider && this._Provider.setStatus(!e); - } catch (e) {} - }), - (Hc.prototype.setVisibility = function (e) { - (this.item.show = e), this._Provider && this._Provider.setStatus(e); - }), - (Hc.prototype.isCache = function (e) { - this._cache = e; - }), - (Hc.prototype.edit = function (e, t) { - return ( - (this.isEditting = e), - (this.editoption = t), - this._Provider && this._Provider.edit && this._Provider.edit(e, t) - ); - }), - (Hc.prototype.forceRefresh = function () { - try { - for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) - this._Provider.quadtree._levelZeroTiles[e].freeResources(); - } catch (e) {} - }); - var kc = - "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 Nc(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 jc(e, t) { - (this._viewer = e), (this._cesium = t), (this._core = new v()); - } - (Gc.prototype._serialize = function (e) { - var t, - i = [], - o = window.encodeURIComponent; - for (t in e) { - var r = e[t]; - "object" === (void 0 === r ? "undefined" : kc(r)) - ? i.push(o(t) + "=" + o(JSON.stringify(r))) - : i.push(o(t) + "=" + o(e[t])); - } - return i.join("&"); - }), - (Gc.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._core._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 = f.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 = f.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); - }), - (Gc.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 = f.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 = f.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); - }), - (Gc.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 = f.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 = f.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 - ); - }), - (Gc.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), - _serialize, - 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 = f.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 = f.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); - }), - (Gc.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("/]/", "") - : f.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 - ); - }), - (Gc.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; - }), - (Gc.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 y(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); - }), - (Gc.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Gc.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 }, - }; - }), - (Gc.prototype.deleteObject = function () { - this._viewer.scene.primitives.remove(this.item); - try { - this._Provider.remove(); - } catch (e) {} - }), - (Gc.prototype.setRefresh = function (e) { - try { - this._Provider && this._Provider.setStatus(e); - } catch (e) {} - }), - (Gc.prototype.setVisibility = function (e) { - try { - null != this.item && null != this.item.show && (this.item.show = e), - this._Provider && this._Provider.setStatus(e); - } catch (e) {} - }), - (Gc.prototype.isCache = function (e) { - this._cache = e; - }), - (Gc.prototype.edit = function (e, t) { - return ( - (this.isEditting = e), - (this.editoption = t), - this._Provider && this._Provider.edit && this._Provider.edit(e, t) - ); - }), - (Gc.prototype.forceRefresh = function () { - try { - for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++) - this._Provider.quadtree._levelZeroTiles[e].freeResources(); - } catch (e) {} - }), - (Nc.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 - ); - }), - (Nc.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 - ); - }), - (Nc.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 - ); - }), - (jc.prototype.createWindField = function (e, t) { - var i = this; - return ( - (this.WindFieldOption = { - color: this._cesium.Color.WHITE, - speed: 0.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 - ); - }), - (jc.prototype._init = function () { - this.windField = this.createField(); - for (var e = 0; e < this.WindFieldOption.num; e++) - this.particles.push(this.randomParticle(new zc())); - }), - (jc.prototype.createField = function () { - var e = this._parseWindJson(); - return new Uc(e); - }), - (jc.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); - }), - (jc.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 } - ); - }), - (jc.prototype.removeLines = function () { - this.lines && (this.primitives.remove(this.lines), this.lines.destroy()); - }), - (jc.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; - }), - (jc.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, - }), - }); - }), - (jc.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); - }), - (jc.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 - ); - }), - (jc.prototype.changeColor = function (e) { - this.WindFieldOption.color = - "random" === e ? e : this._cesium.Color.fromCssColorString(e); - }), - (jc.prototype.setSpeed = function (e) { - this.WindFieldOption.speed = e; - }), - (jc.prototype.setMaxAge = function (e) { - this.WindFieldOption.maxAge = e; - }), - (jc.prototype.setBrighten = function (e) { - this.WindFieldOption.brighten = e; - }), - (jc.prototype.destroy = function () { - this.timer && clearInterval(this.timer), - (this.timer = void 0), - this.removeLines(); - }); - var zc = function () { - (this.x = null), - (this.dx = null), - (this.dx = null), - (this.y = null), - (this.age = null), - (this.birthAge = null), - (this.path = null); - }, - Uc = 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); - }, - Wc = - ((Uc.prototype = { - constructor: Uc, - _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; - }, - }), - "uniform vec4 u_moveColor;\nuniform vec4 u_lineColor;\n#define PI_OVER_TWO 1.5707963\nczm_material czm_getMaterial(czm_materialInput materialInput){\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat iTime = czm_frameNumber / 60.0 * {speed};\nvec2 uv = materialInput.st;\nvec4 finalColor = u_lineColor;\nfloat dt = clamp(tan(uv.x * 5.0 - iTime * 1.0) * 0.3 - 0.1, 0.5, PI_OVER_TWO);\nfinalColor = mix(finalColor, u_moveColor, dt);\nfloat alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0);\nmaterial.diffuse = finalColor.xyz;\nmaterial.alpha = alpha;\nreturn material;\n}\n"); - function Yc(e) { - (this._viewer = e), - (this.PrimitiveCollection = []), - (this.lineColor = - Cesium.Color.fromCssColorString("#330066").withAlpha(0.8)), - (this.pointColor = - Cesium.Color.fromCssColorString("#CCFFFF").withAlpha(1)); - } - (Yc.prototype.create = function (e = {}) { - (this.position = e.position || void 0), - (this.positions = e.positions || void 0), - (this.linewidth = e.width || 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.color && (this.lineColor = Cesium.Color.fromCssColorString(e.color)), - e.pointColor && - (this.pointColor = Cesium.Color.fromCssColorString(e.pointColor)), - this.getShader(), - (this.collection = new Cesium.PrimitiveCollection()), - (this.collection._guid = this._id), - this._viewer.scene.primitives.add(this.collection), - this.PrimitiveCollection.push(this.collection), - this.addPathLayer(); - }), - (Yc.prototype.addPathLayer = async function () { - this.position - ? this.getInstance() - : this.positions && this.getInstances(), - this.instances.forEach((e) => { - this.addGroundLine(e); - }); - }), - (Yc.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; - }), - (Yc.prototype.remove = function (e) { - e = this.getById(e); - e && this._viewer.scene.primitives.remove(e); - }), - (Yc.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 = []; - }), - (Yc.prototype.show = function (e) { - for (var t = 0; t < this.PrimitiveCollection.length; t++) - this.PrimitiveCollection[t].show = e; - }), - (Yc.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 - ), - }, - }); - }), - (Yc.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); - } - }), - (Yc.prototype.addGroundLine = async function (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); - }), - (Yc.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); - }), - (Yc.prototype.getShader = function () { - this.fs = Wc.replace("{speed}", this._speed.toFixed(1)); - }); - var Jc, - Kc = - "uniform vec4 u_moveColor;\nuniform vec4 u_wallColor;\n#define PI_OVER_TWO 1.5707963\nczm_material czm_getMaterial(czm_materialInput materialInput){\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat iTime = czm_frameNumber / 60.0 * {speed};\nvec2 uv = materialInput.st;\nvec4 finalColor = u_wallColor;\nfloat dt = clamp(tan(uv.y * 5.0 - iTime) * 0.3 - 0.1, 0.5, PI_OVER_TWO);\nfinalColor = mix(finalColor, u_moveColor, dt);\nfloat alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0);\nif(uv.y < 0.5){\nalpha = 1.0;\nfinalColor = u_wallColor;\nif(uv.y > 0.4){\nalpha = (0.5 - uv.y) * 5.0 + 0.5;\n}\n}\nmaterial.diffuse = finalColor.xyz;\nmaterial.alpha = alpha;\nreturn material;\n}\n"; - function Qc(e) { - (this._viewer = e), - (this.PrimitiveCollection = []), - (this.color = Cesium.Color.BLUE); - } - function qc(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._Color = new m(this._viewer, this._cesium)), - (this._core = new v()), - (this._getPosition = new C(this._viewer, this._cesium)), - (this._tree = F), - (this._polylines = []), - (this.Streamerpath = new Yc(this._viewer)), - (this.Streamerwall = new Qc(this._viewer)); - } - function Xc(e) { - (this._viewer = e), - (this._cesium = Cesium), - (this._core = new v()), - (this._Buffer = new Si(e, Cesium)), - (this._tree = F); - } - function Zc(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F); - } - function K(e) { - (this._viewer = e), - (this._core = new v()), - (this._tree = F), - (this._getPosition = new C(this._viewer, Cesium)), - (this._popupmessage = new yi(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 = !1), - (this.openEdit = !0); - } - function $c(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (this._Provider = void 0); - } - function eh(e) { - (this._viewer = e), - (this._cesium = Cesium), - (this._core = new v()), - (this._tree = F), - (this.texturePixel = 1024); - } - function th(e) { - (this._viewer = e), (this._core = new v()); - } - function ih(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._tree = F); - } - function oh(e) { - if ( - ((this._viewer = e), - (this._cesium = Cesium), - (this._core = new v()), - (this._tree = F), - !window.h337) - ) { - let e = new oe(!1); - e.addJs(window.SmartEarthRootUrl + "Workers/heatmap/heatmap.min.js"), - e.addJs(window.SmartEarthRootUrl + "Workers/heatmap/webgl-heatmap.js"); - } - } - function rh(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this.TrailEntitys = []); - } - function nh(e) { - (this.lon = 0), - (this.lat = 0), - (this.hei = e), - (this.phei = e / 2), - (this.time = 0); - } - function ah(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._color = new m(this._viewer, this._cesium)), - (this._tree = F), - (this.item = { show: !0 }), - (this._option = void 0), - (this._primitive = void 0), - (this._Provider = void 0); - } - function sh(e) { - (this._viewer = e), (Jc = e); - } - function lh(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this.isPause = !1), - (this.isLoad = !1); - } - function uh(e, t) { - if ( - ((this._viewer = e), - (this._cesium = t), - (this._core = new v()), - !Cesium.GeoWTFS) - ) { - let e = new oe(!1); - e.addJs(window.SmartEarthRootUrl + "Workers/cesiumTdt.js"); - } - } - function ch(e) { - (this._viewer = e), (this._core = new v()), (this._tree = F); - } - function hh(e) { - (this._viewer = e), (this._core = new v()); - } - (Qc.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); - }), - (Qc.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; - }), - (Qc.prototype.remove = function (e) { - e = this.getById(e); - null != e && this._viewer.scene.primitives.remove(e); - }), - (Qc.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 = []; - }), - (Qc.prototype.show = function (e) { - for (var t = 0; t < this.PrimitiveCollection.length; t++) - this.PrimitiveCollection[t].show = e; - }), - (Qc.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 - ), - }, - }), - ]; - }), - (Qc.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); - } - }), - (Qc.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(0.5), - u_moveColor: this.color, - }, - }, - }), - }), - }); - this.collection.add(e); - }); - }), - (Qc.prototype.getShader = function () { - this.fs = Kc.replace("{speed}", this._speed.toFixed(1)); - }), - (qc.prototype.createPathLayer = function (e = {}) { - var t = { - color: e.color || "#0033FF", - width: e.width || 5, - pointColor: e.pointColor || "#FFFFFF", - id: e.id || this._core.getuid(), - near: e.near, - far: e.far, - speed: e.speed || 1, - }; - let i = Cesium.GeoJsonDataSource.load(e.url), - o = [], - r = []; - i.then((e) => { - var i = e.entities.values; - for (let t = 0; t < i.length; t++) { - let e = i[t]; - e.polyline - ? (r.push(e.polyline.positions.getValue()), - (o = o.concat(r[r.length - 1]))) - : e.polygon && - (r.push(e.polygon.hierarchy.getValue().positions), - (o = o.concat(r[r.length - 1]))); - } - (this.boundingSphere = Cesium.BoundingSphere.fromPoints(o)), - (o = null), - this.Streamerpath.create({ positions: r, ...t }); - }), - (this.updateLayer = (e = {}) => { - (t = this._core.extend(t, e, !0, !0)), - this.Streamerpath.removeAll(), - this.Streamerpath.create({ positions: r, ...t }); - }); - e = { - id: t.id, - name: "鏂板缓娴佸厜绾垮浘灞�", - pId: 0, - type: "TrailLineLayer", - item: this, - }; - return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this; - }), - (qc.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), - o = [], - r = []; - i.then((e) => { - var i = e.entities.values; - for (let t = 0; t < i.length; t++) { - let e = i[t]; - e.polyline - ? (r.push(e.polyline.positions.getValue()), - (o = o.concat(r[r.length - 1]))) - : e.polygon && - (r.push(e.polygon.hierarchy.getValue().positions), - (o = o.concat(r[r.length - 1]))); - } - (this.boundingSphere = Cesium.BoundingSphere.fromPoints(o)), - (o = null), - this.Streamerwall.create({ positions: r, ...t }); - }), - (this.updateLayer = (e = {}) => { - (t = this._core.extend(t, e, !0, !0)), - this.Streamerwall.removeAll(), - this.Streamerwall.create({ positions: r, ...t }); - }); - e = { - id: t.id, - name: "鏂板缓娴佸姩澧欏浘灞�", - pId: 0, - type: "TrailLineLayer", - item: this, - }; - return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this; - }), - (qc.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 + I.TrailLine - ), - height: 5e4, - num: 100, - width: 2, - LightSpot: !1, - alpha: 0.3, - }, - o = this._core.extend(o, i, !0), - r = ie({ - color: Cesium.Color.fromCssColorString(o.LineColor), - image: o.LinkImage, - time: o.time, - alpha: o.alpha, - lightSpot: o.LightSpot, - lightSpotColor: Cesium.Color.fromCssColorString( - o.lightSpotColor || o.LineColor - ), - twoColor: !!o.twoColor, - color1: - o.twoColor && - o.twoColor.color1 && - Cesium.Color.fromCssColorString(o.twoColor.color1), - color2: - o.twoColor && - o.twoColor.color2 && - Cesium.Color.fromCssColorString(o.twoColor.color2), - }); - let n = new Cesium.PrimitiveCollection(); - this._viewer.scene.primitives.add(n), this._polylines.push(n); - var a = i.inflow; - let s, l; - for (var u = 0; u < t.length; u++) { - a ? ((s = t[u]), (l = e)) : ((l = t[u]), (s = e)); - for ( - var c = this.parabolaEquation({ - pt1: s, - pt2: l, - height: o.height, - num: o.num, - }), - h = [], - m = 0; - m < c.length; - m++ - ) - h.push(c[m][0], c[m][1], c[m][2]); - n.add(this.getPolylinePrimitive(h, r, o)); - } - this.pathMaterial = r; - i = { - id: this._core.getuid(), - name: "鏂板缓娴佸姩璺緞", - pId: 0, - type: "TrailLinePrimitive", - item: this, - }; - return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this; - }), - (qc.prototype.getPolylinePrimitive = function (e, t, i = {}) { - let o = i.clampToGround - ? Cesium.GroundPolylineGeometry - : Cesium.PolylineGeometry; - (e = new o({ - positions: - "object" == typeof e[0] - ? e - : Cesium.Cartesian3.fromDegreesArrayHeights(e), - width: i.width, - })), - (e = new Cesium.GeometryInstance({ - geometry: e, - attributes: { - distanceDisplayCondition: - new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( - i.near, - i.far - ), - }, - })); - let r = i.clampToGround - ? Cesium.GroundPolylinePrimitive - : Cesium.Primitive; - return new r({ - geometryInstances: e, - appearance: new Cesium.PolylineMaterialAppearance({ material: t }), - }); - }), - (qc.prototype.createFlyingLine = function (e, t = {}) { - var i = this._core.extend( - { time: 3e3, color: "#ffffff", width: 1, alpha: 0 }, - t, - !0 - ), - o = ie({ - lightSpotColor: Cesium.Color.fromCssColorString(i.color), - time: i.time, - alpha: i.alpha, - lightSpot: !0, - }); - let r = new Cesium.PrimitiveCollection(); - this._viewer.scene.primitives.add(r), this._polylines.push(r); - let n; - e.forEach((e) => { - (n = [e.lon, e.lat, i.minHeight, e.lon, e.lat, e.height]), - r.add(this.getPolylinePrimitive(n, o, i)); - }); - t = { - id: this._core.getuid(), - name: "鏂板缓鍨傜洿椋炵嚎", - pId: 0, - type: "TrailLinePrimitive", - item: this, - }; - return this.setTreeobj(t), this._tree.insertGroupId(t, 0), this; - }), - (qc.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 + I.TrailLine - ), - height: 5e4, - width: 10, - LightSpot: !1, - alpha: 0.3, - }, - i = this._core.extend(i, t, !0), - t = ie({ - color: Cesium.Color.fromCssColorString(i.LineColor), - image: i.LinkImage, - time: i.time, - alpha: i.alpha, - lightSpot: i.LightSpot, - lightSpotColor: Cesium.Color.fromCssColorString( - i.lightSpotColor || i.LineColor - ), - twoColor: !!i.twoColor, - color1: - i.twoColor && - i.twoColor.color1 && - Cesium.Color.fromCssColorString(i.twoColor.color1), - color2: - i.twoColor && - i.twoColor.color2 && - Cesium.Color.fromCssColorString(i.twoColor.color2), - }), - 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]) - ); - (t = this._viewer.scene.primitives.add( - this.getPolylinePrimitive(o, t, i) - )), - this._polylines.push(t), - (i = { - id: this._core.getuid(), - name: "鏂板缓娴佸姩绾�", - pId: 0, - type: "TrailLinePrimitive", - item: this, - }); - return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this; - }), - (qc.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 + I.colors3 - ), - }, - t = new te( - (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: "TrailLinePrimitive", - item: this, - }; - return this.setTreeobj(t), this._tree.insertGroupId(t, 0), this; - }), - (qc.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(-0.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(-0.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; - }), - (qc.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)); - }), - (qc.prototype.clear = function () { - if (0 < this._polylines.length) - for (var e = 0; e < this._polylines.length; e++) - (this._polylines[e] instanceof Cesium.Entity - ? this._viewer.entities - : this._viewer.scene.primitives - ).remove(this._polylines[e]); - (this._polylines = []), - this.Streamerpath.removeAll(), - this.Streamerwall.removeAll(); - }), - (qc.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (qc.prototype.deleteObject = function () { - this.clear(); - }), - (qc.prototype.setVisibility = function (e) { - if (0 < this._polylines.length) - for (var t = 0; t < this._polylines.length; t++) - this._polylines[t].show = e; - this.Streamerpath.show(e), this.Streamerwall.show(e); - }), - (Xc.prototype.createRoad = function (e = {}) { - var t = { - id: e.id || this._core.getuid(), - image: window.SmartEarthRootUrl + I.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; - }), - (Xc.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Xc.prototype.deleteObject = function () { - this.item && this._viewer.entities.remove(this.item); - }), - (Xc.prototype.setVisibility = function (e) { - this.item && (this.item.show = e); - }), - (Zc.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 - ); - }), - (K.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 + I.draw - ), - (this.drawHandler = new Cesium.ScreenSpaceEventHandler(a.scene.canvas)), - (F.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 () { - F.states = 0; - }, 100), - "cancel" === e - ? u && (a.entities.remove(u), n.MilitaryStandardObj.pop()) - : t && t(u); - }), - this - ); - }), - (K.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 + I.draw - ), - (F.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 () { - F.states = 0; - }, 100), - "cancel" === e - ? c && (a.entities.remove(c), n.MilitaryStandardObj.pop()) - : t && t(c); - }), - this - ); - }), - (K.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 + I.draw - ), - (F.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 () { - F.states = 0; - }, 100), - "cancel" === e - ? l && (s.entities.remove(l), a.MilitaryStandardObj.pop()) - : t && t(l); - }), - this - ); - }), - (K.prototype.createStraightArrow = function (e, o, t) { - var r, - n = e, - a = this, - s = this._viewer, - l = [], - u = void 0, - c = [], - h = "鍗曞嚮寮�濮嬬粯鍒�"; - return ( - (F.states = 1), - this.drawHandler && - (this.drawHandler.destroy(), (this.drawHandler = void 0)), - a._core.mouse( - a._viewer.container, - 1, - window.SmartEarthRootUrl + I.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 () { - F.states = 0; - }, 100), - "cancel" === e - ? u && (s.entities.remove(u), a.MilitaryStandardObj.pop()) - : t && t(u); - }), - this - ); - }), - (K.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 + I.draw - ), - (F.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 () { - F.states = 0; - }, 100), - "cancel" === e - ? h && (l.entities.remove(h), s.MilitaryStandardObj.pop()) - : t && t(h); - }), - this - ); - }), - (K.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 + I.draw - ), - (F.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 () { - F.states = 0; - }, 100), - "cancel" === e - ? r && (u.entities.remove(r), c.MilitaryStandardObj.pop()) - : t && t(r); - }), - this - ); - }), - (K.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 + I.draw - ), - (F.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 () { - F.states = 0; - }, 100), - "cancel" === e - ? m && (l.entities.remove(m), s.MilitaryStandardObj.pop()) - : t && t(m); - }), - this - ); - }), - (K.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 + I.draw - ), - (F.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 () { - F.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); - }), - (K.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 + I.draw - ), - (F.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 () { - F.states = 0; - }, 100), - t && t(u); - }, Cesium.ScreenSpaceEventType.RIGHT_DOWN); - }), - (K.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 + I.draw - ), - (F.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 () { - F.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 - ); - }), - (K.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; - }), - (K.prototype.addFeature = function (e) { - let t, - i = e.geometry.coordinates, - o = []; - if ("PincerArrow" == e.type) { - var r = z.algorithm.doubleArrow(i); - let e = []; - -1 == JSON.stringify(r.polygonalPoint).indexOf("null") && - (e = r.polygonalPoint), - (t = e); - } else if ("AttackArrow" == e.type) { - r = z.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({ - id: e.id, - 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({ - id: e.id, - 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), - e.removeEdit || this.MilitaryStandardObj.push(a.id), - this.defaultEdit(), - a - ); - }), - (K.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); - }; - }), - (K.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); - }), - (K.prototype.getColor = function (e) { - return { - color: this.colorHex( - "rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")" - ), - alpha: e.alpha, - }; - }), - (K.prototype.getFeature = function (e) { - let t = { id: e.id, 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 - ); - }), - (K.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"); - }), - (K.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; - } - }), - (K.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(0.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 - ); - }), - (K.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 - ); - }), - (K.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; - }), - (K.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]) }; - }), - (K.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 = z.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 - ); - }), - (K.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 = z.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)") - ), - }), - }); - }), - (K.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]; - }), - (K.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; - }), - (K.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; - }), - (K.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; - }), - (K.prototype._createBezierPoints = function (e) { - for (var t = [], i = 0; i <= 100; i++) { - var o = this._computeBezierPoints(e, i / 100); - t.push(o); - } - return t; - }), - (K.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 }; - }), - (K.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; - }), - (K.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, 0.5 * a)[0]).x + o.x, - y: n.y + o.y, - }), - s.push(t, i, o, r, e, a)), - s - ); - }), - (K.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, - f = c + m, - _ = h + d, - C = Math.sqrt(f * f + _ * _), - f = f / C, - _ = _ / C; - Math.abs(1 - (c * m + h * d)) < 0.005 - ? ((l.x = s.x - m * p * 0.4), - (l.y = s.y - d * p * 0.4), - (u.x = s.x + c * g * 0.4), - (u.y = s.y + h * g * 0.4)) - : ((l.x = s.x - f * p * 0.4), - (l.y = s.y - _ * p * 0.4), - (u.x = s.x + f * g * 0.4), - (u.y = s.y + _ * g * 0.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; - }), - (K.prototype.calculatePointsFBZ3 = function (e, t) { - var i = [], - o = 0.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; - }), - (K.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] - ); - }), - (K.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 - ); - }), - (K.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 + 0.265625 * (e - n), y: n - 0.265625 * (o - r) }), - (a[2] = { x: r + 0.078125 * (e - n), y: n - 0.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 - 0.078125 * (e - n), y: n + 0.078125 * (o - r) }), - (a[7] = { x: r - 0.265625 * (e - n), y: n + 0.265625 * (o - r) }), - a - ); - }), - (K.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 }, - f = this.calculateVector(g, Math.PI / 2, n / 2), - _ = f[0], - f = f[1], - C = this.calculateVector(p, Math.PI / 2, n / 2), - y = C[0], - C = C[1], - _ = { x: m.x + _.x, y: m.y + _.y }, - m = { x: m.x + f.x, y: m.y + f.y }, - f = { x: d.x + y.x, y: d.y + y.y }, - y = { x: d.x + C.x, y: d.y + C.y }, - d = this.calculateIntersection(g, p, _, f), - C = this.calculateIntersection(g, p, m, y); - (p = - 0 == c - ? ((h = { x: ((l = _).x + d.x) / 2, y: (l.y + d.y) / 2 }), - { x: ((u = m).x + C.x) / 2, y: (u.y + C.y) / 2 }) - : ((f = a[a.length - 1]), - (g = s[s.length - 1]), - (h = { x: (f.x + d.x) / 2, y: (f.y + d.y) / 2 }), - { x: (g.x + C.x) / 2, y: (g.y + C.y) / 2 })), - a.push(h), - s.push(p), - a.push(d), - s.push(C); - } - for ( - var v, - w, - b, - T = e[e.length - 2], - E = e[e.length - 1], - S = { x: E.x - T.x, y: E.y - T.y }, - P = Math.sqrt(S.x * S.x + S.y * S.y), - x = [], - D = { x: void 0, y: void 0 }, - I = { x: void 0, y: void 0 }, - A = { x: void 0, y: void 0 }, - L = { x: void 0, y: void 0 }, - M = { x: void 0, y: void 0 }, - F = { x: void 0, y: void 0 }, - R = a[a.length - 1], - O = s[s.length - 1], - F = - P <= n - ? ((D = (x = this.calculateVector(S, Math.PI / 2, n / 2))[0]), - (I = x[1]), - (w = { x: T.x + D.x, y: T.y + D.y }), - (b = { x: T.x + I.x, y: T.y + I.y }), - (A = { x: (R.x + w.x) / 2, y: (R.y + w.y) / 2 }), - (L = { x: (O.x + b.x) / 2, y: (O.y + b.y) / 2 }), - a.push(A), - s.push(L), - (M = { x: 2 * w.x - T.x, y: 2 * w.y - T.y }), - { x: 2 * b.x - T.x, y: 2 * b.y - T.y }) - : ((P = E.x - T.x), - (T = E.y - T.y), - (v = Math.sqrt(P * P + T * T)), - (P = E.x - (P * n) / v), - (T = E.y - (T * n) / v), - (D = (x = this.calculateVector(S, Math.PI / 2, n / 2))[0]), - (I = x[1]), - (w = { x: P + D.x, y: T + D.y }), - (b = { x: P + I.x, y: T + I.y }), - (A = { x: (R.x + w.x) / 2, y: (R.y + w.y) / 2 }), - (L = { x: (O.x + b.x) / 2, y: (O.y + b.y) / 2 }), - a.push(A), - s.push(L), - (M = { x: 2 * w.x - P, y: 2 * w.y - T }), - { x: 2 * b.x - P, y: 2 * b.y - T }), - B = [], - H = [], - r = 0; - r < a.length - 2; - r++ - ) - var V = [], - G = [], - k = a[r], - N = a[r + 1], - j = a[r + 2], - z = s[r], - U = s[r + 1], - W = s[r + 2], - k = (V.push(k, N, j), G.push(z, U, W), this._createBezierPoints(V)), - N = this._createBezierPoints(G), - B = B.concat(k), - H = H.concat(N); - (v = (v = [l]).concat(B)).push(w), - v.push(M), - v.push(E), - v.push(F), - v.push(b), - (v = v.concat(H.reverse())).push(u); - } else v = this.calculateTwoPoints(e); - return v; - }), - (K.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 }; - }), - (K.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; - }), - (K.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 = 0.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, - f = 1.5 * Math.PI, - _ = g, - C = 0; - C < Math.abs(g - f); - C += d - ) { - var y = n + r * Math.cos(_), - v = a + r * Math.sin(_), - _ = - (_ = (_ += d) < 0 ? 2 * Math.PI + _ : _) > 2 * Math.PI - ? 2 * Math.PI - _ - : _; - p.push({ x: y, y: v }); - } - for ( - var w = p, b = (3 * Math.PI) / 2, T = 2 * Math.PI, E = b, C = 0; - C < Math.abs(b - T); - C += d - ) { - (y = s + r * Math.cos(E)), - (v = l + r * Math.sin(E)), - (E = - (E = (E += d) < 0 ? 2 * Math.PI + E : E) > 2 * Math.PI - ? 2 * Math.PI - E - : E); - w.push({ x: y, y: v }); - } - for ( - var S = w, P = 0.5 * Math.PI, x = 0, C = 0; - C < Math.abs(0 - P); - C += d - ) { - (y = u + r * Math.cos(x)), - (v = c + r * Math.sin(x)), - (x = - (x = (x += d) < 0 ? 2 * Math.PI + x : x) > 2 * Math.PI - ? 2 * Math.PI - x - : x); - S.push({ x: y, y: v }); - } - for ( - var D = S, I = 0.5 * Math.PI, A = Math.PI, L = I, C = 0; - C < Math.abs(I - A); - C += d - ) { - (y = h + r * Math.cos(L)), - (v = m + r * Math.sin(L)), - (L = - (L = (L += d) < 0 ? 2 * Math.PI + L : L) > 2 * Math.PI - ? 2 * Math.PI - L - : L); - D.push({ x: y, y: v }); - } - return D; - }), - (K.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; - }), - (K.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; - }), - (K.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 f = s + u * Math.cos(d), - _ = 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: f, y: _ }); - } - } else { - d = h < c ? c : h; - for (g = 0; g < 2 * Math.PI - Math.abs(c - h); g += m) { - (f = s + u * Math.cos(d)), (_ = 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: f, y: _ }); - } - } - return p; - }), - (K.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)) - ); - }), - (K.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, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - show: t, - }); - }), - (K.prototype.setEdit = function (e, t) { - (this.openEdit = e = void 0 === e ? !0 : e), - t && (this.editOption = t), - this.defaultEdit(); - }), - (K.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); - }, - }, - }); - }), - (K.prototype.defaultEdit = function () { - this.openEdit - ? this.MilitaryStandardObj.length && !this.editHandler - ? this.edit(this.openEdit, this.editOption) - : !this.MilitaryStandardObj.length && - this.editHandler && - this.edit(!1) - : this.editHandler && this.edit(!1); - }), - (K.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(0.6), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - }); - (c.pottingPoint = l), - F.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(0.6), - outlineWidth: 2, - 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(0.6), - outlineWidth: 2, - disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - })), - (SmartEarthPopupData.editGraphic = { - entity: e, - graphic: e.polygon || e.polyline, - heightpoints: this.heightpoints, - }), - !0 - ); - } - } - }), - (K.prototype.edit = function (e, o) { - var A = this, - L = this._viewer; - if ( - (void 0 !== (o = o || this.editOption || {}).editProp && - (this.editProp = o.editProp), - this.editHandler) - ) { - for (var t in (this.editHandler.destroy(), - (this.editHandler = void 0), - F.pointsId)) - this._viewer.entities.removeById(F.pointsId[t]); - F.pointsId = []; - } - if ((e = void 0 === e ? !0 : e)) { - var M, - R = void 0, - O = ((this.isEditting = !1), void 0), - B = void 0; - for (t in ((this.editHandler = new Cesium.ScreenSpaceEventHandler( - L.scene.canvas - )), - this.editHandler.setInputAction((e) => { - var t; - Cesium.ExpandBySmartEarth && - (Cesium.ExpandBySmartEarth.underEarth.enable || - Cesium.ExpandBySmartEarth.isStreetView) - ? A.isEditting && (A.endThisEdit(), A.defaultEvent(!1)) - : F.editVector || - ((e = e.position), - (e = L.scene.pick(e)) && e.id instanceof Cesium.Entity - ? ((e = e.id), - A.isEditting || 0 != F.states - ? "box_point" == e.name || - "polygon_point" == e.name || - "move_point" == e.name - ? (A.defaultEvent(!1), - (M = - "box_point" == e.name - ? ((B = e.position.getValue()), - (t = Cesium.Cartographic.fromCartesian(B)), - (B = { - 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) || A.endThisEdit() - : this.startEdit(e) && - ((R = e), this.editProp && this.openEditProp(R, o))) - : A.endThisEdit()); - }, Cesium.ScreenSpaceEventType.LEFT_DOWN), - this.editHandler.setInputAction(function (e) { - if ( - Cesium.ExpandBySmartEarth && - (Cesium.ExpandBySmartEarth.underEarth.enable || - Cesium.ExpandBySmartEarth.isStreetView) - ) - A.isEditting && (A.endThisEdit(), A.defaultEvent(!1)); - else if (!F.editVector) { - var i = L.scene.pick(e.endPosition); - if (Cesium.defined(i)) - if (A.isEditting && !O) { - if ( - Cesium.ExpandBySmartEarth && - (Cesium.ExpandBySmartEarth.underEarth.enable || - Cesium.ExpandBySmartEarth.isStreetView) - ) - return void ( - A.isEditting && (A.endThisEdit(), A.defaultEvent(!1)) - ); - !i.id || - ("move_point" !== i.id.name && "polygon_point" !== i.id.name) - ? i.id && "box_point" === i.id.name - ? A.tooltip.showAt(e.endPosition, "鎷栨嫿淇敼楂樺害") - : i.id == R && A.tooltip.show(!1) - : A.tooltip.showAt(e.endPosition, "鎷栨嫿淇敼浣嶇疆"); - } else - A.isEditting || - 0 !== F.states || - (i.id && -1 < A.MilitaryStandardObj.indexOf(i.id.id) - ? A.tooltip.showAt(e.endPosition, "鐐瑰嚮婵�娲荤紪杈戯紝鍙抽敭鍒犻櫎") - : A.tooltip.show(!1)); - else 0 != F.states || O || A.tooltip.show(!1); - if (A.isEditting && O) { - A.tooltip.showAt(e.endPosition, "閲婃斁鍚庡畬鎴愪慨鏀�"); - i = e.startPosition; - if ( - (C = (i = L.camera.getPickRay(i)) - ? L.scene.globe.pick(i, L.scene) - : C) - ) { - var t = void 0; - if ("polygon_point" == M) { - for (var r in ((O.position = C), F.pointsId)) - if (F.pointsId[r] == O.id) { - var o = L.entities.getById(A.heightpointsId[r]); - if (!o) break; - var n = Cesium.Cartographic.fromCartesian(C), - 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 F.pointsId) { - var d = L.entities.getById(F.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), - A.movePoint && (A.movePoint.position = m), - "StraightArrow" == R.GeoType) - ) - x = A.calculateMorePoints(c); - else if ("RoundedRectangle" == R.GeoType) - x = A._computeRoundedRectanglePoints(c); - else if ("Sector" == R.GeoType) x = A._computeSectorPoints(c); - else if ("Bow" == R.GeoType) x = A._computeBowPoints(c); - else if ("GatheringPlace" == R.GeoType) { - var g = A._computeGatheringPlacePoints(c), - g = A.createCloseCardinal(g); - x = A.calculatePointsFBZ3(g, 100); - } else if ("SwallowtailArrow" == R.GeoType) - x = A._computeSwallowtailArrow(c); - else if ("Bezierline" == R.GeoType) - x = A._createBezierPoints(c); - else if ("BezierArrow" == R.GeoType) - x = A._createBezierPoints(c); - else if ("PincerArrow" == R.GeoType) { - g = z.algorithm.doubleArrow(h); - let e = []; - var f = JSON.stringify(g.polygonalPoint).indexOf("null"); - x = e = -1 == f ? g.polygonalPoint : e; - } else if ("AttackArrow" == R.GeoType) { - (f = z.algorithm.tailedAttackArrow(h)), - (g = JSON.stringify(f.polygonalPoint).indexOf("null")); - let e = []; - x = e = -1 == g ? f.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" == M) { - var _, - i = L.camera.getPickRay(e.endPosition), - C = L.scene.globe.pick(i, L.scene), - y = Cesium.Cartographic.fromCartesian(C), - v = Cesium.Math.toDegrees(y.longitude), - w = Cesium.Math.toDegrees(y.latitude), - b = B.lon, - T = B.lat, - t = (u = A.Cdcl(w, v, T, b)); - for (_ in A.heightpointsId) { - var E = L.entities.getById(A.heightpointsId[_]), - S = E.position._value, - S = Cesium.Cartographic.fromCartesian(S), - P = Cesium.Math.toDegrees(S.longitude), - S = Cesium.Math.toDegrees(S.latitude), - P = Cesium.Cartesian3.fromDegrees(P, S, t); - E.position = P; - } - (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, - y = Cesium.Cartographic.fromCartesian(C), - v = Cesium.Math.toDegrees(y.longitude), - w = Cesium.Math.toDegrees(y.latitude), - g = - ((B = O.position.getValue()), - Cesium.Cartographic.fromCartesian(B)), - D = - v - - (b = (B = { - lon: Cesium.Math.toDegrees(g.longitude), - lat: Cesium.Math.toDegrees(g.latitude), - height: g.height, - }).lon), - I = w - (T = B.lat), - c = ((O.position = C), []), - h = []; - for (r in F.pointsId) { - let e, - t, - i = L.entities.getById(F.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 + D, - e.lat + I, - e.height - )), - c.push({ x: e.lon + D, y: e.lat + I, z: e.height }), - h.push([e.lon + D, e.lat + I, e.height])), - L.entities.getById(A.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 + D, - e.lat + I, - e.height - ))); - } - if ("StraightArrow" == R.GeoType) - x = A.calculateMorePoints(c); - else if ("RoundedRectangle" == R.GeoType) - x = A._computeRoundedRectanglePoints(c); - else if ("Sector" == R.GeoType) x = A._computeSectorPoints(c); - else if ("Bow" == R.GeoType) x = A._computeBowPoints(c); - else if ("GatheringPlace" == R.GeoType) { - (f = A._computeGatheringPlacePoints(c)), - (e = A.createCloseCardinal(f)); - x = A.calculatePointsFBZ3(e, 100); - } else if ("SwallowtailArrow" == R.GeoType) - x = A._computeSwallowtailArrow(c); - else if ("Bezierline" == R.GeoType) - x = A._createBezierPoints(c); - else if ("BezierArrow" == R.GeoType) - x = A._createBezierPoints(c); - else if ("PincerArrow" == R.GeoType) { - i = z.algorithm.doubleArrow(h); - let e = []; - y = JSON.stringify(i.polygonalPoint).indexOf("null"); - x = e = -1 == y ? i.polygonalPoint : e; - } else if ("AttackArrow" == R.GeoType) { - (v = z.algorithm.tailedAttackArrow(h)), - (g = JSON.stringify(v.polygonalPoint).indexOf("null")); - let e = []; - x = e = -1 == g ? v.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) - ? A.isEditting && (A.endThisEdit(), A.defaultEvent(!1)) - : F.editVector || - (O && - o.callBack && - o.callBack.update && - o.callBack.update(O.name, R), - (O = void 0), - A.defaultEvent(!0)); - }, Cesium.ScreenSpaceEventType.LEFT_UP), - this.editHandler.setInputAction(function (e) { - var t, i; - Cesium.ExpandBySmartEarth && - (Cesium.ExpandBySmartEarth.underEarth.enable || - Cesium.ExpandBySmartEarth.isStreetView) - ? A.isEditting && (A.endThisEdit(), A.defaultEvent(!1)) - : F.editVector || - ((t = L.scene.pick(e.position)), - Cesium.defined(t) && - 0 == F.states && - ((i = t.id), - -1 !== A.MilitaryStandardObj.indexOf(i.id) && - A.delButton(!0, e.position, function () { - L.entities.removeById(i.id); - var e = A.MilitaryStandardObj.indexOf(i.id); - A.MilitaryStandardObj.splice(e, 1), - A.delButton(!1), - A.tooltip.show(!1), - A.endThisEdit(), - A.defaultEdit(), - o.callBack && o.callBack.delete && o.callBack.delete(i); - }))); - }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), - A.defaultEvent(!0), - F.pointsId)) - L.entities.removeById(F.pointsId[t]); - for (t in A.heightpointsId) L.entities.removeById(A.heightpointsId[t]); - (A.heightpointsId = []), - (A.heightpoints = []), - (F.pointsId = []), - (this.endThisEdit = () => { - for (var e in (A.defaultEvent(!0), F.pointsId)) - L.entities.removeById(F.pointsId[e]); - for (var e in A.heightpointsId) - L.entities.removeById(A.heightpointsId[e]); - A.movePoint && L.entities.remove(A.movePoint), - (A.movePoint = void 0), - (R = void 0), - window.layuiLayer.close(SmartEarthPopupData.layerIndex), - (SmartEarthPopupData.editGraphic = {}), - (A.isEditting = !1), - (F.pointsId = []), - (A.heightpointsId = []), - (A.heightpoints = []), - A.delButton(!1); - }); - } - }), - (K.prototype.spArray = function (e, t) { - for (var i = [], o = 0; o < t.length; ) i.push(t.slice(o, (o += e))); - return i; - }), - (K.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)); - } - }), - (K.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); - }), - ($c.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); - } - }); - }), - ($c.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; - }), - ($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 }, - }; - }), - ($c.prototype.deleteObject = function () { - this._viewer.dataSources.remove(this.item); - }), - ($c.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - ($c.prototype.setVisibility = function (e) { - null != this.item && (this.item.show = e); - }), - (eh.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; - }), - (eh.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 - ); - }), - (eh.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 - ); - }), - (eh.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; - } - }), - (eh.prototype.remove = function () { - this.item.modifyMeshObject = void 0; - }), - (th.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; - }), - (th.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()) - ); - }), - (th.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) - ); - }), - (th.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); - }), - (th.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; - }), - (th.prototype.remove = function () { - this.item && - this.item.clippingPlanes && - this.item.clippingPlanes.removeAll(), - this.item && (this.item.clippingPlanes = void 0); - }), - (ih.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; - }), - (ih.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); - }); - }), - (ih.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 - )); - }); - }), - (ih.prototype.deleteObject = function () { - this._viewer.dataSources.remove(this.item); - }), - (ih.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (ih.prototype.setVisibility = function (e) { - null != this.item && (this.item.show = e); - }), - (oh.prototype.addHeatMap = function (e, t = {}) { - "HeatmapGL" === t.type - ? (this.item = new Wr(this._viewer, t)) - : (this.item = new Ur(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; - }), - (oh.prototype.setData = function (e) { - this.item && this.item.setData(e); - }), - (oh.prototype.flyToBounding = function () { - this.item && this.item.flyToBounding(); - }), - (oh.prototype.deleteObject = function () { - this.item && this.item.destroy(); - }), - (oh.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (oh.prototype.setVisibility = function (e) { - null != this.item && this.item.show(e); - }), - (rh.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 - ); - }), - (rh.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 + I.flyModel, - minimumPixelSize: 32, - scale: t.scale, - }), - i.entities.add(s)); - l.position.setInterpolationOptions({ - interpolationDegree: 5, - interpolationAlgorithm: Cesium.LagrangePolynomialApproximation, - }), - this.TrailEntitys.push(l); - }), - (rh.prototype.clear = function () { - this.TrailEntitys.forEach((e) => { - this._viewer.entities.remove(e); - }), - (this.TrailEntitys = []); - }), - (rh.prototype.faster = function () { - this._viewer.animation.viewModel.faster(); - }), - (rh.prototype.slower = function () { - this._viewer.animation.viewModel.slower(); - }), - (rh.prototype.setSpeed = function (e) { - this._viewer.clock.multiplier = parseFloat(e); - }), - (rh.prototype.isPause = function (e) { - this._viewer.clockViewModel.shouldAnimate = !e; - }), - (rh.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; - }), - (rh.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 nh(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 nh(o); - (e.lon = t), (e.lat = n), (e.time = 10 * (t + 180)), i.push(e); - } - t.push(i); - } - }), - (ah.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); - (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.primitives.add(this._primitive), - r || this.setVisibility(!1), - this._core.isnull(t.id) && (t.id = this._core.getuid()), - this._core.isnull(e) && (e = "鏂板缓鍥惧眰" + t.id); - a = { - 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(a), - this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), - "function" == typeof n && n(this.item), - this - ); - }), - (ah.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (ah.prototype.setVisibility = function (e) { - try { - this._Provider && - this._Provider.setStatus && - this._Provider.setStatus(e); - } catch (e) {} - }), - (ah.prototype.deleteObject = function () { - this._viewer.scene.primitives.remove(this.item); - try { - this._Provider.remove(); - } catch (e) {} - }), - (sh.prototype.findDirectParent = function (e) { - try { - var t = []; - if (e.width == Math.PI) return null; - for ( - var i = 0; - i < Jc.scene.globe._surface._tilesToRender.length; - i++ - ) { - var o = Jc.scene.globe._surface._tilesToRender[i], - r = o._rectangle; - Cesium.Rectangle.intersection(r, e) && t.push(o); - } - return t; - } catch (e) {} - return null; - }), - (sh.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; - }), - (lh.prototype.Video3D = function (e) { - return ( - (this.url = e.url), - (this.options = e), - (this.videoContainer = e.video || void 0), - (this.videoType = e.type || "mp4"), - (this.video2D = e.video2D), - (this.options.video = { - container: this.videoContainer, - offset: e.offset, - }), - this.addVideo(e.success), - this - ); - }), - (lh.prototype.addVideo = function (e) { - var t, i; - this.videoContainer - ? (this.videoContainer.oncanplay = () => { - this.init && this.init(); - }) - : ((i = `<video id="${(t = - "Video3D" + - this._core.getuid())}" autoplay muted loop crossorigin style="display: none"></video>`), - $(this._viewer.container).append(i), - (this.videoContainer = document.getElementById(t)), - (this.options.video.container = this.videoContainer), - this.load(), - (this.videoContainer.oncanplay = () => { - this.thisVideo || (this.init && this.init(), e && e(this)); - })); - }), - (lh.prototype.load = function () { - var e, - t = this.url; - if ("hls" === this.videoType) { - if (!window.Hls) { - let e = new oe(!1); - e.addJs(window.SmartEarthRootUrl + "Workers/hls.js"); - } - this.videoContainer.canPlayType("application/vnd.apple.mpegurl") - ? (this.videoContainer.src = t) - : Hls.isSupported() && - ((e = new Hls()).loadSource(t), - e.attachMedia(this.videoContainer), - (this.player = e)); - } else if ("flv" === this.videoType) { - if (!window.flvjs) { - let e = new oe(!1); - e.addJs(window.SmartEarthRootUrl + "Workers/flv.js"); - } - flvjs.isSupported() && - ((e = flvjs.createPlayer({ type: "flv", url: t })).attachMediaElement( - this.videoContainer - ), - e.load(), - (this.player = e)); - } else - (this.videoContainer.src = t), - this.thisVideo && - (this.videoContainer.load(), this.videoContainer.play()); - this.isLoad = !0; - }), - (lh.prototype.pause = function () { - "mp4" !== this.videoType && (this.isLoad = !1), - this.player && this.player.destroy(), - this.videoContainer.pause(); - }), - (lh.prototype.flyTo = function () { - this.thisVideo && this.thisVideo.flyTo(); - }), - (lh.prototype.play = function () { - this.isLoad || this.load(), this.videoContainer.play(); - }), - (lh.prototype.init = function () { - this.thisVideo || - (!this.isPause && - this.videoContainer && - this.videoContainer.readyState === - this.videoContainer.HAVE_ENOUGH_DATA && - this.play(), - this.video2D - ? (this.thisVideo = new Al(this._viewer, this.options)) - : (this.thisVideo = new Ko(this._viewer, this.options))); - }), - (lh.prototype.updateVideo = function (e) { - (e.url || e.type) && - (e.type && (this.videoType = e.type), - e.url && (this.url = e.url), - e.url && - (this.pause(), - this.load(), - (this.videoContainer.oncanplay = () => { - this.play(); - }))), - this.thisVideo.updatePost(e); - }), - (lh.prototype.setVisibility = function (e) { - this.thisVideo && this.thisVideo.setVisibility(e); - }), - (lh.prototype.destroy = function () { - this.thisVideo && this.thisVideo.destroy(), - (this.thisVideo = null), - this.player && this.player.destroy && this.player.destroy(), - this.videoContainer && this.videoContainer.remove(); - }), - (uh.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: 0.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 - ); - }), - (ch.prototype.createPolygonLayer = function (e = {}) { - let o = { - color: e.color || "rgba(135,206,235,0.6)", - image: e.image || window.SmartEarthRootUrl + I.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; - }), - (ch.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); - }), - (ch.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (ch.prototype.deleteObject = function () { - try { - this._viewer.scene.primitives.remove(this.item); - } catch (e) { - console.log(e); - } - }), - (ch.prototype.setVisibility = function (e) { - this.item && (this.item.show = e); - }), - (hh.prototype.create = function (e, t = {}) { - this.grid = this._core.defaultValue(t.grid, !0); - let _ = t.center, - C = t.scale || 1; - return ( - this._core.getJSON(e, (n) => { - var a = Math.max(...n.mData) * C, - s = n.mHorPointsNum, - l = n.mVerPointsNum; - if ( - (_ = n.mCenterPoint && n.mCenterPoint.length ? n.mCenterPoint : _) - ) { - 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++] * C, - f = this._core.getPositionFromHPR(_, g, i, e), - f = Cesium.Cartesian3.fromDegrees(f.lon, f.lat, f.height); - (u[c++] = f.x), - (u[c++] = f.y), - (u[c++] = f.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 - ); - }), - (hh.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); - }), - (hh.prototype.setVisibility = function (e) { - this.item && (this.item.show = e); - }), - (hh.prototype.deleteObject = function () { - this._viewer.scene.primitives.remove(this.item); - }), - (hh.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 "; - }); - var mh = - "uniform float angle;\nuniform sampler2D image;\nuniform vec4 color;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nst.x = st.x - 0.5;\nst.y = st.y - 0.5;\nif(st.x * st.x + st.y * st.y <= 0.25){\nfloat x = st.x * cos(angle) - st.y * sin(angle);\nfloat y = st.y * cos(angle) + st.x * sin(angle);\nst.x = x + 0.5;\nst.y = y + 0.5;\n} else {\nst.x = st.x + 0.5;\nst.y = st.y + 0.5;\n}\nmaterial.diffuse = czm_gammaCorrect(texture2D(image, st).rgb * color.rgb);\nmaterial.alpha = texture2D(image, st).a * color.a;\nmaterial.emission = vec3(0.2);\nreturn material;\n}\n"; - function dh(e) { - (this._viewer = e), - (this._core = new v()), - (this.angle = 0), - (this.multiple = 1), - (this.destroyed = !1), - (this.type = "rotate"), - (this.show = !0); - } - (dh.prototype.createRotateCircle = function (e = {}) { - (this.type = "rotate"), - (this.radius = e.radius || 500), - (this.multiple = e.multiple || 1), - (this.scale = [this.radius, this.radius, 1]); - var t = Cesium.Color.fromCssColorString(e.color || "#80ccff"); - return ( - (this.color = [t.red, t.green, t.blue]), - (this.clampToGround = e.clampToGround), - (this.position = e.position), - (this.image = e.image), - e.image || - (this.image = e.scan - ? SmartEarthRootUrl + I.scanCircle - : SmartEarthRootUrl + I.effectCircle), - e.scan && (this.multiple = -this.multiple), - Cesium.Resource.createIfNeeded(this.image) - .fetchImage() - .then((e) => { - this.image = e; - let t = this.clampToGround - ? Cesium.GroundPrimitive - : Cesium.Primitive; - (this.circle = new t({ - geometryInstances: this.getInstances(), - appearance: this.getAppearance(), - asynchronous: !1, - })), - setTimeout(() => { - this.circle.appearance.material.uniforms.color.alpha = 2; - }); - }), - this._viewer.scene.primitives.add(this), - this - ); - }), - (dh.prototype.createDRWCircle = function (e = {}) { - (this.type = "DRW"), - (this.radius = e.radius || 50), - (this.multiple = e.multiple || 5), - (this.scale = [this.radius, this.radius, 1]); - var t = Cesium.Color.fromCssColorString(e.color || "#80ccff"); - (this.color = [t.red, t.green, t.blue]), - (this.clampToGround = e.clampToGround), - (this.position = e.position); - let i = document.createElement("canvas"), - o = ((i.width = 512), (i.height = 512), i.getContext("2d")), - r = o.createRadialGradient(256, 256, 0, 256, 256, 256), - n = - (r.addColorStop(0.1, "rgba(255, 255, 255, 1.0)"), - r.addColorStop(0.2, "rgba(255, 255, 255, 0.0)"), - r.addColorStop(0.3, "rgba(255, 255, 255, 0.9)"), - r.addColorStop(0.5, "rgba(255, 255, 255, 0.0)"), - r.addColorStop(0.9, "rgba(255, 255, 255, 0.2)"), - r.addColorStop(1, "rgba(255, 255, 255, 1.0)"), - o.clearRect(0, 0, 512, 512), - (o.strokeStyle = "rgb(255, 255, 255)"), - o.setLineDash([80, 80]), - (o.lineWidth = 30), - o.arc(256, 256, 180, 0, 2 * Math.PI, !0), - o.stroke(), - o.beginPath(), - o.arc(256, 256, 256, 0, 2 * Math.PI, !0), - (o.fillStyle = r), - o.fill(), - o.restore(), - (this.image = i), - this.clampToGround ? Cesium.GroundPrimitive : Cesium.Primitive); - return ( - (this.circle = new n({ - geometryInstances: this.getInstances(), - appearance: this.getAppearance(), - asynchronous: !1, - })), - setTimeout(() => { - this.circle.appearance.material.uniforms.color.alpha = 2; - }), - this._viewer.scene.primitives.add(this), - this - ); - }), - (dh.prototype.getInstances = function () { - var e, t; - return this.clampToGround - ? ((t = Cesium.Cartesian3.fromDegrees( - this.position.lon, - this.position.lat, - this.position.height - )), - (e = this._core.setPositionOffset(t, { - x: -this.scale[0], - y: -this.scale[1], - z: 0, - })), - (t = this._core.setPositionOffset(t, { - x: this.scale[0], - y: this.scale[1], - z: 0, - })), - new Cesium.GeometryInstance({ - geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromCartesianArray([e, t]), - }), - modelMatrix: this.modelMatrix, - })) - : ((this.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees( - this.position.lon, - this.position.lat, - this.position.height - ) - )), - new Cesium.GeometryInstance({ - geometry: this.getGeometry(), - modelMatrix: this.modelMatrix, - })); - }), - (dh.prototype.getGeometry = function () { - return this._core.customGeometry({ - scale: this.scale, - position: [-1, -1, 0, 1, -1, 0, 1, 1, 0, -1, 1, 0], - st: [0, 0, 1, 0, 1, 1, 0, 1], - indices: [0, 1, 2, 0, 2, 3], - boundingSphere: new Cesium.BoundingSphere( - new Cesium.Cartesian3(0, 0, 0), - 1 - ), - }); - }), - (dh.prototype.getAppearance = function () { - return new Cesium.EllipsoidSurfaceAppearance({ - material: new Cesium.Material({ - fabric: { - uniforms: { - image: this.image, - angle: this.angle, - color: new Cesium.Color(...this.color, 0), - }, - source: mh, - }, - }), - }); - }), - (dh.prototype.update = function (e) { - this.circle && - this.show && - ((this.circle.appearance.material.uniforms.angle = - Cesium.Math.toRadians((this.angle += this.multiple))), - this.circle.update(e)); - }), - (dh.prototype.isDestroyed = function () { - return this.destroyed; - }), - (dh.prototype.destroy = function () { - this.circle && this.circle.destroy(), - (this.circle = null), - (this.destroyed = !0); - }), - (dh.prototype.deleteObject = function () { - this._viewer.scene.primitives.remove(this); - }), - (dh.prototype.setVisibility = function (e) { - this.show = e; - }); - var ph = - "uniform vec4 color;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nmaterial.diffuse = czm_gammaCorrect(color.rgb);\nmaterial.alpha = color.a * pow(1.0 - st.t, 2.0);\nmaterial.emission = vec3(0.2);\nreturn material;\n}\n", - gh = - "uniform vec4 color;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat powerRatio = fract(czm_frameNumber / 30.0) + 1.0;\nfloat alpha = pow(1.0 - st.t, powerRatio);\nmaterial.diffuse = czm_gammaCorrect(color.rgb);\nmaterial.alpha = alpha * color.a;\nmaterial.emission = vec3(0.2);\nreturn material;\n}\n", - fh = - "uniform sampler2D image;\nuniform vec4 color;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 v_st = materialInput.st;\nfloat dt = fract(czm_frameNumber / 90.0);\nvec2 st = fract(vec2(1.0) + v_st - vec2(dt, dt));\nvec4 imageColor = texture2D(image, st);\nvec3 diffuse = imageColor.rgb;\nfloat alpha = imageColor.a;\ndiffuse *= color.rgb;\nalpha *= color.a;\ndiffuse *= color.rgb;\nalpha *= color.a;\nmaterial.diffuse = diffuse;\nmaterial.alpha = alpha * pow(1.0 - v_st.t, 2.0);\nmaterial.emission = vec3(0.2);\nreturn material;\n}\n"; - function _h(e) { - (this._viewer = e), - (this._core = new v()), - (this.angle = 0), - (this.multiple = 1), - (this.destroyed = !1), - (this.type = "cylinder"), - (this.show = !0); - } - function Ch(e, t) { - (this.show = !0), - (this._position = Cesium.Cartesian3.fromDegrees( - t.position.lon, - t.position.lat, - t.position.height - )), - (this._command = void 0), - (this._outlineCommand = void 0), - (this._angle = 0), - (this._viewer = e), - (this._speed = X(t.multiple, 1)), - (this._color = X(t.color, "#80ccff")), - (this._color = Cesium.Color.fromCssColorString(this._color).withAlpha( - 0.5 - )), - (this._outlineColor = X(t.outlineColor, "#ffff00")), - (this._outlineColor = Cesium.Color.fromCssColorString( - this._outlineColor - )), - (this._scale = X(t.scale, new Cesium.Cartesian3(1, 1, 1))), - (this._modelMatrix = this.computeModelMatrix()), - (this._height = 0), - (this.animate = X(t.animate, !0)), - e.scene.primitives.add(this); - } - function yh(e) { - (this._viewer = e), - (this._core = new v()), - (this.destroyed = !1), - (this.show = !0), - (this._values = new Map()), - this._viewer.scene.primitives.add(this), - (this.img = {}); - } - function Q(e, t) { - var h; - (this._viewer = e), - (this._cesium = t), - (this._core = new v()), - (this._Label = new G(this._viewer, this._cesium)), - (this._Circle = new V(this._viewer, this._cesium)), - (this._Box = new B(this._viewer, this._cesium)), - (this._Cone = new j(this._viewer, this._cesium)), - (this._Color = new m(this._viewer, this._cesium)), - (this._Polyline = new R(this._viewer, this._cesium)), - (this._Rectangle = new H(this._viewer, this._cesium)), - (this._Polygon = new M(this._viewer, this._cesium)), - (this._ImageLabel = new sc(this._viewer, this._cesium)), - (this._GeoJsonFeatureLayer = new w( - this._viewer, - this._cesium, - this._ImageryProvidererid - )), - (this._Ellipsoid = new Pr(this._viewer, this._cesium)), - (this._PointModel = new P(this._viewer, this._cesium)), - (this._wall = new lc(this._viewer, this._cesium)), - (this._Terrain = new Fc(this._viewer, this._cesium)), - (this._createdynamicObject = new k(this._viewer, this._cesium)), - this._GeometryCreator, - (this._ImageryLayer = new hc(this._viewer, this._cesium)), - (this._VolumeGeoJsonFeatureLayer = void 0), - (this._PolygonVectorGeoJsonFeatureLayer = void 0), - (this._skyBox = new Nc(this._viewer, this._cesium)), - (this._flowField = new jc(this._viewer, this._cesium)), - (this._canvasField = new ql(this._viewer, this._cesium)), - (this.VectorGeoJsonFeatureLayer = new S(this._viewer, this._cesium)), - (this._straightArrow = new K(this._viewer, this._cesium)), - (this._SimpleGraphic = new x(this._viewer, this._cesium)), - (this._popupmessage = new yi(this._viewer, this._cesium)), - (this.VectorImgFeatureLayer = new ah(this._viewer, this._cesium)), - (this._TerrainModifier = new sh(this._viewer, this._cesium)), - t.Resource._Implementations.createImageSGS || - ((h = new de({ - 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 vh(e, t) { - (this._viewer = e), (this.Cesium = t), (this.czmlData = new Map()); - } - function wh(e, t) { - (this._viewer = e), (this._cesium = t), (this._Core = new v()); - } - function bh(e, t) { - (this._viewer = e), (this._cesium = t); - } - function Th(e, t) { - (this._viewer = e), (this._cesium = t); - } - function Eh(e, t) { - (this._viewer = e), (this._cesium = t); - } - function Sh(e, t) { - (this._viewer = e), (this._cesium = t), (this._tree = F.getSource()); - } - function Ph(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._tree = F.getSource()), - (this._core = new v()); - } - function xh(e, t) { - (this._viewer = e), (this._cesium = t); - } - function Dh(e, t) { - (this._viewer = e), (this._cesium = t); - } - function Ih(e, t) { - (this._viewer = e), (this._cesium = t); - } - function Ah(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._zoomIn = new Th(this._viewer, this._cesium)), - (this._zoomOut = new Eh(this._viewer, this._cesium)), - (this._flyTo = new Mi(this._viewer, this._cesium, this._tree)), - (this._flyToObj = new Sh(this._viewer, this._cesium)), - (this._jumpTo = new Ph(this._viewer, this._cesium, this._tree)), - (this._northfinger = new xh(this._viewer, this._cesium)), - (this._Stop = new Ih(this._viewer, this._cesium)), - (this._PointFly = new ar(this._viewer, this._cesium)); - } - function Lh(e, t) { - (this._viewer = e), (this._cesium = t), (this._tree = F.getSource()); - } - function Mh(e, t) { - (this._viewer = e), (this._cesium = t), (this._tree = F.getSource()); - } - function Rh(e, t) { - (this._viewer = e), (this._cesium = t), (this._tree = F.getSource()); - } - function Oh(e, t) { - (this._viewer = e), (this._cesium = t), (this._tree = F.getSource()); - } - function Bh(e, t) { - (this._viewer = e), (this._cesium = t), (this._tree = F.getSource()); - } - function Fh(e, t) { - (this._viewer = e), (this._cesium = t), (this._tree = F.getSource()); - } - function Hh(e, t) { - (this._viewer = e), (this._cesium = t), (this._tree = F.getSource()); - } - (_h.prototype.createCylinder = function (e = {}) { - (this.type = "cylinder"), - (this.radius = e.radius || 500), - (this.length = e.length || 100), - (this.number = e.number || 30), - (this.multiple = e.multiple || 1), - (this.near = e.near), - (this.far = e.far); - var t = Cesium.Color.fromCssColorString(e.color || "#80ccff"), - t = - ((this.scale = [this.radius, this.radius, this.length]), - (this.color = [t.red, t.green, t.blue, t.alpha]), - (this.geometryValue = this.getCylinderGeometryValue( - 1, - 1, - 1, - this.number - )), - (this.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees( - e.position.lon, - e.position.lat, - e.position.height - ) - )), - new Cesium.GeometryInstance({ - geometry: this.getGeometry(this.geometryValue), - modelMatrix: this.modelMatrix, - })); - return ( - (this.cylinder = new Cesium.Primitive({ - geometryInstances: t, - appearance: this.getAppearance(), - asynchronous: !1, - })), - this._viewer.scene.primitives.add(this), - this - ); - }), - (_h.prototype.createCone = function (e = {}) { - (this.type = "cone"), - (this.radius = e.radius || 500), - (this.length = e.length || 100), - (this.near = e.near), - (this.far = e.far); - var t = Cesium.Color.fromCssColorString(e.color || "#80ccff"), - t = - ((this.scale = [this.radius, this.radius, this.length]), - (this.color = [t.red, t.green, t.blue, t.alpha]), - (this.geometryValue = this.getCylinderGeometryValue(2, 0.3, 1, 6)), - (this.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees( - e.position.lon, - e.position.lat, - e.position.height - ) - )), - new Cesium.GeometryInstance({ - geometry: this.getGeometry(this.geometryValue), - modelMatrix: this.modelMatrix, - })); - return ( - (this.cylinder = new Cesium.Primitive({ - geometryInstances: t, - appearance: this.getAppearance(), - asynchronous: !1, - })), - Cesium.Resource.createIfNeeded(SmartEarthRootUrl + I.particles) - .fetchImage() - .then((e) => { - var t = this.getCylinderGeometryValue(4, 4, 1, 6), - t = new Cesium.GeometryInstance({ - geometry: this.getGeometry(t), - modelMatrix: this.modelMatrix, - }); - (this.cylinder1 = new Cesium.Primitive({ - geometryInstances: t, - appearance: new Cesium.EllipsoidSurfaceAppearance({ - material: new Cesium.Material({ - fabric: { - uniforms: { - image: e, - color: new Cesium.Color( - this.color[0], - this.color[1], - this.color[2], - 0 - ), - }, - source: fh, - }, - }), - renderState: { cull: { enabled: !1 } }, - }), - asynchronous: !1, - })), - setTimeout(() => { - this.cylinder1.appearance.material.uniforms.color.alpha = 2; - }); - }), - this._viewer.scene.primitives.add(this), - this - ); - }), - (_h.prototype.getAppearance = function () { - return "cylinder" === this.type - ? new Cesium.EllipsoidSurfaceAppearance({ - material: new Cesium.Material({ - fabric: { - uniforms: { color: new Cesium.Color(...this.color) }, - source: ph, - }, - }), - renderState: { cull: { enabled: !1 } }, - }) - : "cone" === this.type - ? new Cesium.EllipsoidSurfaceAppearance({ - material: new Cesium.Material({ - fabric: { - uniforms: { color: new Cesium.Color(...this.color) }, - source: gh, - }, - }), - renderState: { cull: { enabled: !1 } }, - }) - : void 0; - }), - (_h.prototype.getGeometry = function (e) { - return this._core.customGeometry({ - scale: this.scale, - boundingSphere: new Cesium.BoundingSphere( - new Cesium.Cartesian3(0, 0, 0), - 1 - ), - ...JSON.parse(JSON.stringify(e)), - }); - }), - (_h.prototype.getCylinderGeometryValue = function ( - e = 1, - t = 1, - n = 1, - a = 30 - ) { - var s = [e, 0], - l = [t, 0], - u = Cesium.Math.toRadians(360 / a), - c = 1 / a; - let h = [], - m = [0, 1, a + 1, 1, a + 2, a + 1], - d = []; - (h[0] = s[0]), - (h[1] = s[1]), - (h[2] = 0), - (h[3 * (a + 1)] = l[0]), - (h[3 * (a + 1) + 1] = l[1]), - (h[3 * (a + 1) + 2] = n), - (d[0] = 0), - (d[1] = 0), - (d[2 * (a + 1)] = 0); - for (let e = (d[2 * (a + 1) + 1] = 1), t, i, o, r; e <= a; e++) - (t = u * e), - (i = c * e), - (o = s[0] * Math.cos(t) - s[1] * Math.sin(t)), - (r = s[1] * Math.cos(t) + s[0] * Math.sin(t)), - (h[3 * e] = o), - (h[3 * e + 1] = r), - (o = l[(h[3 * e + 2] = 0)] * Math.cos(t) - l[1] * Math.sin(t)), - (r = l[1] * Math.cos(t) + l[0] * Math.sin(t)), - (h[3 * (a + 1) + 3 * e] = o), - (h[3 * (a + 1) + 3 * e + 1] = r), - (h[3 * (a + 1) + 3 * e + 2] = n), - (d[2 * e] = i), - (d[2 * e + 1] = 0), - (d[2 * (a + 1) + 2 * e] = i), - (d[2 * (a + 1) + 2 * e + 1] = 1), - m.push(e, e + 1, a + e + 1, e + 1, a + e + 2, a + e + 1); - return { position: h, st: d, indices: m }; - }), - (_h.prototype.update = function (e) { - var t; - this.cylinder && - this.show && - ("cylinder" === this.type && - (void 0 === this.dt && (this.dt = 0), - (this.dt += 0.003 * this.multiple), - 1 < this.dt && (this.dt = 0), - (t = 0.5 * (1 - Math.cos(this.dt * Math.PI * 2))), - (this.scale[0] = this.scale[1] = - this.radius * (1 - Math.cos(this.dt * Math.PI)) * 0.5), - (this.scale[2] = this.length * t), - (this.color[3] = 2 * t), - (t = new Cesium.GeometryInstance({ - geometry: this.getGeometry(this.geometryValue), - modelMatrix: this.modelMatrix, - })), - this.cylinder.destroy(), - (this.cylinder = new Cesium.Primitive({ - geometryInstances: t, - appearance: this.getAppearance(), - asynchronous: !1, - })), - (t = null)), - this.cylinder.update(e), - this.cylinder1 && this.cylinder1.update(e)); - }), - (_h.prototype.isDestroyed = function () { - return this.destroyed; - }), - (_h.prototype.destroy = function () { - this.cylinder && this.cylinder.destroy(), - (this.cylinder = null), - this.cylinder1 && this.cylinder1.destroy(), - (this.cylinder1 = null), - (this.destroyed = !0); - }), - (_h.prototype.deleteObject = function () { - this._viewer.scene.primitives.remove(this); - }), - (_h.prototype.setVisibility = function (e) { - this.show = e; - }), - (Ch.prototype.update = function (e) { - this.show && - (Cesium.defined(this._command) || - (this._command = this.createCommand(e.context)), - Cesium.defined(this._outlineCommand) || - (this._outlineCommand = this.createCommand(e.context, !0)), - e.commandList.push(this._command, this._outlineCommand), - this.animate && - ((this._angle += 0.01), - 1 < this._angle && (this._angle = 0), - (this._height = 0.04 * Math.sin(this._angle * Math.PI * 2)), - (e = new Cesium.Cartesian3(0, 0, this._height)), - Cesium.Matrix4.multiplyByTranslation( - this._modelMatrix, - e, - this._modelMatrix - ), - (e = Cesium.Matrix4.fromRotationTranslation( - Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(4 * this._speed)) - )), - Cesium.Matrix4.multiply(this._modelMatrix, e, this._modelMatrix))); - }), - (Ch.prototype.isDestroyed = function () { - return !1; - }), - (Ch.prototype.destroy = function () { - return ( - Cesium.defined(this._command) && - (this._command.shaderProgram = - this._command.shaderProgram && - this._command.shaderProgram.destroy()), - Cesium.defined(this._outlineCommand) && - (this._outlineCommand.shaderProgram = - this._outlineCommand.shaderProgram && - this._outlineCommand.shaderProgram.destroy()), - Cesium.destroyObject(this) - ); - }), - (Ch.prototype.startAnimate = function () { - this.animate = !0; - }), - (Ch.prototype.closeAnimate = function () { - this.animate = !1; - }), - (Ch.prototype.deleteObject = function () { - this.destroy(); - }), - (Ch.prototype.setVisibility = function (e) { - this.show = e; - }), - (Ch.prototype.createCommand = function (e, t) { - var i = Cesium.Appearance.getDefaultRenderState(!0, !0, void 0), - i = new Cesium.RenderState(i), - o = Cesium.ShaderProgram.fromCache({ - context: e, - vertexShaderSource: this.createVertexShader(), - fragmentShaderSource: this.createFragmentShader(), - attributeLocations: { position: 0, textureCoordinates: 1 }, - }); - let r = t ? this._outlineColor : this._color; - return new Cesium.DrawCommand({ - pickId: "Tetrahedron", - vertexArray: this.createVertexArray(e, t), - primitiveType: t - ? Cesium.PrimitiveType.LINES - : Cesium.PrimitiveType.TRIANGLES, - renderState: i, - shaderProgram: o, - uniformMap: { color: () => r }, - owner: this, - pass: Cesium.Pass.TRANSLUCENT, - modelMatrix: this._modelMatrix, - boundingVolume: new Cesium.BoundingSphere(this._position, 1), - }); - }), - (Ch.prototype.createVertexArray = function (e, t = !1) { - (t = this.cereatePositionsAndIndice(t)), - (t = new Cesium.Geometry({ - attributes: { - position: new Cesium.GeometryAttribute({ - componentDatatype: Cesium.ComponentDatatype.FLOAT, - componentsPerAttribute: 3, - values: t.positions, - }), - textureCoordinates: new Cesium.GeometryAttribute({ - componentDatatype: Cesium.ComponentDatatype.FLOAT, - componentsPerAttribute: 2, - values: t.sts, - }), - }, - indices: t.indices, - primitiveType: Cesium.PrimitiveType.TRIANGLES, - boundingSphere: Cesium.BoundingSphere.fromVertices(t.positions), - })), - (t = Cesium.GeometryPipeline.computeNormal(t)); - return Cesium.VertexArray.fromGeometry({ - context: e, - geometry: t, - attributeLocations: { position: 0, textureCoordinates: 1 }, - bufferUsage: Cesium.BufferUsage.STATIC_DRAW, - }); - }), - (Ch.prototype.cereatePositionsAndIndice = function (e = !1) { - return { - indices: e - ? [ - 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 0, 3, 0, 4, 0, 1, 4, 1, 2, 4, 2, 3, - 4, 3, - ] - : [0, 1, 4, 1, 2, 4, 2, 3, 4, 3, 0, 4], - positions: [1, 0, 1.5, 0, 1, 1.5, -1, 0, 1.5, 0, -1, 1.5, 0, 0, 0], - sts: [], - }; - }), - (Ch.prototype.createVertexShader = function () { - return "attribute vec3 position;\n void main()\n {\n gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n }\n "; - }), - (Ch.prototype.createFragmentShader = function () { - return "uniform vec4 color;\n void main()\n {\n gl_FragColor = color;\n }\n "; - }), - (Ch.prototype.computeModelMatrix = function () { - var e = Cesium.Transforms.eastNorthUpToFixedFrame(this._position), - t = Cesium.Matrix4.fromScale(this._scale); - return Cesium.Matrix4.multiply(e, t, new Cesium.Matrix4()); - }), - (yh.prototype.add = function (t = {}) { - (t.id = t.id || this._core.uuid()), (t.name = t.name || "绾㈢豢鐏�"); - let e = document.createElement("canvas"); - var i = e.getContext("2d"); - return ( - this._values.set(t.id, { - id: t.id, - name: t.name, - canvas: e, - context: i, - far: t.far || 800, - state: { left: -1, center: 1, right: 1, time: 30 }, - show: !0, - deleteObject: () => { - this.removeById(t.id); - }, - setVisibility: (e) => { - this.showById(t.id, e); - }, - update: (e) => { - this.updateById(t.id, e); - }, - }), - this.loadImage || - (this.loadImage = [ - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.l_go - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.l_wait - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.l_stop - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.l_null - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.go - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.wait - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.stop - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.null - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.r_go - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.r_wait - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.r_stop - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.r_null - ).fetchImage(), - Cesium.Resource.createIfNeeded( - window.SmartEarthRootUrl + I.trafficLight.bg - ).fetchImage(), - ]), - this.imageData - ? this.addGeometry(t) - : Promise.all(this.loadImage).then((e) => { - (this.imageData = { - left: { go: e[0], wait: e[1], stop: e[2], null: e[3] }, - center: { go: e[4], wait: e[5], stop: e[6], null: e[7] }, - right: { go: e[8], wait: e[9], stop: e[10], null: e[11] }, - bg: e[12], - }), - this.addGeometry(t); - }), - this._values.get(t.id) - ); - }), - (yh.prototype.addGeometry = function (e = {}) { - let t = this._values.get(e.id); - this.drawImage(t, e); - var i = e.scale || 1, - o = 0.02 * t.canvas.width * i, - i = 0.02 * t.canvas.height * i, - o = new Cesium.Cartesian3(o, i, 1), - i = Cesium.Cartesian3.fromDegrees( - e.position.lon, - e.position.lat, - e.position.height + i - ), - i = ((t.position = i), Cesium.Transforms.eastNorthUpToFixedFrame(i)), - r = new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(e.heading || 0), - Cesium.Math.toRadians(0), - Cesium.Math.toRadians(90) - ), - r = Cesium.Matrix3.fromHeadingPitchRoll(r), - r = - (Cesium.Matrix4.multiplyByMatrix3(i, r, i), - Cesium.Matrix4.fromScale(o)), - o = (Cesium.Matrix4.multiply(i, r, i), new Cesium.PlaneGeometry()), - r = new Cesium.GeometryInstance({ - geometry: o, - modelMatrix: i, - attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), - }, - }); - let n = Cesium.Material.fromType("Image"); - (n.uniforms.image = t.canvas.toDataURL("image/png")), - (t.geometry = new Cesium.Primitive({ - id: e, - geometryInstances: r, - appearance: new Cesium.MaterialAppearance({ flat: !0, material: n }), - })); - }), - (yh.prototype.getImage = function (e, t) { - let i = "null"; - return ( - 0 === t - ? (i = "wait") - : -1 === t - ? (i = "stop") - : 1 === t && (i = "go"), - this.imageData[e][i] - ); - }), - (yh.prototype.drawImage = function (e, t) { - var i = this._core.defaultValue(t.left, e.state.left), - o = this._core.defaultValue(t.center, e.state.center), - r = this._core.defaultValue(t.right, e.state.right), - t = this._core.defaultValue(t.time, e.state.time), - n = - ((e.state = { left: i, center: o, right: r, time: t }), - this.imageData.bg), - a = this.getImage("left", i), - s = this.getImage("left"), - l = this.getImage("center", o), - u = this.getImage("center"), - c = this.getImage("right", r), - h = this.getImage("right"), - n = - ((e.canvas.height = n.height), - (e.canvas.width = n.width), - e.context.drawImage( - n, - 0, - 0, - n.width, - n.height, - 0, - 0, - n.width, - n.height - ), - a.height + 25), - m = 2 * a.height + 35; - e.context.drawImage( - -1 === i ? a : s, - 0, - 0, - a.width, - a.height, - 10, - 15, - a.width, - a.height - ), - e.context.drawImage( - 0 === i ? a : s, - 0, - 0, - a.width, - a.height, - 10, - n, - a.width, - a.height - ), - e.context.drawImage( - 1 === i ? a : s, - 0, - 0, - a.width, - a.height, - 10, - m, - a.width, - a.height - ), - e.context.drawImage( - -1 === o ? l : u, - 0, - 0, - l.width, - l.height, - 303, - 15, - l.width, - l.height - ), - e.context.drawImage( - 0 === o ? l : u, - 0, - 0, - l.width, - l.height, - 303, - n, - l.width, - l.height - ), - e.context.drawImage( - 1 === o ? l : u, - 0, - 0, - l.width, - l.height, - 303, - m, - l.width, - l.height - ), - e.context.drawImage( - -1 === r ? c : h, - 0, - 0, - c.width, - c.height, - 485, - 15, - c.width, - c.height - ), - e.context.drawImage( - 0 === r ? c : h, - 0, - 0, - c.width, - c.height, - 485, - n, - c.width, - c.height - ), - e.context.drawImage( - 1 === r ? c : h, - 0, - 0, - c.width, - c.height, - 485, - m, - c.width, - c.height - ), - this.drawTime(e.context, { - left: i, - center: o, - x: 153, - y: 143, - time: t, - }); - }), - (yh.prototype.drawTime = function (e, t = {}) { - let i = 1, - o = - (0 === t.left || 0 === t.center - ? (i = 0) - : 1 === t.left || 1 === t.center - ? (i = 1) - : -1 === t.left && -1 === t.center && (i = -1), - "#31fb09"), - r = - (0 === i ? (o = "#ffd511") : -1 === i && (o = "#f81838"), - t.time || 0); - 0 === (r = 99 < (r = r < 0 ? 0 : r) ? 99 : r) - ? (r = "00") - : r < 10 - ? (r = "0" + r) - : (r += ""), - (e.font = "bold 60px Arial"), - (e.fillStyle = o), - e.fillText(r, t.x, t.y); - }), - (yh.prototype.updateById = function (e, t = {}) { - let i = this._values.get(e); - i && - (i.context.clearRect(0, 0, i.canvas.width, i.canvas.height), - this.drawImage(i, t), - (i.context.isUpdate = !0)); - }), - (yh.prototype.update = function (e) { - if (this.show) - for (var t of this._values.values()) - t.show && - t.geometry && - this.isShow(t) && - (t.context.isUpdate && - ((t.geometry.appearance.material.uniforms.image = - t.canvas.toDataURL("image/png")), - (t.context.isUpdate = null)), - t.geometry.update(e)); - }), - (yh.prototype.isShow = function (e) { - return ( - Cesium.Cartesian3.distance(this._viewer.camera.position, e.position) < - e.far - ); - }), - (yh.prototype.removeById = function (e) { - let t = this._values.get(e); - t && t.geometry && t.geometry.destroy(), this._values.delete(e); - }), - (yh.prototype.showById = function (e, t) { - let i = this._values.get(e); - i && (i.show = t); - }), - (yh.prototype.isDestroyed = function () { - return this.destroyed; - }), - (yh.prototype.destroy = function () { - for (var e of this._values.values()) e.geometry && e.geometry.destroy(); - (this._values = new Map()), - (this.img = null), - (this.imageData = null), - (this.destroyed = !0); - }), - (yh.prototype.deleteObject = function () { - this._viewer.scene.primitives.remove(this), this.destroy(); - }), - (yh.prototype.setVisibility = function (e) { - this.show = e; - }), - (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._SE3DTilesets = new Map())), - this._SE3DTilesets.set(e.treeobj.id, e), - 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) { - return new Rt( - { url: e, ...(t = t instanceof Cesium.Scene ? { scene: t } : t) }, - i - ); - }), - (Q.prototype.createWaterPolygonLayer = function (e = {}) { - let t = new ch(this._viewer); - return t.createPolygonLayer(e); - }), - (Q.prototype.createCloudMap = function (e, t, i, o) { - return new M(this._viewer, this._cesium).createCloudMap(e, t, i, o); - }), - (Q.prototype.addVideoPolygon = function (e, t) { - return new M(this._viewer, this._cesium).addVideoPolygon(e, t); - }), - (Q.prototype.addVideoBox = function (e, t) { - return new M(this._viewer, this._cesium).addVideoPlane(e, t); - }), - (Q.prototype.CZML = function (e, t, i) { - let o = new ih(this._viewer, this._cesium); - return o.addCZML(e, t, i); - }), - (Q.prototype.addHeatMap = function (e, t) { - let i = new oh(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) => { - a.removeEdit && r.MilitaryStandardObj.pop(), r.defaultEdit(), 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 = 0.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 uh(this._viewer, this._cesium)), - this._TdtLabel.GeoWTFS(e) - ); - }), - (Q.prototype.Video3D = function (e) { - let t = new lh(this._viewer, this._cesium); - return t.Video3D(e); - }), - (Q.prototype.addRotateEffectCircle = function (e) { - return new dh(this._viewer).createRotateCircle(e); - }), - (Q.prototype.addTetrahedron = function (e) { - return new Ch(this._viewer, e); - }), - (Q.prototype.addTrafficLight = function (e) { - return ( - this._TrafficLight || (this._TrafficLight = new yh(this._viewer)), - this._TrafficLight.add(e) - ); - }), - (Q.prototype.addDRWEffectCircle = function (e) { - return new dh(this._viewer).createDRWCircle(e); - }), - (Q.prototype.addEffectCylinder = function (e) { - return new _h(this._viewer).createCylinder(e); - }), - (Q.prototype.addEffectCone = function (e) { - return new _h(this._viewer).createCone(e); - }), - (Q.prototype.createGeoJsonFeatureLayerProviderOptimization = function ( - e, - t, - i, - o, - r, - n - ) { - var a = new S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.selectedItem.id), - (o = this._core.isnull(o) ? 0 : o), - a.createVector3DTilesFeatureLayerRelease(e, t, i, o, r, n) - ); - }), - (Q.prototype.createGeojsonImage = function (e) { - return new S(this._viewer, this._cesium).createGeojsonImage(e); - }), - (Q.prototype.createGeoJsonFeatureLayerProvider = function ( - e, - t, - i, - o, - r, - n - ) { - var a = new S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 Fc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 Fc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 Fc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 Fc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 Fc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 Fc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 Fc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.selectedItem.id), - (i = this._core.isnull(i) ? 0 : i), - r.createCesiumTerrain(e, t, i, o) - ); - }), - (Q.prototype.getFlyData = function (e, t) { - this._createdynamicObject.getFlyData(e, t); - }), - (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 rh(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 G(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 ac(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 Ci(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 Xc(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 P(this._viewer, this._cesium).createModel(e, t, i, o, r, n); - }), - (Q.prototype.createModelEditable = function (e, t, i, o, r, n) { - return new P(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 R(this._viewer, this._cesium).executePolyline(e); - }), - (Q.prototype.executePolygon = function (e) { - return new M(this._viewer, this._cesium).executePolygon(e); - }), - (Q.prototype.executeWall = function (e, t) { - return new lc(this._viewer, this._cesium).executeWall(e, t); - }), - (Q.prototype.createWall = function (e, t, i, o) { - return new lc(this._viewer, this._cesium).createWall(e, t, i, o); - }), - (Q.prototype.executePolyline1 = function (e) { - return new R(this._viewer, this._cesium).executePolyline1(method); - }), - (Q.prototype.createPolylineVolume = function (e, t, i, o, r) { - return new nc(this._viewer, this._cesium).createPolylineVolume( - e, - t, - i, - o, - r - ); - }), - (Q.prototype.createCorridor = function (e, t, i, o) { - return new tu(this._viewer, this._cesium).createCorridor(e, t, i, o); - }), - (Q.prototype.addViewCone = function (e) { - let t = new Qo(this._viewer, this._cesium); - return t.addViewCone(e); - }), - (Q.prototype.createViewCone = function (e, t) { - let i = new Qo(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 th(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 yi(this._viewer, this._cesium).createPopupMessage(e); - }), - (Q.prototype.createMeasurement = function (e) { - return new yi(this._viewer, this._cesium).createMeasurement(e); - }), - (Q.prototype.createPlotting = function (e) { - return new yi(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 Zc(this._viewer, this._cesium).createHawkeye(e, t); - }), - (Q.prototype.createGeoJsonFeatureLayer = function (e, t, i, o, r) { - var n = new w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Ei(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 $c(this._viewer, this._cesium).createKmlLayer(e, t, i); - }), - (Q.prototype.addKmlLayer = function (e, t, i, o) { - return new $c(this._viewer, this._cesium).addKmlLayer(e, t, i, o); - }), - (Q.prototype.createVolumeVectorGeoJsonFeatureLayerArcgis = function ( - e, - t, - i, - o, - r - ) { - var n = new so(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Ei(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 E(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 S(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 hc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.selectedItem.id), - (i = this._core.isnull(i) ? 0 : i), - a.createArcGisImageryLayer(e, t, i, o, r, n) - ); - }), - (Q.prototype.createImageryLayerGrid = function (e) { - return new hc(this._viewer, this._cesium).createImageryLayerGrid(e); - }), - (Q.prototype.createWebMapServerImageLayer = function (e, t, i, o, r, n) { - var a = new hc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 hc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 hc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Ri(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Ri(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 P(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 P(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.selectedItem.id), - (o = this._core.isnull(o) ? 0 : o), - a.createPolygonModel(e, t, i, o, r, n) - ); - }), - (Q.prototype.modelMove = function () { - return new P(this._viewer, this._cesium).modelMove(); - }), - (Q.prototype.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider = - function (e, t, i, o, r, n) { - var a = new Ri(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Ri(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Hc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Hc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Hc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Hc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Gc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Gc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Gc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 uo(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 uo(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 hc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 hc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Oi(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Oi(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Gc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Oi(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Oi(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Oi(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Oi(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Oi(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 Oi(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 w(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 V(this._viewer, this._cesium).createCircle(e, t, i, o); - }), - (Q.prototype.CreateRectangle = function (e, t, i, o, r) { - return new H(this._viewer, this._cesium).CreateRectangle(e, t, i, o, r); - }), - (Q.prototype.createBox = function (e, t, i, o) { - return (t = new B(this._viewer, this._cesium)).createBox(e, t, i, o); - }), - (Q.prototype.createBillboardbatch = function (e) { - return new xl(this._viewer, this._cesium).createBillboardbatch(e); - }), - (Q.prototype.createBillboard = function (e) { - return new xl(this._viewer, this._cesium).createBillboard(e); - }), - (Q.prototype.createCone = function (e, t, i, o) { - return new j(this._viewer, this._cesium).createCone(e, t, i, o); - }), - (Q.prototype.createRectangularSensor = function (e, t, i, o) { - return new j(this._viewer, this._cesium).createRectangularSensor( - e, - t, - i, - o - ); - }), - (Q.prototype.createRadarMaskScan = function (e, t, i, o) { - return new j(this._viewer, this._cesium).createRadarMaskScan(e, t, i, o); - }), - (Q.prototype.ConicSensor = function (e, t, i) { - return new eu(this._viewer).create(e, t, i); - }), - (Q.prototype.FieldIntensity = function (e, t) { - return new hh(this._viewer).create(e, t); - }), - (Q.prototype.createRadarMask = function (e, t, i, o) { - return new j(this._viewer, this._cesium).createRadarMask(e, t, i, o); - }), - (Q.prototype.createConeRadar = function (e, t) { - return new j(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 R(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 R(this._viewer, this._cesium).createLink(e, t, i); - }), - (Q.prototype.createLinkPro = function (e, t, i) { - return new R(this._viewer, this._cesium).createLinkPro(e, t, i); - }), - (Q.prototype.createLandingLine = function (e, t = {}) { - return new R(this._viewer, this._cesium).createLandingLine(e, t); - }), - (Q.prototype.createLinkPros = function (e) { - return new R(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 M(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 M(this._viewer, this._cesium).createSector(e, t, i, o, r); - }), - (Q.prototype.executeEllipsoid = function (e, t, i, o) { - t = new Pr(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 sc(this._viewer, this._cesium); - return ( - this._core.isnull(i) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (i = F.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 G(this._viewer, this._cesium); - return ( - this._core.isnull(r) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (r = F.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 sc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 sc(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 R(this._viewer, this._cesium); - return ( - this._core.isnull(o) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (o = F.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 V(this._viewer, this._cesium); - return ( - this._core.isnull(r) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (r = F.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 V(this._viewer, this._cesium); - return ( - this._core.isnull(a) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (a = F.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 B(this._viewer, this._cesium); - return ( - this._core.isnull(a) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (a = F.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 ac(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 j(this._viewer, this._cesium); - return ( - this._core.isnull(a) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (a = F.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 j(this._viewer, this._cesium); - return ( - this._core.isnull(a) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (a = F.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 Pr(this._viewer, this._cesium); - return ( - this._core.isnull(a) && - !this._core.isnull(F.selectedItem) && - "group" == F.selectedItem.type && - (a = F.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 L(this._viewer, this._cesium).createPointOptimization(e, t); - }), - (Q.prototype.createRectangleOptimization = function (e, t) { - return new H(this._viewer, this._cesium).createRectangleOptimization( - e, - t - ); - }), - (Q.prototype.createCircleOptimization = function (e, t) { - return new V(this._viewer, this._cesium).createCircleOptimization(e, t); - }), - (Q.prototype.createCylinderOptimization = function (e, t) { - return new j(this._viewer, this._cesium).createCylinderOptimization(e, t); - }), - (Q.prototype.createPointOptimization = function (e, t) { - return new L(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 dr(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 A(this._viewer, this._cesium); - }, - }, - }), - Object.defineProperties(Q.prototype, { - _trailLine: { - get: function () { - return new qc(this._viewer, this._cesium); - }, - }, - }), - Object.defineProperties(Q.prototype, { - _Point: { - get: function () { - return new L(this._viewer, this._cesium); - }, - }, - GeometryCreator: { - CreateLinearRingGeometry: function (e) { - return {}; - }, - }, - }), - (vh.prototype.get = function (e) { - return this.czmlData.get(e); - }), - (vh.prototype.flyTo = function (e) { - this._viewer.flyTo(this.get(e)); - }), - (vh.prototype.trackedEntity = function (e) { - let t = this.get(e); - this._viewer.trackedEntity = t.entities.getById(e); - }), - (vh.prototype.delete = function (e) { - var t = this.czmlData.get(e); - this._viewer.dataSources.remove(t), this.czmlData.delete(e); - }), - (vh.prototype.deleteAll = function () { - for (var e of this.czmlData.values()) this._viewer.dataSources.remove(e); - this.czmlData = new Map(); - }), - (vh.prototype.getThisPlayTime = function () { - return ( - this._viewer.clock.currentTime.secondsOfDay - - this._viewer.clock.startTime.secondsOfDay - ); - }), - (vh.prototype.init = function (i, e, o = {}) { - var t = { - gltf: - o.modelUrl || - "http://183.162.245.49:18076/sdkdemo_2022/SmartEarthSDK/Workers/Model/xiaoche.glb", - runAnimations: !0, - scale: o.modelScale || 1, - minimumPixelSize: o.minimumPixelSize, - }; - let r = [ - { - id: "document", - name: "czmlPathAnimation", - version: "1.0", - clock: { - interval: "2021-01-01T00:00:00Z/2021-01-02T00:00:00Z", - currentTime: "2021-01-01T00:00:00Z", - multiplier: 1, - }, - }, - ], - n = this.getThisPlayTime(); - e = { lon: e.lon, lat: e.lat, height: e.alt || e.height || 0 }; - r.push({ - path: { - show: void 0 !== o.showPath && o.showPath, - leadTime: 0, - trailTime: 1e5, - width: 3, - resolution: 1, - material: { - polylineGlow: { - glowPower: 0.3, - taperPower: 1, - color: { rgba: o.color || [255, 255, 0, 255] }, - }, - }, - }, - id: i, - position: { - interpolationAlgorithm: "LINEAR", - interpolationDegree: 1, - forwardExtrapolationType: "HOLD", - backwardExtrapolationType: "HOLD", - epoch: "2021-01-01T00:00:00Z", - cartographicDegrees: [ - n, - e.lon, - e.lat, - e.height, - 86400, - e.lon, - e.lat, - e.height, - ], - }, - orientation: { velocityReference: "#position" }, - model: t, - }); - let a = new this.Cesium.CzmlDataSource(); - return ( - this._viewer.dataSources.add(a), - (a.prePosition = e), - this.czmlData.set(i, a), - a.process(r).then((e) => { - let t = e.entities.getById(i); - (t.propData = o.propData), - (this._viewer.clock.currentTime = this.Cesium.JulianDate.addSeconds( - this._viewer.clock.startTime.clone(), - n, - new this.Cesium.JulianDate() - )), - o.callback && o.callback(a); - }), - a - ); - }), - (vh.prototype.update = function (e, t, i = 1) { - let o = this.get(e); - var r = this.getThisPlayTime(), - t = { lon: t.lon, lat: t.lat, height: t.alt || t.height || 0 }; - let n = t.lon - o.prePosition.lon, - a = t.lat - o.prePosition.lat, - s = t.height - o.prePosition.height; - e = [ - { - id: e, - position: { - epoch: "2021-01-01T00:00:00Z", - cartographicDegrees: [ - r + i, - t.lon, - t.lat, - t.height, - 86400, - t.lon + n, - t.lat + a, - t.height + s, - ], - }, - }, - ]; - (o.prePosition = t), o && o.process(e); - }), - (vh.prototype.pick = function (t) { - this.endPick(), - (this.pickHandler = new this.Cesium.ScreenSpaceEventHandler( - this._viewer.scene.canvas - )); - let i; - this.pickHandler.setInputAction((e) => { - (i = this._viewer.scene.pick(e.endPosition)) && - i.id && - this.get(i.id.id) && - t && - t(i); - }, this.Cesium.ScreenSpaceEventType.LEFT_CLICK); - }), - (vh.prototype.endPick = function () { - this.pickHandler.destroy(), (this.pickHandler = void 0); - }), - (wh.prototype.AttachEvent = function (e, o) { - var t, - i, - r = this._viewer, - n = this._Core, - n = this._Core; - return e === zr.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 === zr.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 === zr.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 === zr.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 === zr.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 === zr.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 === zr.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 === zr.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 === zr.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 === zr.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 === zr.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 === zr.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; - }), - (wh.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 - ); - }), - (wh.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 - ); - }), - (wh.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 - ); - }), - (wh.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 - ); - }), - (wh.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 - ); - }), - (wh.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 - ); - }), - (wh.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 - ); - }), - (wh.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 - ); - }), - (wh.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 - ); - }), - (wh.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 - ); - }), - (wh.prototype.AttachCameraChangeEvent = function (e) { - return ( - (this._viewer.scene.camera.percentageChanged = 1e-6), - this._viewer.scene.camera.changed.addEventListener(e), - e - ); - }), - (wh.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); - }), - (bh.prototype.DetachEvent = function (e, t) { - t === zr.L_Click - ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_CLICK) - : t === zr.L_DBL_Click - ? e && - e.removeInputAction( - this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK - ) - : t === zr.L_Down - ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOWN) - : t === zr.L_Up - ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_UP) - : t === zr.M_Click - ? e && - e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_CLICK) - : t === zr.M_Down - ? e && - e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_DOWN) - : t === zr.M_Up - ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_UP) - : t === zr.R_Click - ? e && - e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_CLICK) - : t === zr.R_Down - ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_DOWN) - : t === zr.R_Up - ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_UP) - : t === zr.Wheel - ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.WHEEL) - : t === zr.Move - ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.MOUSE_MOVE) - : e && e.destroy(); - }), - (bh.prototype.DetachEventAll = function (e) { - e && e.destroy(); - }), - (bh.prototype.RemoNormalCesiumLeftDoubleClick = function () { - this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction( - this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK - ); - }), - (bh.prototype.DetachCameraChangeEvent = function (e) { - (this._viewer.scene.camera.percentageChanged = 0.5), - this._viewer.scene.camera.changed.removeEventListener(e); - }), - (Th.prototype.zoomIn = function () { - var e = 0.6 * Math.ceil(this._viewer.camera.positionCartographic.height); - return this._viewer.camera.zoomIn(e); - }), - (Eh.prototype.zoomOut = function () { - var e = 0.6 * Math.ceil(this._viewer.camera.positionCartographic.height); - return this._viewer.camera.zoomOut(e); - }), - (Sh.prototype.flyToObj = function (e) { - if (e && e.flyTo) e.flyTo(); - else 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.rectangle) - this._viewer.camera.flyTo({ destination: e.rectangle }); - else { - if (e && e.item && null != e.item.id && null != e.item.id) { - var t = F.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 = f.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 instanceof Cesium.Cesium3DTileset) && - 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)); - } - }), - (Ph.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 = F.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 = f.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); - } - }), - (Ph.prototype.jumpToPosition = function (e, t, i, o = {}) { - o = { - heading: this._core.defaultValue(o.heading, 0), - pitch: this._core.defaultValue(o.pitch, -90), - roll: this._core.defaultValue(o.roll, 0), - }; - Math.abs(e) <= 180 && Math.abs(t) <= 90 - ? this._viewer.camera.setView({ - destination: this._cesium.Cartesian3.fromDegrees(e, t, i), - orientation: new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(o.heading), - Cesium.Math.toRadians(o.pitch), - Cesium.Math.toRadians(o.roll) - ), - duration: o.time, - }) - : this._viewer.camera.setView({ - destination: { x: e, y: t, z: i }, - orientation: new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(o.heading), - Cesium.Math.toRadians(o.pitch), - Cesium.Math.toRadians(o.roll) - ), - }); - }), - (xh.prototype.northfinger = function () { - this._viewer.camera.setView({ - destination: this._viewer.camera._destination, - orientation: { pitch: this._viewer.camera._pitch, roll: 0 }, - }); - }), - (Dh.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 } }); - }), - (Ih.prototype.Stop = function () { - this._viewer.scene.camera.cancelFlight(); - }), - (Ah.prototype.getPosition = function () { - return ( - this._getPosition || - (this._getPosition = new C(this._viewer, this._cesium)), - this._getPosition.getPosition() - ); - }), - (Ah.prototype.getMousePosition = function (e, t, i, o, r) { - return ( - this._getPosition || - (this._getPosition = new C(this._viewer, this._cesium)), - this._getPosition.getMousePosition(e, t, i, o, r) - ); - }), - (Ah.prototype.getDegrees = function () { - return ( - this._getPosition || - (this._getPosition = new C(this._viewer, this._cesium)), - this._getPosition.getDegrees() - ); - }), - (Ah.prototype.getMouseDegrees = function (e, t, i, o, r) { - return ( - this._getPosition || - (this._getPosition = new C(this._viewer, this._cesium)), - this._getPosition.getMouseDegrees(e, t, i, o, r) - ); - }), - (Ah.prototype.setPosition = function (e, t, i) { - return ( - this.Stop(), - this._setPosition || - (this._setPosition = new Dh(this._viewer, this._cesium)), - this._setPosition.setPosition(e, t, i) - ); - }), - (Ah.prototype.zoomIn = function () { - return this._zoomIn.zoomIn(); - }), - (Ah.prototype.zoomOut = function () { - return this._zoomOut.zoomOut(); - }), - (Ah.prototype.flyTo = function (e, t) { - return this.Stop(), this._flyTo.flyTo(e, t); - }), - (Ah.prototype.flyToObj = function (e) { - this.Stop(), this._flyToObj.flyToObj(e); - }), - (Ah.prototype.jumpTo = function (e) { - return this.Stop(), this._jumpTo.jumpTo(e); - }), - (Ah.prototype.northfinger = function () { - this._northfinger.northfinger(); - }), - (Ah.prototype.flyToPosition = function (e, t, i, o) { - this.Stop(), this._flyTo.flyToPosition(e, t, i, o); - }), - (Ah.prototype.jumpToPosition = function (e, t, i, o) { - this.Stop(), this._jumpTo.jumpToPosition(e, t, i, o); - }), - (Ah.prototype.flyToPointsInterest = function (e, t) { - this.Stop(), this._flyTo.flyToPointsInterest(e, t); - }), - (Ah.prototype.Stop = function () { - this._Stop.Stop(); - }), - (Ah.prototype.rotateCenter = function (e = 360, t = 5) { - var i = { - x: this._viewer.canvas.clientWidth / 2, - y: this._viewer.canvas.clientHeight / 2, - }; - return this._PointFly.setPointFly({ - position: this.getMousePosition(i), - time: t, - limitAngel: e, - limitTime: !0, - hideImage: !0, - pitch: Cesium.Math.toDegrees(this._viewer.camera.pitch), - }); - }), - (Ah.prototype.getCameraInfo = function (e) { - let t = this.getDegrees(); - (t.lon = t.lon.toFixed(5)), - (t.lat = t.lat.toFixed(5)), - (t.height = t.height.toFixed(2)), - (t.x = t.lon), - (t.y = t.lat), - (t.z = t.height); - var { heading: i, pitch: o, roll: r } = this._viewer.camera, - i = Cesium.Math.toDegrees(i).toFixed(1), - o = Cesium.Math.toDegrees(o).toFixed(1), - r = Cesium.Math.toDegrees(r).toFixed(1), - o = { - location: t, - rotation: { heading: i, pitch: o, roll: r, yaw: i }, - }; - return e && e(o), o; - }), - (Ah.prototype.globalRotate = function (e = {}, t) { - this.Stop(), - this.jumpTo({ - destination: e.startPosition || { - x: -5909515.002227878, - y: 23989884.92116255, - z: 15985285.564042224, - }, - }); - let i = e.angle || 3, - o = 360 / i, - r = ((i = Cesium.Math.toRadians(i)), 0), - n = () => { - this._viewer.scene.camera.rotate(Cesium.Cartesian3.UNIT_Z, i), - ++r >= o && - (this._viewer.clock.onTick.removeEventListener(n), t && t()); - }; - this._viewer.clock.onTick.addEventListener(n); - }), - (Lh.prototype.deleteItem = function (e) { - F.delete(e, this._viewer, this._cesium); - }), - (Lh.prototype.testTreeSource = function () { - console.log(this._tree); - }), - (Mh.prototype.findItem = function (e) { - for ( - var t = "", i = f.clone(this._tree), o = e.split("\\"), r = 0; - r < o.length; - r++ - ) - if (((i = F.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; - }), - (Rh.prototype.getItemName = function (e) { - e = F.getSourceById(this._tree, e); - return e ? e.name : ""; - }), - (Oh.prototype.getVisibility = function (e) { - e = F.getSourceById(this._tree, e); - if (e) return e.item.getVisibility(); - }), - (Bh.prototype.setVisibility = function (e, t) { - F.setVisibility(e, t, this._viewer, this._cesium); - }), - (Fh.prototype.rename = function (e, t) { - var i = F.getSourceById(this._tree, e), - i = (i && (i.name = t), F.getTempSourceById(e)); - i && (i.name = t); - }), - (Hh.prototype.getNextItem = function (e, t) {}); - var Vh = 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 Gh(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._tree = F.getSource()), - (this._treeSource = F.Source), - (this._treeTemp = F.getTempSource()), - (this._tree1 = F), - (this._core = new v()); - } - function kh(e, t) { - (this._viewer = e), (this._cesium = t), (this._tree = F.getSource()); - } - function Nh(e, t) { - (this._viewer = e), (this._cesium = t); - } - function q(e, t, i) { - (this._viewer = e), - (this._cesium = t), - (this._tree = F.Source), - (this._createGroup = new vi(this._viewer, this._cesium, this._tree)), - (this._deleteItem = new Lh(this._viewer, this._cesium, this._tree)), - (this._findItem = new Mh(this._viewer, this._cesium, this._tree)), - (this._getItemName = new Rh(this._viewer, this._cesium, this._tree)), - (this._getVisibility = new Oh(this._viewer, this._cesium, this._tree)), - (this._setVisibility = new Bh(this._viewer, this._cesium, this._tree)), - (this._renameGroup = new Fh(this._viewer, this._cesium, this._tree)), - (this._getNextItem = new Hh(this._viewer, this._cesium, this._tree)), - (this._isGroup = new kh(this._viewer, this._cesium, this._tree)), - (this._creator = new Q(this._viewer, this._cesium)), - (this._getObject = new Gh(this._viewer, this._cesium)), - (this._exportTree = new Nh(this._viewer, this._cesium)), - (this._core = new v()), - this.InitTree(i, 0), - this.InitRootImageLayerAndTerrainlayer(); - } - (Gh.prototype.getObject = function (e) { - var t = f.clone(this._tree), - t = F.getSourceById(t, e); - if (t) return t.item; - (t = f.clone(F.PointSelectSource)), (t = F.getPointSelectSourceById(t, e)); - return t ? t.item : void 0; - }), - (Gh.prototype.getTreeItem = function (e) { - var t = f.clone(this._tree), - t = F.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 L(this._viewer, this._cesium)).setItem(u), - (l = { - id: this._core.getuid(), - name: "", - pId: 0, - type: "point", - item: s, - }), - F.pusPointSelectSource(l), - l - ); - if (u.label && (null == u.label.show || u.label.show._value)) - return ( - (s = new G(this._viewer, this._cesium)).setItem(u), - (l = { - id: this._core.getuid(), - name: "", - pId: 0, - type: "label", - item: s, - }), - F.pusPointSelectSource(l), - l - ); - if (u.box && (null == u.box.show || u.box.show._value)) - return ( - (r = new B(this._viewer, this._cesium)).setItem(u), - (l = { - id: this._core.getuid(), - name: "", - pId: 0, - type: "box", - item: r, - }), - F.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, - }), - F.pusPointSelectSource(l), - l - ); - if (u.wall && (null == u.wall.show || u.wall.show._value)) - return ( - (r = new lc(this._viewer, this._cesium)).setItem(u), - (l = { - id: this._core.getuid(), - name: "", - pId: 0, - type: "wall", - item: r, - }), - F.pusPointSelectSource(l), - l - ); - if (u.polyline) - return ( - (n = new R(this._viewer, this._cesium)).setItem(u), - (l = { - id: this._core.getuid(), - name: "", - pId: 0, - type: "polyline", - item: n, - }), - F.pusPointSelectSource(l), - l - ); - if (u.polygon) - return ( - (n = new M(this._viewer, this._cesium)).setItem(u), - (l = { - id: this._core.getuid(), - name: "", - pId: 0, - type: "polygon", - item: n, - }), - F.pusPointSelectSource(l), - l - ); - if (u.rectangle) - return ( - (a = new H(this._viewer, this._cesium)).setItem(u), - (l = { - id: this._core.getuid(), - name: "", - pId: 0, - type: "rectangle", - item: a, - }), - F.pusPointSelectSource(l), - l - ); - if ( - u.billboard && - (null == u.billboard.show || u.billboard.show._value) - ) - return ( - (s = new sc(this._viewer, this._cesium)).setItem(u), - (l = { - id: this._core.getuid(), - name: "", - pId: 0, - type: "billboard", - item: s, - }), - F.pusPointSelectSource(l), - l - ); - } - } - }), - (Gh.prototype.updateItemId = function (e, t) { - var i = this._treeSource, - o = F.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 = F.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; - }), - (Gh.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); - }), - (Gh.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), - Vh.none == i || Vh.position == i - ? ((s = { - id: o && o.id ? o.id : this._core.getuid(), - name: t, - pId: e, - type: "unknown", - item: null, - }), - F.insertGroupId(s, e)) - : Vh.imageLayer == i - ? ((s = { - id: o && o.id ? o.id : this._core.getuid(), - name: t, - pId: e, - checked: l, - type: "unknown", - item: null, - }), - F.insertGroupId(s, e)) - : Vh.dynamicObject == i - ? ((s = { - id: o && o.id ? o.id : this._core.getuid(), - name: t, - pId: e, - type: "unknown", - item: null, - }), - F.insertGroupId(s, e)) - : Vh.point == i - ? ((n = new L(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), - F.insertGroupId(s, e)) - : Vh.polyline == i - ? ((r = new R(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), - F.insertGroupId(s, e)) - : Vh.rectangle == i - ? ((r = new H(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), - F.insertGroupId(s, e)) - : Vh.ellipsoid == i - ? ((r = new Pr(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), - F.insertGroupId(s, e)) - : Vh.polygon == i - ? ((r = new M(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), - F.insertGroupId(s, e)) - : Vh.wall == i - ? ((r = new lc(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), - F.insertGroupId(s, e)) - : Vh.polylinevolume == i - ? ((r = new nc(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), - F.insertGroupId(s, e)) - : Vh.pointmodel == i - ? ((r = new P(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), - F.insertGroupId(s, e)) - : Vh.label == i - ? ((n = new G(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), - F.insertGroupId(s, e)) - : Vh.imageLabel == i - ? ((n = new sc(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), - F.insertGroupId(s, e)) - : Vh.D3titles == i - ? ((r = new A(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), - F.insertGroupId(s, e)) - : Vh.box == i - ? ((l = new B(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), - F.insertGroupId(s, e)) - : Vh.circle == i - ? ((n = new V(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), - F.insertGroupId(s, e)) - : Vh.cone == i - ? ((r = new j(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), - F.insertGroupId(s, e)) - : Vh.pointfeaturelayer == i - ? ((a = new w(this._viewer, this._cesium)).setItem(o), - (s = { - id: o && o.id ? o.id : this._core.getuid(), - name: t, - pId: e, - type: "pointLayer", - item: a, - }), - F.insertGroupId(s, e)) - : Vh.pointfeaturelayer == i - ? ((a = new w(this._viewer, this._cesium)).setItem(o), - (s = { - id: o && o.id ? o.id : this._core.getuid(), - name: t, - pId: e, - type: "polylineLayer", - item: a, - }), - F.insertGroupId(s, e)) - : Vh.polygonfeaturelayer == i && - ((a = new w(this._viewer, this._cesium)).setItem(o), - (s = { - id: o && o.id ? o.id : this._core.getuid(), - name: t, - pId: e, - type: "polygonLayer", - item: a, - }), - F.insertGroupId(s, e)), - s - ); - }), - (kh.prototype.isGroup = function (e) { - var t = f.clone(this._tree), - t = F.getSourceById(t, e); - return !(!t || "group" != t.type); - }), - (Nh.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; - }), - (Nh.prototype.export = function () { - return this.exportMethod(F.Source); - }), - (q.prototype.export = function () { - var e = this._exportTree.export(), - t = new Blob([JSON.stringify(e)], { type: "" }); - return this._core.saveAs(t, "tree.json"), e; - }), - (q.prototype.createGroup = function (e, t, i) { - return ( - (this._createGroup = new vi(this._viewer, this._cesium)), - this._createGroup.createGroup(e, t, i) - ); - }), - (q.prototype.changeGroup = function (e, t) { - this._createGroup.changeGroup(e, t); - }), - (q.prototype.starttemporaryItem = function () { - return this._createGroup.starttemporaryItem(); - }), - (q.prototype.pushtemporaryItem = function (e) { - this._createGroup.pushtemporaryItem(e); - }), - (q.prototype.pushStateItem = function (e) { - this._createGroup.pushStateItem(e); - }), - (q.prototype.endtemporaryItem = function () { - this._createGroup.endtemporaryItem(); - }), - (q.prototype.deleteItem = function (e) { - return this._deleteItem.deleteItem(e); - }), - (q.prototype.findItem = function (e) { - return this._findItem.findItem(e); - }), - (q.prototype.getItemName = function (e) { - return this._getItemName.getItemName(e); - }), - (q.prototype.getObject = function (e) { - return this._getObject.getObject(e); - }), - (q.prototype.getTreeItem = function (e) { - return this._getObject.getTreeItem(e); - }), - (q.prototype.updateItemId = function (e, t) { - return this._getObject.updateItemId(e, t); - }), - (q.prototype.getVisibility = function (e) { - return this._getVisibility.getVisibility(e); - }), - (q.prototype.setVisibility = function (e, t) { - return this._setVisibility.setVisibility(e, t); - }), - (q.prototype.removeAll = function (t) { - let i = []; - this._viewer.entities.values.forEach((e) => { - e.objectType === t && i.push(e); - }), - i.forEach((e) => { - this._viewer.entities.remove(e); - }), - (i = null); - }), - (q.prototype.setVisibilityAll = function (t, i) { - this._viewer.entities.values.forEach((e) => { - e.objectType === t && (e.show = i); - }); - }), - (q.prototype.rename = function (e, t) { - return this._renameGroup.rename(e, t); - }), - (q.prototype.getNextItem = function (e, t) { - return this._getNextItem.getNextItem(e); - }), - (q.prototype.isGroup = function (e) { - return this._isGroup.isGroup(e); - }), - Object.defineProperties(q.prototype, { - exitsObjectType: { - get: function () { - return Vh; - }, - }, - }), - (q.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) - ); - }), - (q.prototype.exitsGroup = function (e, t) { - return F.exitsGroup(e, t); - }), - (q.prototype.getTreeSource = function () { - var e = f.cloneDeep(F.getSource()); - return F.removeItem(e); - }), - (q.prototype.unifiedProject = function (e, t) { - this._getObject.unifiedProject(e, t); - }), - (q.prototype.clearn = function () { - F.clearn(); - }), - Object.defineProperties(q.prototype, { - Source: { - get: function () { - return F.TempSource; - }, - }, - }), - Object.defineProperties(q.prototype, { - currentObj: { - get: function () { - return F.currentObj; - }, - }, - }), - (q.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 - ); - } - } - }), - (q.prototype.InitRootImageLayerAndTerrainlayer = function () {}), - Object.defineProperties(q.prototype, { - selectedItem: { - get: function () { - return F.selectedItem; - }, - set: function (e) { - F.selectedItem = e; - }, - }, - }); - let jh = ["02W03803803401M01B01B01D01K01F01A01D01I01E01A01E01G01H01A01G01L"]; - function zh() { - let t = arguments[0], - e, - i, - o, - r = - ((o = - arguments[1] === Cesium - ? ((e = arguments[2] || {}), - "function" == typeof arguments[3] - ? ((i = {}), arguments[3]) - : ((i = arguments[3]), arguments[4])) - : "function" == typeof arguments[4] - ? ((e = arguments[2] || {}), (i = arguments[3]), arguments[4]) - : ((e = arguments[1] || {}), - "function" == typeof arguments[2] - ? ((i = {}), arguments[2]) - : ((i = arguments[2]), arguments[3]))), - (this._core = new v()), - window.location.origin), - n = !1, - a = 0; - for (let e = 0, t; e < jh.length; e++) - if ( - ((t = (function (t) { - var i = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", - o = i.length; - let r, - n, - a, - s, - l = 0, - u; - (u = new Array(Math.floor(t.length / 3))), (r = u.length); - for (let e = 0; e < r; e++) - (n = i.indexOf(t.charAt(l))), - l++, - (a = i.indexOf(t.charAt(l))), - l++, - (s = i.indexOf(t.charAt(l))), - l++, - (u[e] = n * o * o + a * o + s); - return (r = String.fromCharCode(...u)); - })(jh[e])), - -1 < r.indexOf(t)) - ) { - (n = !0), (a = 1 / 0); - break; - } - let s = un( - "\\x6c\\x69\\x63\\x65\\x6e\\x73\\x65\\x53\\x65\\x72\\x76\\x65\\x72" - ), - l = un("\\x5f\\x56\\x69\\x65\\x77\\x65\\x72"), - u = e[s] || Cesium[s] || window[s]; - if ( - (u && - ln(u).then((e) => { - e.success && e.registeredModules && e.registeredModules.indexOf(37) - ? new Date().getTime() < (a = new Date(e.expireDate).getTime()) && - ((n = !0), (Cesium[s] = u)) - : (n = !1); - e = logSmartEarthLog && logSmartEarthLog(a); - (n = e ? !0 : n) || (cn(t), this[l].destroy()); - }), - !u) - ) { - var c = logSmartEarthLog && logSmartEarthLog(a); - if (!(n = c ? !0 : n)) return void cn(t); - } - (Cesium.Ion.defaultAccessToken = - e.defaultAccessToken || - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwYWRlZDhiNi1hZTljLTQ4MWItYjdjNS0xYTkyMjk2YzdlOTQiLCJpZCI6NjcxNTksImlhdCI6MTYzMTU4NDY2NX0.l2kHF0uC2pTgJYwzQGpEBj6HCCdbYfRThEbXajcXOI8"), - (this.rightRotate = e.rightRotate); - var h = { - toolbar: !1, - baseLayerPicker: !1, - shadows: !1, - skyAtmosphere: new Cesium.SkyAtmosphere(), - terrainShadows: Cesium.ShadowMode.ENABLED, - shouldAnimate: !0, - animation: !0, - fullscreenButton: !1, - geocoder: !1, - homeButton: !1, - infoBox: !0, - selectionIndicator: !1, - timeline: !1, - navigationHelpButton: !1, - imageryProviderViewModels: [], - terrainProviderViewModels: [], - contextOptions: { - webgl: { preserveDrawingBuffer: !0 }, - failIfMajorPerformanceCaveat: !1, - }, - navigation: !0, - disableRightClickMenu: !0, - }; - if ( - ("string" == typeof e - ? (h.imageryProvider = new Cesium.SingleTileImageryProvider({ url: e })) - : (e.url && - (h.imageryProvider = new Cesium.SingleTileImageryProvider({ - url: e.url, - })), - this._core.extend(h, e, !0)), - h.baseLayerPicker) - ) { - let t = this.getAllImageryView(); - if (h.basemaps) - h.basemaps.forEach((e) => { - h.imageryProviderViewModels.push(t[e]); - }); - else for (var m in t) h.imageryProviderViewModels.push(t[m]); - } else h.imageryProvider || ((c = this._core.defaultValue(localStorage.getItem("sdkIsOnline"), 1)), parseInt(c) ? (h.imageryProvider = new Cesium.ArcGisMapServerImageryProvider({ name: "ArcGisMapServer", url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" })) : (h.imageryProvider = new Cesium.SingleTileImageryProvider({ url: window.SmartEarthRootUrl + "Workers/image/earth.jpg" }))); - c = { - destination: Cesium.Cartesian3.fromDegrees( - e.x || 110, - e.y || 32, - e.z || 8e6 - ), - orientation: { - heading: Cesium.Math.toRadians(this._core.defaultValue(e.heading, 0)), - pitch: Cesium.Math.toRadians(this._core.defaultValue(e.pitch, -90)), - roll: Cesium.Math.toRadians(this._core.defaultValue(e.roll, 0)), - }, - duration: e.duration || 0.5, - }; - if ( - (e.removeGlobe && - ((h.skyBox = !1), - (h.skyAtmosphere = !1), - (h.contextOptions = { - failIfMajorPerformanceCaveat: !1, - webgl: { alpha: !0, preserveDrawingBuffer: !0 }, - })), - (this._Viewer = new Cesium.Viewer(t, h)), - this._Viewer.scene, - (this._tree = i), - (this._Viewer._enableInfoOrSelection = !1), - (this._Viewer.scene.globe.baseColor = Cesium.Color.WHITE), - (this._Viewer.shadowMap.size = 2048), - (this._Viewer._cesiumWidget._creditContainer.style.display = "none"), - (this._Viewer.terrainShadows = 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 = e.toolbar), - e.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)")), - e.backgroundImage && - (this._Viewer.container.style.backgroundImage = - "url(" + e.backgroundImage + ")")) - : (this._Viewer.scene.globe.depthTestAgainstTerrain = !0), - this.Navigate.flyToPointsInterest(c, o), - this._Viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction( - Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK - ), - this._Viewer.extend(Cesium.viewerCesiumInspectorMixin), - this.rightRotate && - (this._Viewer.scene.screenSpaceCameraController.zoomEventTypes.shift(), - (this._Viewer.scene.screenSpaceCameraController.tiltEventTypes[0] = 1)), - h.maxViewHeight && - (this._Viewer.scene.screenSpaceCameraController.maximumZoomDistance = - h.maxViewHeight), - h.minViewHeight || h.maxViewPitch) - ) { - (this.minViewHeight = h.minViewHeight), - (this.maxViewPitch = - h.maxViewPitch && Cesium.Math.toRadians(h.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; - }, Cesium.ScreenSpaceEventType.MIDDLE_UP), - e.setInputAction(() => { - t = !0; - }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), - e.setInputAction(() => { - t = !1; - }, 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 || - Cesium.Cartesian3.fromRadians( - i.positionCartographic.longitude, - i.positionCartographic.latitude, - t - ), - orientation: { heading: i.heading, pitch: o, roll: 0 }, - }) - : (this.oldPosition = i.position.clone()); - } - } - }); - } - if ( - (e.mouseDownView && this.mouseDownView(!0), - 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), - h.navigation) - ) { - if (!Cesium.viewerCesiumNavigationMixin) { - let e = new oe(!1); - e.addJs( - window.SmartEarthRootUrl + "Workers/viewerCesiumNavigationMixin.js" - ); - } - c = { - defaultResetView: Cesium.Rectangle.fromDegrees(80, 22, 130, 50), - enableCompass: !0, - enableZoomControls: !0, - enableDistanceLegend: !0, - enableCompassOuterRing: !0, - }; - e.navigationOption && this._core.extend(c, e.navigationOption, !0), - this._Viewer.extend(Cesium.viewerCesiumNavigationMixin, c); - } - h.disableRightClickMenu && - (document.oncontextmenu = function () { - return !1; - }); - c = this._Viewer; - if ( - c.cesiumWidget._supportsImageRenderingPixelated && - window && - window.devicePixelRatio - ) { - for (var d = window.devicePixelRatio; 2 <= d; ) d /= 2; - c.resolutionScale = d; - } - (c.scene.postProcessStages.fxaa.enabled = !0), (this.sunLight = !1); - var p = this; - function g(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(C(t, i), function (e) { - o.resolve(e); - }) - : setTimeout(e, 10); - })(), - o.promise - ); - } - function f(e, t) { - for ( - var i = e.tilingScheme, - o = i.positionToTileXY(t, 0), - e = - p._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 _(e) { - var t; - for ( - $.grep(p._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 = p.G), - o || - ((o = Cesium.Cartesian3.fromRadiansArrayHeights([ - r.longitude, - r.latitude, - r.height, - ])[0]), - (i.z = o.z)); - } - return e; - } - function C(e, t) { - for (var i = 0; i < t.length; ++i) { - var o = t[i], - r = f(e, o); - o.height = r.data.terrainData.interpolateHeight( - r.rectangle, - o.longitude, - o.latitude - ); - } - return t; - } - function y(e) { - this.value = new Float32Array([e]); - } - (p.G = 65535), - (y.fromZBias = function (e) { - if (Cesium.defined(e)) return new y(e); - throw new DeveloperError("zbias is required."); - }), - (y.toValue = function (e, t) { - if (Cesium.defined(e)) - return Cesium.defined(t) ? color.toBytes(t) : new Float32Array(e); - throw new DeveloperError("zbias is required."); - }), - (y.equals = function (e, t) { - return ( - e === t || - (Cesium.defined(e) && Cesium.defined(t) && e.value[0] === t.value[0]) - ); - }), - (y.defaultBias = function () { - return y.fromZBias(15e-6); - }), - (Cesium.ZBiasGeometryInstanceAttribute = y), - (Cesium.SampleRenderedDataFlags = { TERRAIN: 2, MESH: 4, FLOOR: 8 }), - (Cesium.DynamicEyeOffset = function (e) { - return ( - void 0 === e && (e = 0), new Cesium.Cartesian3(0.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(g(p._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(_(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 != p.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(_(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(C(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 - ); - }); - } - function Uh(e, t) { - let i = new oe(!1); - i.addJs(SmartEarthRootUrl + "SmartEarth.min.js"), - (this._core = new v()), - (this.left = e), - (this.leftContainer = e._Viewer.container), - (this.leftContainer.style.width = "50%"), - (this.parentElement = this.leftContainer.parentElement), - this.createRightScreen(t), - this.addEvenListener(); - } - (zh.prototype.mouseDownView = function (e) { - if (e && !this.cursorHandel) { - this.cursorHandel = new Cesium.ScreenSpaceEventHandler( - this._Viewer.scene.canvas - ); - let t, - i, - o = - ((this.cursorPoint = document.createElement("div")), - (this.cursorPoint.className = "mouseDownViewPoint"), - (this.cursorPoint.style.cssText = - "visibility: hidden;opacity: 0;pointer-events: none;position: absolute;z-index: 999;transition: visibility 0.2s ease 0s, opacity 0.2s ease-in;"), - (this.cursorPoint.innerHTML = - '<img src="' + - window.SmartEarthRootUrl + - 'Workers/image/cursor.png" style="width: 36px;height: 36px;">'), - this._Viewer.container.appendChild(this.cursorPoint), - (e) => { - e = (e = e || i).position || e.endPosition; - (this.cursorPoint.style.top = e.y - 18 + "px"), - (this.cursorPoint.style.left = e.x - 18 + "px"), - (this.cursorPoint.style.visibility = "unset"), - (this.cursorPoint.style.opacity = 1); - }), - r = (e) => { - e = e.position || e.endPosition; - (this.cursorPoint.style.top = e.y - 18 + "px"), - (this.cursorPoint.style.left = e.x - 18 + "px"); - }, - n = - (this.cursorHandel.setInputAction( - (e) => { - (i = e), - clearTimeout(t), - (t = void 0), - this._Viewer.camera.positionCartographic.height < 1e4 - ? o(e) - : ((this.cursorPoint.style.visibility = "hidden"), - (this.cursorPoint.style.opacity = 0)); - }, - this.rightRotate - ? Cesium.ScreenSpaceEventType.RIGHT_DOWN - : Cesium.ScreenSpaceEventType.MIDDLE_DOWN - ), - this.cursorHandel.setInputAction( - (e) => { - this.cursorPoint.style.visibility = "hidden"; - }, - this.rightRotate - ? Cesium.ScreenSpaceEventType.RIGHT_UP - : Cesium.ScreenSpaceEventType.MIDDLE_UP - ), - this.cursorHandel.setInputAction((e) => { - (i = e), t && r(e); - }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), - this.cursorHandel.setInputAction((e) => { - clearTimeout(t), - o(), - (t = setTimeout(() => { - (this.cursorPoint.style.visibility = "hidden"), - (this.cursorPoint.style.opacity = 0), - (t = void 0); - }, 500)); - }, Cesium.ScreenSpaceEventType.WHEEL), - 0), - a; - this.cursorHandel.setInputAction((e) => { - this._PointFly && this._PointFly.end && this._PointFly.end(); - }, Cesium.ScreenSpaceEventType.LEFT_CLICK), - this.cursorHandel.setInputAction((e) => { - n++, - clearInterval(a), - (a = setTimeout(() => { - n = 0; - }, 500)), - 2 <= n && - ((n = 0), - this._PointFly || (this._PointFly = new ar(this._Viewer, Cesium)), - this._PointFly && this._PointFly.end && this._PointFly.end(), - this._PointFly.setPointFly({ - position: this.Navigate.getMousePosition(e), - hideImage: !0, - time: this._rotateFlyTime, - pitch: Cesium.Math.toDegrees(this._Viewer.camera.pitch), - })); - }, Cesium.ScreenSpaceEventType.RIGHT_CLICK); - } else - this.cursorHandel && this.cursorHandel.destroy(), - (this.cursorHandel = void 0), - this.cursorPoint && this.cursorPoint.remove(), - (this.cursorPoint = void 0); - }), - (zh.prototype.pick = function (e, o = !0, r = !0, n = !1) { - this.endPick(), - (this.pick_callBcak = e), - (this._Viewer._enableInfoOrSelection = !0), - r && (this.pick_stage = this.Core.addPickStage(this._Viewer)), - (this.pick_handel = new Cesium.ScreenSpaceEventHandler( - this._Viewer.scene.canvas - )); - let a, s, l, u; - this.pick_handel.setInputAction((t) => { - if ( - (r && this.pick_stage.remove(), - (a = this._Viewer.scene.pick(t.position)), - (s = void 0), - !a || n) - ) { - var i = this._Viewer.scene.pickPosition(t.position); - if (!i) return; - let e = this.Core.toDegrees(i); - (u = "鍧愭爣淇℃伅"), - (s = { - 缁忓害: e.lon.toFixed(6), - 绾害: e.lat.toFixed(6), - 楂樺害: e.height.toFixed(2), - }); - } else if (a) - if ((r && this.pick_stage.select(a), a.id)) - a.id.fid && a.id.attributes - ? ((u = a.id.fid), (s = a.id.attributes)) - : a.id.id && a.id.properties - ? ((u = a.id.name || a.id.id), - (s = a.id.properties.getValue - ? a.id.properties.getValue() - : a.id.properties)) - : a.id.feature && - ((u = a.id.feature.id), (s = a.id.feature.properties)); - else if (a._modelId) - a._modelId.id && - a._modelId.properties && - ((u = a._modelId.id), (s = a._modelId.properties)); - else if (!a.color && a.content) { - u = "妯″瀷" + a.content.tile._priority; - i = this._Viewer.scene.pickPosition(t.position); - if (i) { - let e = this.Core.toDegrees(i); - s = { - 缁忓害: e.lon.toFixed(6), - 绾害: e.lat.toFixed(6), - 楂樺害: e.height.toFixed(2), - }; - } - } - if (o && s) { - for (var e in ((l = - '<table class="cesium-infoBox-defaultTable"><tbody>'), - s)) - l += `<tr><th>${e}</th><td>${s[e]}</td></tr>`; - (l += "</tbody></table>"), - (this._Viewer.selectedEntity = new Cesium.Entity({ - name: u, - description: l, - })); - } else if (a && a.getPropertyNames && a.getProperty) { - let e = a.getPropertyNames(); - (s = {}), - e.forEach((e) => { - s[e] = a.getProperty(e); - }); - } - this.pick_callBcak && (a || s) && this.pick_callBcak(s, a, t); - }, Cesium.ScreenSpaceEventType.LEFT_CLICK); - }), - (zh.prototype.pickPosition = function (e, t = !0) { - this.endPick(), this.pick(e, t, !1, !0); - }), - (zh.prototype.endPick = function () { - this._Viewer.infoBox && - this._Viewer.infoBox.viewModel.closeClicked.raiseEvent(), - (this._Viewer._enableInfoOrSelection = !1), - (this.pick_callBcak = void 0), - this.pick_handel && this.pick_handel.destroy(), - (this.pick_handel = void 0), - this.pick_stage && - (this.pick_stage.remove(), - this.pick_stage.destroy(), - (this.pick_stage = void 0)); - }), - (zh.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(zh.prototype, { - Analysis: { - get: function () { - return ( - null == this._Analysis && - (this._Analysis = new O(this._Viewer, Cesium)), - this._Analysis - ); - }, - }, - Navigate: { - get: function () { - return ( - null == this._Navigate && - (this._Navigate = new Ah(this._Viewer, Cesium, this._tree)), - this._Navigate - ); - }, - }, - Creator: { - get: function () { - return ( - null == this._Creator && - (this._Creator = new Q(this._Viewer, Cesium)), - this._Creator - ); - }, - }, - Core: { - get: function () { - return null == this._Core && (this._Core = new v()), this._Core; - }, - }, - Command: { - get: function () { - return ( - null == this._Command && - (this._Command = new jr(this._Viewer, Cesium)), - this._Command - ); - }, - }, - ProjectTree: { - get: function () { - return ( - null == this._ProjectTree && - (this._ProjectTree = new q(this._Viewer, 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; - }, - }, - bloom: { - get: function () { - return this._Viewer.scene.postProcessStages.bloom.enabled; - }, - set: function (e) { - this._Viewer.scene.postProcessStages.bloom.enabled = e; - }, - }, - sunLight: { - get: function () { - return this._Viewer.scene.globe.enableLighting; - }, - set: function (e) { - var t = this.lightColor, - i = this.lightIntensity; - (this._Viewer.scene.light = e - ? new Cesium.SunLight() - : new Cesium.DirectionalLight({ - direction: new Cesium.Cartesian3( - 0.35492591601301104, - -0.8909182691839401, - -0.2833588392420772 - ), - })), - (this.lightColor = t), - (this.lightIntensity = i), - (this._Viewer.scene.globe.enableLighting = e); - }, - }, - lightIntensity: { - get: function () { - return this._Viewer.scene.light && this._Viewer.scene.light.intensity; - }, - set: function (e) { - this._Viewer.scene.light && (this._Viewer.scene.light.intensity = e); - }, - }, - lightColor: { - get: function () { - return ( - this._Viewer.scene.light && - this._Viewer.scene.light.color.toCssHexString() - ); - }, - set: function (e) { - this._Viewer.scene.light && - (this._Viewer.scene.light.color = - Cesium.Color.fromCssColorString(e)); - }, - }, - colorAdjustment: { - get: function () { - return this._Viewer.scene.colorAdjustment || new $l(this._Viewer); - }, - }, - brightness: { - get: function () { - return this.colorAdjustment.brightness; - }, - set: function (e) { - this.colorAdjustment.brightness = e; - }, - }, - contrast: { - get: function () { - return this.colorAdjustment.contrast; - }, - set: function (e) { - this.colorAdjustment.contrast = e; - }, - }, - saturation: { - get: function () { - return this.colorAdjustment.saturation; - }, - set: function (e) { - this.colorAdjustment.saturation = e; - }, - }, - rotateFlyTime: { - get: function () { - return this._rotateFlyTime || 30; - }, - set: function (e) { - this._rotateFlyTime = e; - }, - }, - }), - (zh.prototype.navControl = function (e, t) { - var i = t ? "" : "none"; - this._Viewer.cesiumNavigation && - ("all" === e - ? ((this._Viewer.cesiumNavigation.container.style.display = i), - (this._Viewer.cesiumNavigation.navigationDiv.style.display = i), - (this._Viewer.cesiumNavigation.distanceLegendDiv.style.display = i)) - : ("nav" === e - ? (this._Viewer.cesiumNavigation.navigationDiv.style.display = i) - : (this._Viewer.cesiumNavigation.distanceLegendDiv.style.display = - i), - t && (this._Viewer.cesiumNavigation.container.style.display = i))); - }), - (zh.prototype.CreateWfs = function (e, t, i, o, r, n, a, s, l) { - return new W(e, t, i, o, r, n, a, s, l); - }), - (zh.prototype.AttachEvent = function (e, t) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachEvent(e, t) - ); - }), - (zh.prototype.RemoNormalCesiumLeftDoubleClick = function () { - return ( - null == this._DetachEvent && - (this._DetachEvent = new bh(this._Viewer, Cesium)), - this._DetachEvent.RemoNormalCesiumLeftDoubleClick() - ); - }), - (zh.prototype.AttachOnLButtonDblClkEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachOnLButtonDblClkEvent(e) - ); - }), - (zh.prototype.AttachOnLButtonDownEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachOnLButtonDownEvent(e) - ); - }), - (zh.prototype.AttachOnLButtonUpEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachOnLButtonUpEvent(e) - ); - }), - (zh.prototype.AttachOnMButtonDblClkEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachOnMButtonDblClkEvent(e) - ); - }), - (zh.prototype.AttachOnMButtonDownEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachOnMButtonDownEvent(e) - ); - }), - (zh.prototype.AttachOnMButtonUpEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachOnMButtonUpEvent(e) - ); - }), - (zh.prototype.AttachOnMouseWheelEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachOnMouseWheelEvent(e) - ); - }), - (zh.prototype.AttachOnFrameEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachOnFrameEvent(e) - ); - }), - (zh.prototype.AttachOnRButtonDownEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachOnRButtonDownEvent(e) - ); - }), - (zh.prototype.AttachOnRButtonUpEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachOnRButtonUpEvent(e) - ); - }), - (zh.prototype.AttachCameraChangeEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.AttachCameraChangeEvent(e) - ); - }), - (zh.prototype.CameraMoveEndEvent = function (e) { - return ( - null == this._AttachEvent && - (this._AttachEvent = new wh(this._Viewer, Cesium)), - this._AttachEvent.CameraMoveEndEvent(e) - ); - }), - (zh.prototype.DetachEvent = function (e, t) { - return ( - null == this._DetachEvent && - (this._DetachEvent = new bh(this._Viewer, Cesium)), - this._DetachEvent.DetachEvent(e, t) - ); - }), - (zh.prototype.DetachEventAll = function (e) { - return ( - null == this._DetachEvent && - (this._DetachEvent = new bh(this._Viewer, Cesium)), - this._DetachEvent.DetachEventAll(e) - ); - }), - (zh.prototype.DetachCameraChangeEvent = function (e) { - return ( - null == this._DetachEvent && - (this._DetachEvent = new bh(this._Viewer, Cesium)), - this._DetachEvent.DetachCameraChangeEvent(e) - ); - }), - (Uh.prototype.createRightScreen = function (e) { - (this.rightContainer = document.createElement("div")), - (this.rightContainer.id = "SDKSecondaryScreen"), - (this.rightContainer.style.cssText = ` - height: 100%; - flex: 1; - position: relative; - `), - this.parentElement.append(this.rightContainer), - (this.defaultStyle = { - display: this.parentElement.style.display, - flexDirection: this.parentElement.style.flexDirection, - flex: this.parentElement.style.flex, - }), - (this.parentElement.style.display = "flex"), - (this.parentElement.style.flexDirection = "row"), - (this.parentElement.style.flex = 1), - (this.right = new zh("SDKSecondaryScreen", e)), - this.right.Navigate.Stop(), - this.leftEvenListener(); - }), - (Uh.prototype.leftEvenListener = function () { - this.right._Viewer.camera.setView({ - destination: this.left._Viewer.camera.position.clone(), - orientation: { - heading: this.left._Viewer.camera.heading, - pitch: this.left._Viewer.camera.pitch, - roll: this.left._Viewer.camera.roll, - }, - }); - }), - (Uh.prototype.rightEvenListener = function () { - this.left._Viewer.camera.setView({ - destination: this.right._Viewer.camera.position.clone(), - orientation: { - heading: this.right._Viewer.camera.heading, - pitch: this.right._Viewer.camera.pitch, - roll: this.right._Viewer.camera.roll, - }, - }); - }); - let Wh, Yh; - function Jh(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._Color = new m(this._viewer, this._cesium)), - (this._core = new v()), - (this._getPosition = new C(this._viewer, this._cesium)), - (this._tree = F), - (this._points = []), - (this._polylines = []), - (this.Streamerpath = new Yc(this._viewer)), - (this.Streamerwall = new Qc(this._viewer)); - } - function Kh(e, t) { - (this._viewer = e), (this._cesium = t); - } - function Qh(e, t) { - (this._viewer = e), - (this._cesium = t), - (this._current = new Kh(this._viewer, this._cesium)); - } - (Uh.prototype.addEvenListener = function () { - (this.leftContainer.onmouseover = () => { - Wh || - ((Wh = this.leftEvenListener.bind(this)), - this.left._Viewer.scene.preRender.addEventListener(Wh)), - Yh && this.right._Viewer.scene.preRender.removeEventListener(Yh), - (Yh = null); - }), - (this.rightContainer.onmouseover = () => { - Yh || - ((Yh = this.rightEvenListener.bind(this)), - this.right._Viewer.scene.preRender.addEventListener(Yh)), - Wh && this.left._Viewer.scene.preRender.removeEventListener(Wh), - (Wh = null); - }); - }), - (Uh.prototype.removeEvenListener = function () { - (this.leftContainer.onmouseover = null), - (this.rightContainer.onmouseover = null), - Yh && this.right._Viewer.scene.preRender.removeEventListener(Yh), - Wh && this.left._Viewer.scene.preRender.removeEventListener(Wh), - (Yh = null), - (Wh = null); - }), - (Uh.prototype.destroy = function () { - this.removeEvenListener(), - this.rightContainer.remove(), - (this.left = null), - (this.right = null), - (this.parentElement.style.display = this.defaultStyle.display), - (this.parentElement.style.flexDirection = - this.defaultStyle.flexDirection), - (this.parentElement.style.flex = this.defaultStyle.flex), - (this.leftContainer.style.width = "100%"); - }), - (Jh.prototype.createPathLayer = function (e = {}) { - var t = { - lineColor: e.color || "#0033FF", - linewidth: e.width || 5, - pointColor: e.pointColor || "#FFFFFF", - 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; - }), - (Jh.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; - }), - (Jh.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 + I.TrailLine - ), - height: 5e4, - num: 100, - width: 2, - LightSpot: !1, - alpha: 0.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 te(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; - }), - (Jh.prototype.createFlyingLine = function (e, t = {}) { - var i = { - time: 3e3, - LineColor: this._core.defaultValue(t.color, "#ffffff"), - LinkImage: this._core.defaultValue( - t.url, - window.SmartEarthRootUrl + I.TrailLine - ), - minHeight: 0, - width: 1, - alpha: 0, - }, - t = { - LightSpot: !0, - color: - (i = this._core.extend(i, t, !0)).LightSpotColor || i.LineColor, - }, - o = new te( - 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; - }), - (Jh.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 + I.TrailLine - ), - width: 10, - }, - t = new te( - (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; - }), - (Jh.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 + I.colors3 - ), - }, - t = new te( - (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; - }), - (Jh.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(-0.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(-0.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; - }), - (Jh.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)); - }), - (Jh.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(); - }), - (Jh.prototype.setTreeobj = function (e) { - this.treeobj = e; - }), - (Jh.prototype.deleteObject = function () { - this.clear(); - }), - (Jh.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); - }), - (Kh.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 - ); - }), - (Kh.prototype.currentTimeFaster = function () { - return this._viewer.animation.viewModel.faster(), this; - }), - (Kh.prototype.currentTimeSlower = function () { - return this._viewer.animation.viewModel.slower(), this; - }), - (Kh.prototype.currentplayForwardViewModel = function () { - return ( - this._viewer.animation.viewModel.playForwardViewModel.command(), this - ); - }), - (Kh.prototype.currentplayReverseViewModel = function () { - return ( - this._viewer.animation.viewModel.playReverseViewModel.command(), this - ); - }), - (Kh.prototype.currentpauseViewModel = function () { - return this._viewer.animation.viewModel.pauseViewModel.command(), this; - }), - (Qh.prototype.currentTime = function (e) { - return this._current.currentTime(e); - }), - (Qh.prototype.currentTimeFaster = function () { - return this._current.currentTimeFaster(); - }), - (Qh.prototype.currentTimeSlower = function () { - return this._current.currentTimeSlower(); - }), - (Qh.prototype.currentplayForwardViewModel = function () { - return this._current.currentplayForwardViewModel(); - }), - (Qh.prototype.currentplayReverseViewModel = function () { - return this._current.currentplayReverseViewModel(); - }), - (Qh.prototype.currentpauseViewModel = function () { - return this._current.currentpauseViewModel(); - }); - let qh = - "undefined" != typeof window - ? window - : "undefined" != typeof self - ? self - : {}, - Xh = document.currentScript && document.currentScript.src; - if (!Xh) - try { - throw Error("鑾峰彇褰撳墠鏂囦欢璺緞"); - } catch (e) { - e.fileName - ? (Xh = e.fileName) - : e.stack - ? (Xh = (e.stack.match(/at\s+(.*?):\d+:\d+/) || ["", ""])[1]) - : e.sourceURL && (Xh = e.sourceURL); - } - let Zh = (Xh = -1 < Xh.indexOf("(") ? Xh.split("(")[1] : Xh).indexOf( - "SmartEarth.js" - ), - $h = - (Zh < 0 && (Zh = Xh.indexOf("SmartEarth.min.js")), qh.SmartEarthRootUrl); - if (!$h) { - $h = - Zh < 0 - ? ((Zh = Xh.indexOf("Source/Main")), Xh.substring(0, Zh) + "Build/") - : Xh.substring(0, Zh); - let t = document.getElementsByTagName("link"), - i = !1; - for (let e = 0; e < t.length; e++) - -1 !== t[e].href.indexOf("smartearth.css") && (i = !0); - if (!i) { - let e = document.createElement("link"); - (e.rel = "stylesheet"), - (e.type = "text/css"), - (e.href = $h + "Workers/css/smartearth.css"), - document.head.appendChild(e); - } - let e = new oe(!1); - try { - qh.$ || e.addJs($h + "Workers/jquery-2.0.3.js"), - qh.layer || e.addJs($h + "Workers/layui/lay/modules/layer.js"), - (qh.layuiLayer = qh.layer), - qh.Cesium_turf || - (e.addJs($h + "Workers/turf.min.js"), (qh.Cesium_turf = qh.turf)), - e.addJs($h + "Workers/polyfill.min.js"); - } catch (e) {} - qh.SmartEarthPopupData = {}; - } - function em(e, t) { - (this._viewer = e), (this._cesium = t), (this._tree = F.getSource()); - } - (qh.SmartEarthRootUrl = $h), - (qh.logSmartEarthLog = (e) => { - var t = qh.SmartEarth && qh.SmartEarth.VERSION, - i = qh.SmartEarth && qh.SmartEarth.COMPILETIME, - o = qh.Cesium && qh.Cesium.VERSION; - let r = - e === 1 / 0 || -1 < Xh.indexOf("Source/Main") - ? "姘镐箙婵�娲�" - : new Date(e); - e = ` -%c -SmartEarth -%c -鐗� 鏈� 鍙凤細${t} Cesium鐗堟湰锛�${o} -缂栬瘧鏃堕棿锛�${i} -鎺堟潈淇℃伅锛�${(r = - "姘镐箙婵�娲�" !== r - ? `鏈夋晥鏈熻嚦${r.getFullYear()}骞�${r.getMonth() + 1}鏈�${r.getDate()}鏃 - : r)}銆� -鐗堟潈澹版槑锛� SmartEarthSDK鐗堟潈瀹屽叏灞炰簬銆愬悎鑲ユ嘲鐟炴暟鍒涚鎶�鏈夐檺鍏徃銆� - - - -鍦ㄧ嚎绀轰緥锛歨ttp://183.162.245.49:18076/sdkdemo_2022 -鎺ュ彛鏂囨。锛歨ttp://183.162.245.49:18076/sdkdemo_2022/api - `; - return ( - setTimeout( - console.log.bind( - console, - e, - "font:bold 50px 寰蒋闆呴粦;color:#018aff;", - "color:#018aff;font-size:13px;font-family:寰蒋闆呴粦" - ), - 0 - ), - -1 < Xh.indexOf("Source/Main") - ); - }), - (em.prototype.deleteItem = function (e) {}); - var tm = 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" - ); - }, - im = - "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 om(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 rm(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 nm() { - (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 am(e, i) { - $.each(e._primitives, function (e, t) { - if (t instanceof Cesium.BillboardCollection) - return ( - (e = dm.indexOf((t = t))), - (t._parentCollection._primitiveOld = i), - -1 !== e - ? (viewer.scene.primitives.remove(dm[e]._parentCollection), - (dm[e] = t)) - : dm.push(t), - !1 - ); - }); - } - function sm(e, t) { - viewer.scene.primitives.remove(t), - (e._onDestroyTilePrimitive = function () { - viewer.scene.primitives.remove(t), - (this._onDestroyTilePrimitive = void 0); - }); - } - function lm(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 um(e, t) { - lm( - $.map(e._primitives, function (e) { - return e.readyPromise; - }), - e, - t - ); - } - function cm(e, t) { - lm( - $.map(e._primitives[0]._primitives, function (e) { - return e.readyPromise; - }), - e, - t - ); - } - function hm(e, t) { - viewer.scene.primitives.remove(t); - } - function mm(e, t) { - lm([e.readyPromise], e, t); - } - (rm.prototype._serialize = function (e) { - var t, - i = [], - o = window.encodeURIComponent; - for (t in e) { - var r = e[t]; - "object" === (void 0 === r ? "undefined" : im(r)) - ? i.push(o(t) + "=" + o(JSON.stringify(r))) - : i.push(o(t) + "=" + o(e[t])); - } - return i.join("&"); - }), - (rm.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); - }); - }), - (rm.prototype._lonLatToTileInWGS84 = function (e, t) { - var e = tm(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), - ]; - }), - (rm.prototype._radianToDegree = function (e) { - return (e / Math.PI) * 180; - }), - (rm.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; - } - }), - (rm.prototype._cameraMoveStartHandler = function () { - this._isCameraMoving = !0; - }), - (rm.prototype._loadTile = function (e) { - var r = [], - n = new this._Cesium.ColorGeometryInstanceAttribute( - 0.75, - 0.75, - 0.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, om(e)); - }) - : (t = o[i]).push.apply(t, om(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, - }) - ); - }), - (rm.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, om(t))), - (n = Math.max.apply(Math, om(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; - })); - })); - }), - (rm.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 - ); - }), - (rm.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]); - }), - (rm.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(); - }), - (rm.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); - } - }), - (rm.prototype.setStatus = function (e) { - this._stop = e; - }), - (rm.prototype.isRemoved = function () { - return this._isRemoved; - }), - (rm.prototype.filterBy = function (e, t, i) { - (this._propertyToBeFiltered = e), (this._valuesToBeFiltered = t); - }), - (rm.prototype.removeFilter = function () { - (this._propertyToBeFiltered = null), (this._valuesToBeFiltered = null); - }), - Object.defineProperties(nm.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; - }, - }, - }), - (nm.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 dm = [], - pm = 0, - gm = !(nm.prototype.onPreFrame = function (e, t) { - if ((pm++, !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 && - pm % 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(dm, function (e, t) { - t.ready && - viewer.scene.primitives.remove(t._parentCollection._primitiveOld); - }); - } - }), - fm = - ((nm.prototype.initialize = function (e) { - gm || - (viewer.scene.preRender.addEventListener(this.onPreFrame, this), - (gm = !0)); - }), - (nm.prototype.beginUpdate = function (e) { - this.quadtree.beginFrame(e); - }), - (nm.prototype.endUpdate = function (e) { - var t = this; - e.afterRender.push(function () { - t.quadtree.endFrame(e); - }); - }), - (nm.prototype.updateForPick = function (e) {}), - (nm.prototype.getLevelMaximumGeometricError = function (e) { - return ( - (this._levelZeroMaximumError / (1 << e)) * - this._quadtree.maximumScreenSpaceError - ); - }), - Math.PI, - (nm.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 - - 0.99 * TerraExplorer.internal.Navigate.HeightAboveGround, - }), - attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor(t), - }, - }), - appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }), - }); - e.data.primitive.add(t); - }), - (nm.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)); - }), - (nm.prototype.getTile = function (e) { - return this._tileCache[e]; - }), - (nm.prototype.getAllTiles = function () { - var e, - t = []; - for (e in this._tileCache) t.push(this._tileCache[e]); - return t; - }), - (nm.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)) - ); - }), - (nm.prototype.showTileThisFrame = function (e, t) { - e.data.primitive.update(t); - }), - (nm.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 - ); - }), - (nm.prototype.isDestroyed = function () { - return !1; - }), - (nm.prototype.destroy = function () { - return Cesium.destroyObject(this); - }), - (nm.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 - ); - }), - (nm.prototype.addToScene = function (e) { - this._primitivesWaitingToBeAddedToTheScene.push(e); - }), - (nm.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); - }), - (nm.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": - am(t, e); - break; - case "labels": - sm(t, e); - break; - case "polygons": - um(t, e); - break; - case "models": - cm(t, e); - break; - case "polylines": - mm(t, e); - break; - case "points": - hm(0, e); - break; - default: - console.log("Error updating layer"), - viewer.scene.primitives.remove(e); - } - }), - { - billboards: am, - labels: sm, - polygons: um, - models: cm, - polylines: mm, - points: hm, - }); - nm.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 = fm[i]) - ? i(t, e) - : (console.log("Error updating layer"), - viewer.scene.primitives.remove(e))); - }; - ei = 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, - CRN_DXT5: 26, - STANDARD_CRN: 27, - }); - (o.Analysis = O), - (o.Angle = fr), - (o.ArcgisNVectorTileProvider = rm), - (o.AttachEvent = wh), - (o.BaiduImageryProvider = El), - (o.Bearing = gr), - (o.Billboard = xl), - (o.Box = B), - (o.BoxGeoJsonFeatureLayer = Dl), - (o.BufferAnalysis = Si), - (o.CIMServerTool = ne), - (o.COMPILETIME = "2022.10.9"), - (o.CZML = ih), - (o.CameraPlaneVideo = Al), - (o.CanvasField = ql), - (o.Cartesian2 = function (e = 0, t = 0) { - (this.x = e), (this.y = t); - }), - (o.Cartesian3 = function (e = 0, t = 0, i = 0) { - (this.x = e), (this.y = t), (this.z = i); - }), - (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 = mr), - (o.CesiumHeatmap = Ur), - (o.CesiumHeatmapGL = Wr), - (o.CesiumRenderPass = tr), - (o.Circle = V), - (o.ClusterLayer = Xl), - (o.Color = m), - (o.ColorAdjustment = $l), - (o.ColorAdjustmentFS = Zl), - (o.CombineEcharts = re), - (o.Command = jr), - (o.Cone = j), - (o.ConicSensor = eu), - (o.ContentState = Ce), - (o.CoordTransform = he), - (o.Core = v), - (o.Corridor = tu), - (o.CreateWfsFeatureLayer = rc), - (o.Creator = Q), - (o.Current = Kh), - (o.DDSTexture = Qe), - (o.DXTTextureDecode = Se), - (o.DateTime = Qh), - (o.Degrees = function (e = 0, t = 0, i = 0) { - (this.lon = e), (this.lat = t), (this.height = i); - }), - (o.Deprecated = Cr), - (o.DetachEvent = bh), - (o.DivPoint = Ci), - (o.DoubleScreen = Uh), - (o.EdgeStage = ir), - (o.EffectCircle = dh), - (o.EffectCircleSource = mh), - (o.EffectConeBottomSource = fh), - (o.EffectConeSource = gh), - (o.EffectCylinder = _h), - (o.EffectCylinderSource = ph), - (o.ElevationContour = Nt), - (o.ElevationTool = $r), - (o.Ellipsoid = Pr), - (o.EntityCreator = Fn), - (o.EventType = zr), - (o.FieldIntensity = hh), - (o.FlowField = jc), - (o.GeoJSONVectorTileProvider = y), - (o.GeoJSONVectorTileProvider1 = Pi), - (o.GeoJSONVectorTileProviderPolymerization = gc), - (o.GeoJsonFeatureLayer = w), - (o.Gettreeid = function (e, t) { - for (var i = "", o = F.getSource(), r = 0; r < o.length; r++) - e == o[r].name && o[r].pId == t && (i = o[r].id); - return i; - }), - (o.GmlParser = pn), - (o.Hawkeye = Zc), - (o.Heatmap = oh), - (o.Highvolume = Er), - (o.ImageLabel = sc), - (o.ImageryLayer = hc), - (o.InstanceMode = ot), - (o.JBAlgorithm = z), - (o.KmlLayer = $c), - (o.Label = G), - (o.LabelGeoJsonFeatureLayer = fc), - (o.LabelGeoJsonFeatureLayercopy = E), - (o.LonLatProjection = xi), - (o.MaterialPass = qe), - (o.MilitaryStandard = K), - (o.Mjcl = _r), - (o.ModelClipping = th), - (o.ModelEdit = jt), - (o.ModifyMesh = eh), - (o.Navigate = Ah), - (o.OperationType = Lt), - (o.Particle = bo), - (o.Point = L), - (o.PointFly = ar), - (o.PointModel = P), - (o.Polygon = M), - (o.PolygonGeoJsonFeatureLayer = Oi), - (o.PolygonVectorGeoJsonFeatureLayer = Gc), - (o.PolygonVectorTileLayerArcgis = so), - (o.Polyline = R), - (o.PolylineGeoJsonFeatureLayer = Ri), - (o.PolylineLinkSource = Vt), - (o.PolylineTrailLinkMaterial = te), - (o.PolylineTrailLinkMaterialSource = ee), - (o.PolylineTrailLinkSource = Z), - (o.PolylineVolume = nc), - (o.PopupMessage = yi), - (o.ProgramDefines = tt), - (o.ProjectTree = q), - (o.RangeMode = _t), - (o.Recorder = ae), - (o.Rectangle = H), - (o.RenderEntity = nt), - (o.Road = Xc), - (o.S3MCacheFileRenderEntity = ut), - (o.S3MCompressType = { - encNONE: 0, - enrS3TCDXTN: 14, - enrPVRTPF_PVRTC2: 19, - enrPVRTPF_PVRTC: 20, - enrPVRTPF_PVRTC_4bpp: 21, - enrPVRTPF_ETC1: 22, - }), - (o.S3MContentFactory = dt), - (o.S3MContentParser = pt), - (o.S3MCreateIndexJob = et), - (o.S3MCreateShaderProgramJob = rt), - (o.S3MCreateVertexJob = $e), - (o.S3MLayerCache = At), - (o.S3MLayerScheduler = Tt), - (o.S3MObliqueRenderEntity = mt), - (o.S3MPixelFormat = ei), - (o.S3MTile = Ct), - (o.S3MTilesFS = Ze), - (o.S3MTilesLayer = Rt), - (o.S3MTilesNoLightFS = ht), - (o.S3MTilesNoLightVS = ct), - (o.S3MTilesVS = Xe), - (o.S3ModelParser = xe), - (o.SE3DTileset = A), - (o.SE3DTilesetFS = ur), - (o.SE3DTilesetVS = cr), - (o.SFSTerrainProvider = Pc), - (o.SFSTerrainProvider7_2_3 = bc), - (o.SGWorld = zh), - (o.SatelliteTrail = rh), - (o.Scan = Ho), - (o.Scan_PostProcessStage = Sr), - (o.Screenshot = nr), - (o.ShadowPostProcess = Ko), - (o.ShadowPostProcessFS = Yo), - (o.ShadowsAnalysis = rr), - (o.SightLine = po), - (o.SimpleGraphic = x), - (o.SimpleSqlParser = xn), - (o.Skip = oe), - (o.SkyBox = Nc), - (o.SkylineAnalysis = Xo), - (o.Stop = Ih), - (o.StreamerPath = Yc), - (o.StreamerPathFS = Wc), - (o.StreamerWall = Qc), - (o.StreamerWallFS = Kc), - (o.StreetView = Eo), - (o.Style3D = Mt), - (o.SunshineAnalysis = sr), - (o.TdtLabel = uh), - (o.Terrain = Fc), - (o.TerrainExcavation = or), - (o.TerrainModifier = sh), - (o.Tetrahedron = Ch), - (o.TileManager = nm), - (o.TileManager1 = gn), - (o.TrafficLight = yh), - (o.TrailLine = Jh), - (o.TrailLinePrimitive = qc), - (o.UndergroundGrid = To), - (o.UndergroundMode = br), - (o.VERSION = "2.3.0"), - (o.VectorCesiumTerrainProvider = Dc), - (o.VectorGeoJsonFeatureLayer = S), - (o.VectorImgFeatureLayer = ah), - (o.VectorTileProvider = T), - (o.VertexCompressOption = it), - (o.Video = lh), - (o.ViewCone = Qo), - (o.Viewshed = No), - (o.ViewshedPoss = qo), - (o.VolumeGeoJsonFeatureLayer = Hc), - (o.VolumetricMeasure = dr), - (o.WFSTool = Tl), - (o.WGS84_to_Cartesian3 = function (e) { - return Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height); - }), - (o.WMTSGetCapabilities = ge), - (o.WMTSTerrain = Bc), - (o.WallGeoFeatureLayer = uo), - (o.WaterGeoJsonFeatureLayer = ch), - (o.WfsLayer = W), - (o.WorkerPool = de), - (o.billboardGeoJsonFeatureLayer = Ei), - (o.clone = function e(t, i) { - if (null === t || "object" != typeof t) return t; - i = X(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 = I), - (o.createGroup = vi), - (o.curtaincontrast = fo), - (o.czmlPathAnimation = vh), - (o.decode = Zr), - (o.defaultValue = X), - (o.deleteItem = Lh), - (o.demolition = hr), - (o.depthTestAgainstTerrain = Vo), - (o.dynamicObject = k), - (o.execute = Nr), - (o.expandGroup = em), - (o.export = Nh), - (o.findItem = Mh), - (o.flyTo = Mi), - (o.flyToObj = Sh), - (o.getExitsObjectType = Vh), - (o.getItemName = Rh), - (o.getNextItem = Hh), - (o.getObject = Gh), - (o.getPosition = C), - (o.getVisibility = Oh), - (o.gradientColor = me), - (o.indoormode = vo), - (o.isGroup = kh), - (o.jumpTo = Ph), - (o.license = ln), - (o.lineOfSight = wr), - (o.lodash = f), - (o.main = qh), - (o.measure = pr), - (o.meshopt_decoder_module = Pe), - (o.northfinger = xh), - (o.pako_inflate = ye), - (o.pbf_dev = Fi), - (o.position = ac), - (o.renameGroup = Fh), - (o.setPosition = Dh), - (o.setVisibility = Bh), - (o.tdtwmtsimageprovider = mn), - (o.treeSource = F), - (o.uuid = dn), - (o.vectortile = no), - (o.wall = lc), - (o.weather = wo), - (o.zoomIn = Th), - (o.zoomOut = Eh), - Object.defineProperty(o, "__esModule", { value: !0 }); -}); -- Gitblit v1.9.3