deeptwins-engine-3d 0.1.39 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/Build/DeepTwins/YunJing/yunjing-cesium-plugins.min.js +1 -0
- package/dist/assets/Build/DeepTwins/YunJing/yunjing-for-cesium.js +1 -1
- package/dist/esm/deepTwins/index.d.ts +2 -1
- package/dist/esm/deepTwins/index.js +22 -4
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +4 -2
- package/dist/esm/tileLayer/BarrierLayer.d.ts +73 -0
- package/dist/esm/tileLayer/BarrierLayer.js +281 -0
- package/dist/umd/deeptwins-engine-3d.min.js +1 -1
- package/package.json +1 -1
- package/dist/assets/Build/DeepTwins/Image/compass/pointer-white.png +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function (i, t) { "object" == typeof exports && "undefined" != typeof module ? t(exports, require("cesium")) : "function" == typeof define && define.amd ? define(["exports", "cesium"], t) : t((i = "undefined" != typeof globalThis ? globalThis : i || self).YunjingCesiumPlugins = {}, i.Cesium) }(this, function (i, t) { "use strict"; function n(i) { if (i && i.i) return i; var t = Object.create(null); return i && Object.keys(i).forEach(function (n) { if ("default" !== n) { var s = Object.getOwnPropertyDescriptor(i, n); Object.defineProperty(t, n, s.get ? s : { enumerable: !0, get: function () { return i[n] } }) } }), t.default = i, Object.freeze(t) } var s = n(t), l = Cesium.Color.fromCssColorString("#4fa8f9"), c = Cesium.Color.fromCssColorString("#ffffff"), h = Cesium.Color.fromCssColorString("#2d93f9"), u = function () { function i(i, t) { var n, s, l, c, h, u, d; void 0 === t && (t = {}), this.t = null, this.target = null, this.l = null, this.h = [], this.u = [], this.o = null, this.m = null, this.Z = null, this.p = !1, this.X = [], this.G = null, this.isOpen = !1, this.W = null, this.V = "static", this.isCreateMode = !1, this.C = [], this.K = { open: [], close: [], adjust: [], addnode: [] }, this.I = i, this.M = { clampToGround: null === (n = t.clampToGround) || void 0 === n || n, polylineWidth: null !== (s = t.polylineWidth) && void 0 !== s ? s : 3, polylineColor: null !== (l = t.polylineColor) && void 0 !== l ? l : Cesium.Color.BLUE, defaultHeight: null !== (c = t.defaultHeight) && void 0 !== c ? c : 1e3, minHeight: null !== (h = t.minHeight) && void 0 !== h ? h : 0, maxHeight: null !== (u = t.maxHeight) && void 0 !== u ? u : 5e4, createLineLength: null !== (d = t.createLineLength) && void 0 !== d ? d : 100 } } return i.prototype.on = function (i, t) { this.K[i].push(t) }, i.prototype.off = function (i, t) { var n = this.K[i], s = n.indexOf(t); 0 > s || n.splice(s, 1) }, i.prototype.emit = function (i, t) { this.K[i].forEach(function (i) { return i(t) }) }, i.prototype.setTarget = function (i) { this.isOpen && this.close(), this.target = i || null, this.L() }, i.prototype.open = function () { this.isOpen && this.close(), this.isOpen = !0, this.v(), this.t = new Cesium.ScreenSpaceEventHandler(this.I.canvas), this.target ? this.R() : this.T(), this.J(), this.H(), this.S(), this.Y(), this.emit("open", { target: this.target }) }, i.prototype.close = function () { this.isOpen && (this.isOpen = !1, this.N(), this.isCreateMode ? this.k() : this.P(), this.j(!0), this.D(), this.emit("close", { target: this.target })) }, i.prototype.getPositions = function () { return this.C.slice() }, i.prototype.createMultiplePolylines = function (i) { var t = this, n = []; return i.forEach(function (i) { t.setTarget(), t.open(), t.setPositions(i.positions), t.close(); var s = t.I.entities.values.find(function (i) { return "鏂板缓鎶樼嚎" === i.name }); if (s) { if (s.name = i.name, i.color) if ("string" == typeof i.color) try { s.polyline.material = Cesium.Color.fromCssColorString(i.color) } catch (t) { console.warn("Invalid color string:", i.color) } else s.polyline.material = i.color; i.width && (s.polyline.width = i.width), n.push(s) } }), n }, i.prototype.setPositions = function (i) { if (0 === i.length) this.C = []; else if (i[0] instanceof Cesium.Cartesian3) this.C = i.slice(); else { if (!Array.isArray(i[0]) || "number" != typeof i[0][0]) return void console.warn("Invalid positions format"); this.C = i.map(function (i) { return Cesium.Cartesian3.fromDegrees(i[0], i[1], i[2] || 0) }) } this.H(), this.S() }, i.prototype.setPointHeight = function (i, t) { if (i >= 0 && this.C.length > i) { var n = Math.max(this.M.minHeight, Math.min(this.M.maxHeight, t)), s = Cesium.Cartographic.fromCartesian(this.C[i]); s.height = n, this.C[i] = Cesium.Cartesian3.fromRadians(s.longitude, s.latitude, s.height), this.H(), this.S() } }, i.prototype.setAllPointsHeight = function (i) { var t = Math.max(this.M.minHeight, Math.min(this.M.maxHeight, i)); this.C = this.C.map(function (i) { var n = Cesium.Cartographic.fromCartesian(i); return n.height = t, Cesium.Cartesian3.fromRadians(n.longitude, n.latitude, n.height) }), this.H(), this.S() }, i.prototype.getPointHeight = function (i) { return 0 > i || i >= this.C.length ? 0 : Cesium.Cartographic.fromCartesian(this.C[i]).height || 0 }, i.prototype.U = function () { this.target && this.W && (this.target.polyline.material = Cesium.Color.clone(this.W)) }, i.prototype.L = function () { this.W = null, this.V = "static", this.isCreateMode = !this.target, this.C = [] }, i.prototype.R = function () { this.B(), this.F(), this.V = this.target.polyline.positions instanceof Cesium.CallbackProperty ? "callback" : "static", this.target.polyline.material = l }, i.prototype.T = function () { this.C = [] }, i.prototype.P = function () { if (this.target && this.W) { var i = this.C.slice(), t = Cesium.Color.clone(this.W); this.target.polyline.positions = "callback" === this.V ? new Cesium.CallbackProperty(function () { return i }, !1) : i, this.target.polyline.material = t } }, i.prototype.k = function () { if (this.C.length > 0 && this.l) { var i = this.C.slice(), t = this.l.polyline; t.positions = new Cesium.CallbackProperty(function () { return i }, !1), t.width = this.M.polylineWidth; var n = Cesium.Color.RED; if (this.M.polylineColor) if ("string" == typeof this.M.polylineColor) try { n = Cesium.Color.fromCssColorString(this.M.polylineColor) } catch (i) { n = Cesium.Color.RED } else this.M.polylineColor instanceof Cesium.Color && (n = this.M.polylineColor); t.material = n, t.clampToGround = this.M.clampToGround, this.l.name = "鏂板缓鎶樼嚎", this.l = null } }, i.prototype.B = function () { if (this.target) { var i = this.target.polyline.material.getValue(Cesium.JulianDate.now()), t = i && i.color ? i.color : Cesium.Color.WHITE; this.W = Cesium.Color.clone(t) } }, i.prototype.F = function () { if (this.target) { var i = this.target.polyline.positions.getValue(Cesium.JulianDate.now()); this.C = i ? i.slice() : [] } }, i.prototype.D = function () { this.l && this.isCreateMode && (this.I.entities.remove(this.l), this.l = null) }, i.prototype.J = function () { var i = this; this.isCreateMode && !this.l && (this.l = this.I.entities.add({ polyline: new Cesium.PolylineGraphics({ positions: new Cesium.CallbackProperty(function () { return i.C.slice() }, !1), width: this.M.polylineWidth, material: l, clampToGround: this.M.clampToGround }) })) }, i.prototype.H = function () { var i = this; if (this.isCreateMode && this.l) { var t = this.l.polyline; t.positions = new Cesium.CallbackProperty(function () { return i.C.slice() }, !1), t.width = this.M.polylineWidth, t.material = l, t.clampToGround = this.M.clampToGround } else !this.isCreateMode && this.target && (this.target.polyline.positions = new Cesium.CallbackProperty(function () { return i.C.slice() }, !1), this.target.polyline.material = l, this.target.polyline.clampToGround = this.M.clampToGround) }, i.prototype.S = function () { this.O(), this.A(), this._() }, i.prototype.O = function () { var i = this; this.h.forEach(function (t) { return i.I.entities.remove(t) }), this.h = [], this.u.forEach(function (t) { return i.I.entities.remove(t) }), this.u = [] }, i.prototype.A = function () { for (var i = 0; this.C.length > i; i++) { var t = this.I.entities.add({ position: this.C[i], point: { color: c, pixelSize: 14, heightReference: this.M.clampToGround ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE, disableDepthTestDistance: 1 / 0 } }); t.q = { kind: "vertex", index: i }, this.h.push(t) } }, i.prototype._ = function () { for (var i = 0; this.C.length - 1 > i; i++) { var t = Cesium.Cartesian3.midpoint(this.C[i], this.C[i + 1], new Cesium.Cartesian3), n = this.I.entities.add({ position: t, point: { color: h, pixelSize: 10, heightReference: this.M.clampToGround ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE, disableDepthTestDistance: 1 / 0, outlineColor: Cesium.Color.WHITE, outlineWidth: 2 } }); n.q = { kind: "midpoint", index: i }, this.u.push(n) } }, i.prototype.Y = function () { var i = this, t = this.I.scene, n = function (n) { var s = n.position || n.endPosition, l = t.pickPosition(s); if (l && Cesium.Cartesian3.magnitude(l) > 0) return l; var c = i.I.camera.getPickRay(s); if (!c) return null; var h = t.globe.pick(c, t); if (h) { var u = Cesium.Cartographic.fromCartesian(h); return u.height = i.M.defaultHeight, Cesium.Cartesian3.fromRadians(u.longitude, u.latitude, u.height) } return null }; this.t.setInputAction(function (s) { var l = t.pick(s.position), c = l && l.id ? l.id.q : void 0; c ? i.$(c, s, n) : i.ii(l, s) ? i.ti(s, n) : i.target || 0 !== i.C.length || i.ni(s, n) }, Cesium.ScreenSpaceEventType.LEFT_DOWN), this.t.setInputAction(function (t) { (null != i.o || i.p) && (i.p ? i.si(t) : i.li(t)) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.t.setInputAction(function () { i.N() }, Cesium.ScreenSpaceEventType.LEFT_UP), this.t.setInputAction(function () { i.N() }, Cesium.ScreenSpaceEventType.MOUSE_OUT) }, i.prototype.$ = function (i, t, n) { "vertex" === i.kind ? this.ci(i.index, t) : "midpoint" === i.kind && this.hi(i.index, t, n) }, i.prototype.ni = function (i, t) { var n = t(i); if (n) { var s = Cesium.Cartographic.fromCartesian(n); this.M.minHeight > s.height && (s.height = this.M.defaultHeight, n = Cesium.Cartesian3.fromRadians(s.longitude, s.latitude, s.height)), this.ui(n), this.H(), this.S() } }, i.prototype.ui = function (i) { var t = Cesium.Cartographic.fromCartesian(i), n = this.M.createLineLength / 2, s = this.di(t, -n), l = this.di(t, n); this.C = [s, i, l] }, i.prototype.di = function (i, t) { return Cesium.Cartesian3.fromRadians(i.longitude + t / 111320 * Math.cos(i.latitude), i.latitude, i.height) }, i.prototype.ci = function (i, t) { this.o = i, this.m = this.C[i].clone(), this.Z = t.position, this.ai() }, i.prototype.hi = function (i, t, n) { var s = Cesium.Cartesian3.midpoint(this.C[i], this.C[i + 1], new Cesium.Cartesian3), l = i + 1; this.C.splice(l, 0, s), this.H(), this.S(), this.ci(l, t), this.emit("addnode", { target: this.target, index: l, position: s }) }, i.prototype.ii = function (i, t) { return !(!i || !i.id) && (!(!this.l || i.id !== this.l) || !(!this.target || i.id !== this.target)) }, i.prototype.ti = function (i, t) { var n = t(i); n && (this.p = !0, this.X = this.C.slice(), this.m = n, this.Z = i.position, this.ai()) }, i.prototype.si = function (i) { var t = this; if (this.m && 0 !== this.X.length && this.Z) { var n = i.endPosition, s = this.I.camera.getPickRay(this.Z), l = this.I.camera.getPickRay(n); if (s && l) { var c = this.I.scene.globe.pick(s, this.I.scene), h = this.I.scene.globe.pick(l, this.I.scene); if (c && h) { var u = Cesium.Cartesian3.subtract(h, c, new Cesium.Cartesian3); this.C = this.X.map(function (i) { var n = Cesium.Cartesian3.add(i, u, new Cesium.Cartesian3); if (!t.M.clampToGround) { var s = Cesium.Cartographic.fromCartesian(i), l = Cesium.Cartographic.fromCartesian(n); return l.height = s.height, Cesium.Cartesian3.fromRadians(l.longitude, l.latitude, l.height) } return n }), this.H(), this.S() } } } }, i.prototype.li = function (i) { if (this.m && this.Z) { var t = i.endPosition, n = Cesium.Cartographic.fromCartesian(this.C[this.o]).height, s = this.I.camera.getPickRay(this.Z), l = this.I.camera.getPickRay(t); if (s && l) { var c, h; if (this.M.clampToGround) c = this.I.scene.globe.pick(s, this.I.scene), h = this.I.scene.globe.pick(l, this.I.scene); else { var u = this.I.scene.globe.pick(s, this.I.scene), d = this.I.scene.globe.pick(l, this.I.scene); if (!u || !d) return; var a = Cesium.Cartographic.fromCartesian(u), o = Cesium.Cartographic.fromCartesian(d); a.height = n, o.height = n, c = Cesium.Cartesian3.fromRadians(a.longitude, a.latitude, a.height), h = Cesium.Cartesian3.fromRadians(o.longitude, o.latitude, o.height) } if (c && h) { var e = Cesium.Cartesian3.subtract(h, c, new Cesium.Cartesian3), b = Cesium.Cartesian3.add(this.m, e, new Cesium.Cartesian3); if (!this.M.clampToGround) { var m = Cesium.Cartographic.fromCartesian(b); m.height = n, b = Cesium.Cartesian3.fromRadians(m.longitude, m.latitude, m.height) } this.C[this.o] = b, this.H(), this.S() } } } }, i.prototype.N = function () { this.o = null, this.m = null, this.Z = null, this.p = !1, this.X = [], this.v() }, i.prototype.j = function (i) { void 0 === i && (i = !1), this.t && (this.t.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN), this.t.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.t.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP), this.t.destroy(), this.t = null), this.O(), i || this.N() }, i.prototype.ai = function () { var i = this.I.scene.screenSpaceCameraController; if (i) { this.G || (this.G = { enableInputs: i.enableInputs, enableRotate: i.enableRotate, enableTranslate: i.enableTranslate, enableTilt: i.enableTilt, enableZoom: i.enableZoom, enableLook: i.enableLook, enableCollisionDetection: i.enableCollisionDetection }), Object.keys(this.G).forEach(function (t) { i[t] = !1 }); try { this.I.container.style.cursor = "grabbing" } catch (i) { } } }, i.prototype.v = function () { var i = this, t = this.I.scene.screenSpaceCameraController; if (t && this.G) { Object.keys(this.G).forEach(function (n) { t[n] = i.G[n] }), this.G = null; try { this.I.container.style.cursor = "default" } catch (i) { } } }, i }(), d = function (i, t) { return d = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (i, t) { i.__proto__ = t } || function (i, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (i[n] = t[n]) }, d(i, t) }; var a = function () { return a = Object.assign || function (i) { for (var t, n = 1, s = arguments.length; s > n; n++)for (var l in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, l) && (i[l] = t[l]); return i }, a.apply(this, arguments) }; function o(i, t, n, s) { return new (n || (n = Promise))(function (l, c) { function h(i) { try { d(s.next(i)) } catch (i) { c(i) } } function u(i) { try { d(s.throw(i)) } catch (i) { c(i) } } function d(i) { var t; i.done ? l(i.value) : (t = i.value, t instanceof n ? t : new n(function (i) { i(t) })).then(h, u) } d((s = s.apply(i, t || [])).next()) }) } function e(i, t) { var n, s, l, c = { label: 0, sent: function () { if (1 & l[0]) throw l[1]; return l[1] }, trys: [], ops: [] }, h = Object.create(("function" == typeof Iterator ? Iterator : Object).prototype); return h.next = u(0), h.throw = u(1), h.return = u(2), "function" == typeof Symbol && (h[Symbol.iterator] = function () { return this }), h; function u(u) { return function (d) { return function (u) { if (n) throw new TypeError("Generator is already executing."); for (; h && (h = 0, u[0] && (c = 0)), c;)try { if (n = 1, s && (l = 2 & u[0] ? s.return : u[0] ? s.throw || ((l = s.return) && l.call(s), 0) : s.next) && !(l = l.call(s, u[1])).done) return l; switch (s = 0, l && (u = [2 & u[0], l.value]), u[0]) { case 0: case 1: l = u; break; case 4: return c.label++, { value: u[1], done: !1 }; case 5: c.label++, s = u[1], u = [0]; continue; case 7: u = c.ops.pop(), c.trys.pop(); continue; default: if (!(l = c.trys, (l = l.length > 0 && l[l.length - 1]) || 6 !== u[0] && 2 !== u[0])) { c = 0; continue } if (3 === u[0] && (!l || u[1] > l[0] && l[3] > u[1])) { c.label = u[1]; break } if (6 === u[0] && l[1] > c.label) { c.label = l[1], l = u; break } if (l && l[2] > c.label) { c.label = l[2], c.ops.push(u); break } l[2] && c.ops.pop(), c.trys.pop(); continue }u = t.call(i, c) } catch (i) { u = [6, i], s = 0 } finally { n = l = 0 } if (5 & u[0]) throw u[1]; return { value: u[0] ? u[1] : void 0, done: !0 } }([u, d]) } } } "function" == typeof SuppressedError && SuppressedError; var b = function () { function i(i) { this.oi = new Map, this.ei = 0, this.bi = 30, this.mi = null, this.Zi = .8, this.pi = 2, this.Xi = 300, this.yi = 0, this.ri = i.ri, this.bi = i.ei || 30 } return i.prototype.Gi = function (i) { return { Wi: i, Vi: (new Date).getTime(), Ci: 0 } }, i.prototype.Ki = function (i, t) { var n = this.oi.get(i); return n ? (t || (n.Vi = (new Date).getTime(), n.Ci += 1), n.Wi) : null }, i.prototype.Ii = function (i, t) { this.oi.forEach(function (n, s) { i.call(t, n.Wi, s) }) }, i.prototype.Mi = function (i, t) { if (this.oi.has(i) ? this.oi.get(i).Wi = t : (this.ei += 1, this.oi.set(i, this.Gi(t))), this.ei > this.bi && this.fi(), this.ei > this.bi - 1) return !0 }, i.prototype.zi = function (i) { return this.oi.has(i) }, i.prototype.Li = function (i) { if (!this.zi(i)) return null; this.ei -= 1; var t = this.oi.get(i); return this.oi.delete(i), t.Wi }, i.prototype.Ri = function () { this.Ti(), this.oi.clear(), this.ei = 0 }, i.prototype.gi = function () { var i = this; this.Ii(function (t, n) { i.ri ? i.ri(n, t) && i.Li(n) : i.Li(n) }, this) }, i.prototype.Ti = function () { this.mi && clearTimeout(this.mi) }, i.prototype.fi = function () { if (this.ei > this.bi * this.pi) this.Ti(), this.Ji(); else { if (10 > (new Date).getTime() - this.yi) return; this.Ti(); var i = this; this.mi = setTimeout(function () { i.mi = null, i.Ji() }, this.Xi), this.yi = (new Date).getTime() } }, i.prototype.Ji = function () { var i = Math.round(this.bi * this.Zi); if (this.ei >= i) for (var t, n = this.Hi(this.ei - i), s = 0, l = n.length; l > s; s += 1) { if (t = n[s], this.ri) this.ri(t, this.oi.get(t).Wi) && this.Li(t); else this.Li(t) } }, i.prototype.xi = function (i, t) { var n = this.oi.get(i), s = this.oi.get(t), l = n.Vi - s.Vi; return 0 !== l ? l : n.Ci - s.Ci }, i.prototype.Hi = function (i) { var t = function (i) { for (var t = [], n = i.next(); !n.done;)t.push(n.value), n = i.next(); return t }(this.oi.keys()); return this.Si(t, i, this.xi) }, i.prototype.Si = function (i, t, n) { if (0 >= t) return []; for (var s, l, c, h = 0, u = i.length - 1; u > h;) { for (s = h, l = u, c = i[t]; t >= s && l >= t;) { for (; t >= s && 0 > n.call(this, i[s], c);)s += 1; for (; l >= t && n.call(this, i[l], c) > 0;)l -= 1; var d = i[s]; i[s] = i[l], i[l] = d, s += 1, l -= 1 } t > l && (h = s), s > t && (u = l) } return i.slice(0, t) }, i }(), m = null; try { var Z = "undefined" != typeof module && "function" == typeof module.require && module.require("worker_threads") || "function" == typeof __non_webpack_require__ && __non_webpack_require__("worker_threads") || "function" == typeof require && require("worker_threads"); m = Z.Worker } catch (i) { } function p(i, t, n) { var s = void 0 === t ? null : t, l = function (i, t) { return Buffer.from(i, "base64").toString(t ? "utf16" : "utf8") }(i, void 0 !== n && n), c = l.indexOf("\n", 10) + 1, h = l.substring(c) + (s ? "//# sourceMappingURL=" + s : ""); return function (i) { return new m(h, Object.assign({}, i, { eval: !0 })) } } function X(i, t, n) { var s = void 0 === t ? null : t, l = function (i, t) { var n = atob(i); if (t) { for (var s = new Uint8Array(n.length), l = 0, c = n.length; c > l; ++l)s[l] = n.charCodeAt(l); return new TextDecoder("utf-16le").decode(new Uint16Array(s.buffer)) } return n }(i, void 0 !== n && n), c = l.indexOf("\n", 10) + 1, h = l.substring(c) + (s ? "//# sourceMappingURL=" + s : ""), u = new Blob([h], { type: "application/javascript" }); return URL.createObjectURL(u) } var y = "[object process]" === Object.prototype.toString.call("undefined" != typeof process ? process : 0); function r(i, t, n) { return y ? p(i, t, n) : function (i, t, n) { var s; return function (l) { return s = s || X(i, t, n), new Worker(s, l) } }(i, t, n) } var G = r("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7bGV0IHQ9IkFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5Ky8iLnNwbGl0KCIiKSxpPVtdO2ZvcihsZXQgcj0wO3QubGVuZ3RoPnI7cisrKWlbdFtyXS5jaGFyQ29kZUF0KDApXT1yO2lbNDVdPXQuaW5kZXhPZigiKyIpLGlbOTVdPXQuaW5kZXhPZigiLyIpO2NvbnN0IHI9dD0+U3RyaW5nLmZyb21DaGFyQ29kZS5hcHBseShTdHJpbmcsdCk7ZnVuY3Rpb24gZSgpe2xldCB0PTAsaT0wO2ZvcihsZXQgcj0wOzI4PnI7cis9N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X1zZWxmLm9ubWVzc2FnZT1mdW5jdGlvbih0KXt0cnl7Y29uc3QgaT1mdW5jdGlvbih0KXtjb25zdHt4OmkseTpyLGxldmVsOmUsZGF0YVR5cGU6bn09dCxzPW5ldyBFKG5ldyBVaW50OEFycmF5KHQuZGF0YSkpO2lmKDA9PT1PYmplY3Qua2V5cyhzLmxheWVycykubGVuZ3RoKXJldHVybiBjb25zb2xlLndhcm4oYFtXb3JrZXJdIFRpbGUgJHtpfV8ke3J9XyR7ZX06IE5vIGxheWVycyBmb3VuZCBpbiB0aWxlYCkse2RlZmF1bHQ6W119O2NvbnN0IG89e307Zm9yKGNvbnN0IHQgaW4gcy5sYXllcnMpe2NvbnN0IGg9cy5sYXllcnNbdF07b1t0XT1bXTtmb3IobGV0IHM9MDtoLmxlbmd0aD5zO3MrKyl7Y29uc3QgdT1oLmZlYXR1cmUocyksYT11LnRvR2VvSlNPTihpLHIsZSksbD1UKHsuLi51LnByb3BlcnRpZXMsb3JpZ2luUG9pbnQ6YS5nZW9tZXRyeS5jb29yZGluYXRlcyxkYXRhVHlwZTpufSk7b1t0XT1vW3RdLmNvbmNhdChsKX19cmV0dXJuIG99KHQuZGF0YSk7c2VsZi5wb3N0TWVzc2FnZSh7c3VjY2VzczohMCxkYXRhOmksbWVzc2FnZUlkOnQuZGF0YS5tZXNzYWdlSWR9KX1jYXRjaChpKXtzZWxmLnBvc3RNZXNzYWdlKHtzdWNjZXNzOiExLGVycm9yOmkubWVzc2FnZSxtZXNzYWdlSWQ6dC5kYXRhLm1lc3NhZ2VJZH0pfX19KCk7Cgo=", null, !1), W = function () { function i(i, t) { void 0 === t && (t = 4), this.workers = [], this.idleWorkers = [], this.taskQueue = [], this.workerStates = new Map; var n = new Blob([i], { type: "application/javascript" }); this.Yi = URL.createObjectURL(n); for (var s = 0; t > s; s++) { var l = new G; l.onmessage = this.handleMessage.bind(this, l), l.onerror = this.handleError.bind(this, l), this.workers.push(l), this.idleWorkers.push(l), this.workerStates.set(l, !0) } } return i.prototype.postMessage = function (i) { var t = this; return new Promise(function (n, s) { if (t.idleWorkers.length > 0) { var l = t.idleWorkers.pop(); t.workerStates.set(l, !1), l.postMessage(a(a({}, i), { messageId: t.generateMessageId() })), l.Ni = { resolve: n, reject: s } } else t.taskQueue.push({ data: i, resolve: n, reject: s }) }) }, i.prototype.handleMessage = function (i, t) { var n = t.data, s = n.error, l = i.Ni; l && (n.success ? l.resolve(n.data) : l.reject(Error(s)), delete i.Ni), this.workerStates.set(i, !0), this.idleWorkers.push(i), this.processQueuedTasks() }, i.prototype.handleError = function (i, t) { console.log(t) }, i.prototype.processQueuedTasks = function () { for (; this.taskQueue.length > 0 && this.idleWorkers.length > 0;) { var i = this.taskQueue.shift(), t = this.idleWorkers.pop(); this.workerStates.set(t, !1), t.postMessage(a(a({}, i.data), { messageId: this.generateMessageId() })), t.Ni = { resolve: i.resolve, reject: i.reject } } }, i.prototype.generateMessageId = function () { return Date.now() + Math.random() }, i.prototype.destroy = function () { this.workers.forEach(function (i) { i.terminate() }), this.workers = [], this.idleWorkers = [], this.taskQueue = [], this.workerStates.clear() }, i }(), V = function (i) { function t(t) { var n = i.call(this, { url: t.url }) || this; return n.ki = new Map, n.Qi = !0, n.wi = null, null == t.cacheSize && (t.cacheSize = 1e3), n.M = t, n.M.dataZooms = t.dataZooms || [3, 18], n.M.zooms = t.zooms || [3, 18], n.I = t.viewer, n.Pi = t.url, n.ji = t.dataType, n.I.imageryLayers.addImageryProvider(n), n.I.scene.postRender.addEventListener(n.Di.bind(n)), n.Ui = new b({ ei: t.cacheSize, ri: function (i, t) { if (t) { var s = i.split("_"), l = n.ki.get(i); return l && (l.abort({ reason: "缂撳瓨琚垹闄�" }), n.ki.delete(i)), n.M.customPrimitive.destroyPrimitives({ x: +s[0], y: +s[1], level: +s[2] }, t), !0 } } }), n.Bi = new W("parseWorker", 4), n } return function (i, t) { if ("function" != typeof t && null !== t) throw new TypeError("Class extends value " + t + " is not a constructor or null"); function n() { this.constructor = i } d(i, t), i.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n) }(t, i), t.prototype.hide = function () { this.wi = !1, this.Qi = !1 }, t.prototype.show = function () { this.wi = !0, this.Qi = !0 }, t.prototype.destroy = function () { var i = this; this.I = void 0, this.Ui.Ii(function (t, n) { var s = n.split("_"); i.M.customPrimitive.destroyPrimitives({ x: +s[0], y: +s[1], level: +s[2] }, t) }, this), this.Ui.Ri() }, t.prototype.Di = function () { if (this.I) { var i = (this.Fi() || 10) - 2; if (this.M.zooms[0] > i || i > this.M.zooms[1]) return this.Qi = !1, void this.Oi(); if (this.Qi = null === this.wi || this.wi, 0 != this.I.scene.globe._surface._tilesToRender.length) { var t = this.Ei(i); if (this.Ui.bi = Math.max(this.M.cacheSize || 1e3, 2 * t.length), t) { this.Ai(t), this.Oi(); for (var n = [], s = [], l = 0; t.length > l; l++) { var c = t[l], h = c.x, u = c.y, d = c.level; s.push({ x: h, y: u, level: d }); var a = this._i(h, u, d); if (this.Ui.zi(this.qi(h, u, d))) { var o = this.Ui.Ki(this.qi(h, u, d), !1); n.push(o), this.Qi && this.M.customPrimitive.showPrimitives({ x: h, y: u, level: d }, o) } else this.Qi && this.$i(a, h, u, d) } this.M.customPrimitive.updatePrimitives(s, n) } } } }, t.prototype.requestImage = function (i, t, n, s) { }, t.prototype.Ei = function (i) { var t = this, n = 256, l = 20037508.34, c = this.I; if (c) { var h = this.it(c); if (!h) return null; for (var u = this.tt(i = Math.min(this.M.dataZooms[1], Math.max(this.M.dataZooms[0], i))), d = u.x, a = u.y, o = s.Cartographic.fromRadians(h.west, h.north), e = s.Cartographic.fromRadians(h.east, h.south), b = this.nt(o), m = this.nt(e), Z = 40075016.68 / (Math.pow(2, i) * n), p = Math.floor((b.x + l) / (n * Z)), X = Math.floor((m.x + l) / (n * Z)), y = Math.floor((l - b.y) / (n * Z)), r = Math.floor((l - m.y) / (n * Z)), G = { xMin: Math.min(p, X), xMax: Math.max(p, X), yMin: Math.min(y, r), yMax: Math.max(y, r), z: i }, W = [], V = {}, C = new Set, K = G.xMin; G.xMax >= K; K++)for (var I = G.yMin; G.yMax >= I; I++) { var M = 0, f = 0, z = K | 0, L = I | 0, v = d | 0, R = a | 0; v > z && v % 2 != 0 && (M = -1), R > L && R % 2 != 0 && (f = -1), z > v && v % 2 == 0 && (M = 1), L > R && R % 2 == 0 && (f = 1); var T = Math.max(Math.floor(Math.log(Math.max(Math.abs(z - v + M), Math.abs(L - R - f)) + 1) / Math.log(8)), 0), g = i - T, J = K >> T, H = I >> T, x = "".concat(J, "_").concat(H, "_").concat(g); C.has(x) || T > 3 || (C.add(x), W.push({ x: J, y: H, level: g }), V[g] ? V[g].push({ x: J, y: H, level: g }) : V[g] = [{ x: J, y: H, level: g }]) } var S = [], Y = new Set, N = new Set; W.forEach(function (i) { Y.add("".concat(i.x, "_").concat(i.y, "_").concat(i.level)), N.add(i.level) }); var k = []; return N.forEach(function (i) { return k.push(i) }), k.sort(function (i, t) { return t - i }).forEach(function (i) { V[i].forEach(function (i) { t.st(i.x, i.y, i.level, Y) || S.push(i) }) }), S } }, t.prototype.st = function (i, t, n, s) { var l = n - 1, c = t >> 1, h = "".concat(i >> 1, "_").concat(c, "_").concat(l); return !!s.has(h) }, t.prototype.it = function (i, t) { void 0 === t && (t = 5); for (var n = i.scene.canvas, l = n.clientWidth, c = n.clientHeight, h = [], u = 0, d = [{ x: 0, y: c }, { x: l, y: c }, { x: 0, y: 0 }, { x: l, y: 0 }]; d.length > u; u++) { var a = this.lt(i, d[u], t); if (a) { var o = i.scene.globe.ellipsoid.cartesianToCartographic(a); h.push(o) } } if (0 !== h.length) { var e = Math.min.apply(Math, h.map(function (i) { return s.Math.toDegrees(i.longitude) })), b = Math.max.apply(Math, h.map(function (i) { return s.Math.toDegrees(i.longitude) })), m = Math.min.apply(Math, h.map(function (i) { return s.Math.toDegrees(i.latitude) })), Z = Math.max.apply(Math, h.map(function (i) { return s.Math.toDegrees(i.latitude) })); return s.Rectangle.fromDegrees(e, m, b, Z) } }, t.prototype.lt = function (i, t, n) { void 0 === n && (n = 5); for (var l = t.y, c = i.scene.canvas.height, h = void 0, u = 0; n > u; u++) { var d = (l + c) / 2, a = new s.Cartesian2(t.x, d), o = i.camera.pickEllipsoid(a, i.scene.globe.ellipsoid); s.defined(o) ? (h = o, c = d) : l = d } return h }, t.prototype.nt = function (i) { return new s.WebMercatorTilingScheme({ ellipsoid: s.Ellipsoid.WGS84 }).projection.project(i) }, t.prototype.Ai = function (i) { var t = this; this.ki.forEach(function (n, s) { i.some(function (i) { return t.qi(i.x, i.y, i.level) === s }) || n.signal.aborted || (t.ki.delete(s), n.abort({ reason: "Tile no longer needed" })) }) }, t.prototype.Oi = function () { var i = this; this.Ui.Ii(function (t, n) { var s = n.split("_"); i.M.customPrimitive.hidePrimitives({ x: +s[0], y: +s[1], level: +s[2] }, t) }, this) }, t.prototype.$i = function (i, t, n, s) { return o(this, void 0, void 0, function () { var l, c, h, u, d, a, o, b = this; return e(this, function (e) { switch (e.label) { case 0: l = this.qi(t, n, s), this.Ui.Mi(l, []), c = new AbortController, h = c.signal, this.ki.set(l, c), e.label = 1; case 1: return e.trys.push([1, 4, , 5]), [4, fetch(i, { signal: h })]; case 2: return u = e.sent(), this.ki.delete(l), 200 !== u.status ? (console.log("璇锋眰閿欒: ", t, n, s, u.status), [2]) : [4, u.arrayBuffer()]; case 3: return d = e.sent(), this.Bi.postMessage({ dataType: this.ji, data: d, x: t, y: n, level: s }).then(function (i) { if (0 >= b.Ui.Ki(l, !0).length) { var c = b.M.customPrimitive.createPrimitives({ x: t, y: n, level: s }, i); b.Ui.Mi(l, c), b.Qi || b.M.customPrimitive.hidePrimitives({ x: t, y: n, level: s }, c) } }).catch(function (i) { console.error("Worker error:", i) }), [3, 5]; case 4: return a = e.sent(), (o = this.Ui.Ki(l, !0)) && 0 === o.length && this.Ui.Li(l), this.ki.delete(l), a.reason || console.warn("璇锋眰閿欒锛�", l, o.length, a), [3, 5]; case 5: return [2] } }) }) }, t.prototype._i = function (i, t, n) { return this.Pi.replace("{x}", "" + i).replace("{y}", "" + t).replace("{z}", "" + n) }, t.prototype.qi = function (i, t, n) { return "".concat(i, "_").concat(t, "_").concat(n) }, t.prototype.tt = function (i) { var t = this.I; if (!t) return { x: 0, y: 0 }; var n = Math.min(-50, s.Math.toDegrees(t.camera.pitch)), l = t.scene.canvas, c = new s.Cartesian2(l.clientWidth / 2, l.clientHeight / 2 + n / -90 * l.clientHeight / 2), h = t.scene.camera.pickEllipsoid(c, s.Ellipsoid.WGS84); if (!h) return console.warn("鏃犳硶鑾峰彇灞忓箷涓績鐐瑰搴旂殑鍦拌〃鍧愭爣"), { x: 0, y: 0 }; var u = s.Ellipsoid.WGS84.cartesianToCartographic(h), d = this.nt(u); return this.ct(d.x, d.y, i) }, t.prototype.ct = function (i, t, n) { var s = 20037508.34, l = 40075016.68 / (256 * Math.pow(2, n)); return { x: Math.floor((i + s) / (256 * l)), y: Math.floor((s - t) / (256 * l)) } }, t.prototype.Fi = function () { var i = this.I; if (i) { var t = -40467.74; return Math.round(t + 80955.31 / (1 + Math.pow(Math.ceil(i.camera.positionCartographic.height) / 91610.74, 7096758e-11))) } }, t }(s.UrlTemplateImageryProvider); i.GridVTLayer = V, i.PolylineEditor = u, Object.defineProperty(i, "i", { value: !0 }) });
|