leiting-bim 2.2.63 → 2.2.66
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/OpenSourceModelConvert/output/test/Errorlog/2026-10-21.log +250 -0
- package/leiting-bim.es.js +1 -1
- package/package.json +1 -1
- package/plugins/cesium-core/dist/cesium-core.mjs +21 -5
- package/plugins/cesium-core/dist/cesium-core.umd.js +1 -1
- package/plugins/cesium-core/dist/components/HtmlOverlayLabelPool.d.ts +16 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-manage/index.d.ts +1 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/index.d.ts +2 -2
- package/plugins/cesium-vue/dist/components/marker-manage.js +8 -7
- package/plugins/cesium-vue/dist/{index-qGfk85JD.js → index-DlOVVw3V.js} +516 -411
- package/plugins/cesium-vue/dist/index.js +20 -19
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { p as ht, c as Me, w as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { MaterialManager as
|
|
1
|
+
import { p as ht, c as Me, w as le } from "./create-DynflqE1.js";
|
|
2
|
+
import { defineComponent as se, computed as m, openBlock as E, createElementBlock as H, normalizeStyle as $, normalizeClass as T, unref as M, toDisplayString as dt, createCommentVNode as te, createElementVNode as we, h as O, markRaw as P, render as X, inject as mt, onMounted as Te, watch as z, onUnmounted as yt, renderSlot as pt, ref as G, nextTick as bt, onBeforeUnmount as vt, createBlock as xt, resolveDynamicComponent as Ct } from "vue";
|
|
3
|
+
import { MaterialManager as Se, MarkerEventBus as K, HtmlOverlayLabelPool as Q, BufferedHierarchicalAggregator as Mt, EntityLayerManager as wt, getPolylineFlowMaterialProperty as Tt, getDynamicImgMaterial as St, getWallMaterial as Le, MarkerEventKey as ee } from "leiting-bim/plugins-methods";
|
|
4
4
|
import { CxCardCarousel as ye } from "./components/card-carousel.js";
|
|
5
|
-
import { CxMarkerBubbleLine as
|
|
6
|
-
import { CxMarkerDefault as
|
|
7
|
-
import { CxMarkerHtml as
|
|
5
|
+
import { CxMarkerBubbleLine as Oe, CxMarkerBubble as Pe } from "./components/marker-bubble.js";
|
|
6
|
+
import { CxMarkerDefault as re } from "./components/marker-default.js";
|
|
7
|
+
import { CxMarkerHtml as Lt } from "./components/marker-html.js";
|
|
8
8
|
import { CxMarkerText as Ee } from "./components/marker-text.js";
|
|
9
|
-
import { i as
|
|
9
|
+
import { i as ce, b as Ie, a as S, S as V, d as pe, c as ue, e as _e, f as Ot, g as Ae, M as Ne, h as ae, j as Pt, k as Et, l as It, m as ke, n as He, o as _t, p as At, q as Nt, r as kt, s as Ht, t as Fe, u as Ft, v as Dt, w as Rt, x as Wt } from "./index-DcRdyqU6.js";
|
|
10
10
|
const Bt = {
|
|
11
11
|
text: { type: String, default: "" },
|
|
12
12
|
svg: { type: Object, default: () => ({}) },
|
|
13
13
|
textStyle: { type: Object, default: () => ({}) },
|
|
14
14
|
textPosition: { type: String, default: "top" },
|
|
15
15
|
textGap: { type: Number, default: 8 }
|
|
16
|
-
}, Gt = /* @__PURE__ */
|
|
16
|
+
}, Gt = /* @__PURE__ */ se({
|
|
17
17
|
name: `${ht}-marker-svg`,
|
|
18
18
|
__name: "MarkerSvg",
|
|
19
19
|
props: Bt,
|
|
20
20
|
setup(t) {
|
|
21
|
-
const e = t, r = Me("marker"), a = (u,
|
|
22
|
-
const
|
|
23
|
-
return Number.isFinite(
|
|
24
|
-
}, n = m(() => a(e.svg.height, 48, 16, 160)),
|
|
21
|
+
const e = t, r = Me("marker"), a = (u, h, b, p) => {
|
|
22
|
+
const w = Number(u);
|
|
23
|
+
return Number.isFinite(w) ? Math.min(p, Math.max(b, w)) : h;
|
|
24
|
+
}, n = m(() => a(e.svg.height, 48, 16, 160)), i = m(() => a(e.svg.width, n.value, 1, 320)), o = m(() => a(e.textGap, 8, 0, 80)), l = m(
|
|
25
25
|
() => ["top", "bottom", "left", "right"].includes(e.textPosition) ? e.textPosition : "top"
|
|
26
26
|
), c = m(() => ({
|
|
27
|
-
width: `${
|
|
27
|
+
width: `${i.value}px`,
|
|
28
28
|
height: `${n.value}px`
|
|
29
29
|
})), f = m(() => ({
|
|
30
|
-
width: `${
|
|
30
|
+
width: `${i.value}px`,
|
|
31
31
|
height: `${n.value}px`,
|
|
32
32
|
backgroundColor: e.svg.fill || "#1890ff",
|
|
33
33
|
opacity: a(e.svg.opacity, 1, 0, 1),
|
|
34
34
|
WebkitMaskImage: e.svg.src ? `url("${e.svg.src}")` : "none",
|
|
35
35
|
maskImage: e.svg.src ? `url("${e.svg.src}")` : "none"
|
|
36
|
-
})),
|
|
36
|
+
})), s = m(() => ({
|
|
37
37
|
position: "absolute",
|
|
38
38
|
width: "max-content",
|
|
39
39
|
maxWidth: "none",
|
|
@@ -44,30 +44,30 @@ const Bt = {
|
|
|
44
44
|
textAlign: "center",
|
|
45
45
|
fontFamily: 'Arial, "Microsoft YaHei", sans-serif',
|
|
46
46
|
...{
|
|
47
|
-
top: { left: "50%", bottom: `calc(100% + ${
|
|
48
|
-
bottom: { left: "50%", top: `calc(100% + ${
|
|
49
|
-
left: { right: `calc(100% + ${
|
|
50
|
-
right: { left: `calc(100% + ${
|
|
51
|
-
}[
|
|
47
|
+
top: { left: "50%", bottom: `calc(100% + ${o.value}px)`, transform: "translateX(-50%)" },
|
|
48
|
+
bottom: { left: "50%", top: `calc(100% + ${o.value}px)`, transform: "translateX(-50%)" },
|
|
49
|
+
left: { right: `calc(100% + ${o.value}px)`, top: "50%", transform: "translateY(-50%)" },
|
|
50
|
+
right: { left: `calc(100% + ${o.value}px)`, top: "50%", transform: "translateY(-50%)" }
|
|
51
|
+
}[l.value],
|
|
52
52
|
...e.textStyle
|
|
53
53
|
}));
|
|
54
|
-
return (u,
|
|
55
|
-
class:
|
|
54
|
+
return (u, h) => (E(), H("div", {
|
|
55
|
+
class: T(M(r).b("svg")),
|
|
56
56
|
style: $(c.value)
|
|
57
57
|
}, [
|
|
58
58
|
u.text && u.textStyle.display !== "none" ? (E(), H("span", {
|
|
59
59
|
key: 0,
|
|
60
|
-
class:
|
|
61
|
-
style: $(
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
class:
|
|
60
|
+
class: T(M(r).be("svg", "text")),
|
|
61
|
+
style: $(s.value)
|
|
62
|
+
}, dt(u.text), 7)) : te("", !0),
|
|
63
|
+
we("span", {
|
|
64
|
+
class: T(M(r).be("svg", "image")),
|
|
65
65
|
style: $(f.value),
|
|
66
66
|
"aria-hidden": "true"
|
|
67
67
|
}, null, 6)
|
|
68
68
|
], 6));
|
|
69
69
|
}
|
|
70
|
-
}),
|
|
70
|
+
}), De = le(Gt), $t = {
|
|
71
71
|
id: { type: String, default: "marker" },
|
|
72
72
|
Cesium: { type: Object },
|
|
73
73
|
viewer: { type: Object },
|
|
@@ -78,22 +78,22 @@ const Bt = {
|
|
|
78
78
|
themeConfig: { type: Object }
|
|
79
79
|
// Optional override
|
|
80
80
|
};
|
|
81
|
-
var
|
|
82
|
-
function
|
|
83
|
-
return typeof t == "symbol" ||
|
|
81
|
+
var Y = /* @__PURE__ */ ((t) => (t.左建选中模型 = "MODEL_LEFT_CLICK", t.标记左键点击 = "TAG_LEFT_CLICK", t.标记移入 = "TAG_MOUSEENTER", t.标记移出 = "TAG_MOUSELEAVE", t.模型位置保存 = "SAVE_REGION", t.模型加载完成 = "MODEL_READY", t))(Y || {}), Xt = "[object Symbol]";
|
|
82
|
+
function fe(t) {
|
|
83
|
+
return typeof t == "symbol" || ce(t) && Ie(t) == Xt;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Re(t, e) {
|
|
86
86
|
for (var r = -1, a = t == null ? 0 : t.length, n = Array(a); ++r < a; )
|
|
87
87
|
n[r] = e(t[r], r, t);
|
|
88
88
|
return n;
|
|
89
89
|
}
|
|
90
|
-
var be =
|
|
91
|
-
function
|
|
90
|
+
var be = V ? V.prototype : void 0, ve = be ? be.toString : void 0;
|
|
91
|
+
function We(t) {
|
|
92
92
|
if (typeof t == "string")
|
|
93
93
|
return t;
|
|
94
|
-
if (
|
|
95
|
-
return
|
|
96
|
-
if (
|
|
94
|
+
if (S(t))
|
|
95
|
+
return Re(t, We) + "";
|
|
96
|
+
if (fe(t))
|
|
97
97
|
return ve ? ve.call(t) : "";
|
|
98
98
|
var e = t + "";
|
|
99
99
|
return e == "0" && 1 / t == -1 / 0 ? "-0" : e;
|
|
@@ -101,7 +101,7 @@ function Re(t) {
|
|
|
101
101
|
function Be(t) {
|
|
102
102
|
return t;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Kt(t, e, r) {
|
|
105
105
|
switch (r.length) {
|
|
106
106
|
case 0:
|
|
107
107
|
return t.call(e);
|
|
@@ -115,7 +115,7 @@ function Xt(t, e, r) {
|
|
|
115
115
|
return t.apply(e, r);
|
|
116
116
|
}
|
|
117
117
|
var Yt = 800, zt = 16, Vt = Date.now;
|
|
118
|
-
function
|
|
118
|
+
function qt(t) {
|
|
119
119
|
var e = 0, r = 0;
|
|
120
120
|
return function() {
|
|
121
121
|
var a = Vt(), n = zt - (a - r);
|
|
@@ -127,7 +127,7 @@ function Ut(t) {
|
|
|
127
127
|
return t.apply(void 0, arguments);
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Ut(t) {
|
|
131
131
|
return function() {
|
|
132
132
|
return t;
|
|
133
133
|
};
|
|
@@ -136,100 +136,100 @@ var jt = pe ? function(t, e) {
|
|
|
136
136
|
return pe(t, "toString", {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !1,
|
|
139
|
-
value:
|
|
139
|
+
value: Ut(e),
|
|
140
140
|
writable: !0
|
|
141
141
|
});
|
|
142
|
-
} : Be, Ge =
|
|
142
|
+
} : Be, Ge = qt(jt), xe = Math.max;
|
|
143
143
|
function $e(t, e, r) {
|
|
144
144
|
return e = xe(e === void 0 ? t.length - 1 : e, 0), function() {
|
|
145
|
-
for (var a = arguments, n = -1,
|
|
146
|
-
|
|
145
|
+
for (var a = arguments, n = -1, i = xe(a.length - e, 0), o = Array(i); ++n < i; )
|
|
146
|
+
o[n] = a[e + n];
|
|
147
147
|
n = -1;
|
|
148
|
-
for (var
|
|
149
|
-
|
|
150
|
-
return
|
|
148
|
+
for (var l = Array(e + 1); ++n < e; )
|
|
149
|
+
l[n] = a[n];
|
|
150
|
+
return l[e] = r(o), Kt(t, this, l);
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
function Zt(t, e) {
|
|
154
154
|
return Ge($e(t, e, Be), t + "");
|
|
155
155
|
}
|
|
156
156
|
function Jt(t, e, r) {
|
|
157
|
-
if (!
|
|
157
|
+
if (!ue(r))
|
|
158
158
|
return !1;
|
|
159
159
|
var a = typeof e;
|
|
160
|
-
return (a == "number" ? _e(r) &&
|
|
160
|
+
return (a == "number" ? _e(r) && Ot(e, r.length) : a == "string" && e in r) ? Ae(r[e], t) : !1;
|
|
161
161
|
}
|
|
162
162
|
function Qt(t) {
|
|
163
163
|
return Zt(function(e, r) {
|
|
164
|
-
var a = -1, n = r.length,
|
|
165
|
-
for (
|
|
166
|
-
var
|
|
167
|
-
|
|
164
|
+
var a = -1, n = r.length, i = n > 1 ? r[n - 1] : void 0, o = n > 2 ? r[2] : void 0;
|
|
165
|
+
for (i = t.length > 3 && typeof i == "function" ? (n--, i) : void 0, o && Jt(r[0], r[1], o) && (i = n < 3 ? void 0 : i, n = 1), e = Object(e); ++a < n; ) {
|
|
166
|
+
var l = r[a];
|
|
167
|
+
l && t(e, l, a, i);
|
|
168
168
|
}
|
|
169
169
|
return e;
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
var er = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, tr = /^\w*$/;
|
|
173
173
|
function rr(t, e) {
|
|
174
|
-
if (
|
|
174
|
+
if (S(t))
|
|
175
175
|
return !1;
|
|
176
176
|
var r = typeof t;
|
|
177
|
-
return r == "number" || r == "symbol" || r == "boolean" || t == null ||
|
|
177
|
+
return r == "number" || r == "symbol" || r == "boolean" || t == null || fe(t) ? !0 : tr.test(t) || !er.test(t) || e != null && t in Object(e);
|
|
178
178
|
}
|
|
179
179
|
var ar = "Expected a function";
|
|
180
|
-
function
|
|
180
|
+
function ge(t, e) {
|
|
181
181
|
if (typeof t != "function" || e != null && typeof e != "function")
|
|
182
182
|
throw new TypeError(ar);
|
|
183
183
|
var r = function() {
|
|
184
|
-
var a = arguments, n = e ? e.apply(this, a) : a[0],
|
|
185
|
-
if (
|
|
186
|
-
return
|
|
187
|
-
var
|
|
188
|
-
return r.cache =
|
|
184
|
+
var a = arguments, n = e ? e.apply(this, a) : a[0], i = r.cache;
|
|
185
|
+
if (i.has(n))
|
|
186
|
+
return i.get(n);
|
|
187
|
+
var o = t.apply(this, a);
|
|
188
|
+
return r.cache = i.set(n, o) || i, o;
|
|
189
189
|
};
|
|
190
|
-
return r.cache = new (
|
|
190
|
+
return r.cache = new (ge.Cache || Ne)(), r;
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
ge.Cache = Ne;
|
|
193
193
|
var nr = 500;
|
|
194
194
|
function ir(t) {
|
|
195
|
-
var e =
|
|
195
|
+
var e = ge(t, function(a) {
|
|
196
196
|
return r.size === nr && r.clear(), a;
|
|
197
197
|
}), r = e.cache;
|
|
198
198
|
return e;
|
|
199
199
|
}
|
|
200
200
|
var or = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, lr = /\\(\\)?/g, sr = ir(function(t) {
|
|
201
201
|
var e = [];
|
|
202
|
-
return t.charCodeAt(0) === 46 && e.push(""), t.replace(or, function(r, a, n,
|
|
203
|
-
e.push(n ?
|
|
202
|
+
return t.charCodeAt(0) === 46 && e.push(""), t.replace(or, function(r, a, n, i) {
|
|
203
|
+
e.push(n ? i.replace(lr, "$1") : a || r);
|
|
204
204
|
}), e;
|
|
205
205
|
});
|
|
206
206
|
function cr(t) {
|
|
207
|
-
return t == null ? "" :
|
|
207
|
+
return t == null ? "" : We(t);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
return
|
|
209
|
+
function he(t, e) {
|
|
210
|
+
return S(t) ? t : rr(t, e) ? [t] : sr(cr(t));
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
if (typeof t == "string" ||
|
|
212
|
+
function ne(t) {
|
|
213
|
+
if (typeof t == "string" || fe(t))
|
|
214
214
|
return t;
|
|
215
215
|
var e = t + "";
|
|
216
216
|
return e == "0" && 1 / t == -1 / 0 ? "-0" : e;
|
|
217
217
|
}
|
|
218
218
|
function ur(t, e) {
|
|
219
|
-
e =
|
|
219
|
+
e = he(e, t);
|
|
220
220
|
for (var r = 0, a = e.length; t != null && r < a; )
|
|
221
|
-
t = t[
|
|
221
|
+
t = t[ne(e[r++])];
|
|
222
222
|
return r && r == a ? t : void 0;
|
|
223
223
|
}
|
|
224
|
-
var Ce =
|
|
224
|
+
var Ce = V ? V.isConcatSpreadable : void 0;
|
|
225
225
|
function fr(t) {
|
|
226
|
-
return
|
|
226
|
+
return S(t) || ae(t) || !!(Ce && t && t[Ce]);
|
|
227
227
|
}
|
|
228
228
|
function gr(t, e, r, a, n) {
|
|
229
|
-
var
|
|
230
|
-
for (r || (r = fr), n || (n = []); ++
|
|
231
|
-
var
|
|
232
|
-
r(
|
|
229
|
+
var i = -1, o = t.length;
|
|
230
|
+
for (r || (r = fr), n || (n = []); ++i < o; ) {
|
|
231
|
+
var l = t[i];
|
|
232
|
+
r(l) ? Pt(n, l) : n[n.length] = l;
|
|
233
233
|
}
|
|
234
234
|
return n;
|
|
235
235
|
}
|
|
@@ -237,150 +237,253 @@ function hr(t) {
|
|
|
237
237
|
var e = t == null ? 0 : t.length;
|
|
238
238
|
return e ? gr(t) : [];
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function dr(t) {
|
|
241
241
|
return Ge($e(t, void 0, hr), t + "");
|
|
242
242
|
}
|
|
243
|
-
var
|
|
244
|
-
function
|
|
245
|
-
if (!
|
|
243
|
+
var mr = "[object Object]", yr = Function.prototype, pr = Object.prototype, Xe = yr.toString, br = pr.hasOwnProperty, vr = Xe.call(Object);
|
|
244
|
+
function Ke(t) {
|
|
245
|
+
if (!ce(t) || Ie(t) != mr)
|
|
246
246
|
return !1;
|
|
247
247
|
var e = Et(t);
|
|
248
248
|
if (e === null)
|
|
249
249
|
return !0;
|
|
250
250
|
var r = br.call(e, "constructor") && e.constructor;
|
|
251
|
-
return typeof r == "function" && r instanceof r &&
|
|
251
|
+
return typeof r == "function" && r instanceof r && Xe.call(r) == vr;
|
|
252
252
|
}
|
|
253
253
|
function xr(t, e, r) {
|
|
254
254
|
var a = -1, n = t.length;
|
|
255
255
|
e < 0 && (e = -e > n ? 0 : n + e), r = r > n ? n : r, r < 0 && (r += n), n = e > r ? 0 : r - e >>> 0, e >>>= 0;
|
|
256
|
-
for (var
|
|
257
|
-
|
|
258
|
-
return
|
|
256
|
+
for (var i = Array(n); ++a < n; )
|
|
257
|
+
i[a] = t[a + e];
|
|
258
|
+
return i;
|
|
259
259
|
}
|
|
260
260
|
function Cr(t) {
|
|
261
261
|
return function(e, r, a) {
|
|
262
|
-
for (var n = -1,
|
|
263
|
-
var c =
|
|
264
|
-
if (r(
|
|
262
|
+
for (var n = -1, i = Object(e), o = a(e), l = o.length; l--; ) {
|
|
263
|
+
var c = o[++n];
|
|
264
|
+
if (r(i[c], c, i) === !1)
|
|
265
265
|
break;
|
|
266
266
|
}
|
|
267
267
|
return e;
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
270
|
var Mr = Cr();
|
|
271
|
-
function
|
|
271
|
+
function ie(t, e, r) {
|
|
272
272
|
(r !== void 0 && !Ae(t[e], r) || r === void 0 && !(e in t)) && It(t, e, r);
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
return
|
|
274
|
+
function wr(t) {
|
|
275
|
+
return ce(t) && _e(t);
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function oe(t, e) {
|
|
278
278
|
if (!(e === "constructor" && typeof t[e] == "function") && e != "__proto__")
|
|
279
279
|
return t[e];
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Tr(t) {
|
|
282
282
|
return ke(t, He(t));
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
var
|
|
284
|
+
function Sr(t, e, r, a, n, i, o) {
|
|
285
|
+
var l = oe(t, r), c = oe(e, r), f = o.get(c);
|
|
286
286
|
if (f) {
|
|
287
|
-
|
|
287
|
+
ie(t, r, f);
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
|
-
var
|
|
290
|
+
var s = i ? i(l, c, r + "", t, e, o) : void 0, u = s === void 0;
|
|
291
291
|
if (u) {
|
|
292
|
-
var
|
|
293
|
-
|
|
292
|
+
var h = S(c), b = !h && _t(c), p = !h && !b && At(c);
|
|
293
|
+
s = c, h || b || p ? S(l) ? s = l : wr(l) ? s = Nt(l) : b ? (u = !1, s = kt(c, !0)) : p ? (u = !1, s = Ht(c, !0)) : s = [] : Ke(c) || ae(c) ? (s = l, ae(l) ? s = Tr(l) : (!ue(l) || Fe(l)) && (s = Ft(c))) : u = !1;
|
|
294
294
|
}
|
|
295
|
-
u && (
|
|
295
|
+
u && (o.set(c, s), n(s, c, a, i, o), o.delete(c)), ie(t, r, s);
|
|
296
296
|
}
|
|
297
297
|
function Ye(t, e, r, a, n) {
|
|
298
|
-
t !== e && Mr(e, function(
|
|
299
|
-
if (n || (n = new
|
|
300
|
-
|
|
298
|
+
t !== e && Mr(e, function(i, o) {
|
|
299
|
+
if (n || (n = new Dt()), ue(i))
|
|
300
|
+
Sr(t, e, o, r, Ye, a, n);
|
|
301
301
|
else {
|
|
302
|
-
var
|
|
303
|
-
|
|
302
|
+
var l = a ? a(oe(t, o), i, o + "", t, e, n) : void 0;
|
|
303
|
+
l === void 0 && (l = i), ie(t, o, l);
|
|
304
304
|
}
|
|
305
305
|
}, He);
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function Lr(t) {
|
|
308
308
|
var e = t == null ? 0 : t.length;
|
|
309
309
|
return e ? t[e - 1] : void 0;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function Or(t, e) {
|
|
312
312
|
return e.length < 2 ? t : ur(t, xr(e, 0, -1));
|
|
313
313
|
}
|
|
314
|
-
var
|
|
314
|
+
var Pr = Qt(function(t, e, r) {
|
|
315
315
|
Ye(t, e, r);
|
|
316
316
|
}), Er = Object.prototype, Ir = Er.hasOwnProperty;
|
|
317
317
|
function _r(t, e) {
|
|
318
|
-
e =
|
|
318
|
+
e = he(e, t);
|
|
319
319
|
var r = -1, a = e.length;
|
|
320
320
|
if (!a)
|
|
321
321
|
return !0;
|
|
322
322
|
for (; ++r < a; ) {
|
|
323
|
-
var n =
|
|
323
|
+
var n = ne(e[r]);
|
|
324
324
|
if (n === "__proto__" && !Ir.call(t, "__proto__") || (n === "constructor" || n === "prototype") && r < a - 1)
|
|
325
325
|
return !1;
|
|
326
326
|
}
|
|
327
|
-
var
|
|
328
|
-
return
|
|
327
|
+
var i = Or(t, e);
|
|
328
|
+
return i == null || delete i[ne(Lr(e))];
|
|
329
329
|
}
|
|
330
330
|
function Ar(t) {
|
|
331
|
-
return
|
|
331
|
+
return Ke(t) ? void 0 : t;
|
|
332
332
|
}
|
|
333
|
-
var Nr = 1, kr = 2, Hr = 4,
|
|
333
|
+
var Nr = 1, kr = 2, Hr = 4, Fr = dr(function(t, e) {
|
|
334
334
|
var r = {};
|
|
335
335
|
if (t == null)
|
|
336
336
|
return r;
|
|
337
337
|
var a = !1;
|
|
338
|
-
e =
|
|
339
|
-
return
|
|
340
|
-
}), ke(t,
|
|
338
|
+
e = Re(e, function(i) {
|
|
339
|
+
return i = he(i, t), a || (a = i.length > 1), i;
|
|
340
|
+
}), ke(t, Rt(t), r), a && (r = Wt(r, Nr | kr | Hr, Ar));
|
|
341
341
|
for (var n = e.length; n--; )
|
|
342
342
|
_r(r, e[n]);
|
|
343
343
|
return r;
|
|
344
344
|
});
|
|
345
|
-
|
|
345
|
+
const Dr = "__cx_overlay__:";
|
|
346
|
+
class Rr {
|
|
347
|
+
constructor(e) {
|
|
348
|
+
this.pool = e;
|
|
349
|
+
}
|
|
350
|
+
renderers = /* @__PURE__ */ new Map();
|
|
351
|
+
records = /* @__PURE__ */ new Map();
|
|
352
|
+
mounted = /* @__PURE__ */ new Map();
|
|
353
|
+
themes = /* @__PURE__ */ new Set();
|
|
354
|
+
registerRenderer(e, r) {
|
|
355
|
+
const a = String(e || "").trim();
|
|
356
|
+
if (!a) throw new Error("Overlay renderer name is required");
|
|
357
|
+
this.renderers.set(a, r), this.ensureTheme(a);
|
|
358
|
+
}
|
|
359
|
+
add(e) {
|
|
360
|
+
const r = String(e.id || "").trim(), a = String(e.renderer || "").trim();
|
|
361
|
+
if (!r) throw new Error("Overlay id is required");
|
|
362
|
+
if (!a || !this.renderers.has(a)) throw new Error(`Overlay renderer "${a}" is not registered`);
|
|
363
|
+
const n = this.records.get(r), i = {
|
|
364
|
+
...n,
|
|
365
|
+
...e,
|
|
366
|
+
id: r,
|
|
367
|
+
renderer: a,
|
|
368
|
+
position: { ...n?.position, ...e.position },
|
|
369
|
+
visible: e.visible !== !1,
|
|
370
|
+
offset: {
|
|
371
|
+
x: this.number(e.offset?.x, n?.offset?.x ?? 0),
|
|
372
|
+
y: this.number(e.offset?.y, n?.offset?.y ?? 0)
|
|
373
|
+
},
|
|
374
|
+
anchor: e.anchor || n?.anchor || "top-left"
|
|
375
|
+
};
|
|
376
|
+
this.records.set(r, i), this.ensureTheme(a), this.pool.add(i.data, {
|
|
377
|
+
id: r,
|
|
378
|
+
lon: i.position.longitude,
|
|
379
|
+
lat: i.position.latitude,
|
|
380
|
+
height: i.position.height || 0,
|
|
381
|
+
theme: this.themeName(a),
|
|
382
|
+
show: i.visible,
|
|
383
|
+
offset: i.offset,
|
|
384
|
+
anchor: i.anchor,
|
|
385
|
+
style: { zIndex: String(i.zIndex ?? 1) }
|
|
386
|
+
}), i.visible || this.pool.hideByIds([r]);
|
|
387
|
+
}
|
|
388
|
+
update(e, r) {
|
|
389
|
+
const a = this.records.get(e);
|
|
390
|
+
a && this.add({ ...a, ...r, id: e, renderer: a.renderer, data: r.data ?? a.data });
|
|
391
|
+
}
|
|
392
|
+
remove(e) {
|
|
393
|
+
const r = Array.isArray(e) ? e : [e];
|
|
394
|
+
for (const a of r)
|
|
395
|
+
this.records.has(a) && (this.pool.removeByIds([a]), this.records.delete(a), this.mounted.delete(a));
|
|
396
|
+
}
|
|
397
|
+
clear() {
|
|
398
|
+
this.remove([...this.records.keys()]);
|
|
399
|
+
}
|
|
400
|
+
destroy() {
|
|
401
|
+
this.clear(), this.renderers.clear(), this.themes.clear();
|
|
402
|
+
}
|
|
403
|
+
ensureTheme(e) {
|
|
404
|
+
const r = this.themeName(e);
|
|
405
|
+
this.themes.has(r) || (this.themes.add(r), this.pool.registerTheme(r, {
|
|
406
|
+
createElement: (a, n) => {
|
|
407
|
+
const i = this.records.get(n.id);
|
|
408
|
+
if (!i) return;
|
|
409
|
+
const o = this.renderers.get(i.renderer);
|
|
410
|
+
if (!o) return;
|
|
411
|
+
const l = this.context(i);
|
|
412
|
+
if (this.mounted.get(i.id))
|
|
413
|
+
o.update?.(a, l);
|
|
414
|
+
else {
|
|
415
|
+
const f = o.mount?.(a, l);
|
|
416
|
+
this.mounted.set(i.id, { container: a, cleanup: typeof f == "function" ? f : void 0 });
|
|
417
|
+
}
|
|
418
|
+
return () => this.unmount(i.id);
|
|
419
|
+
}
|
|
420
|
+
}));
|
|
421
|
+
}
|
|
422
|
+
unmount(e) {
|
|
423
|
+
const r = this.records.get(e), a = this.mounted.get(e);
|
|
424
|
+
if (!r || !a) return;
|
|
425
|
+
const n = this.renderers.get(r.renderer);
|
|
426
|
+
a.cleanup?.(), n?.unmount?.(a.container, this.context(r)), this.mounted.delete(e);
|
|
427
|
+
}
|
|
428
|
+
context(e) {
|
|
429
|
+
return {
|
|
430
|
+
id: e.id,
|
|
431
|
+
data: e.data,
|
|
432
|
+
position: e.position,
|
|
433
|
+
visible: e.visible,
|
|
434
|
+
anchor: e.anchor,
|
|
435
|
+
offset: e.offset
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
themeName(e) {
|
|
439
|
+
return `${Dr}${e}`;
|
|
440
|
+
}
|
|
441
|
+
number(e, r) {
|
|
442
|
+
const a = Number(e);
|
|
443
|
+
return Number.isFinite(a) ? a : r;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
class Wr {
|
|
346
447
|
labelId;
|
|
347
448
|
cardId;
|
|
348
449
|
opt;
|
|
349
450
|
entityList = /* @__PURE__ */ new Map();
|
|
350
451
|
MaterialManager;
|
|
351
452
|
instance;
|
|
453
|
+
/** 不进入实体图层的通用地图内容容器。 */
|
|
454
|
+
overlays;
|
|
352
455
|
constructor(e) {
|
|
353
|
-
this.labelId = e.labelId, this.cardId = e.cardId, this.opt = e, this.MaterialManager = e.MaterialManager || new
|
|
456
|
+
this.labelId = e.labelId, this.cardId = e.cardId, this.opt = e, this.MaterialManager = e.MaterialManager || new Se(), this.instance = this.initCore(e, e.eventBus, e.cardEventBus), this.overlays = new Rr(this.instance.overlayPool);
|
|
354
457
|
}
|
|
355
458
|
//初始化标记管理
|
|
356
459
|
initCore(e, r, a) {
|
|
357
|
-
let { Cesium: n, viewer:
|
|
358
|
-
r || (r = new
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
const c = new
|
|
460
|
+
let { Cesium: n, viewer: i, aggregatorOptions: o } = e;
|
|
461
|
+
r || (r = new K()), a || (a = new K());
|
|
462
|
+
const l = new Q(n, i, this.labelId, r);
|
|
463
|
+
l.setOcclusionOptions({ distanceEpsilon: 1 }), l.setOcclusionEnabled(!1);
|
|
464
|
+
const c = new Q(n, i, this.cardId, a, !1), f = new Q(n, i, `${this.labelId}-overlay`, new K(), !1), s = new Mt(n, i, {
|
|
362
465
|
//聚合
|
|
363
|
-
threshold:
|
|
364
|
-
displayLimit:
|
|
365
|
-
maxLevel:
|
|
366
|
-
debugCurrentGrids:
|
|
367
|
-
groupByTheme:
|
|
466
|
+
threshold: o?.threshold || 16,
|
|
467
|
+
displayLimit: o?.displayLimit || 300,
|
|
468
|
+
maxLevel: o?.maxLevel || 20,
|
|
469
|
+
debugCurrentGrids: o?.debugCurrentGrids || !1,
|
|
470
|
+
groupByTheme: o?.groupByTheme ?? !0,
|
|
368
471
|
//clusterTheme: aggregatorOptions?.clusterTheme || 'Tag1007', // 这里可以改成你自定义的默认聚合点主题k
|
|
369
|
-
pointTheme:
|
|
472
|
+
pointTheme: o?.pointTheme || "Tag1001",
|
|
370
473
|
// 普通点的默认主题
|
|
371
|
-
centralPointMode:
|
|
474
|
+
centralPointMode: o?.centralPointMode || "firstPoint",
|
|
372
475
|
// 普通点的默认主题
|
|
373
|
-
...
|
|
374
|
-
labelPool:
|
|
375
|
-
}),
|
|
476
|
+
...o,
|
|
477
|
+
labelPool: l
|
|
478
|
+
}), u = this.MaterialManager, h = new wt(
|
|
376
479
|
//实体图层管理
|
|
377
480
|
n,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
481
|
+
i,
|
|
482
|
+
u,
|
|
483
|
+
s,
|
|
381
484
|
c
|
|
382
485
|
);
|
|
383
|
-
return { materialManager:
|
|
486
|
+
return { materialManager: u, entityLayerManager: h, cardPool: c, overlayPool: f, labelPool: l, aggregator: s, eventBus: r, cardEventBus: a };
|
|
384
487
|
}
|
|
385
488
|
//添加标记
|
|
386
489
|
set(e) {
|
|
@@ -394,19 +497,19 @@ class Fr {
|
|
|
394
497
|
//添加
|
|
395
498
|
add(e) {
|
|
396
499
|
let r = [];
|
|
397
|
-
|
|
500
|
+
S(e) ? r = e : r.push(e), r.forEach((a) => {
|
|
398
501
|
this.entityList.set(a.id, a);
|
|
399
502
|
}), this.instance.entityLayerManager.getLayer("Layer_default") || this.instance.entityLayerManager.addLayer("Layer_default"), this.instance.entityLayerManager.addGroupsToLayer("Layer_default", r);
|
|
400
503
|
}
|
|
401
504
|
//更新标记
|
|
402
505
|
update(e, r = !0) {
|
|
403
506
|
let a = [];
|
|
404
|
-
|
|
405
|
-
const n = a.map((
|
|
406
|
-
const
|
|
407
|
-
if (!
|
|
408
|
-
let
|
|
409
|
-
return this.entityList.set(
|
|
507
|
+
S(e) ? a = e : a.push(e);
|
|
508
|
+
const n = a.map((i) => {
|
|
509
|
+
const o = this.entityList.get(i.id);
|
|
510
|
+
if (!o) return;
|
|
511
|
+
let l = Pr({}, o, i);
|
|
512
|
+
return this.entityList.set(i.id, l), l;
|
|
410
513
|
}).filter(Boolean);
|
|
411
514
|
r && this.instance.entityLayerManager.updateGroupToLayer("Layer_default", n);
|
|
412
515
|
}
|
|
@@ -424,7 +527,7 @@ class Fr {
|
|
|
424
527
|
//删除标记
|
|
425
528
|
delete(e) {
|
|
426
529
|
let r = [];
|
|
427
|
-
|
|
530
|
+
S(e) ? r = e : r.push(e), r.forEach((a) => {
|
|
428
531
|
this.entityList.delete(a);
|
|
429
532
|
}), this.instance.entityLayerManager.removeGroups("Layer_default", r);
|
|
430
533
|
}
|
|
@@ -457,27 +560,27 @@ const I = {
|
|
|
457
560
|
polygonTileWidth: 2,
|
|
458
561
|
polygonTileHeight: 2
|
|
459
562
|
};
|
|
460
|
-
function
|
|
563
|
+
function y(t, e) {
|
|
461
564
|
const r = Number(t);
|
|
462
565
|
return Number.isFinite(r) ? r : e;
|
|
463
566
|
}
|
|
464
567
|
function C(t) {
|
|
465
568
|
return Number.isFinite(t) ? Math.max(1, t) : 1;
|
|
466
569
|
}
|
|
467
|
-
function
|
|
570
|
+
function Br(t, e) {
|
|
468
571
|
return Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : e;
|
|
469
572
|
}
|
|
470
|
-
function
|
|
573
|
+
function Gr(t) {
|
|
471
574
|
const e = t?.repeat;
|
|
472
575
|
if (Array.isArray(e) && e.length >= 2)
|
|
473
576
|
return {
|
|
474
|
-
x: C(
|
|
475
|
-
y: C(
|
|
577
|
+
x: C(y(e[0], 1)),
|
|
578
|
+
y: C(y(e[1], 1))
|
|
476
579
|
};
|
|
477
580
|
if (e && typeof e == "object")
|
|
478
581
|
return {
|
|
479
|
-
x: C(
|
|
480
|
-
y: C(
|
|
582
|
+
x: C(y(e.x, 1)),
|
|
583
|
+
y: C(y(e.y, 1))
|
|
481
584
|
};
|
|
482
585
|
const r = Number(t?.repeatX), a = Number(t?.repeatY);
|
|
483
586
|
return Number.isFinite(r) && Number.isFinite(a) ? {
|
|
@@ -490,86 +593,86 @@ function ze(t, e) {
|
|
|
490
593
|
if (r.length < 2) return 1;
|
|
491
594
|
let a = 0;
|
|
492
595
|
for (let n = 1; n < r.length; n++) {
|
|
493
|
-
const
|
|
494
|
-
if (!Array.isArray(
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
596
|
+
const i = r[n - 1], o = r[n];
|
|
597
|
+
if (!Array.isArray(i) || !Array.isArray(o)) continue;
|
|
598
|
+
const l = t.Cartesian3.fromDegrees(
|
|
599
|
+
y(i[0], 0),
|
|
600
|
+
y(i[1], 0),
|
|
601
|
+
y(i[2], 0)
|
|
499
602
|
), c = t.Cartesian3.fromDegrees(
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
603
|
+
y(o[0], 0),
|
|
604
|
+
y(o[1], 0),
|
|
605
|
+
y(o[2], 0)
|
|
503
606
|
);
|
|
504
|
-
a += t.Cartesian3.distance(
|
|
607
|
+
a += t.Cartesian3.distance(l, c);
|
|
505
608
|
}
|
|
506
609
|
return a > 0 ? a : 1;
|
|
507
610
|
}
|
|
508
611
|
function Ve(t) {
|
|
509
612
|
const e = t?.maximumHeights, r = t?.minimumHeights;
|
|
510
613
|
if (Array.isArray(e) && Array.isArray(r) && e.length > 0 && e.length === r.length) {
|
|
511
|
-
let
|
|
512
|
-
for (let
|
|
513
|
-
const c = Number(e[
|
|
514
|
-
Number.isFinite(c) && c > 0 && (
|
|
614
|
+
let i = 0, o = 0;
|
|
615
|
+
for (let l = 0; l < e.length; l++) {
|
|
616
|
+
const c = Number(e[l]) - Number(r[l]);
|
|
617
|
+
Number.isFinite(c) && c > 0 && (i += c, o++);
|
|
515
618
|
}
|
|
516
|
-
if (
|
|
619
|
+
if (o > 0) return i / o;
|
|
517
620
|
}
|
|
518
|
-
const a = Math.abs(
|
|
621
|
+
const a = Math.abs(y(t?.minHeight, 0)), n = Math.abs(y(t?.maxHeight, 0));
|
|
519
622
|
return a > 0 || n > 0 ? a + n : 3;
|
|
520
623
|
}
|
|
521
|
-
function
|
|
624
|
+
function qe(t, e) {
|
|
522
625
|
const r = e?.hierarchy;
|
|
523
626
|
if (!Array.isArray(r) || r.length < 3)
|
|
524
627
|
return { width: 1, height: 1 };
|
|
525
628
|
const a = Array.isArray(r[0]) ? r.flat() : r;
|
|
526
629
|
if (!Array.isArray(a) || a.length < 3) return { width: 1, height: 1 };
|
|
527
|
-
let n = Number.POSITIVE_INFINITY,
|
|
630
|
+
let n = Number.POSITIVE_INFINITY, i = Number.NEGATIVE_INFINITY, o = Number.POSITIVE_INFINITY, l = Number.NEGATIVE_INFINITY;
|
|
528
631
|
for (let p = 0; p < a.length; p += 3) {
|
|
529
|
-
const
|
|
530
|
-
!Number.isFinite(
|
|
632
|
+
const w = Number(a[p]), x = Number(a[p + 1]);
|
|
633
|
+
!Number.isFinite(w) || !Number.isFinite(x) || (n = Math.min(n, w), i = Math.max(i, w), o = Math.min(o, x), l = Math.max(l, x));
|
|
531
634
|
}
|
|
532
|
-
if (!Number.isFinite(n) || !Number.isFinite(
|
|
635
|
+
if (!Number.isFinite(n) || !Number.isFinite(o))
|
|
533
636
|
return { width: 1, height: 1 };
|
|
534
|
-
const c = (
|
|
637
|
+
const c = (o + l) / 2, f = t.Ellipsoid.WGS84.maximumRadius, s = t.Math.toRadians(Math.abs(i - n)), u = t.Math.toRadians(Math.abs(l - o)), h = s * f * Math.cos(t.Math.toRadians(c)), b = u * f;
|
|
535
638
|
return {
|
|
536
|
-
width:
|
|
639
|
+
width: h > 0 ? h : 1,
|
|
537
640
|
height: b > 0 ? b : 1
|
|
538
641
|
};
|
|
539
642
|
}
|
|
540
|
-
function
|
|
643
|
+
function Ue({
|
|
541
644
|
Cesium: t,
|
|
542
645
|
themeOptions: e,
|
|
543
646
|
entityOptions: r,
|
|
544
647
|
category: a
|
|
545
648
|
}) {
|
|
546
|
-
const n =
|
|
649
|
+
const n = Gr(e);
|
|
547
650
|
if (n) return n;
|
|
548
651
|
if (e?.autoRepeat === !1)
|
|
549
652
|
return { x: 1, y: 1 };
|
|
550
653
|
if (a === "wall") {
|
|
551
|
-
const c = ze(t, r), f = Ve(r),
|
|
654
|
+
const c = ze(t, r), f = Ve(r), s = y(
|
|
552
655
|
e?.tileWidth ?? e?.textureWidth,
|
|
553
656
|
I.wallTileWidth
|
|
554
|
-
), u =
|
|
657
|
+
), u = y(
|
|
555
658
|
e?.tileHeight ?? e?.textureHeight,
|
|
556
659
|
I.wallTileHeight
|
|
557
660
|
);
|
|
558
661
|
return {
|
|
559
|
-
x: C(c / Math.max(
|
|
662
|
+
x: C(c / Math.max(s, 0.01)),
|
|
560
663
|
y: C(f / Math.max(u, 0.01))
|
|
561
664
|
};
|
|
562
665
|
}
|
|
563
|
-
const
|
|
666
|
+
const i = qe(t, r), o = y(
|
|
564
667
|
e?.tileWidth ?? e?.textureWidth,
|
|
565
668
|
I.polygonTileWidth
|
|
566
|
-
),
|
|
669
|
+
), l = y(
|
|
567
670
|
e?.tileHeight ?? e?.textureHeight,
|
|
568
671
|
I.polygonTileHeight
|
|
569
672
|
);
|
|
570
673
|
return {
|
|
571
|
-
x: C(
|
|
572
|
-
y: C(
|
|
674
|
+
x: C(i.width / Math.max(o, 0.01)),
|
|
675
|
+
y: C(i.height / Math.max(l, 0.01))
|
|
573
676
|
};
|
|
574
677
|
}
|
|
575
678
|
function je({
|
|
@@ -579,30 +682,30 @@ function je({
|
|
|
579
682
|
category: a,
|
|
580
683
|
freely: n
|
|
581
684
|
}) {
|
|
582
|
-
const
|
|
583
|
-
if (Number.isFinite(
|
|
685
|
+
const i = Number(e?.count);
|
|
686
|
+
if (Number.isFinite(i) && i > 0) return i;
|
|
584
687
|
if (e?.autoRepeat === !1)
|
|
585
688
|
return 1;
|
|
586
689
|
if (a === "wall") {
|
|
587
|
-
const
|
|
690
|
+
const s = ze(t, r), u = Ve(r), h = y(
|
|
588
691
|
e?.tileWidth ?? e?.textureWidth,
|
|
589
692
|
I.wallTileWidth
|
|
590
|
-
), b =
|
|
693
|
+
), b = y(
|
|
591
694
|
e?.tileHeight ?? e?.textureHeight,
|
|
592
695
|
I.wallTileHeight
|
|
593
|
-
), p = n === "vertical" ? u / Math.max(b, 0.01) :
|
|
696
|
+
), p = n === "vertical" ? u / Math.max(b, 0.01) : s / Math.max(h, 0.01);
|
|
594
697
|
return C(Number(p.toFixed(2)));
|
|
595
698
|
}
|
|
596
|
-
const
|
|
699
|
+
const o = qe(t, r), l = y(
|
|
597
700
|
e?.tileWidth ?? e?.textureWidth,
|
|
598
701
|
I.polygonTileWidth
|
|
599
|
-
), c =
|
|
702
|
+
), c = y(
|
|
600
703
|
e?.tileHeight ?? e?.textureHeight,
|
|
601
704
|
I.polygonTileHeight
|
|
602
|
-
), f = n === "vertical" ?
|
|
705
|
+
), f = n === "vertical" ? o.height / Math.max(c, 0.01) : o.width / Math.max(l, 0.01);
|
|
603
706
|
return C(Number(f.toFixed(2)));
|
|
604
707
|
}
|
|
605
|
-
function
|
|
708
|
+
function q(t) {
|
|
606
709
|
const e = t;
|
|
607
710
|
return e.__materialFactory = !0, e;
|
|
608
711
|
}
|
|
@@ -610,12 +713,12 @@ function Ze(t) {
|
|
|
610
713
|
const e = String(t?.wallVerticalMode ?? t?.verticalMode ?? "stretch");
|
|
611
714
|
return e === "repeat" || e === "bottom" || e === "stretch" ? e : "stretch";
|
|
612
715
|
}
|
|
613
|
-
function
|
|
716
|
+
function $r({
|
|
614
717
|
Cesium: t,
|
|
615
718
|
themeOptions: e,
|
|
616
719
|
entityOptions: r
|
|
617
720
|
}) {
|
|
618
|
-
const a =
|
|
721
|
+
const a = Ue({
|
|
619
722
|
Cesium: t,
|
|
620
723
|
themeOptions: e,
|
|
621
724
|
entityOptions: r,
|
|
@@ -623,7 +726,7 @@ function Br({
|
|
|
623
726
|
});
|
|
624
727
|
return Ze(e) === "repeat" ? a : { x: a.x, y: 1 };
|
|
625
728
|
}
|
|
626
|
-
function
|
|
729
|
+
function Xr(t, e) {
|
|
627
730
|
const r = "WallBottomImageMaterial_" + Date.now() + "_" + Math.floor(Math.random() * 1e3);
|
|
628
731
|
function a(n) {
|
|
629
732
|
this._definitionChanged = new t.Event(), this._color = n.color, this.color = n.color;
|
|
@@ -642,13 +745,13 @@ function Gr(t, e) {
|
|
|
642
745
|
color: t.createPropertyDescriptor("color")
|
|
643
746
|
}), a.prototype.getType = function() {
|
|
644
747
|
return r;
|
|
645
|
-
}, a.prototype.getValue = function(n,
|
|
646
|
-
return t.defined(
|
|
748
|
+
}, a.prototype.getValue = function(n, i) {
|
|
749
|
+
return t.defined(i) || (i = {}), i.image = e.image, i.repeatX = e.repeatX, i.bottomHeightRatio = e.bottomHeightRatio, i.color = t.Property.getValueOrClonedDefault(
|
|
647
750
|
this._color,
|
|
648
751
|
n,
|
|
649
752
|
t.Color.WHITE,
|
|
650
|
-
|
|
651
|
-
),
|
|
753
|
+
i.color
|
|
754
|
+
), i;
|
|
652
755
|
}, a.prototype.equals = function(n) {
|
|
653
756
|
return this === n || n instanceof a && t.Property.equals(this._color, n._color);
|
|
654
757
|
}, t.Material._materialCache.addMaterial(r, {
|
|
@@ -682,7 +785,7 @@ function Gr(t, e) {
|
|
|
682
785
|
}
|
|
683
786
|
}), new a(e);
|
|
684
787
|
}
|
|
685
|
-
function
|
|
788
|
+
function Kr({
|
|
686
789
|
Cesium: t,
|
|
687
790
|
options: e,
|
|
688
791
|
MaterialManager: r,
|
|
@@ -690,7 +793,7 @@ function $r({
|
|
|
690
793
|
}) {
|
|
691
794
|
if (e.data?.theme) {
|
|
692
795
|
if (e.data?.lineType == "1") {
|
|
693
|
-
let n =
|
|
796
|
+
let n = Tt(t, {
|
|
694
797
|
color: t.Color.fromCssColorString(e?.options?.color || "#ffffff"),
|
|
695
798
|
duration: 100
|
|
696
799
|
});
|
|
@@ -733,7 +836,7 @@ function $r({
|
|
|
733
836
|
category: "polyline"
|
|
734
837
|
});
|
|
735
838
|
} else if (e.data?.lineType == "5") {
|
|
736
|
-
let n =
|
|
839
|
+
let n = St(t, {
|
|
737
840
|
image: e.img,
|
|
738
841
|
color: t.Color.fromCssColorString(e?.options?.color || "#ffffff"),
|
|
739
842
|
duration: 5e3,
|
|
@@ -750,7 +853,7 @@ function $r({
|
|
|
750
853
|
}
|
|
751
854
|
}
|
|
752
855
|
}
|
|
753
|
-
function
|
|
856
|
+
function Yr({
|
|
754
857
|
Cesium: t,
|
|
755
858
|
options: e,
|
|
756
859
|
MaterialManager: r,
|
|
@@ -771,16 +874,16 @@ function Kr({
|
|
|
771
874
|
themeKey: e.data?.theme,
|
|
772
875
|
category: "polygon",
|
|
773
876
|
force: a,
|
|
774
|
-
material:
|
|
775
|
-
const
|
|
877
|
+
material: q((i = {}) => {
|
|
878
|
+
const o = Ue({
|
|
776
879
|
Cesium: t,
|
|
777
880
|
themeOptions: n,
|
|
778
|
-
entityOptions:
|
|
881
|
+
entityOptions: i,
|
|
779
882
|
category: "polygon"
|
|
780
883
|
});
|
|
781
884
|
return new t.ImageMaterialProperty({
|
|
782
885
|
image: e.img,
|
|
783
|
-
repeat: new t.Cartesian2(
|
|
886
|
+
repeat: new t.Cartesian2(o.x, o.y)
|
|
784
887
|
});
|
|
785
888
|
})
|
|
786
889
|
});
|
|
@@ -790,28 +893,28 @@ function Kr({
|
|
|
790
893
|
themeKey: e.data?.theme,
|
|
791
894
|
category: "polygon",
|
|
792
895
|
force: a,
|
|
793
|
-
material:
|
|
794
|
-
const
|
|
896
|
+
material: q((i = {}) => {
|
|
897
|
+
const o = e.data?.freely || "vertical", l = je({
|
|
795
898
|
Cesium: t,
|
|
796
899
|
themeOptions: n,
|
|
797
|
-
entityOptions:
|
|
900
|
+
entityOptions: i,
|
|
798
901
|
category: "polygon",
|
|
799
|
-
freely:
|
|
902
|
+
freely: o
|
|
800
903
|
});
|
|
801
|
-
return
|
|
904
|
+
return Le(t, {
|
|
802
905
|
image: e.img,
|
|
803
906
|
color: t.Color.fromCssColorString(n?.color || "#ffffff"),
|
|
804
|
-
duration:
|
|
805
|
-
freely:
|
|
907
|
+
duration: y(n?.duration, 5e3),
|
|
908
|
+
freely: o,
|
|
806
909
|
direction: n?.direction || "+",
|
|
807
|
-
count:
|
|
910
|
+
count: l
|
|
808
911
|
});
|
|
809
912
|
})
|
|
810
913
|
});
|
|
811
914
|
}
|
|
812
915
|
}
|
|
813
916
|
}
|
|
814
|
-
function
|
|
917
|
+
function zr({
|
|
815
918
|
Cesium: t,
|
|
816
919
|
options: e,
|
|
817
920
|
MaterialManager: r,
|
|
@@ -824,27 +927,27 @@ function Xr({
|
|
|
824
927
|
themeKey: e.data?.theme,
|
|
825
928
|
category: "wall",
|
|
826
929
|
force: a,
|
|
827
|
-
material:
|
|
828
|
-
const
|
|
930
|
+
material: q((i = {}) => {
|
|
931
|
+
const o = Ze(n), l = $r({
|
|
829
932
|
Cesium: t,
|
|
830
933
|
themeOptions: n,
|
|
831
|
-
entityOptions:
|
|
934
|
+
entityOptions: i
|
|
832
935
|
});
|
|
833
|
-
if (
|
|
834
|
-
const c =
|
|
835
|
-
|
|
936
|
+
if (o === "bottom") {
|
|
937
|
+
const c = Br(
|
|
938
|
+
y(n?.bottomHeightRatio, 0.3),
|
|
836
939
|
0.3
|
|
837
940
|
);
|
|
838
|
-
return
|
|
941
|
+
return Xr(t, {
|
|
839
942
|
image: e.img,
|
|
840
|
-
repeatX:
|
|
943
|
+
repeatX: l.x,
|
|
841
944
|
bottomHeightRatio: c,
|
|
842
945
|
color: t.Color.fromCssColorString(n?.color || "#ffffff")
|
|
843
946
|
});
|
|
844
947
|
}
|
|
845
948
|
return new t.ImageMaterialProperty({
|
|
846
949
|
image: e.img,
|
|
847
|
-
repeat: new t.Cartesian2(
|
|
950
|
+
repeat: new t.Cartesian2(l.x, l.y),
|
|
848
951
|
transparent: !0
|
|
849
952
|
});
|
|
850
953
|
})
|
|
@@ -855,28 +958,28 @@ function Xr({
|
|
|
855
958
|
themeKey: e.data?.theme,
|
|
856
959
|
category: "wall",
|
|
857
960
|
force: a,
|
|
858
|
-
material:
|
|
859
|
-
const
|
|
961
|
+
material: q((i = {}) => {
|
|
962
|
+
const o = e.data?.freely || "vertical", l = je({
|
|
860
963
|
Cesium: t,
|
|
861
964
|
themeOptions: n,
|
|
862
|
-
entityOptions:
|
|
965
|
+
entityOptions: i,
|
|
863
966
|
category: "wall",
|
|
864
|
-
freely:
|
|
967
|
+
freely: o
|
|
865
968
|
});
|
|
866
|
-
return
|
|
969
|
+
return Le(t, {
|
|
867
970
|
image: e.img,
|
|
868
971
|
color: t.Color.fromCssColorString(n?.color || "#ffffff"),
|
|
869
|
-
duration:
|
|
870
|
-
freely:
|
|
972
|
+
duration: y(n?.duration, 5e3),
|
|
973
|
+
freely: o,
|
|
871
974
|
direction: n?.direction || "+",
|
|
872
|
-
count:
|
|
975
|
+
count: l
|
|
873
976
|
});
|
|
874
977
|
})
|
|
875
978
|
});
|
|
876
979
|
}
|
|
877
980
|
}
|
|
878
981
|
}
|
|
879
|
-
class
|
|
982
|
+
class Vr extends Wr {
|
|
880
983
|
getCurrentBillboard(e) {
|
|
881
984
|
return e?.__currentBillboard || e?.billboard?.[0];
|
|
882
985
|
}
|
|
@@ -885,13 +988,13 @@ class Yr extends Fr {
|
|
|
885
988
|
labelId: r = "report-marker",
|
|
886
989
|
cardId: a = "report-marker",
|
|
887
990
|
tagThemeConfig: n = [],
|
|
888
|
-
lineThemeConfig:
|
|
889
|
-
cardThemeConfig:
|
|
890
|
-
runListener:
|
|
991
|
+
lineThemeConfig: i = [],
|
|
992
|
+
cardThemeConfig: o = [],
|
|
993
|
+
runListener: l = () => {
|
|
891
994
|
},
|
|
892
|
-
MaterialManager: c = new
|
|
995
|
+
MaterialManager: c = new Se(),
|
|
893
996
|
aggregatorOptions: f
|
|
894
|
-
} = e,
|
|
997
|
+
} = e, s = [...n], u = [...i], h = [...o], b = {
|
|
895
998
|
clusterTheme: "Tag1007",
|
|
896
999
|
pointTheme: "Tag1001",
|
|
897
1000
|
centralPointMode: "firstPoint",
|
|
@@ -903,9 +1006,9 @@ class Yr extends Fr {
|
|
|
903
1006
|
cardId: a,
|
|
904
1007
|
MaterialManager: c,
|
|
905
1008
|
aggregatorOptions: b,
|
|
906
|
-
eventBus: new
|
|
1009
|
+
eventBus: new K()
|
|
907
1010
|
};
|
|
908
|
-
super(p), this.opt = { ...this.opt, ...p }, this.initTagListener(this.instance.eventBus, this.opt), this.loadTabThemeConfig(
|
|
1011
|
+
super(p), this.opt = { ...this.opt, ...p }, this.initTagListener(this.instance.eventBus, this.opt), this.loadTabThemeConfig(s), this.loadLineThemeConfig(u), this.loadCardThemeConfig(h), this.initDefaultLineMaterials(), this.initDefaultTagTheme();
|
|
909
1012
|
}
|
|
910
1013
|
initDefaultTagTheme() {
|
|
911
1014
|
this.setTagTheme({
|
|
@@ -1017,25 +1120,25 @@ class Yr extends Fr {
|
|
|
1017
1120
|
e.tag && this.loadTabThemeConfig(e.tag), e.card && this.loadCardThemeConfig(e.card);
|
|
1018
1121
|
const a = this.opt.Cesium, n = this.instance.materialManager || this.opt.MaterialManager;
|
|
1019
1122
|
if (e.line?.length > 0)
|
|
1020
|
-
for (let
|
|
1021
|
-
|
|
1022
|
-
options:
|
|
1123
|
+
for (let i of e.line)
|
|
1124
|
+
Kr({
|
|
1125
|
+
options: i,
|
|
1023
1126
|
Cesium: a,
|
|
1024
1127
|
MaterialManager: n,
|
|
1025
1128
|
force: r
|
|
1026
1129
|
});
|
|
1027
1130
|
if (e.polygon?.length > 0)
|
|
1028
|
-
for (let
|
|
1029
|
-
|
|
1030
|
-
options:
|
|
1131
|
+
for (let i of e.polygon)
|
|
1132
|
+
Yr({
|
|
1133
|
+
options: i,
|
|
1031
1134
|
Cesium: a,
|
|
1032
1135
|
MaterialManager: n,
|
|
1033
1136
|
force: r
|
|
1034
1137
|
});
|
|
1035
1138
|
if (e.wall?.length > 0)
|
|
1036
|
-
for (let
|
|
1037
|
-
|
|
1038
|
-
options:
|
|
1139
|
+
for (let i of e.wall)
|
|
1140
|
+
zr({
|
|
1141
|
+
options: i,
|
|
1039
1142
|
Cesium: a,
|
|
1040
1143
|
MaterialManager: n,
|
|
1041
1144
|
force: r
|
|
@@ -1069,10 +1172,10 @@ class Yr extends Fr {
|
|
|
1069
1172
|
let r = this.instance.cardPool;
|
|
1070
1173
|
e.forEach((a) => {
|
|
1071
1174
|
r.registerTheme(a.data.theme, {
|
|
1072
|
-
createElement(n,
|
|
1073
|
-
let
|
|
1074
|
-
return a.comType == 1 ?
|
|
1075
|
-
data:
|
|
1175
|
+
createElement(n, i) {
|
|
1176
|
+
let o = i.data.data, l;
|
|
1177
|
+
return a.comType == 1 ? l = O(P(ye), {
|
|
1178
|
+
data: o || {},
|
|
1076
1179
|
imgSrc: a.data.img,
|
|
1077
1180
|
styleConfig: {
|
|
1078
1181
|
paddingTop: "50px",
|
|
@@ -1092,8 +1195,8 @@ class Yr extends Fr {
|
|
|
1092
1195
|
top: "0px"
|
|
1093
1196
|
},
|
|
1094
1197
|
bgClass: [a.data.theme]
|
|
1095
|
-
}) : a.comType == 3 && (
|
|
1096
|
-
data:
|
|
1198
|
+
}) : a.comType == 3 && (l = O(P(ye), {
|
|
1199
|
+
data: o || {},
|
|
1097
1200
|
imgSrc: a.data.img,
|
|
1098
1201
|
styleConfig: {
|
|
1099
1202
|
paddingTop: "55px",
|
|
@@ -1115,7 +1218,7 @@ class Yr extends Fr {
|
|
|
1115
1218
|
bgClass: [a.data.theme]
|
|
1116
1219
|
// titleConfig: themeOptions.options.titleConfig,
|
|
1117
1220
|
// pageInfoConfig: themeOptions.options.pageInfoConfig,
|
|
1118
|
-
})),
|
|
1221
|
+
})), X(l, n), () => X(null, n);
|
|
1119
1222
|
},
|
|
1120
1223
|
options: {
|
|
1121
1224
|
offset: a.data.pixelOffset,
|
|
@@ -1129,12 +1232,12 @@ class Yr extends Fr {
|
|
|
1129
1232
|
let { labelPool: r } = this.instance;
|
|
1130
1233
|
const a = (n) => this.getCurrentBillboard(n);
|
|
1131
1234
|
r.registerTheme(e.data.theme, {
|
|
1132
|
-
createElement(n,
|
|
1133
|
-
let
|
|
1134
|
-
const
|
|
1235
|
+
createElement(n, i) {
|
|
1236
|
+
let o = a(i.data);
|
|
1237
|
+
const l = Fr(o, ["position", "options"]);
|
|
1135
1238
|
let c, f = {
|
|
1136
|
-
...
|
|
1137
|
-
text:
|
|
1239
|
+
...l,
|
|
1240
|
+
text: o?.options?.text,
|
|
1138
1241
|
isFullLink: e?.isFullLink ?? !1,
|
|
1139
1242
|
img: e?.data?.options?.img,
|
|
1140
1243
|
textStyle: e?.data?.options?.textStyle,
|
|
@@ -1143,9 +1246,9 @@ class Yr extends Fr {
|
|
|
1143
1246
|
textPosition: e?.data?.options?.textPosition || "top",
|
|
1144
1247
|
textGap: e?.data?.options?.textGap
|
|
1145
1248
|
};
|
|
1146
|
-
if (
|
|
1147
|
-
c = P(
|
|
1148
|
-
text:
|
|
1249
|
+
if (i.data?.gridKey)
|
|
1250
|
+
c = O(P(re), {
|
|
1251
|
+
text: i.data?.count,
|
|
1149
1252
|
isFullLink: e.isFullLink ?? !1,
|
|
1150
1253
|
img: e?.data.options.img,
|
|
1151
1254
|
imgStyle: e?.data.options?.imgStyle,
|
|
@@ -1166,37 +1269,37 @@ class Yr extends Fr {
|
|
|
1166
1269
|
}
|
|
1167
1270
|
});
|
|
1168
1271
|
else if (e.comType == 4)
|
|
1169
|
-
c = P(
|
|
1272
|
+
c = O(P(Lt), f);
|
|
1170
1273
|
else if (e.comType == 5 || e.comType == 8) {
|
|
1171
|
-
const
|
|
1172
|
-
c = P(
|
|
1274
|
+
const s = o?.options || {}, u = e?.data?.options || {}, h = o?.pixelOffset || e?.data?.pixelOffset || { x: 0, y: 0 }, b = s.otherOffset ?? u.otherOffset ?? { x: 0, y: -0 }, p = s.isCanDraggable ?? u.isCanDraggable ?? e?.isCanDraggable ?? !1, w = e.comType == 8 ? Oe : Pe;
|
|
1275
|
+
c = O(P(w), {
|
|
1173
1276
|
...f,
|
|
1174
|
-
pixelOffset:
|
|
1175
|
-
textStyle:
|
|
1176
|
-
lineStyle:
|
|
1277
|
+
pixelOffset: h,
|
|
1278
|
+
textStyle: s.textStyle || u.textStyle,
|
|
1279
|
+
lineStyle: s.lineStyle || u.lineStyle,
|
|
1177
1280
|
otherOffset: b,
|
|
1178
1281
|
isCanDraggable: p,
|
|
1179
|
-
onCanDraggable:
|
|
1282
|
+
onCanDraggable: s.onCanDraggable || e?.onCanDraggable,
|
|
1180
1283
|
onSetOtherOffset: (x) => {
|
|
1181
|
-
const _ = a(
|
|
1182
|
-
_?.options && (_.options.otherOffset = x),
|
|
1284
|
+
const _ = a(i.data);
|
|
1285
|
+
_?.options && (_.options.otherOffset = x), s.onSetOtherOffset?.(x), e?.onSetOtherOffset?.(i.data, x);
|
|
1183
1286
|
},
|
|
1184
1287
|
onSetLineStake: (x) => {
|
|
1185
|
-
const _ = a(
|
|
1186
|
-
_?.options && (_.options.lineStake = x),
|
|
1288
|
+
const _ = a(i.data);
|
|
1289
|
+
_?.options && (_.options.lineStake = x), s.onSetLineStake?.(x), e?.onSetLineStake?.(i.data, x);
|
|
1187
1290
|
}
|
|
1188
1291
|
});
|
|
1189
|
-
} else e.comType == 6 || e.comType == 7 ? c = P(
|
|
1292
|
+
} else e.comType == 6 || e.comType == 7 ? c = O(P(Ee), {
|
|
1190
1293
|
text: f.text,
|
|
1191
1294
|
textStyle: f.textStyle
|
|
1192
|
-
}) : e.comType == 9 ? c = P(
|
|
1295
|
+
}) : e.comType == 9 ? c = O(P(De), {
|
|
1193
1296
|
text: f.text,
|
|
1194
1297
|
svg: f.svg,
|
|
1195
1298
|
textStyle: f.textStyle,
|
|
1196
1299
|
textPosition: f.textPosition || "top",
|
|
1197
1300
|
textGap: f.textGap
|
|
1198
|
-
}) : c = P(
|
|
1199
|
-
return
|
|
1301
|
+
}) : c = O(P(re), f);
|
|
1302
|
+
return X(c, n), () => X(null, n);
|
|
1200
1303
|
},
|
|
1201
1304
|
options: {
|
|
1202
1305
|
offset: e.comType == 5 || e.comType == 8 ? {} : e?.data?.pixelOffset || {}
|
|
@@ -1206,120 +1309,121 @@ class Yr extends Fr {
|
|
|
1206
1309
|
//标记监听事件
|
|
1207
1310
|
initTagListener(e, r) {
|
|
1208
1311
|
let { viewer: a, tagListeningOptions: n } = r;
|
|
1209
|
-
e.addListener(
|
|
1312
|
+
e.addListener(ee.Click, {
|
|
1210
1313
|
name: "marker:click",
|
|
1211
|
-
fn: (
|
|
1212
|
-
r.runListener?.(
|
|
1314
|
+
fn: (i) => {
|
|
1315
|
+
r.runListener?.(Y.标记左键点击, i.data), Fe(i.data?.onClick) && i.data?.onClick(i.data), i.data?.cameraPoint && this.getCurrentBillboard(i.data)?.isFlyToCameraPoint && a?.camera?.flyTo({
|
|
1213
1316
|
duration: 1,
|
|
1214
|
-
...
|
|
1317
|
+
...i.data?.cameraPoint
|
|
1215
1318
|
});
|
|
1216
1319
|
}
|
|
1217
|
-
}), e.addListener(
|
|
1320
|
+
}), e.addListener(ee.MouseEnter, {
|
|
1218
1321
|
name: "marker:mouseenter",
|
|
1219
|
-
fn: (
|
|
1220
|
-
let
|
|
1322
|
+
fn: (i) => {
|
|
1323
|
+
let o = this.opt.Cesium, l = { x: 0, y: 0 };
|
|
1221
1324
|
try {
|
|
1222
|
-
const c = this.getCurrentBillboard(
|
|
1325
|
+
const c = this.getCurrentBillboard(i.data);
|
|
1223
1326
|
if (c?.position?.length > 2) {
|
|
1224
|
-
let f = c.position,
|
|
1225
|
-
|
|
1327
|
+
let f = c.position, s = o.Cartesian3.fromDegrees(f[0], f[1], f[3] || 0), u = this.instance.labelPool.toWindowCoordinates(s);
|
|
1328
|
+
l.x = u.x, l.y = u.y;
|
|
1226
1329
|
}
|
|
1227
1330
|
} catch (c) {
|
|
1228
1331
|
console.log(c);
|
|
1229
1332
|
}
|
|
1230
|
-
r.runListener?.(
|
|
1333
|
+
r.runListener?.(Y.标记移入, i.data, l);
|
|
1231
1334
|
}
|
|
1232
|
-
}), e.addListener(
|
|
1335
|
+
}), e.addListener(ee.MouseLeave, {
|
|
1233
1336
|
name: "marker:mouseleave",
|
|
1234
|
-
fn: (
|
|
1235
|
-
let
|
|
1337
|
+
fn: (i) => {
|
|
1338
|
+
let o = this.opt.Cesium, l = { x: 0, y: 0 };
|
|
1236
1339
|
try {
|
|
1237
|
-
const c = this.getCurrentBillboard(
|
|
1340
|
+
const c = this.getCurrentBillboard(i.data);
|
|
1238
1341
|
if (c?.position?.length > 2) {
|
|
1239
|
-
let f = c.position,
|
|
1240
|
-
|
|
1342
|
+
let f = c.position, s = o.Cartesian3.fromDegrees(f[0], f[1], f[3] || 0), u = this.instance.labelPool.toWindowCoordinates(s);
|
|
1343
|
+
l.x = u.x, l.y = u.y;
|
|
1241
1344
|
}
|
|
1242
1345
|
} catch (c) {
|
|
1243
1346
|
console.log(c);
|
|
1244
1347
|
}
|
|
1245
|
-
r.runListener?.(
|
|
1348
|
+
r.runListener?.(Y.标记移出, i.data, l);
|
|
1246
1349
|
}
|
|
1247
|
-
}), n?.forEach((
|
|
1248
|
-
e.addListener(
|
|
1350
|
+
}), n?.forEach((i) => {
|
|
1351
|
+
e.addListener(i.key, i.ListenerItem, i.overwrite);
|
|
1249
1352
|
});
|
|
1250
1353
|
}
|
|
1251
1354
|
// 兼容旧模式的材质注册
|
|
1252
1355
|
setMaterial(e) {
|
|
1253
|
-
const { type: r, material: a, materialKey: n, cover:
|
|
1356
|
+
const { type: r, material: a, materialKey: n, cover: i } = e, o = r ? r.toLowerCase() : "default";
|
|
1254
1357
|
this.MaterialManager.register({
|
|
1255
1358
|
themeKey: n,
|
|
1256
1359
|
// 兼容传入的是 { material: ... } 结构或者直接是材质对象
|
|
1257
1360
|
material: a?.material || a,
|
|
1258
|
-
force:
|
|
1259
|
-
category:
|
|
1361
|
+
force: i,
|
|
1362
|
+
category: o
|
|
1260
1363
|
});
|
|
1261
1364
|
}
|
|
1262
1365
|
}
|
|
1263
|
-
const
|
|
1366
|
+
const qr = /* @__PURE__ */ se({
|
|
1264
1367
|
__name: "MarkerManage",
|
|
1265
1368
|
props: $t,
|
|
1266
1369
|
emits: ["register", "load", "marker-event"],
|
|
1267
1370
|
setup(t, { expose: e, emit: r }) {
|
|
1268
|
-
const a = t, n = r,
|
|
1269
|
-
let
|
|
1270
|
-
const
|
|
1271
|
-
if (
|
|
1371
|
+
const a = t, n = r, i = mt("leitingMethods");
|
|
1372
|
+
let o = null;
|
|
1373
|
+
const l = (s = {}) => {
|
|
1374
|
+
if (o) return o;
|
|
1272
1375
|
const u = {
|
|
1273
1376
|
...a,
|
|
1274
|
-
...
|
|
1275
|
-
Cesium:
|
|
1276
|
-
viewer:
|
|
1277
|
-
runListener: (
|
|
1278
|
-
n("marker-event", { key:
|
|
1377
|
+
...s,
|
|
1378
|
+
Cesium: s.Cesium || a.Cesium,
|
|
1379
|
+
viewer: s.viewer || a.viewer,
|
|
1380
|
+
runListener: (h, b, ...p) => {
|
|
1381
|
+
n("marker-event", { key: h, data: b, args: p });
|
|
1279
1382
|
}
|
|
1280
1383
|
};
|
|
1281
|
-
return !u.Cesium || !u.viewer ? null : (
|
|
1384
|
+
return !u.Cesium || !u.viewer ? null : (o = new Vr(u), s.methods && (s.methods.setTagTheme = o.setTagTheme.bind(o), s.methods.setMaterial = o.setMaterial.bind(o), s.methods.setEntityList = o.set.bind(o), s.methods.addComItem = o.add.bind(o), s.methods.deleteComItem = o.delete.bind(o), s.methods.updateComItem = o.update.bind(o), s.methods.getEntityByID = o.getById.bind(o), s.methods.getOptions = o.getOptions.bind(o)), n("load", o), o);
|
|
1282
1385
|
}, c = {
|
|
1283
|
-
init:
|
|
1284
|
-
set: (
|
|
1285
|
-
add: (
|
|
1286
|
-
update: (
|
|
1287
|
-
getById: (
|
|
1288
|
-
getOptions: () =>
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1386
|
+
init: l,
|
|
1387
|
+
set: (s) => o?.set(s),
|
|
1388
|
+
add: (s) => o?.add(s),
|
|
1389
|
+
update: (s, u) => o?.update(s, u),
|
|
1390
|
+
getById: (s) => o?.getById(s),
|
|
1391
|
+
getOptions: () => o?.getOptions(),
|
|
1392
|
+
overlays: () => o?.overlays,
|
|
1393
|
+
delete: (s) => o?.delete(s),
|
|
1394
|
+
setMarkerAggregationEnabled: (s, u) => o?.setMarkerAggregationEnabled(s, u),
|
|
1395
|
+
setDebugCurrentGridsEnabled: (s) => o?.setDebugCurrentGridsEnabled(s),
|
|
1396
|
+
setLabelOcclusionEnabled: (s) => o?.setLabelOcclusionEnabled(s),
|
|
1397
|
+
setLabelOcclusionDistanceEpsilon: (s) => o?.setLabelOcclusionDistanceEpsilon(s),
|
|
1398
|
+
setLabelOcclusionOptions: (s) => o?.setLabelOcclusionOptions(s),
|
|
1399
|
+
getLabelOcclusionOptions: () => o?.getLabelOcclusionOptions(),
|
|
1400
|
+
initThemes: (s) => o?.initThemes(s),
|
|
1401
|
+
setTagTheme: (s) => o?.setTagTheme(s),
|
|
1402
|
+
setMaterial: (s) => o?.setMaterial(s)
|
|
1299
1403
|
};
|
|
1300
1404
|
e(c), n("register", c);
|
|
1301
1405
|
function f() {
|
|
1302
|
-
if (
|
|
1303
|
-
const
|
|
1304
|
-
u &&
|
|
1406
|
+
if (o) return o;
|
|
1407
|
+
const s = M(i), u = s?.getCesium?.(), h = s?.getViewer?.();
|
|
1408
|
+
u && h ? l({ Cesium: u, viewer: h, methods: s }) : a.Cesium && a.viewer && l({ methods: s });
|
|
1305
1409
|
}
|
|
1306
|
-
return
|
|
1410
|
+
return Te(() => {
|
|
1307
1411
|
f();
|
|
1308
|
-
}),
|
|
1412
|
+
}), z(
|
|
1309
1413
|
() => [a.Cesium, a.viewer],
|
|
1310
|
-
([
|
|
1311
|
-
|
|
1414
|
+
([s, u]) => {
|
|
1415
|
+
s && u && !o && f();
|
|
1312
1416
|
}
|
|
1313
|
-
),
|
|
1314
|
-
() =>
|
|
1315
|
-
(
|
|
1417
|
+
), z(
|
|
1418
|
+
() => i?.value,
|
|
1419
|
+
(s, u) => {
|
|
1316
1420
|
f();
|
|
1317
1421
|
},
|
|
1318
1422
|
{ deep: !1 }
|
|
1319
1423
|
), yt(() => {
|
|
1320
|
-
}), (
|
|
1424
|
+
}), (s, u) => pt(s.$slots, "default");
|
|
1321
1425
|
}
|
|
1322
|
-
}),
|
|
1426
|
+
}), Ur = /* @__PURE__ */ se({
|
|
1323
1427
|
name: "CxMarkerPreview",
|
|
1324
1428
|
__name: "MarkerPreview",
|
|
1325
1429
|
props: {
|
|
@@ -1330,100 +1434,100 @@ const zr = /* @__PURE__ */ le({
|
|
|
1330
1434
|
},
|
|
1331
1435
|
emits: ["imageSize", "pixelOffsetSelect"],
|
|
1332
1436
|
setup(t, { emit: e }) {
|
|
1333
|
-
const r = t, a = e, n = Me("marker"),
|
|
1437
|
+
const r = t, a = e, n = Me("marker"), i = G(), o = G(), l = m(() => r.config?.data?.options || {}), c = m(() => Number(r.config?.comType ?? 2)), f = m(() => c.value === 5 ? Pe : c.value === 8 ? Oe : [6, 7].includes(c.value) ? Ee : c.value === 9 ? De : re), s = m(() => c.value === 2), u = m(() => r.img ?? l.value.img ?? r.config?.img ?? ""), h = m(() => l.value.textStyle || {}), b = m(() => l.value.imgStyle || {}), p = m(() => l.value.lineStyle || {}), w = m(() => l.value.svg || {}), x = m(() => String(l.value.textPosition || "top")), _ = m(() => Number(l.value.textGap ?? 8)), U = m(() => r.config?.data?.pixelOffset || { x: 0, y: 0 }), Je = m(() => l.value.otherOffset || { x: 0, y: 0 }), Qe = m(
|
|
1334
1438
|
() => JSON.stringify({
|
|
1335
1439
|
comType: c.value,
|
|
1336
1440
|
image: u.value,
|
|
1337
1441
|
text: r.text,
|
|
1338
|
-
options:
|
|
1442
|
+
options: l.value
|
|
1339
1443
|
})
|
|
1340
|
-
),
|
|
1341
|
-
transform: `translate(${
|
|
1342
|
-
visibility:
|
|
1343
|
-
})),
|
|
1444
|
+
), W = G(!1), B = G(!1), L = G({ scale: 1, shiftX: 0, shiftY: 0 }), et = m(() => ({
|
|
1445
|
+
transform: `translate(${L.value.shiftX}px, ${L.value.shiftY}px) scale(${L.value.scale})`,
|
|
1446
|
+
visibility: W.value || s.value && (!u.value || !B.value) ? "hidden" : "visible"
|
|
1447
|
+
})), j = m(
|
|
1344
1448
|
() => r.offsetSelectable && c.value === 2 && !!u.value && B.value
|
|
1345
1449
|
), tt = m(() => {
|
|
1346
|
-
const
|
|
1450
|
+
const d = Number(U.value.x), g = Number(U.value.y);
|
|
1347
1451
|
return {
|
|
1348
|
-
left: `${Number.isFinite(
|
|
1452
|
+
left: `${Number.isFinite(d) ? -d : 0}px`,
|
|
1349
1453
|
top: `${Number.isFinite(g) ? -g : 0}px`
|
|
1350
1454
|
};
|
|
1351
1455
|
});
|
|
1352
1456
|
function rt() {
|
|
1353
|
-
if (!
|
|
1354
|
-
const
|
|
1355
|
-
if (!
|
|
1356
|
-
const g =
|
|
1457
|
+
if (!i.value || !o.value || i.value.clientWidth <= 0 || i.value.clientHeight <= 0) return;
|
|
1458
|
+
const d = Array.from(o.value.querySelectorAll("*")).filter((v) => !v.classList.contains(n.be("preview", "anchor"))).map((v) => v.getBoundingClientRect()).filter((v) => v.width || v.height);
|
|
1459
|
+
if (!d.length) return;
|
|
1460
|
+
const g = i.value.getBoundingClientRect(), N = Math.min(...d.map((v) => v.left)), k = Math.max(...d.map((v) => v.right)), D = Math.min(...d.map((v) => v.top)), R = Math.max(...d.map((v) => v.bottom)), ot = k - N, lt = R - D, me = L.value.scale || 1, st = Math.min(
|
|
1357
1461
|
1,
|
|
1358
1462
|
Math.max(1, g.width - 8) / Math.max(ot / me, 1),
|
|
1359
1463
|
Math.max(1, g.height - 8) / Math.max(lt / me, 1)
|
|
1360
|
-
), ct = (N + k) / 2, ut = (
|
|
1361
|
-
|
|
1464
|
+
), ct = (N + k) / 2, ut = (D + R) / 2, ft = g.left + g.width / 2, gt = g.top + g.height / 2;
|
|
1465
|
+
L.value = {
|
|
1362
1466
|
scale: st,
|
|
1363
|
-
shiftX:
|
|
1364
|
-
shiftY:
|
|
1467
|
+
shiftX: L.value.shiftX + ft - ct,
|
|
1468
|
+
shiftY: L.value.shiftY + gt - ut
|
|
1365
1469
|
};
|
|
1366
1470
|
}
|
|
1367
|
-
function at(
|
|
1368
|
-
const g =
|
|
1369
|
-
!(g instanceof HTMLImageElement) || !
|
|
1471
|
+
function at(d) {
|
|
1472
|
+
const g = d.target;
|
|
1473
|
+
!(g instanceof HTMLImageElement) || !o.value?.contains(g) || (B.value = !0, W.value = !1, a("imageSize", g.naturalHeight > 0 ? g.naturalWidth / g.naturalHeight : void 0), J());
|
|
1370
1474
|
}
|
|
1371
|
-
function nt(
|
|
1372
|
-
!(
|
|
1475
|
+
function nt(d) {
|
|
1476
|
+
!(d.target instanceof HTMLImageElement) || !o.value?.contains(d.target) || (W.value = !0, a("imageSize", void 0));
|
|
1373
1477
|
}
|
|
1374
|
-
function it(
|
|
1375
|
-
if (!
|
|
1376
|
-
const g =
|
|
1478
|
+
function it(d) {
|
|
1479
|
+
if (!j.value || !o.value) return;
|
|
1480
|
+
const g = o.value.querySelector(`.${n.b("default")}`);
|
|
1377
1481
|
if (!g) return;
|
|
1378
|
-
const N = g.getBoundingClientRect(), k =
|
|
1379
|
-
|
|
1482
|
+
const N = g.getBoundingClientRect(), k = L.value.scale || 1, D = (d.clientX - N.left) / k, R = (d.clientY - N.top) / k;
|
|
1483
|
+
D < 0 || R < 0 || D > N.width / k || R > N.height / k || a("pixelOffsetSelect", { x: -Math.round(D), y: -Math.round(R) });
|
|
1380
1484
|
}
|
|
1381
|
-
|
|
1485
|
+
z(
|
|
1382
1486
|
u,
|
|
1383
1487
|
() => {
|
|
1384
|
-
B.value = !1,
|
|
1488
|
+
B.value = !1, W.value = !1, a("imageSize", void 0);
|
|
1385
1489
|
},
|
|
1386
1490
|
{ flush: "sync" }
|
|
1387
1491
|
);
|
|
1388
|
-
let
|
|
1389
|
-
function
|
|
1492
|
+
let F, Z = /* @__PURE__ */ new Set(), A;
|
|
1493
|
+
function J() {
|
|
1390
1494
|
A !== void 0 && cancelAnimationFrame(A);
|
|
1391
|
-
let
|
|
1495
|
+
let d = 0;
|
|
1392
1496
|
const g = () => {
|
|
1393
|
-
A = void 0, rt(),
|
|
1497
|
+
A = void 0, rt(), d += 1, d < 3 && (A = requestAnimationFrame(g));
|
|
1394
1498
|
};
|
|
1395
1499
|
A = requestAnimationFrame(g);
|
|
1396
1500
|
}
|
|
1397
|
-
function
|
|
1398
|
-
const
|
|
1399
|
-
for (const g of
|
|
1400
|
-
for (const g of
|
|
1401
|
-
|
|
1501
|
+
function de() {
|
|
1502
|
+
const d = new Set(Array.from(o.value?.querySelectorAll("*") || []));
|
|
1503
|
+
for (const g of Z) d.has(g) || F?.unobserve(g);
|
|
1504
|
+
for (const g of d) Z.has(g) || F?.observe(g);
|
|
1505
|
+
Z = d, J();
|
|
1402
1506
|
}
|
|
1403
|
-
return
|
|
1404
|
-
|
|
1507
|
+
return z(Qe, () => bt(de)), Te(() => {
|
|
1508
|
+
F = new ResizeObserver(J), i.value && F.observe(i.value), o.value && F.observe(o.value), de();
|
|
1405
1509
|
}), vt(() => {
|
|
1406
|
-
|
|
1407
|
-
}), (
|
|
1510
|
+
F?.disconnect(), A !== void 0 && cancelAnimationFrame(A);
|
|
1511
|
+
}), (d, g) => (E(), H("div", {
|
|
1408
1512
|
ref_key: "host",
|
|
1409
|
-
ref:
|
|
1410
|
-
class:
|
|
1513
|
+
ref: i,
|
|
1514
|
+
class: T([M(n).b("preview"), j.value ? M(n).bm("preview", "offset-picker") : ""]),
|
|
1411
1515
|
"aria-hidden": "true"
|
|
1412
1516
|
}, [
|
|
1413
|
-
|
|
1517
|
+
W.value ? (E(), H("div", {
|
|
1414
1518
|
key: 0,
|
|
1415
|
-
class:
|
|
1416
|
-
}, "图片不可用", 2)) :
|
|
1519
|
+
class: T(M(n).be("preview", "message"))
|
|
1520
|
+
}, "图片不可用", 2)) : s.value && !u.value ? (E(), H("div", {
|
|
1417
1521
|
key: 1,
|
|
1418
|
-
class:
|
|
1419
|
-
}, "请选择图片", 2)) :
|
|
1522
|
+
class: T(M(n).be("preview", "message"))
|
|
1523
|
+
}, "请选择图片", 2)) : s.value && !B.value ? (E(), H("div", {
|
|
1420
1524
|
key: 2,
|
|
1421
|
-
class:
|
|
1422
|
-
}, "图片加载中…", 2)) :
|
|
1423
|
-
|
|
1525
|
+
class: T(M(n).be("preview", "message"))
|
|
1526
|
+
}, "图片加载中…", 2)) : te("", !0),
|
|
1527
|
+
we("div", {
|
|
1424
1528
|
ref_key: "content",
|
|
1425
|
-
ref:
|
|
1426
|
-
class:
|
|
1529
|
+
ref: o,
|
|
1530
|
+
class: T(M(n).be("preview", "content")),
|
|
1427
1531
|
style: $(et.value),
|
|
1428
1532
|
onLoadCapture: at,
|
|
1429
1533
|
onErrorCapture: nt,
|
|
@@ -1433,30 +1537,31 @@ const zr = /* @__PURE__ */ le({
|
|
|
1433
1537
|
key: u.value,
|
|
1434
1538
|
text: t.text,
|
|
1435
1539
|
img: u.value,
|
|
1436
|
-
"text-style":
|
|
1540
|
+
"text-style": h.value,
|
|
1437
1541
|
"img-style": b.value,
|
|
1438
1542
|
"line-style": p.value,
|
|
1439
1543
|
"pixel-offset": U.value,
|
|
1440
1544
|
"other-offset": Je.value,
|
|
1441
|
-
svg:
|
|
1545
|
+
svg: w.value,
|
|
1442
1546
|
"text-position": x.value,
|
|
1443
1547
|
"text-gap": _.value
|
|
1444
1548
|
}, null, 8, ["text", "img", "text-style", "img-style", "line-style", "pixel-offset", "other-offset", "svg", "text-position", "text-gap"])),
|
|
1445
|
-
|
|
1549
|
+
j.value ? (E(), H("span", {
|
|
1446
1550
|
key: 0,
|
|
1447
|
-
class:
|
|
1551
|
+
class: T(M(n).be("preview", "anchor")),
|
|
1448
1552
|
style: $(tt.value)
|
|
1449
|
-
}, null, 6)) :
|
|
1553
|
+
}, null, 6)) : te("", !0)
|
|
1450
1554
|
], 38)
|
|
1451
1555
|
], 2));
|
|
1452
1556
|
}
|
|
1453
|
-
}),
|
|
1557
|
+
}), ia = le(qr), oa = le(Ur);
|
|
1454
1558
|
export {
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1559
|
+
De as C,
|
|
1560
|
+
Wr as M,
|
|
1561
|
+
Y as R,
|
|
1562
|
+
ia as a,
|
|
1563
|
+
oa as b,
|
|
1564
|
+
Rr as c,
|
|
1565
|
+
Vr as d,
|
|
1461
1566
|
$t as m
|
|
1462
1567
|
};
|