leiting-bim 2.1.62 → 2.1.98
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/leiting-bim.es.js +1 -1
- package/leiting-bim.umd.js +42 -48
- package/leitingbim.css +1 -1
- package/package.json +1 -1
- package/plugins/cesium-core/dist/cesium-core.mjs +301 -295
- package/plugins/cesium-core/dist/cesium-core.mjs.map +1 -1
- package/plugins/cesium-core/dist/cesium-core.umd.js +13 -13
- package/plugins/cesium-core/dist/cesium-core.umd.js.map +1 -1
- package/plugins/cesium-core/dist/components/BufferedHierarchicalAggregator.d.ts +2 -0
- package/plugins/cesium-core/package.json +1 -1
- package/plugins/cesium-vue/dist/cesium-vue/src/components/basic-audio/index.d.ts +13 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/basic-video/index.d.ts +98 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/card-carousel/index.d.ts +147 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/card-content/index.d.ts +16 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/card-page/index.d.ts +64 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/carousel-img/index.d.ts +34 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/echarts-pro/index.d.ts +63 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-bubble/index.d.ts +73 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-default/index.d.ts +43 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-html/index.d.ts +43 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-manage/index.d.ts +159 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-text/index.d.ts +25 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/measurement/index.d.ts +73 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/position-picker/index.d.ts +58 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/index.d.ts +46 -0
- package/plugins/cesium-vue/dist/components/basic-audio.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/basic-audio.js.map +1 -1
- package/plugins/cesium-vue/dist/components/basic-video.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/basic-video.js.map +1 -1
- package/plugins/cesium-vue/dist/components/card-carousel.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/card-carousel.js.map +1 -1
- package/plugins/cesium-vue/dist/components/card-content.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/card-content.js.map +1 -1
- package/plugins/cesium-vue/dist/components/card-page.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/card-page.js.map +1 -1
- package/plugins/cesium-vue/dist/components/carousel-img.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/carousel-img.js.map +1 -1
- package/plugins/cesium-vue/dist/components/echarts-pro.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/marker-bubble.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/marker-bubble.js.map +1 -1
- package/plugins/cesium-vue/dist/components/marker-default.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/marker-default.js.map +1 -1
- package/plugins/cesium-vue/dist/components/marker-html.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/marker-html.js.map +1 -1
- package/plugins/cesium-vue/dist/components/marker-manage.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/marker-manage.js +511 -488
- package/plugins/cesium-vue/dist/components/marker-manage.js.map +1 -1
- package/plugins/cesium-vue/dist/components/marker-text.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/marker-text.js.map +1 -1
- package/plugins/cesium-vue/dist/components/measurement.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/measurement.js.map +1 -1
- package/plugins/cesium-vue/dist/components/position-picker.d.ts +3 -3
- package/plugins/cesium-vue/dist/components/position-picker.js.map +1 -1
- package/plugins/cesium-vue/dist/index-CUs_hd1V.js.map +1 -1
- package/plugins/cesium-vue/dist/index-Kdqw0FJN.js.map +1 -1
- package/plugins/cesium-vue/dist/index.d.ts +6 -46
- package/plugins/cesium-vue/dist/index.js.map +1 -1
- package/plugins/cesium-vue/package.json +4 -4
- package/plugins/theme-chalk/package.json +1 -1
- package/plugins/utils/package.json +1 -1
- package/snapdom-D8jRyUPk.js +0 -2896
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { w as be } from "../create-DynflqE1.js";
|
|
2
|
-
import { h as w, markRaw as x, render as
|
|
3
|
-
import { M as
|
|
2
|
+
import { h as w, markRaw as x, render as G, defineComponent as Me, inject as _e, onMounted as Pe, watch as Y, onUnmounted as Le, renderSlot as Te, unref as we } from "vue";
|
|
3
|
+
import { M as D, H as X, a as $ } from "../HtmlOverlayLabelPool-B1gUt-p1.js";
|
|
4
4
|
import { CxCardCarousel as q } from "./card-carousel.js";
|
|
5
5
|
import { CxMarkerDefault as Z } from "./marker-default.js";
|
|
6
6
|
import { CxMarkerHtml as xe } from "./marker-html.js";
|
|
7
|
-
import { i as
|
|
8
|
-
const
|
|
7
|
+
import { i as F, b as ie, a as _, S as O, d as j, c as K, e as re, f as Se, g as ae, M as oe, h as H, j as Ee, k as Ge, l as De, m as ne, n as se, o as Ie, p as Oe, q as Ae, r as ke, s as Be, t as le, u as $e, v as He, w as Re, x as ze } from "../index-Kdqw0FJN.js";
|
|
8
|
+
const Fe = {
|
|
9
9
|
id: { type: String, default: "marker" },
|
|
10
10
|
Cesium: { type: Object },
|
|
11
11
|
viewer: { type: Object },
|
|
@@ -16,8 +16,8 @@ const Ke = {
|
|
|
16
16
|
themeConfig: { type: Object }
|
|
17
17
|
// Optional override
|
|
18
18
|
};
|
|
19
|
-
var I = /* @__PURE__ */ ((
|
|
20
|
-
class
|
|
19
|
+
var I = /* @__PURE__ */ ((r) => (r.左建选中模型 = "MODEL_LEFT_CLICK", r.标记左键点击 = "TAG_LEFT_CLICK", r.标记移入 = "TAG_MOUSEENTER", r.标记移出 = "TAG_MOUSELEAVE", r.模型位置保存 = "SAVE_REGION", r.模型加载完成 = "MODEL_READY", r))(I || {});
|
|
20
|
+
class Ke {
|
|
21
21
|
Cesium;
|
|
22
22
|
viewer;
|
|
23
23
|
labelPool;
|
|
@@ -37,6 +37,7 @@ class Fe {
|
|
|
37
37
|
groupByTheme;
|
|
38
38
|
tilingScheme;
|
|
39
39
|
levelIndexByTileLevel = /* @__PURE__ */ new Map();
|
|
40
|
+
_lastTileProvider = null;
|
|
40
41
|
_updateTimer = null;
|
|
41
42
|
_updateDelay = 100;
|
|
42
43
|
_tilesRetryCount = 0;
|
|
@@ -44,26 +45,26 @@ class Fe {
|
|
|
44
45
|
_cameraDirty = !1;
|
|
45
46
|
_tileLoadListener = null;
|
|
46
47
|
_cameraChangedHandler = null;
|
|
47
|
-
constructor(e, t,
|
|
48
|
-
this.Cesium = e, this.viewer = t, this.labelPool =
|
|
49
|
-
const o = this.viewer.scene && this.viewer.scene.globe, a = o && o._surface, n = a && a._tileProvider;
|
|
50
|
-
this.
|
|
51
|
-
|
|
48
|
+
constructor(e, t, i) {
|
|
49
|
+
this.Cesium = e, this.viewer = t, this.labelPool = i.labelPool, this.threshold = i.threshold ?? 10, this.displayLimit = i.displayLimit ?? 100, this.maxLevel = i.maxLevel ?? 5, this.debugCurrentGrids = i.debugCurrentGrids ?? !1, this.clusterTheme = i.clusterTheme ?? "cluster-label", this.pointTheme = i.pointTheme ?? "point-label", this.centralPointMode = i.centralPointMode ?? "central", this.minGlobalPointCount = i.minGlobalPointCount ?? 0, this.groupByTheme = i.groupByTheme ?? !1;
|
|
50
|
+
const o = this.viewer.scene && this.viewer.scene.globe, a = o && o._surface, n = a && a._tileProvider, l = n?.tilingScheme || new this.Cesium.GeographicTilingScheme();
|
|
51
|
+
this._lastTileProvider = n, this.tilingScheme = l, this.levels = this._createLevels(), this._buildLevels(), this._updateFn = this._update.bind(this), o && (this._tileLoadListener = (s) => {
|
|
52
|
+
s === 0 && this._cameraDirty && (this._cameraDirty = !1, this._scheduleUpdate());
|
|
52
53
|
}, o.tileLoadProgressEvent.addEventListener(this._tileLoadListener)), this._cameraChangedHandler = () => {
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
54
|
+
const s = this.viewer.scene, d = s && s.globe;
|
|
55
|
+
if (!d) {
|
|
55
56
|
this._scheduleUpdate();
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
|
-
this._cameraDirty = !0,
|
|
59
|
+
this._cameraDirty = !0, d.tilesLoaded && (this._cameraDirty = !1, this._scheduleUpdate());
|
|
59
60
|
}, this.viewer.camera.changed.addEventListener(this._cameraChangedHandler);
|
|
60
61
|
}
|
|
61
|
-
setGroupByTheme(e, t = !0,
|
|
62
|
+
setGroupByTheme(e, t = !0, i = !0) {
|
|
62
63
|
if (this.groupByTheme === e) {
|
|
63
|
-
|
|
64
|
+
i && this._update();
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
66
|
-
this.groupByTheme = e, t && this._buildLevels(),
|
|
67
|
+
this.groupByTheme = e, t && this._buildLevels(), i && this._update();
|
|
67
68
|
}
|
|
68
69
|
setMinGlobalPointCount(e, t = !0) {
|
|
69
70
|
this.minGlobalPointCount = e, t && this._update();
|
|
@@ -74,12 +75,16 @@ class Fe {
|
|
|
74
75
|
setDebugCurrentGrids(e, t = !0) {
|
|
75
76
|
this.debugCurrentGrids = e, e || this._clearDebugGrids(), t && this._update();
|
|
76
77
|
}
|
|
78
|
+
_syncTilingSchemeAndLevels() {
|
|
79
|
+
const e = this.viewer.scene && this.viewer.scene.globe, t = e && e._surface, i = t && t._tileProvider, o = i?.tilingScheme || new this.Cesium.GeographicTilingScheme(), a = i !== this._lastTileProvider, n = this.tilingScheme !== o;
|
|
80
|
+
!a && !n && this.levels && this.levels.length > 0 || (this._lastTileProvider = i, this.tilingScheme = o, this.levels = this._createLevels(), this._buildLevels());
|
|
81
|
+
}
|
|
77
82
|
_createLevels() {
|
|
78
83
|
const e = [];
|
|
79
84
|
this.levelIndexByTileLevel = /* @__PURE__ */ new Map();
|
|
80
|
-
const t = 0,
|
|
85
|
+
const t = 0, i = this.maxLevel;
|
|
81
86
|
let o = 0;
|
|
82
|
-
for (let a = t; a <=
|
|
87
|
+
for (let a = t; a <= i; a++, o++) {
|
|
83
88
|
const n = 360 / Math.pow(2, a);
|
|
84
89
|
e.push({
|
|
85
90
|
level: a,
|
|
@@ -93,10 +98,10 @@ class Fe {
|
|
|
93
98
|
this.points = e, this._buildLevels();
|
|
94
99
|
}
|
|
95
100
|
appendPoints(e, t = !0) {
|
|
96
|
-
for (const
|
|
97
|
-
this.points.push(
|
|
98
|
-
for (const
|
|
99
|
-
this._addPointToGrid(
|
|
101
|
+
for (const i of e)
|
|
102
|
+
this.points.push(i);
|
|
103
|
+
for (const i of e)
|
|
104
|
+
this._addPointToGrid(i);
|
|
100
105
|
t && this._scheduleUpdate();
|
|
101
106
|
}
|
|
102
107
|
_scheduleUpdate() {
|
|
@@ -107,45 +112,45 @@ class Fe {
|
|
|
107
112
|
updatePoint(e) {
|
|
108
113
|
const t = this.points.findIndex((a) => a.id === e.id);
|
|
109
114
|
if (t === -1) return;
|
|
110
|
-
const
|
|
115
|
+
const i = this.points[t];
|
|
111
116
|
for (const a of this.levels) {
|
|
112
117
|
const n = a.level, l = this.gridLayers.get(n);
|
|
113
118
|
if (!l) continue;
|
|
114
|
-
const s = this.Cesium.Cartographic.fromDegrees(
|
|
119
|
+
const s = this.Cesium.Cartographic.fromDegrees(i.lon, i.lat), d = this.tilingScheme.positionToTileXY(
|
|
115
120
|
s,
|
|
116
121
|
n,
|
|
117
122
|
new this.Cesium.Cartesian2()
|
|
118
123
|
);
|
|
119
|
-
if (!
|
|
120
|
-
const h = `${
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
124
|
-
const
|
|
125
|
-
|
|
124
|
+
if (!d) continue;
|
|
125
|
+
const h = `${d.x}_${d.y}`, c = l.get(h);
|
|
126
|
+
if (c) {
|
|
127
|
+
const g = c.allPoints.findIndex((u) => u.id === e.id);
|
|
128
|
+
if (g !== -1 && c.allPoints.splice(g, 1), i.data?.skipAggregation) {
|
|
129
|
+
const u = c.skipPoints.findIndex((f) => f.id === e.id);
|
|
130
|
+
u !== -1 && c.skipPoints.splice(u, 1);
|
|
126
131
|
} else {
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
const
|
|
130
|
-
|
|
132
|
+
const u = this.groupByTheme ? i.data?.theme : this.clusterTheme, f = c.groups.get(u);
|
|
133
|
+
if (f) {
|
|
134
|
+
const L = f.findIndex((b) => b.id === e.id);
|
|
135
|
+
L !== -1 && f.splice(L, 1), f.length === 0 && c.groups.delete(u);
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
139
|
}
|
|
135
|
-
const o = { ...
|
|
140
|
+
const o = { ...i, ...e };
|
|
136
141
|
this.points[t] = o, this._addPointToGrid(o), this._update();
|
|
137
142
|
}
|
|
138
143
|
removePointsById(e) {
|
|
139
144
|
const t = new Set(e);
|
|
140
|
-
this.points = this.points.filter((
|
|
141
|
-
for (const
|
|
142
|
-
const o = this.gridLayers.get(
|
|
145
|
+
this.points = this.points.filter((i) => !t.has(i.id));
|
|
146
|
+
for (const i of this.levels) {
|
|
147
|
+
const o = this.gridLayers.get(i.level);
|
|
143
148
|
if (o)
|
|
144
149
|
for (const [a, n] of o.entries()) {
|
|
145
150
|
n.allPoints = n.allPoints.filter((l) => !t.has(l.id)), n.skipPoints = n.skipPoints.filter((l) => !t.has(l.id));
|
|
146
151
|
for (const [l, s] of n.groups.entries()) {
|
|
147
|
-
const
|
|
148
|
-
|
|
152
|
+
const d = s.filter((h) => !t.has(h.id));
|
|
153
|
+
d.length === 0 ? n.groups.delete(l) : n.groups.set(l, d);
|
|
149
154
|
}
|
|
150
155
|
n.allPoints.length === 0 && o.delete(a);
|
|
151
156
|
}
|
|
@@ -161,11 +166,11 @@ class Fe {
|
|
|
161
166
|
}
|
|
162
167
|
_addPointToGrid(e) {
|
|
163
168
|
for (const t of this.levels) {
|
|
164
|
-
const
|
|
169
|
+
const i = t.level, o = this.gridLayers.get(i);
|
|
165
170
|
if (!o) continue;
|
|
166
171
|
const a = this.Cesium.Cartographic.fromDegrees(e.lon, e.lat), n = this.tilingScheme.positionToTileXY(
|
|
167
172
|
a,
|
|
168
|
-
|
|
173
|
+
i,
|
|
169
174
|
new this.Cesium.Cartesian2()
|
|
170
175
|
);
|
|
171
176
|
if (!n) continue;
|
|
@@ -178,25 +183,25 @@ class Fe {
|
|
|
178
183
|
}, o.set(l, s)), s.allPoints.push(e), e.data?.billboard?.[0]?.skipAggregation)
|
|
179
184
|
s.skipPoints.push(e);
|
|
180
185
|
else {
|
|
181
|
-
const
|
|
182
|
-
s.groups.has(
|
|
186
|
+
const d = this.groupByTheme ? e.data?.billboard?.[0]?.theme : this.clusterTheme;
|
|
187
|
+
s.groups.has(d) || s.groups.set(d, []), s.groups.get(d).push(e);
|
|
183
188
|
}
|
|
184
189
|
}
|
|
185
190
|
}
|
|
186
191
|
_update() {
|
|
187
192
|
if (!this.labelPool) return;
|
|
188
|
-
this.labelPool.reset(), this.debugCurrentGrids && this._clearDebugGrids();
|
|
193
|
+
this._syncTilingSchemeAndLevels(), this.labelPool.reset(), this.debugCurrentGrids && this._clearDebugGrids();
|
|
189
194
|
const e = this.points.length < this.minGlobalPointCount ? 1 / 0 : this.threshold;
|
|
190
195
|
let t = 0;
|
|
191
|
-
const
|
|
196
|
+
const i = (o, a, n) => {
|
|
192
197
|
if (t >= this.displayLimit || o < 0) return;
|
|
193
198
|
o >= this.levels.length && (o = this.levels.length - 1);
|
|
194
|
-
const l = this.levels[o], s = o === this.levels.length - 1,
|
|
199
|
+
const l = this.levels[o], s = o === this.levels.length - 1, d = l.level, h = this.gridLayers.get(d);
|
|
195
200
|
if (!h) return;
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
198
|
-
const
|
|
199
|
-
for (const p of
|
|
201
|
+
const c = `${a}_${n}`, g = h.get(c);
|
|
202
|
+
if (!g) return;
|
|
203
|
+
const u = this.tilingScheme.tileXYToRectangle(a, n, d), f = this.Cesium.Math.toDegrees(u.west), L = this.Cesium.Math.toDegrees(u.south), b = this.Cesium.Math.toDegrees(u.east), T = this.Cesium.Math.toDegrees(u.north), A = (f + b) / 2, k = (L + T) / 2;
|
|
204
|
+
for (const p of g.skipPoints)
|
|
200
205
|
if (p.data?.show !== !1) {
|
|
201
206
|
if (t >= this.displayLimit) break;
|
|
202
207
|
this.labelPool.add(p.data, {
|
|
@@ -209,42 +214,43 @@ class Fe {
|
|
|
209
214
|
}), t++;
|
|
210
215
|
}
|
|
211
216
|
if (t >= this.displayLimit) {
|
|
212
|
-
this.debugCurrentGrids && this._drawDebugGrid(
|
|
217
|
+
this.debugCurrentGrids && this._drawDebugGrid(f, L, b, T, c);
|
|
213
218
|
return;
|
|
214
219
|
}
|
|
215
|
-
for (const [p, B] of
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
218
|
-
let
|
|
219
|
-
if (this.centralPointMode == "firstPoint" && (
|
|
220
|
-
for (const
|
|
220
|
+
for (const [p, B] of g.groups) {
|
|
221
|
+
const C = B.filter((m) => m.data?.show !== !1);
|
|
222
|
+
if (C.length === 0) continue;
|
|
223
|
+
let S = A, E = k, y = C[0]?.height || 0;
|
|
224
|
+
if (this.centralPointMode == "firstPoint" && (S = C[0]?.lon || 0, E = C[0]?.lat || 0, y = C[0]?.height || 0), s || C.length < e)
|
|
225
|
+
for (const m of C) {
|
|
221
226
|
if (t >= this.displayLimit) break;
|
|
222
|
-
this.labelPool.add(
|
|
223
|
-
id: `point-${
|
|
224
|
-
lon:
|
|
225
|
-
lat:
|
|
226
|
-
height:
|
|
227
|
-
theme:
|
|
228
|
-
style:
|
|
227
|
+
this.labelPool.add(m.data, {
|
|
228
|
+
id: `point-${m.id}`,
|
|
229
|
+
lon: m.lon,
|
|
230
|
+
lat: m.lat,
|
|
231
|
+
height: m.height,
|
|
232
|
+
theme: m.data?.billboard?.[0]?.theme || this.pointTheme,
|
|
233
|
+
style: m.style
|
|
229
234
|
}), t++;
|
|
230
235
|
}
|
|
231
236
|
else {
|
|
232
237
|
if (t >= this.displayLimit) break;
|
|
233
|
-
const
|
|
238
|
+
const v = C[0]?.data?.billboard?.[0]?.theme || this.clusterTheme, P = this.groupByTheme ? `cluster-${o}-${a}-${n}-${p}` : `cluster-${o}-${a}-${n}`;
|
|
234
239
|
this.labelPool.add(
|
|
235
240
|
{
|
|
236
|
-
id:
|
|
237
|
-
billboard:
|
|
238
|
-
count:
|
|
239
|
-
gridKey:
|
|
240
|
-
points:
|
|
241
|
+
id: P,
|
|
242
|
+
billboard: C[0]?.data?.billboard || [],
|
|
243
|
+
count: C.length,
|
|
244
|
+
gridKey: c,
|
|
245
|
+
points: C,
|
|
241
246
|
aggregationGroup: p
|
|
242
247
|
},
|
|
243
248
|
{
|
|
244
|
-
id:
|
|
245
|
-
lon:
|
|
246
|
-
lat:
|
|
247
|
-
|
|
249
|
+
id: P,
|
|
250
|
+
lon: S,
|
|
251
|
+
lat: E,
|
|
252
|
+
height: y,
|
|
253
|
+
theme: v
|
|
248
254
|
}
|
|
249
255
|
), t++;
|
|
250
256
|
}
|
|
@@ -252,8 +258,8 @@ class Fe {
|
|
|
252
258
|
if (this.debugCurrentGrids) {
|
|
253
259
|
const p = this.levels[o].level;
|
|
254
260
|
this._drawDebugGrid(
|
|
255
|
-
|
|
256
|
-
|
|
261
|
+
f,
|
|
262
|
+
L,
|
|
257
263
|
b,
|
|
258
264
|
T,
|
|
259
265
|
`L:${p} X:${a} Y:${n}`
|
|
@@ -281,47 +287,47 @@ class Fe {
|
|
|
281
287
|
this._tilesRetryCount = 0;
|
|
282
288
|
const l = /* @__PURE__ */ new Set();
|
|
283
289
|
for (const s of n) {
|
|
284
|
-
const
|
|
285
|
-
if (!
|
|
286
|
-
let
|
|
287
|
-
if (
|
|
290
|
+
const d = s.rectangle, h = s._level ?? s.level;
|
|
291
|
+
if (!d || typeof h != "number") continue;
|
|
292
|
+
let c = this.levelIndexByTileLevel.get(h);
|
|
293
|
+
if (c === void 0) {
|
|
288
294
|
if (this.levels.length === 0) continue;
|
|
289
|
-
const
|
|
290
|
-
if (h >
|
|
291
|
-
|
|
292
|
-
else if (h <
|
|
293
|
-
|
|
295
|
+
const y = this.levels[0].level, m = this.levels[this.levels.length - 1].level;
|
|
296
|
+
if (h > m)
|
|
297
|
+
c = this.levels.length - 1;
|
|
298
|
+
else if (h < y)
|
|
299
|
+
c = 0;
|
|
294
300
|
else {
|
|
295
|
-
let
|
|
301
|
+
let v = 0, P = 1 / 0;
|
|
296
302
|
for (let M = 0; M < this.levels.length; M++) {
|
|
297
303
|
const U = Math.abs(this.levels[M].level - h);
|
|
298
|
-
U <
|
|
304
|
+
U < P && (P = U, v = M);
|
|
299
305
|
}
|
|
300
|
-
|
|
306
|
+
c = v;
|
|
301
307
|
}
|
|
302
308
|
}
|
|
303
|
-
if (
|
|
304
|
-
const
|
|
305
|
-
if (typeof
|
|
306
|
-
let
|
|
307
|
-
const
|
|
308
|
-
if (
|
|
309
|
-
const M = 1 <<
|
|
310
|
-
|
|
311
|
-
} else if (
|
|
312
|
-
const M = 1 << -
|
|
313
|
-
|
|
309
|
+
if (c === void 0) continue;
|
|
310
|
+
const g = this.levels[c].level, u = s._x ?? s.x, f = s._y ?? s.y;
|
|
311
|
+
if (typeof u == "number" && typeof f == "number") {
|
|
312
|
+
let y = u, m = f;
|
|
313
|
+
const v = h - g;
|
|
314
|
+
if (v > 0) {
|
|
315
|
+
const M = 1 << v;
|
|
316
|
+
y = Math.floor(u / M), m = Math.floor(f / M);
|
|
317
|
+
} else if (v < 0) {
|
|
318
|
+
const M = 1 << -v;
|
|
319
|
+
y = u * M, m = f * M;
|
|
314
320
|
}
|
|
315
|
-
const
|
|
316
|
-
if (l.has(
|
|
317
|
-
l.add(
|
|
321
|
+
const P = `${g}_${y}_${m}`;
|
|
322
|
+
if (l.has(P)) continue;
|
|
323
|
+
l.add(P), i(c, y, m);
|
|
318
324
|
continue;
|
|
319
325
|
}
|
|
320
|
-
const b = this.levels[
|
|
321
|
-
for (let
|
|
322
|
-
for (let
|
|
323
|
-
const
|
|
324
|
-
l.has(
|
|
326
|
+
const b = this.levels[c].size, T = this.Cesium.Math.toDegrees(d.west), A = this.Cesium.Math.toDegrees(d.east), k = this.Cesium.Math.toDegrees(d.south), p = this.Cesium.Math.toDegrees(d.north), B = Math.floor((T - -180) / b), C = Math.floor((A - -180) / b), S = Math.floor((k - -90) / b), E = Math.floor((p - -90) / b);
|
|
327
|
+
for (let y = B; y <= C; y++)
|
|
328
|
+
for (let m = S; m <= E; m++) {
|
|
329
|
+
const v = `${g}_${y}_${m}`;
|
|
330
|
+
l.has(v) || (l.add(v), i(c, y, m));
|
|
325
331
|
}
|
|
326
332
|
}
|
|
327
333
|
} catch {
|
|
@@ -333,8 +339,8 @@ class Fe {
|
|
|
333
339
|
refresh() {
|
|
334
340
|
this._update();
|
|
335
341
|
}
|
|
336
|
-
_drawDebugGrid(e, t,
|
|
337
|
-
const n = this.Cesium.Rectangle.fromDegrees(e, t,
|
|
342
|
+
_drawDebugGrid(e, t, i, o, a) {
|
|
343
|
+
const n = this.Cesium.Rectangle.fromDegrees(e, t, i, o), l = this.viewer.entities.add({
|
|
338
344
|
rectangle: {
|
|
339
345
|
coordinates: n,
|
|
340
346
|
material: this.Cesium.Color.YELLOW.withAlpha(0.2),
|
|
@@ -367,187 +373,187 @@ class Fe {
|
|
|
367
373
|
}
|
|
368
374
|
}
|
|
369
375
|
var Ne = "[object Symbol]";
|
|
370
|
-
function N(
|
|
371
|
-
return typeof
|
|
376
|
+
function N(r) {
|
|
377
|
+
return typeof r == "symbol" || F(r) && ie(r) == Ne;
|
|
372
378
|
}
|
|
373
|
-
function he(
|
|
374
|
-
for (var t = -1,
|
|
375
|
-
o[t] = e(
|
|
379
|
+
function he(r, e) {
|
|
380
|
+
for (var t = -1, i = r == null ? 0 : r.length, o = Array(i); ++t < i; )
|
|
381
|
+
o[t] = e(r[t], t, r);
|
|
376
382
|
return o;
|
|
377
383
|
}
|
|
378
|
-
var
|
|
379
|
-
function ce(
|
|
380
|
-
if (typeof
|
|
381
|
-
return
|
|
382
|
-
if (
|
|
383
|
-
return he(
|
|
384
|
-
if (N(
|
|
385
|
-
return
|
|
386
|
-
var e =
|
|
387
|
-
return e == "0" && 1 /
|
|
384
|
+
var J = O ? O.prototype : void 0, Q = J ? J.toString : void 0;
|
|
385
|
+
function ce(r) {
|
|
386
|
+
if (typeof r == "string")
|
|
387
|
+
return r;
|
|
388
|
+
if (_(r))
|
|
389
|
+
return he(r, ce) + "";
|
|
390
|
+
if (N(r))
|
|
391
|
+
return Q ? Q.call(r) : "";
|
|
392
|
+
var e = r + "";
|
|
393
|
+
return e == "0" && 1 / r == -1 / 0 ? "-0" : e;
|
|
388
394
|
}
|
|
389
|
-
function de(
|
|
390
|
-
return
|
|
395
|
+
function de(r) {
|
|
396
|
+
return r;
|
|
391
397
|
}
|
|
392
|
-
function We(
|
|
398
|
+
function We(r, e, t) {
|
|
393
399
|
switch (t.length) {
|
|
394
400
|
case 0:
|
|
395
|
-
return
|
|
401
|
+
return r.call(e);
|
|
396
402
|
case 1:
|
|
397
|
-
return
|
|
403
|
+
return r.call(e, t[0]);
|
|
398
404
|
case 2:
|
|
399
|
-
return
|
|
405
|
+
return r.call(e, t[0], t[1]);
|
|
400
406
|
case 3:
|
|
401
|
-
return
|
|
407
|
+
return r.call(e, t[0], t[1], t[2]);
|
|
402
408
|
}
|
|
403
|
-
return
|
|
409
|
+
return r.apply(e, t);
|
|
404
410
|
}
|
|
405
411
|
var Ve = 800, Ue = 16, Ye = Date.now;
|
|
406
|
-
function Xe(
|
|
412
|
+
function Xe(r) {
|
|
407
413
|
var e = 0, t = 0;
|
|
408
414
|
return function() {
|
|
409
|
-
var
|
|
410
|
-
if (t =
|
|
415
|
+
var i = Ye(), o = Ue - (i - t);
|
|
416
|
+
if (t = i, o > 0) {
|
|
411
417
|
if (++e >= Ve)
|
|
412
418
|
return arguments[0];
|
|
413
419
|
} else
|
|
414
420
|
e = 0;
|
|
415
|
-
return
|
|
421
|
+
return r.apply(void 0, arguments);
|
|
416
422
|
};
|
|
417
423
|
}
|
|
418
|
-
function qe(
|
|
424
|
+
function qe(r) {
|
|
419
425
|
return function() {
|
|
420
|
-
return
|
|
426
|
+
return r;
|
|
421
427
|
};
|
|
422
428
|
}
|
|
423
|
-
var Ze =
|
|
424
|
-
return
|
|
429
|
+
var Ze = j ? function(r, e) {
|
|
430
|
+
return j(r, "toString", {
|
|
425
431
|
configurable: !0,
|
|
426
432
|
enumerable: !1,
|
|
427
433
|
value: qe(e),
|
|
428
434
|
writable: !0
|
|
429
435
|
});
|
|
430
436
|
} : de, ge = Xe(Ze), ee = Math.max;
|
|
431
|
-
function ue(
|
|
432
|
-
return e = ee(e === void 0 ?
|
|
433
|
-
for (var
|
|
434
|
-
n[o] =
|
|
437
|
+
function ue(r, e, t) {
|
|
438
|
+
return e = ee(e === void 0 ? r.length - 1 : e, 0), function() {
|
|
439
|
+
for (var i = arguments, o = -1, a = ee(i.length - e, 0), n = Array(a); ++o < a; )
|
|
440
|
+
n[o] = i[e + o];
|
|
435
441
|
o = -1;
|
|
436
442
|
for (var l = Array(e + 1); ++o < e; )
|
|
437
|
-
l[o] =
|
|
438
|
-
return l[e] = t(n), We(
|
|
443
|
+
l[o] = i[o];
|
|
444
|
+
return l[e] = t(n), We(r, this, l);
|
|
439
445
|
};
|
|
440
446
|
}
|
|
441
|
-
function
|
|
442
|
-
return ge(ue(
|
|
447
|
+
function je(r, e) {
|
|
448
|
+
return ge(ue(r, e, de), r + "");
|
|
443
449
|
}
|
|
444
|
-
function
|
|
445
|
-
if (!
|
|
450
|
+
function Je(r, e, t) {
|
|
451
|
+
if (!K(t))
|
|
446
452
|
return !1;
|
|
447
|
-
var
|
|
448
|
-
return (
|
|
453
|
+
var i = typeof e;
|
|
454
|
+
return (i == "number" ? re(t) && Se(e, t.length) : i == "string" && e in t) ? ae(t[e], r) : !1;
|
|
449
455
|
}
|
|
450
|
-
function
|
|
451
|
-
return
|
|
452
|
-
var
|
|
453
|
-
for (a =
|
|
454
|
-
var l = t[
|
|
455
|
-
l &&
|
|
456
|
+
function Qe(r) {
|
|
457
|
+
return je(function(e, t) {
|
|
458
|
+
var i = -1, o = t.length, a = o > 1 ? t[o - 1] : void 0, n = o > 2 ? t[2] : void 0;
|
|
459
|
+
for (a = r.length > 3 && typeof a == "function" ? (o--, a) : void 0, n && Je(t[0], t[1], n) && (a = o < 3 ? void 0 : a, o = 1), e = Object(e); ++i < o; ) {
|
|
460
|
+
var l = t[i];
|
|
461
|
+
l && r(e, l, i, a);
|
|
456
462
|
}
|
|
457
463
|
return e;
|
|
458
464
|
});
|
|
459
465
|
}
|
|
460
466
|
var et = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, tt = /^\w*$/;
|
|
461
|
-
function
|
|
462
|
-
if (
|
|
467
|
+
function it(r, e) {
|
|
468
|
+
if (_(r))
|
|
463
469
|
return !1;
|
|
464
|
-
var t = typeof
|
|
465
|
-
return t == "number" || t == "symbol" || t == "boolean" ||
|
|
470
|
+
var t = typeof r;
|
|
471
|
+
return t == "number" || t == "symbol" || t == "boolean" || r == null || N(r) ? !0 : tt.test(r) || !et.test(r) || e != null && r in Object(e);
|
|
466
472
|
}
|
|
467
|
-
var
|
|
468
|
-
function W(
|
|
469
|
-
if (typeof
|
|
470
|
-
throw new TypeError(
|
|
473
|
+
var rt = "Expected a function";
|
|
474
|
+
function W(r, e) {
|
|
475
|
+
if (typeof r != "function" || e != null && typeof e != "function")
|
|
476
|
+
throw new TypeError(rt);
|
|
471
477
|
var t = function() {
|
|
472
|
-
var
|
|
478
|
+
var i = arguments, o = e ? e.apply(this, i) : i[0], a = t.cache;
|
|
473
479
|
if (a.has(o))
|
|
474
480
|
return a.get(o);
|
|
475
|
-
var n =
|
|
481
|
+
var n = r.apply(this, i);
|
|
476
482
|
return t.cache = a.set(o, n) || a, n;
|
|
477
483
|
};
|
|
478
484
|
return t.cache = new (W.Cache || oe)(), t;
|
|
479
485
|
}
|
|
480
486
|
W.Cache = oe;
|
|
481
487
|
var at = 500;
|
|
482
|
-
function ot(
|
|
483
|
-
var e = W(
|
|
484
|
-
return t.size === at && t.clear(),
|
|
488
|
+
function ot(r) {
|
|
489
|
+
var e = W(r, function(i) {
|
|
490
|
+
return t.size === at && t.clear(), i;
|
|
485
491
|
}), t = e.cache;
|
|
486
492
|
return e;
|
|
487
493
|
}
|
|
488
|
-
var nt = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, st = /\\(\\)?/g, lt = ot(function(
|
|
494
|
+
var nt = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, st = /\\(\\)?/g, lt = ot(function(r) {
|
|
489
495
|
var e = [];
|
|
490
|
-
return
|
|
491
|
-
e.push(o ? a.replace(st, "$1") :
|
|
496
|
+
return r.charCodeAt(0) === 46 && e.push(""), r.replace(nt, function(t, i, o, a) {
|
|
497
|
+
e.push(o ? a.replace(st, "$1") : i || t);
|
|
492
498
|
}), e;
|
|
493
499
|
});
|
|
494
|
-
function ht(
|
|
495
|
-
return
|
|
500
|
+
function ht(r) {
|
|
501
|
+
return r == null ? "" : ce(r);
|
|
496
502
|
}
|
|
497
|
-
function V(
|
|
498
|
-
return
|
|
503
|
+
function V(r, e) {
|
|
504
|
+
return _(r) ? r : it(r, e) ? [r] : lt(ht(r));
|
|
499
505
|
}
|
|
500
|
-
function fe(
|
|
501
|
-
if (typeof
|
|
502
|
-
return
|
|
503
|
-
var e =
|
|
504
|
-
return e == "0" && 1 /
|
|
506
|
+
function fe(r) {
|
|
507
|
+
if (typeof r == "string" || N(r))
|
|
508
|
+
return r;
|
|
509
|
+
var e = r + "";
|
|
510
|
+
return e == "0" && 1 / r == -1 / 0 ? "-0" : e;
|
|
505
511
|
}
|
|
506
|
-
function ct(
|
|
507
|
-
e = V(e,
|
|
508
|
-
for (var t = 0,
|
|
509
|
-
|
|
510
|
-
return t && t ==
|
|
512
|
+
function ct(r, e) {
|
|
513
|
+
e = V(e, r);
|
|
514
|
+
for (var t = 0, i = e.length; r != null && t < i; )
|
|
515
|
+
r = r[fe(e[t++])];
|
|
516
|
+
return t && t == i ? r : void 0;
|
|
511
517
|
}
|
|
512
518
|
var te = O ? O.isConcatSpreadable : void 0;
|
|
513
|
-
function dt(
|
|
514
|
-
return
|
|
519
|
+
function dt(r) {
|
|
520
|
+
return _(r) || H(r) || !!(te && r && r[te]);
|
|
515
521
|
}
|
|
516
|
-
function gt(
|
|
517
|
-
var a = -1, n =
|
|
522
|
+
function gt(r, e, t, i, o) {
|
|
523
|
+
var a = -1, n = r.length;
|
|
518
524
|
for (t || (t = dt), o || (o = []); ++a < n; ) {
|
|
519
|
-
var l =
|
|
520
|
-
t(l) ?
|
|
525
|
+
var l = r[a];
|
|
526
|
+
t(l) ? Ee(o, l) : o[o.length] = l;
|
|
521
527
|
}
|
|
522
528
|
return o;
|
|
523
529
|
}
|
|
524
|
-
function ut(
|
|
525
|
-
var e =
|
|
526
|
-
return e ? gt(
|
|
530
|
+
function ut(r) {
|
|
531
|
+
var e = r == null ? 0 : r.length;
|
|
532
|
+
return e ? gt(r) : [];
|
|
527
533
|
}
|
|
528
|
-
function ft(
|
|
529
|
-
return ge(ue(
|
|
534
|
+
function ft(r) {
|
|
535
|
+
return ge(ue(r, void 0, ut), r + "");
|
|
530
536
|
}
|
|
531
537
|
var mt = "[object Object]", pt = Function.prototype, yt = Object.prototype, me = pt.toString, Ct = yt.hasOwnProperty, vt = me.call(Object);
|
|
532
|
-
function pe(
|
|
533
|
-
if (!
|
|
538
|
+
function pe(r) {
|
|
539
|
+
if (!F(r) || ie(r) != mt)
|
|
534
540
|
return !1;
|
|
535
|
-
var e =
|
|
541
|
+
var e = Ge(r);
|
|
536
542
|
if (e === null)
|
|
537
543
|
return !0;
|
|
538
544
|
var t = Ct.call(e, "constructor") && e.constructor;
|
|
539
545
|
return typeof t == "function" && t instanceof t && me.call(t) == vt;
|
|
540
546
|
}
|
|
541
|
-
function bt(
|
|
542
|
-
var
|
|
547
|
+
function bt(r, e, t) {
|
|
548
|
+
var i = -1, o = r.length;
|
|
543
549
|
e < 0 && (e = -e > o ? 0 : o + e), t = t > o ? o : t, t < 0 && (t += o), o = e > t ? 0 : t - e >>> 0, e >>>= 0;
|
|
544
|
-
for (var a = Array(o); ++
|
|
545
|
-
a[
|
|
550
|
+
for (var a = Array(o); ++i < o; )
|
|
551
|
+
a[i] = r[i + e];
|
|
546
552
|
return a;
|
|
547
553
|
}
|
|
548
|
-
function Mt(
|
|
549
|
-
return function(e, t,
|
|
550
|
-
for (var o = -1, a = Object(e), n =
|
|
554
|
+
function Mt(r) {
|
|
555
|
+
return function(e, t, i) {
|
|
556
|
+
for (var o = -1, a = Object(e), n = i(e), l = n.length; l--; ) {
|
|
551
557
|
var s = n[++o];
|
|
552
558
|
if (t(a[s], s, a) === !1)
|
|
553
559
|
break;
|
|
@@ -555,77 +561,94 @@ function Mt(i) {
|
|
|
555
561
|
return e;
|
|
556
562
|
};
|
|
557
563
|
}
|
|
558
|
-
var
|
|
559
|
-
function
|
|
560
|
-
(t !== void 0 && !ae(
|
|
564
|
+
var _t = Mt();
|
|
565
|
+
function R(r, e, t) {
|
|
566
|
+
(t !== void 0 && !ae(r[e], t) || t === void 0 && !(e in r)) && De(r, e, t);
|
|
561
567
|
}
|
|
562
|
-
function Pt(
|
|
563
|
-
return
|
|
568
|
+
function Pt(r) {
|
|
569
|
+
return F(r) && re(r);
|
|
564
570
|
}
|
|
565
|
-
function
|
|
566
|
-
if (!(e === "constructor" && typeof
|
|
567
|
-
return
|
|
571
|
+
function z(r, e) {
|
|
572
|
+
if (!(e === "constructor" && typeof r[e] == "function") && e != "__proto__")
|
|
573
|
+
return r[e];
|
|
568
574
|
}
|
|
569
|
-
function
|
|
570
|
-
return ne(
|
|
575
|
+
function Lt(r) {
|
|
576
|
+
return ne(r, se(r));
|
|
571
577
|
}
|
|
572
|
-
function
|
|
573
|
-
var l =
|
|
574
|
-
if (
|
|
575
|
-
|
|
578
|
+
function Tt(r, e, t, i, o, a, n) {
|
|
579
|
+
var l = z(r, t), s = z(e, t), d = n.get(s);
|
|
580
|
+
if (d) {
|
|
581
|
+
R(r, t, d);
|
|
576
582
|
return;
|
|
577
583
|
}
|
|
578
|
-
var h = a ? a(l, s, t + "",
|
|
579
|
-
if (
|
|
580
|
-
var
|
|
581
|
-
h = s,
|
|
584
|
+
var h = a ? a(l, s, t + "", r, e, n) : void 0, c = h === void 0;
|
|
585
|
+
if (c) {
|
|
586
|
+
var g = _(s), u = !g && Ie(s), f = !g && !u && Oe(s);
|
|
587
|
+
h = s, g || u || f ? _(l) ? h = l : Pt(l) ? h = Ae(l) : u ? (c = !1, h = ke(s, !0)) : f ? (c = !1, h = Be(s, !0)) : h = [] : pe(s) || H(s) ? (h = l, H(l) ? h = Lt(l) : (!K(l) || le(l)) && (h = $e(s))) : c = !1;
|
|
582
588
|
}
|
|
583
|
-
|
|
589
|
+
c && (n.set(s, h), o(h, s, i, a, n), n.delete(s)), R(r, t, h);
|
|
584
590
|
}
|
|
585
|
-
function ye(
|
|
586
|
-
|
|
587
|
-
if (o || (o = new He()),
|
|
588
|
-
|
|
591
|
+
function ye(r, e, t, i, o) {
|
|
592
|
+
r !== e && _t(e, function(a, n) {
|
|
593
|
+
if (o || (o = new He()), K(a))
|
|
594
|
+
Tt(r, e, n, t, ye, i, o);
|
|
589
595
|
else {
|
|
590
|
-
var l =
|
|
591
|
-
l === void 0 && (l = a),
|
|
596
|
+
var l = i ? i(z(r, n), a, n + "", r, e, o) : void 0;
|
|
597
|
+
l === void 0 && (l = a), R(r, n, l);
|
|
592
598
|
}
|
|
593
599
|
}, se);
|
|
594
600
|
}
|
|
595
|
-
function wt(
|
|
596
|
-
var e =
|
|
597
|
-
return e ?
|
|
601
|
+
function wt(r) {
|
|
602
|
+
var e = r == null ? 0 : r.length;
|
|
603
|
+
return e ? r[e - 1] : void 0;
|
|
598
604
|
}
|
|
599
|
-
function xt(
|
|
600
|
-
return e.length < 2 ?
|
|
605
|
+
function xt(r, e) {
|
|
606
|
+
return e.length < 2 ? r : ct(r, bt(e, 0, -1));
|
|
601
607
|
}
|
|
602
|
-
var
|
|
603
|
-
ye(
|
|
604
|
-
});
|
|
605
|
-
function
|
|
606
|
-
|
|
608
|
+
var St = Qe(function(r, e, t) {
|
|
609
|
+
ye(r, e, t);
|
|
610
|
+
}), Et = Object.prototype, Gt = Et.hasOwnProperty;
|
|
611
|
+
function Dt(r, e) {
|
|
612
|
+
e = V(e, r);
|
|
613
|
+
var t = -1, i = e.length;
|
|
614
|
+
if (!i)
|
|
615
|
+
return !0;
|
|
616
|
+
for (var o = r == null || typeof r != "object" && typeof r != "function"; ++t < i; ) {
|
|
617
|
+
var a = e[t];
|
|
618
|
+
if (typeof a == "string") {
|
|
619
|
+
if (a === "__proto__" && !Gt.call(r, "__proto__"))
|
|
620
|
+
return !1;
|
|
621
|
+
if (a === "constructor" && t + 1 < i && typeof e[t + 1] == "string" && e[t + 1] === "prototype") {
|
|
622
|
+
if (o && t === 0)
|
|
623
|
+
continue;
|
|
624
|
+
return !1;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
var n = xt(r, e);
|
|
629
|
+
return n == null || delete n[fe(wt(e))];
|
|
607
630
|
}
|
|
608
|
-
function
|
|
609
|
-
return pe(
|
|
631
|
+
function It(r) {
|
|
632
|
+
return pe(r) ? void 0 : r;
|
|
610
633
|
}
|
|
611
|
-
var
|
|
634
|
+
var Ot = 1, At = 2, kt = 4, Bt = ft(function(r, e) {
|
|
612
635
|
var t = {};
|
|
613
|
-
if (
|
|
636
|
+
if (r == null)
|
|
614
637
|
return t;
|
|
615
|
-
var
|
|
638
|
+
var i = !1;
|
|
616
639
|
e = he(e, function(a) {
|
|
617
|
-
return a = V(a,
|
|
618
|
-
}), ne(
|
|
640
|
+
return a = V(a, r), i || (i = a.length > 1), a;
|
|
641
|
+
}), ne(r, Re(r), t), i && (t = ze(t, Ot | At | kt, It));
|
|
619
642
|
for (var o = e.length; o--; )
|
|
620
|
-
|
|
643
|
+
Dt(t, e[o]);
|
|
621
644
|
return t;
|
|
622
645
|
});
|
|
623
|
-
function
|
|
646
|
+
function $t(r, e) {
|
|
624
647
|
const t = e.materialType || "DynamicImgMaterial" + Date.now() + Math.floor(Math.random() * 1e3);
|
|
625
|
-
function
|
|
626
|
-
this._definitionChanged = new
|
|
648
|
+
function i(a) {
|
|
649
|
+
this._definitionChanged = new r.Event(), this._color = a.color, this._colorSubscription = void 0, this.color = a.color, this.duration = a.duration, this._time = Date.now();
|
|
627
650
|
}
|
|
628
|
-
Object.defineProperties(
|
|
651
|
+
Object.defineProperties(i.prototype, {
|
|
629
652
|
isConstant: {
|
|
630
653
|
get() {
|
|
631
654
|
return !1;
|
|
@@ -636,18 +659,18 @@ function kt(i, e) {
|
|
|
636
659
|
return this._definitionChanged;
|
|
637
660
|
}
|
|
638
661
|
},
|
|
639
|
-
color:
|
|
640
|
-
}),
|
|
662
|
+
color: r.createPropertyDescriptor("color")
|
|
663
|
+
}), i.prototype.getType = function() {
|
|
641
664
|
return t;
|
|
642
|
-
},
|
|
643
|
-
return
|
|
665
|
+
}, i.prototype.getValue = function(a, n) {
|
|
666
|
+
return r.defined(n) || (n = {}), n.color = r.Property.getValueOrClonedDefault(
|
|
644
667
|
this._color,
|
|
645
668
|
a,
|
|
646
|
-
|
|
669
|
+
r.Color.WHITE,
|
|
647
670
|
n.color
|
|
648
671
|
), n.image = e.image, n;
|
|
649
|
-
},
|
|
650
|
-
return this === a || a instanceof
|
|
672
|
+
}, i.prototype.equals = function(a) {
|
|
673
|
+
return this === a || a instanceof i && r.Property.equals(this._color, a._color);
|
|
651
674
|
};
|
|
652
675
|
const o = function(a) {
|
|
653
676
|
return `
|
|
@@ -662,7 +685,7 @@ function kt(i, e) {
|
|
|
662
685
|
return material;
|
|
663
686
|
}`;
|
|
664
687
|
};
|
|
665
|
-
return
|
|
688
|
+
return r.Material._materialCache.addMaterial(t, {
|
|
666
689
|
fabric: {
|
|
667
690
|
type: t,
|
|
668
691
|
uniforms: {
|
|
@@ -681,14 +704,14 @@ function kt(i, e) {
|
|
|
681
704
|
translucent() {
|
|
682
705
|
return !0;
|
|
683
706
|
}
|
|
684
|
-
}), new
|
|
707
|
+
}), new i(e);
|
|
685
708
|
}
|
|
686
|
-
function Ce(
|
|
709
|
+
function Ce(r, e) {
|
|
687
710
|
const t = e.MaterialType || "wallType" + (/* @__PURE__ */ new Date()).getTime() + parseInt(Math.random() * 1e3 + "");
|
|
688
|
-
function
|
|
689
|
-
this._definitionChanged = new
|
|
711
|
+
function i(a) {
|
|
712
|
+
this._definitionChanged = new r.Event(), this._color = void 0, this._colorSubscription = void 0, this.color = a.color, this.duration = a.duration, this._time = (/* @__PURE__ */ new Date()).getTime();
|
|
690
713
|
}
|
|
691
|
-
Object.defineProperties(
|
|
714
|
+
Object.defineProperties(i.prototype, {
|
|
692
715
|
isConstant: {
|
|
693
716
|
get: function() {
|
|
694
717
|
return !1;
|
|
@@ -699,13 +722,13 @@ function Ce(i, e) {
|
|
|
699
722
|
return this._definitionChanged;
|
|
700
723
|
}
|
|
701
724
|
},
|
|
702
|
-
color:
|
|
703
|
-
}),
|
|
725
|
+
color: r.createPropertyDescriptor("color")
|
|
726
|
+
}), i.prototype.getType = function() {
|
|
704
727
|
return t;
|
|
705
|
-
},
|
|
706
|
-
return
|
|
707
|
-
},
|
|
708
|
-
return this === a || a instanceof
|
|
728
|
+
}, i.prototype.getValue = function(a, n) {
|
|
729
|
+
return r.defined(n) || (n = {}), n.image = e.image, this.duration && (n.time = ((/* @__PURE__ */ new Date()).getTime() - this._time) % this.duration / this.duration), n;
|
|
730
|
+
}, i.prototype.equals = function(a) {
|
|
731
|
+
return this === a || a instanceof i && r.Property.equals(this._color, a._color);
|
|
709
732
|
};
|
|
710
733
|
const o = function(a) {
|
|
711
734
|
let n = `czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
@@ -727,11 +750,11 @@ function Ce(i, e) {
|
|
|
727
750
|
}
|
|
728
751
|
`, n;
|
|
729
752
|
};
|
|
730
|
-
return
|
|
753
|
+
return r.Material._materialCache.addMaterial(t, {
|
|
731
754
|
fabric: {
|
|
732
755
|
type: t,
|
|
733
756
|
uniforms: {
|
|
734
|
-
color: new
|
|
757
|
+
color: new r.Color(1, 0, 0, 0.5),
|
|
735
758
|
image: e.image,
|
|
736
759
|
time: 0
|
|
737
760
|
},
|
|
@@ -744,15 +767,15 @@ function Ce(i, e) {
|
|
|
744
767
|
translucent: function() {
|
|
745
768
|
return !0;
|
|
746
769
|
}
|
|
747
|
-
}), new
|
|
770
|
+
}), new i(e);
|
|
748
771
|
}
|
|
749
|
-
function
|
|
750
|
-
const t =
|
|
751
|
-
let
|
|
752
|
-
function c
|
|
753
|
-
|
|
772
|
+
function Ht(r, e) {
|
|
773
|
+
const t = r.Color, i = Object.defineProperties, o = r.Event, a = r.createPropertyDescriptor, n = r.Property, l = (c, g) => c === void 0 ? g : c, s = {};
|
|
774
|
+
let d = e.materialType || "PolylineFlow" + Date.now() + Math.floor(Math.random() * 1e3);
|
|
775
|
+
function h(c) {
|
|
776
|
+
c = l(c, s), this._definitionChanged = new o(), this._color = void 0, this._colorSubscription = void 0, this.color = c.color || t.fromBytes(0, 255, 255, 255), this._duration = void 0, this._durationSubscription = void 0, this.duration = l(c.duration, 45);
|
|
754
777
|
}
|
|
755
|
-
return
|
|
778
|
+
return i(h.prototype, {
|
|
756
779
|
isConstant: {
|
|
757
780
|
get() {
|
|
758
781
|
return !1;
|
|
@@ -763,23 +786,23 @@ function Bt(i, e) {
|
|
|
763
786
|
return this._definitionChanged;
|
|
764
787
|
}
|
|
765
788
|
}
|
|
766
|
-
}),
|
|
767
|
-
return
|
|
768
|
-
},
|
|
769
|
-
return
|
|
789
|
+
}), h.prototype.getType = function(c) {
|
|
790
|
+
return d;
|
|
791
|
+
}, h.prototype.getValue = function(c, g) {
|
|
792
|
+
return g || (g = {}), g.color = n.getValueOrClonedDefault(
|
|
770
793
|
this._color,
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
),
|
|
775
|
-
},
|
|
776
|
-
return this ===
|
|
777
|
-
},
|
|
778
|
-
color:
|
|
779
|
-
duration:
|
|
780
|
-
}),
|
|
794
|
+
c,
|
|
795
|
+
r.Color.WHITE,
|
|
796
|
+
g.color
|
|
797
|
+
), g.duration = this._duration, g;
|
|
798
|
+
}, h.prototype.equals = function(c) {
|
|
799
|
+
return this === c || c instanceof h && n.equals(this._color, c._color);
|
|
800
|
+
}, i(h.prototype, {
|
|
801
|
+
color: a("color"),
|
|
802
|
+
duration: a("duration")
|
|
803
|
+
}), r.PolylineFlowMaterialProperty = h, r.Material._materialCache.addMaterial(d, {
|
|
781
804
|
fabric: {
|
|
782
|
-
type:
|
|
805
|
+
type: d,
|
|
783
806
|
uniforms: {
|
|
784
807
|
color: new t(1, 1, 1, 1),
|
|
785
808
|
duration: 45
|
|
@@ -807,7 +830,7 @@ function Bt(i, e) {
|
|
|
807
830
|
translucent() {
|
|
808
831
|
return !0;
|
|
809
832
|
}
|
|
810
|
-
}), new
|
|
833
|
+
}), new h(e);
|
|
811
834
|
}
|
|
812
835
|
class ve {
|
|
813
836
|
categoryMap = /* @__PURE__ */ new Map();
|
|
@@ -822,7 +845,7 @@ class ve {
|
|
|
822
845
|
* 注册材质
|
|
823
846
|
*/
|
|
824
847
|
register(e) {
|
|
825
|
-
const { themeKey: t, material:
|
|
848
|
+
const { themeKey: t, material: i, force: o = !1, category: a = "default" } = e;
|
|
826
849
|
this.categoryMap.has(a) || this.categoryMap.set(a, /* @__PURE__ */ new Map());
|
|
827
850
|
const n = this.categoryMap.get(a);
|
|
828
851
|
if (n.has(t))
|
|
@@ -834,7 +857,7 @@ class ve {
|
|
|
834
857
|
);
|
|
835
858
|
return;
|
|
836
859
|
}
|
|
837
|
-
n.set(t,
|
|
860
|
+
n.set(t, i);
|
|
838
861
|
}
|
|
839
862
|
/**
|
|
840
863
|
* 获取材质
|
|
@@ -842,12 +865,12 @@ class ve {
|
|
|
842
865
|
get({
|
|
843
866
|
themeKey: e,
|
|
844
867
|
category: t,
|
|
845
|
-
options:
|
|
868
|
+
options: i
|
|
846
869
|
}) {
|
|
847
870
|
return t = t || "default", this.CategoryGet[t] ? this.CategoryGet[t]({
|
|
848
871
|
themeKey: e,
|
|
849
872
|
materialMap: this.categoryMap,
|
|
850
|
-
options:
|
|
873
|
+
options: i || {}
|
|
851
874
|
}) : this.categoryMap.get(t)?.get(e);
|
|
852
875
|
}
|
|
853
876
|
/**
|
|
@@ -860,10 +883,10 @@ class ve {
|
|
|
860
883
|
* 移除材质
|
|
861
884
|
*/
|
|
862
885
|
remove(e, t = "default") {
|
|
863
|
-
const
|
|
864
|
-
if (!
|
|
865
|
-
const o =
|
|
866
|
-
o?.destroy && o.destroy(),
|
|
886
|
+
const i = this.categoryMap.get(t);
|
|
887
|
+
if (!i) return;
|
|
888
|
+
const o = i.get(e);
|
|
889
|
+
o?.destroy && o.destroy(), i.delete(e), i.size === 0 && this.categoryMap.delete(t);
|
|
867
890
|
}
|
|
868
891
|
/**
|
|
869
892
|
* 获取某分类下的所有 keys
|
|
@@ -877,8 +900,8 @@ class ve {
|
|
|
877
900
|
clearCategory(e = "default") {
|
|
878
901
|
const t = this.categoryMap.get(e);
|
|
879
902
|
if (t) {
|
|
880
|
-
for (const
|
|
881
|
-
|
|
903
|
+
for (const i of t.values())
|
|
904
|
+
i?.destroy?.();
|
|
882
905
|
t.clear(), this.categoryMap.delete(e);
|
|
883
906
|
}
|
|
884
907
|
}
|
|
@@ -898,7 +921,7 @@ class ve {
|
|
|
898
921
|
return [...this.categoryMap.keys()];
|
|
899
922
|
}
|
|
900
923
|
}
|
|
901
|
-
class
|
|
924
|
+
class Rt {
|
|
902
925
|
id;
|
|
903
926
|
entities = [];
|
|
904
927
|
primitives = [];
|
|
@@ -906,8 +929,8 @@ class $t {
|
|
|
906
929
|
aggregator;
|
|
907
930
|
cardPool;
|
|
908
931
|
constructor(e) {
|
|
909
|
-
const { id: t, entities:
|
|
910
|
-
this.id = t, this.entities =
|
|
932
|
+
const { id: t, entities: i = [], primitives: o = [], dataItem: a = {}, aggregator: n, cardPool: l } = e;
|
|
933
|
+
this.id = t, this.entities = i, this.primitives = o, this.dataItem = a, this.aggregator = n, this.cardPool = l;
|
|
911
934
|
}
|
|
912
935
|
// 改造 setVisible 方法,支持 Entity 和 Primitive 的可见性控制
|
|
913
936
|
setVisible(e) {
|
|
@@ -915,26 +938,26 @@ class $t {
|
|
|
915
938
|
t && (t.show = e);
|
|
916
939
|
}), this.primitives.forEach((t) => {
|
|
917
940
|
t && (t.show = e);
|
|
918
|
-
}), this.aggregator && Array.isArray(this.dataItem.billboard) && this.dataItem.billboard.map((
|
|
941
|
+
}), this.aggregator && Array.isArray(this.dataItem.billboard) && this.dataItem.billboard.map((i, o) => ({
|
|
919
942
|
id: this.dataItem.id,
|
|
920
943
|
data: {
|
|
921
944
|
...this.dataItem,
|
|
922
|
-
show: e && (
|
|
945
|
+
show: e && (i.data?.show ?? !0)
|
|
923
946
|
}
|
|
924
|
-
})).forEach((
|
|
925
|
-
this.aggregator?.updatePoint(
|
|
947
|
+
})).forEach((i) => {
|
|
948
|
+
this.aggregator?.updatePoint(i);
|
|
926
949
|
}), this.cardPool && this.dataItem.card && (e ? this.cardPool.showByIds([this.dataItem.id]) : this.cardPool.hideByIds([this.dataItem.id]));
|
|
927
950
|
}
|
|
928
951
|
// 改造 removeAll 方法,支持 Entity 和 Primitive 的移除
|
|
929
952
|
removeAll(e, t = !0) {
|
|
930
|
-
return this.entities.forEach((
|
|
931
|
-
|
|
932
|
-
}), this.entities = [], this.primitives.forEach((
|
|
933
|
-
|
|
953
|
+
return this.entities.forEach((i) => {
|
|
954
|
+
i && e.entities.remove(i);
|
|
955
|
+
}), this.entities = [], this.primitives.forEach((i) => {
|
|
956
|
+
i && e.scene.primitives.remove(i);
|
|
934
957
|
}), this.primitives = [], t && this.aggregator && Array.isArray(this.dataItem.billboard) && this.aggregator.removePointsById([this.dataItem.id]), t && this.cardPool && this.dataItem.card && this.cardPool.removeByIds([this.dataItem.id]), this.dataItem.id;
|
|
935
958
|
}
|
|
936
959
|
}
|
|
937
|
-
class
|
|
960
|
+
class zt {
|
|
938
961
|
id;
|
|
939
962
|
groupMap = /* @__PURE__ */ new Map();
|
|
940
963
|
Cesium;
|
|
@@ -942,20 +965,20 @@ class Ht {
|
|
|
942
965
|
materialManager;
|
|
943
966
|
aggregator;
|
|
944
967
|
cardPool;
|
|
945
|
-
constructor(e, t,
|
|
946
|
-
this.id = e, this.Cesium = t, this.viewer =
|
|
968
|
+
constructor(e, t, i, o, a, n) {
|
|
969
|
+
this.id = e, this.Cesium = t, this.viewer = i, this.materialManager = o, this.aggregator = a, this.cardPool = n, this.aggregator.labelPool.eventBus.addListener(D.Click, {
|
|
947
970
|
name: "BufferedHierarchicalAggregator_maker_click",
|
|
948
|
-
fn: (s,
|
|
971
|
+
fn: (s, d) => {
|
|
949
972
|
this.cardPool.showByIds([s.data.id]);
|
|
950
973
|
}
|
|
951
|
-
}), new t.ScreenSpaceEventHandler(
|
|
974
|
+
}), new t.ScreenSpaceEventHandler(i.scene.canvas).setInputAction(() => {
|
|
952
975
|
this.cardPool.hideFilter((s) => !s.initShow);
|
|
953
976
|
}, t.ScreenSpaceEventType.LEFT_CLICK);
|
|
954
977
|
}
|
|
955
978
|
/** ====== 下面是抽出的创建函数 ====== */
|
|
956
979
|
createPolyline(e, t) {
|
|
957
980
|
if (!e.positions || e.positions.length < 1) return null;
|
|
958
|
-
const
|
|
981
|
+
const i = this.materialManager.get({
|
|
959
982
|
themeKey: e.theme,
|
|
960
983
|
category: "polyline",
|
|
961
984
|
options: e
|
|
@@ -963,7 +986,7 @@ class Ht {
|
|
|
963
986
|
let a = {
|
|
964
987
|
...e
|
|
965
988
|
};
|
|
966
|
-
return
|
|
989
|
+
return i && (a.material = i), this.viewer.entities.add({
|
|
967
990
|
polyline: {
|
|
968
991
|
...a,
|
|
969
992
|
positions: this.Cesium.Cartesian3.fromDegreesArrayHeights(o)
|
|
@@ -973,7 +996,7 @@ class Ht {
|
|
|
973
996
|
}
|
|
974
997
|
createWall(e, t) {
|
|
975
998
|
if (!e.positions || e.positions.length < 1) return null;
|
|
976
|
-
const
|
|
999
|
+
const i = this.materialManager.get({
|
|
977
1000
|
themeKey: e.theme,
|
|
978
1001
|
category: "wall",
|
|
979
1002
|
options: e
|
|
@@ -983,7 +1006,7 @@ class Ht {
|
|
|
983
1006
|
let l = {
|
|
984
1007
|
...e
|
|
985
1008
|
};
|
|
986
|
-
return
|
|
1009
|
+
return i && (l.material = i), this.viewer.entities.add({
|
|
987
1010
|
wall: {
|
|
988
1011
|
...l,
|
|
989
1012
|
positions: n,
|
|
@@ -995,18 +1018,18 @@ class Ht {
|
|
|
995
1018
|
}
|
|
996
1019
|
createPolygon(e, t) {
|
|
997
1020
|
if (!e.hierarchy || e.hierarchy.length < 1) return null;
|
|
998
|
-
const
|
|
1021
|
+
const i = this.materialManager.get({
|
|
999
1022
|
themeKey: e.theme,
|
|
1000
1023
|
category: "polygon",
|
|
1001
1024
|
options: e
|
|
1002
|
-
}), o = Array.isArray(e.hierarchy[0]) ? e.hierarchy.flat() : e.hierarchy, a = this.Cesium.Cartesian3.fromDegreesArrayHeights(o), n = e.holes?.map((
|
|
1003
|
-
let h = Array.isArray(
|
|
1025
|
+
}), o = Array.isArray(e.hierarchy[0]) ? e.hierarchy.flat() : e.hierarchy, a = this.Cesium.Cartesian3.fromDegreesArrayHeights(o), n = e.holes?.map((d) => {
|
|
1026
|
+
let h = Array.isArray(d[0]) ? e.hierarchy.flat() : e.hole;
|
|
1004
1027
|
return this.Cesium.Cartesian3.fromDegreesArrayHeights(h.flat());
|
|
1005
1028
|
}) || [], l = new this.Cesium.PolygonHierarchy(a, n);
|
|
1006
1029
|
let s = {
|
|
1007
1030
|
...e
|
|
1008
1031
|
};
|
|
1009
|
-
return
|
|
1032
|
+
return i && (s.material = i), this.viewer.entities.add({
|
|
1010
1033
|
polygon: {
|
|
1011
1034
|
...s,
|
|
1012
1035
|
hierarchy: l
|
|
@@ -1017,10 +1040,10 @@ class Ht {
|
|
|
1017
1040
|
}
|
|
1018
1041
|
createBillboardPoints(e) {
|
|
1019
1042
|
return !e.billboard?.length || !this.aggregator ? [] : e.billboard.map((t) => {
|
|
1020
|
-
const [
|
|
1043
|
+
const [i, o, a = 0] = t.position || [0, 0, 0];
|
|
1021
1044
|
return {
|
|
1022
1045
|
id: e.id,
|
|
1023
|
-
lon:
|
|
1046
|
+
lon: i,
|
|
1024
1047
|
lat: o,
|
|
1025
1048
|
height: a,
|
|
1026
1049
|
name: t.options?.text || "",
|
|
@@ -1043,34 +1066,34 @@ class Ht {
|
|
|
1043
1066
|
}
|
|
1044
1067
|
/** ====== 主入口:仅保留循环,内部调用独立函数 ====== */
|
|
1045
1068
|
addGroup(e, t = !0) {
|
|
1046
|
-
const
|
|
1047
|
-
this.removeGroup(
|
|
1069
|
+
const i = e.id || `${Date.now()}`;
|
|
1070
|
+
this.removeGroup(i);
|
|
1048
1071
|
const o = [], a = e.show !== !1;
|
|
1049
1072
|
(e.polyline || []).forEach((s) => {
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1073
|
+
const d = this.createPolyline(s, a);
|
|
1074
|
+
d && o.push(d);
|
|
1052
1075
|
}), (e.wall || []).forEach((s) => {
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1076
|
+
const d = this.createWall(s, a);
|
|
1077
|
+
d && o.push(d);
|
|
1055
1078
|
}), (e.polygon || []).forEach((s) => {
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1079
|
+
const d = this.createPolygon(s, a);
|
|
1080
|
+
d && o.push(d);
|
|
1058
1081
|
});
|
|
1059
1082
|
const n = this.createBillboardPoints(e);
|
|
1060
1083
|
n.length && t && this.aggregator.appendPoints(n, !1), this.createCard(e);
|
|
1061
|
-
const l = new
|
|
1062
|
-
id:
|
|
1084
|
+
const l = new Rt({
|
|
1085
|
+
id: i,
|
|
1063
1086
|
entities: o,
|
|
1064
1087
|
primitives: [],
|
|
1065
1088
|
dataItem: e,
|
|
1066
1089
|
aggregator: this.aggregator,
|
|
1067
1090
|
cardPool: this.cardPool
|
|
1068
1091
|
});
|
|
1069
|
-
return this.groupMap.set(
|
|
1092
|
+
return this.groupMap.set(i, l), n;
|
|
1070
1093
|
}
|
|
1071
1094
|
async addGroups(e) {
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1095
|
+
const i = e.map((o) => this.addGroup(o, !1)).flat();
|
|
1096
|
+
i.length > 0 && this.aggregator && this.aggregator.appendPoints(i, !1);
|
|
1074
1097
|
}
|
|
1075
1098
|
removeGroup(e) {
|
|
1076
1099
|
const t = this.groupMap.get(e);
|
|
@@ -1078,11 +1101,11 @@ class Ht {
|
|
|
1078
1101
|
}
|
|
1079
1102
|
removeGroups(e) {
|
|
1080
1103
|
let t = [];
|
|
1081
|
-
for (const
|
|
1082
|
-
const o = this.groupMap.get(
|
|
1104
|
+
for (const i of e) {
|
|
1105
|
+
const o = this.groupMap.get(i);
|
|
1083
1106
|
if (o) {
|
|
1084
1107
|
let a = o.removeAll(this.viewer, !1);
|
|
1085
|
-
this.groupMap.delete(
|
|
1108
|
+
this.groupMap.delete(i), t.push(a);
|
|
1086
1109
|
}
|
|
1087
1110
|
}
|
|
1088
1111
|
this.aggregator.removePointsById(t), this.cardPool.removeByIds(t);
|
|
@@ -1093,11 +1116,11 @@ class Ht {
|
|
|
1093
1116
|
}
|
|
1094
1117
|
async updateGroups(e) {
|
|
1095
1118
|
this.aggregator.removePointsById(e.map((o) => o.id)), this.cardPool.removeByIds(e.map((o) => o.id));
|
|
1096
|
-
const
|
|
1119
|
+
const i = e.map((o) => {
|
|
1097
1120
|
const a = this.groupMap.get(o.id);
|
|
1098
1121
|
return a && (a.removeAll(this.viewer, !1), this.groupMap.delete(o.id)), this.addGroup(o, !1);
|
|
1099
1122
|
}).flat();
|
|
1100
|
-
|
|
1123
|
+
i.length > 0 && this.aggregator && this.aggregator.appendPoints(i, !1);
|
|
1101
1124
|
}
|
|
1102
1125
|
setGroupVisible(e, t) {
|
|
1103
1126
|
this.groupMap.get(e)?.setVisible(t);
|
|
@@ -1106,20 +1129,20 @@ class Ht {
|
|
|
1106
1129
|
this.groupMap.forEach((e) => e.removeAll(this.viewer)), this.groupMap.clear();
|
|
1107
1130
|
}
|
|
1108
1131
|
}
|
|
1109
|
-
class
|
|
1132
|
+
class Ft {
|
|
1110
1133
|
Cesium;
|
|
1111
1134
|
viewer;
|
|
1112
1135
|
layerMap = /* @__PURE__ */ new Map();
|
|
1113
1136
|
materialManager;
|
|
1114
1137
|
aggregator;
|
|
1115
1138
|
cardPool;
|
|
1116
|
-
constructor(e, t,
|
|
1117
|
-
this.Cesium = e, this.viewer = t, this.materialManager =
|
|
1139
|
+
constructor(e, t, i, o, a) {
|
|
1140
|
+
this.Cesium = e, this.viewer = t, this.materialManager = i, this.aggregator = o, this.cardPool = a;
|
|
1118
1141
|
}
|
|
1119
1142
|
addLayer(e) {
|
|
1120
1143
|
this.layerMap.has(e) || this.layerMap.set(
|
|
1121
1144
|
e,
|
|
1122
|
-
new
|
|
1145
|
+
new zt(
|
|
1123
1146
|
e,
|
|
1124
1147
|
this.Cesium,
|
|
1125
1148
|
this.viewer,
|
|
@@ -1137,15 +1160,15 @@ class zt {
|
|
|
1137
1160
|
return this.layerMap.get(e);
|
|
1138
1161
|
}
|
|
1139
1162
|
async addGroupsToLayer(e, t) {
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1163
|
+
const i = this.layerMap.get(e);
|
|
1164
|
+
i && (i.addGroups(t), this.aggregator.refresh());
|
|
1142
1165
|
}
|
|
1143
1166
|
updateGroupToLayer(e, t) {
|
|
1144
|
-
const
|
|
1145
|
-
|
|
1167
|
+
const i = this.layerMap.get(e);
|
|
1168
|
+
i && (i.updateGroups(t), this.aggregator.refresh());
|
|
1146
1169
|
}
|
|
1147
|
-
setGroupVisible(e, t,
|
|
1148
|
-
this.layerMap.get(e)?.setGroupVisible(t,
|
|
1170
|
+
setGroupVisible(e, t, i) {
|
|
1171
|
+
this.layerMap.get(e)?.setGroupVisible(t, i);
|
|
1149
1172
|
}
|
|
1150
1173
|
removeGroup(e, t) {
|
|
1151
1174
|
this.layerMap.get(e)?.removeGroup(t);
|
|
@@ -1154,7 +1177,7 @@ class zt {
|
|
|
1154
1177
|
this.layerMap.get(e)?.removeGroups(t);
|
|
1155
1178
|
}
|
|
1156
1179
|
}
|
|
1157
|
-
class
|
|
1180
|
+
class Kt {
|
|
1158
1181
|
labelId;
|
|
1159
1182
|
cardId;
|
|
1160
1183
|
opt;
|
|
@@ -1165,10 +1188,10 @@ class Rt {
|
|
|
1165
1188
|
this.labelId = e.labelId, this.cardId = e.cardId, this.opt = e, this.MaterialManager = e.MaterialManager || new ve(), this.instance = this.initCore(e, e.eventBus, e.cardEventBus);
|
|
1166
1189
|
}
|
|
1167
1190
|
//初始化标记管理
|
|
1168
|
-
initCore(e, t,
|
|
1191
|
+
initCore(e, t, i) {
|
|
1169
1192
|
let { Cesium: o, viewer: a, aggregatorOptions: n } = e;
|
|
1170
|
-
t || (t = new $()),
|
|
1171
|
-
const l = new X(o, a, this.labelId, t), s = new X(o, a, this.cardId,
|
|
1193
|
+
t || (t = new $()), i || (i = new $());
|
|
1194
|
+
const l = new X(o, a, this.labelId, t), s = new X(o, a, this.cardId, i, !1), d = new Ke(o, a, {
|
|
1172
1195
|
//聚合
|
|
1173
1196
|
threshold: n?.threshold || 16,
|
|
1174
1197
|
displayLimit: n?.displayLimit || 1e3,
|
|
@@ -1182,15 +1205,15 @@ class Rt {
|
|
|
1182
1205
|
// 普通点的默认主题
|
|
1183
1206
|
...n,
|
|
1184
1207
|
labelPool: l
|
|
1185
|
-
}), h = this.MaterialManager,
|
|
1208
|
+
}), h = this.MaterialManager, c = new Ft(
|
|
1186
1209
|
//实体图层管理
|
|
1187
1210
|
o,
|
|
1188
1211
|
a,
|
|
1189
1212
|
h,
|
|
1190
|
-
|
|
1213
|
+
d,
|
|
1191
1214
|
s
|
|
1192
1215
|
);
|
|
1193
|
-
return { materialManager: h, entityLayerManager:
|
|
1216
|
+
return { materialManager: h, entityLayerManager: c, cardPool: s, labelPool: l, aggregator: d, eventBus: t, cardEventBus: i };
|
|
1194
1217
|
}
|
|
1195
1218
|
//添加标记
|
|
1196
1219
|
set(e) {
|
|
@@ -1204,18 +1227,18 @@ class Rt {
|
|
|
1204
1227
|
//添加
|
|
1205
1228
|
add(e) {
|
|
1206
1229
|
let t = [];
|
|
1207
|
-
|
|
1208
|
-
this.entityList.set(
|
|
1230
|
+
_(e) ? t = e : t.push(e), t.forEach((i) => {
|
|
1231
|
+
this.entityList.set(i.id, i);
|
|
1209
1232
|
}), this.instance.entityLayerManager.getLayer("Layer_default") || this.instance.entityLayerManager.addLayer("Layer_default"), this.instance.entityLayerManager.addGroupsToLayer("Layer_default", t);
|
|
1210
1233
|
}
|
|
1211
1234
|
//更新标记
|
|
1212
1235
|
update(e, t = !0) {
|
|
1213
|
-
let
|
|
1214
|
-
|
|
1215
|
-
const o =
|
|
1236
|
+
let i = [];
|
|
1237
|
+
_(e) ? i = e : i.push(e);
|
|
1238
|
+
const o = i.map((a) => {
|
|
1216
1239
|
const n = this.entityList.get(a.id);
|
|
1217
1240
|
if (!n) return;
|
|
1218
|
-
let l =
|
|
1241
|
+
let l = St({}, n, a);
|
|
1219
1242
|
return this.entityList.set(a.id, l), l;
|
|
1220
1243
|
}).filter(Boolean);
|
|
1221
1244
|
t && this.instance.entityLayerManager.updateGroupToLayer("Layer_default", o);
|
|
@@ -1234,8 +1257,8 @@ class Rt {
|
|
|
1234
1257
|
//删除标记
|
|
1235
1258
|
delete(e) {
|
|
1236
1259
|
let t = [];
|
|
1237
|
-
|
|
1238
|
-
this.entityList.delete(
|
|
1260
|
+
_(e) ? t = e : t.push(e), t.forEach((i) => {
|
|
1261
|
+
this.entityList.delete(i);
|
|
1239
1262
|
}), this.instance.entityLayerManager.removeGroups("Layer_default", t);
|
|
1240
1263
|
}
|
|
1241
1264
|
setMarkerAggregationEnabled(e, t) {
|
|
@@ -1245,56 +1268,56 @@ class Rt {
|
|
|
1245
1268
|
this.instance.aggregator.setDebugCurrentGrids(e || !1);
|
|
1246
1269
|
}
|
|
1247
1270
|
}
|
|
1248
|
-
function
|
|
1249
|
-
Cesium:
|
|
1271
|
+
function Nt({
|
|
1272
|
+
Cesium: r,
|
|
1250
1273
|
options: e,
|
|
1251
1274
|
MaterialManager: t
|
|
1252
1275
|
}) {
|
|
1253
1276
|
if (e.data?.theme) {
|
|
1254
1277
|
if (e.data?.lineType == "1") {
|
|
1255
|
-
let
|
|
1256
|
-
color: new
|
|
1278
|
+
let i = Ht(r, {
|
|
1279
|
+
color: new r.Color.fromCssColorString(e?.options?.color || "#ffffff"),
|
|
1257
1280
|
duration: 100
|
|
1258
1281
|
});
|
|
1259
1282
|
t.register({
|
|
1260
1283
|
themeKey: e.data?.theme,
|
|
1261
|
-
material:
|
|
1284
|
+
material: i,
|
|
1262
1285
|
category: "polyline"
|
|
1263
1286
|
});
|
|
1264
1287
|
} else if (e.data?.lineType == "2") {
|
|
1265
|
-
let
|
|
1266
|
-
|
|
1288
|
+
let i = new r.PolylineArrowMaterialProperty(
|
|
1289
|
+
r.Color.fromCssColorString(e?.options?.color || "red")
|
|
1267
1290
|
);
|
|
1268
1291
|
t.register({
|
|
1269
1292
|
themeKey: e.data?.theme,
|
|
1270
|
-
material:
|
|
1293
|
+
material: i,
|
|
1271
1294
|
category: "polyline"
|
|
1272
1295
|
});
|
|
1273
1296
|
} else if (e.data?.lineType == "3") {
|
|
1274
|
-
let
|
|
1275
|
-
color:
|
|
1297
|
+
let i = new r.PolylineOutlineMaterialProperty({
|
|
1298
|
+
color: r.Color.fromCssColorString(e?.options?.color || "red"),
|
|
1276
1299
|
outlineWidth: 0
|
|
1277
1300
|
});
|
|
1278
1301
|
t.register({
|
|
1279
1302
|
themeKey: e.data?.theme,
|
|
1280
|
-
material:
|
|
1303
|
+
material: i,
|
|
1281
1304
|
category: "polyline"
|
|
1282
1305
|
});
|
|
1283
1306
|
} else if (e.data?.lineType == "4") {
|
|
1284
|
-
let
|
|
1285
|
-
color:
|
|
1307
|
+
let i = new r.PolylineDashMaterialProperty({
|
|
1308
|
+
color: r.Color.fromCssColorString(e?.options?.color || "red"),
|
|
1286
1309
|
dashLength: Number(e?.options?.dashLength || 30)
|
|
1287
1310
|
//短划线长度
|
|
1288
1311
|
});
|
|
1289
1312
|
t.register({
|
|
1290
1313
|
themeKey: e.data?.theme,
|
|
1291
|
-
material:
|
|
1314
|
+
material: i,
|
|
1292
1315
|
category: "polyline"
|
|
1293
1316
|
});
|
|
1294
1317
|
} else if (e.data?.lineType == "5") {
|
|
1295
|
-
let
|
|
1318
|
+
let i = $t(r, {
|
|
1296
1319
|
image: e.img,
|
|
1297
|
-
color: new
|
|
1320
|
+
color: new r.Color.fromCssColorString(e?.options?.color || "#ffffff"),
|
|
1298
1321
|
duration: 5e3,
|
|
1299
1322
|
// freely: 'vertical',
|
|
1300
1323
|
direction: "-",
|
|
@@ -1302,38 +1325,38 @@ function Kt({
|
|
|
1302
1325
|
});
|
|
1303
1326
|
t.register({
|
|
1304
1327
|
themeKey: e.data?.theme,
|
|
1305
|
-
material:
|
|
1328
|
+
material: i,
|
|
1306
1329
|
category: "polyline"
|
|
1307
1330
|
});
|
|
1308
1331
|
}
|
|
1309
1332
|
}
|
|
1310
1333
|
}
|
|
1311
|
-
function
|
|
1312
|
-
Cesium:
|
|
1334
|
+
function Wt({
|
|
1335
|
+
Cesium: r,
|
|
1313
1336
|
options: e,
|
|
1314
1337
|
MaterialManager: t
|
|
1315
1338
|
}) {
|
|
1316
1339
|
if (e.data?.theme) {
|
|
1317
1340
|
if (e.data?.polygonType == "colorMode") {
|
|
1318
|
-
let
|
|
1341
|
+
let i = new r.Color.fromCssColorString(e?.options?.color || "#ffffff");
|
|
1319
1342
|
t.register({
|
|
1320
1343
|
themeKey: e.data?.theme,
|
|
1321
|
-
material:
|
|
1344
|
+
material: i,
|
|
1322
1345
|
category: "polygon"
|
|
1323
1346
|
});
|
|
1324
1347
|
} else if (e.data?.polygonType == "img") {
|
|
1325
|
-
let
|
|
1348
|
+
let i = new r.ImageMaterialProperty({
|
|
1326
1349
|
image: e.img
|
|
1327
1350
|
});
|
|
1328
1351
|
t.register({
|
|
1329
1352
|
themeKey: e.data?.theme,
|
|
1330
|
-
material:
|
|
1353
|
+
material: i,
|
|
1331
1354
|
category: "polygon"
|
|
1332
1355
|
});
|
|
1333
1356
|
} else if (e.data?.polygonType == "DynamicImgMaterial") {
|
|
1334
|
-
let
|
|
1357
|
+
let i = Ce(r, {
|
|
1335
1358
|
image: e.img,
|
|
1336
|
-
color: new
|
|
1359
|
+
color: new r.Color.fromCssColorString(e?.options?.color),
|
|
1337
1360
|
duration: 5e3,
|
|
1338
1361
|
freely: e.data?.freely || "vertical",
|
|
1339
1362
|
direction: "+",
|
|
@@ -1341,29 +1364,29 @@ function Ft({
|
|
|
1341
1364
|
});
|
|
1342
1365
|
t.register({
|
|
1343
1366
|
themeKey: e.data?.theme,
|
|
1344
|
-
material:
|
|
1367
|
+
material: i,
|
|
1345
1368
|
category: "polygon"
|
|
1346
1369
|
});
|
|
1347
1370
|
}
|
|
1348
1371
|
}
|
|
1349
1372
|
}
|
|
1350
|
-
function
|
|
1351
|
-
Cesium:
|
|
1373
|
+
function Vt({
|
|
1374
|
+
Cesium: r,
|
|
1352
1375
|
options: e,
|
|
1353
1376
|
MaterialManager: t
|
|
1354
1377
|
}) {
|
|
1355
1378
|
if (e.data?.theme) {
|
|
1356
1379
|
if (e.data?.wallType == "img") {
|
|
1357
|
-
let
|
|
1380
|
+
let i = new r.ImageMaterialProperty({
|
|
1358
1381
|
image: e.img
|
|
1359
1382
|
});
|
|
1360
1383
|
t.register({
|
|
1361
1384
|
themeKey: e.data?.theme,
|
|
1362
|
-
material:
|
|
1385
|
+
material: i,
|
|
1363
1386
|
category: "wall"
|
|
1364
1387
|
});
|
|
1365
1388
|
} else if (e.data?.wallType == "DynamicImgMaterial") {
|
|
1366
|
-
let
|
|
1389
|
+
let i = Ce(r, {
|
|
1367
1390
|
image: e.img,
|
|
1368
1391
|
// color: new Cesium.Color.fromCssColorString(options?.options?.color),
|
|
1369
1392
|
duration: 5e3,
|
|
@@ -1373,39 +1396,39 @@ function Nt({
|
|
|
1373
1396
|
});
|
|
1374
1397
|
t.register({
|
|
1375
1398
|
themeKey: e.data?.theme,
|
|
1376
|
-
material:
|
|
1399
|
+
material: i,
|
|
1377
1400
|
category: "wall"
|
|
1378
1401
|
});
|
|
1379
1402
|
}
|
|
1380
1403
|
}
|
|
1381
1404
|
}
|
|
1382
|
-
class
|
|
1405
|
+
class Ut extends Kt {
|
|
1383
1406
|
constructor(e) {
|
|
1384
1407
|
const {
|
|
1385
1408
|
labelId: t = "report-marker",
|
|
1386
|
-
cardId:
|
|
1409
|
+
cardId: i = "report-marker",
|
|
1387
1410
|
tagThemeConfig: o = [],
|
|
1388
1411
|
lineThemeConfig: a = [],
|
|
1389
1412
|
cardThemeConfig: n = [],
|
|
1390
1413
|
runListener: l = () => {
|
|
1391
1414
|
},
|
|
1392
1415
|
MaterialManager: s = new ve(),
|
|
1393
|
-
aggregatorOptions:
|
|
1394
|
-
} = e, h = [...o],
|
|
1416
|
+
aggregatorOptions: d
|
|
1417
|
+
} = e, h = [...o], c = [...a], g = [...n], u = {
|
|
1395
1418
|
clusterTheme: "Tag1007",
|
|
1396
1419
|
pointTheme: "Tag1001",
|
|
1397
1420
|
centralPointMode: "firstPoint",
|
|
1398
1421
|
debugCurrentGrids: !1,
|
|
1399
|
-
...
|
|
1400
|
-
},
|
|
1422
|
+
...d || {}
|
|
1423
|
+
}, f = {
|
|
1401
1424
|
...e,
|
|
1402
1425
|
labelId: t,
|
|
1403
|
-
cardId:
|
|
1426
|
+
cardId: i,
|
|
1404
1427
|
MaterialManager: s,
|
|
1405
|
-
aggregatorOptions:
|
|
1428
|
+
aggregatorOptions: u,
|
|
1406
1429
|
eventBus: new $()
|
|
1407
1430
|
};
|
|
1408
|
-
super(
|
|
1431
|
+
super(f), this.opt = { ...this.opt, ...f }, this.initTagListener(this.instance.eventBus, this.opt), this.loadTabThemeConfig(h), this.loadLineThemeConfig(c), this.loadCardThemeConfig(g), this.initDefaultLineMaterials(), this.initDefaultTagTheme();
|
|
1409
1432
|
}
|
|
1410
1433
|
initDefaultTagTheme() {
|
|
1411
1434
|
this.setTagTheme({
|
|
@@ -1503,9 +1526,9 @@ class Wt extends Rt {
|
|
|
1503
1526
|
})
|
|
1504
1527
|
}
|
|
1505
1528
|
};
|
|
1506
|
-
Object.entries(t).forEach(([
|
|
1507
|
-
this.MaterialManager.has(
|
|
1508
|
-
themeKey:
|
|
1529
|
+
Object.entries(t).forEach(([i, o]) => {
|
|
1530
|
+
this.MaterialManager.has(i, "polyline") || this.MaterialManager.register({
|
|
1531
|
+
themeKey: i,
|
|
1509
1532
|
material: o.material,
|
|
1510
1533
|
category: "polyline"
|
|
1511
1534
|
});
|
|
@@ -1515,33 +1538,33 @@ class Wt extends Rt {
|
|
|
1515
1538
|
initThemes(e) {
|
|
1516
1539
|
if (!e) return;
|
|
1517
1540
|
e.tag && this.loadTabThemeConfig(e.tag), e.card && this.loadCardThemeConfig(e.card);
|
|
1518
|
-
const t = this.opt.Cesium,
|
|
1541
|
+
const t = this.opt.Cesium, i = this.instance.materialManager || this.opt.MaterialManager;
|
|
1519
1542
|
if (e.line?.length > 0)
|
|
1520
1543
|
for (let o of e.line)
|
|
1521
|
-
|
|
1544
|
+
Nt({
|
|
1522
1545
|
options: o,
|
|
1523
1546
|
Cesium: t,
|
|
1524
|
-
MaterialManager:
|
|
1547
|
+
MaterialManager: i
|
|
1525
1548
|
});
|
|
1526
1549
|
if (e.polygon?.length > 0)
|
|
1527
1550
|
for (let o of e.polygon)
|
|
1528
|
-
|
|
1551
|
+
Wt({
|
|
1529
1552
|
options: o,
|
|
1530
1553
|
Cesium: t,
|
|
1531
|
-
MaterialManager:
|
|
1554
|
+
MaterialManager: i
|
|
1532
1555
|
});
|
|
1533
1556
|
if (e.wall?.length > 0)
|
|
1534
1557
|
for (let o of e.wall)
|
|
1535
|
-
|
|
1558
|
+
Vt({
|
|
1536
1559
|
options: o,
|
|
1537
1560
|
Cesium: t,
|
|
1538
|
-
MaterialManager:
|
|
1561
|
+
MaterialManager: i
|
|
1539
1562
|
});
|
|
1540
1563
|
}
|
|
1541
1564
|
extractOnEvents(e) {
|
|
1542
1565
|
const t = {};
|
|
1543
|
-
for (const
|
|
1544
|
-
|
|
1566
|
+
for (const i in e)
|
|
1567
|
+
i.startsWith("on") && typeof e[i] == "function" && (t[i] = e[i]);
|
|
1545
1568
|
return t;
|
|
1546
1569
|
}
|
|
1547
1570
|
//注册标记主题
|
|
@@ -1562,13 +1585,13 @@ class Wt extends Rt {
|
|
|
1562
1585
|
}
|
|
1563
1586
|
loadCardThemeConfig(e) {
|
|
1564
1587
|
let t = this.instance.cardPool;
|
|
1565
|
-
e.forEach((
|
|
1566
|
-
t.registerTheme(
|
|
1588
|
+
e.forEach((i) => {
|
|
1589
|
+
t.registerTheme(i.data.theme, {
|
|
1567
1590
|
createElement(o, a) {
|
|
1568
1591
|
let n = a.data.data, l;
|
|
1569
|
-
return
|
|
1592
|
+
return i.comType == 1 ? l = w(x(q), {
|
|
1570
1593
|
data: n || {},
|
|
1571
|
-
imgSrc:
|
|
1594
|
+
imgSrc: i.data.img,
|
|
1572
1595
|
styleConfig: {
|
|
1573
1596
|
paddingTop: "50px",
|
|
1574
1597
|
paddingRight: "18px",
|
|
@@ -1586,10 +1609,10 @@ class Wt extends Rt {
|
|
|
1586
1609
|
left: "79px",
|
|
1587
1610
|
top: "0px"
|
|
1588
1611
|
},
|
|
1589
|
-
bgClass: [
|
|
1590
|
-
}) :
|
|
1612
|
+
bgClass: [i.data.theme]
|
|
1613
|
+
}) : i.comType == 3 && (l = w(x(q), {
|
|
1591
1614
|
data: n || {},
|
|
1592
|
-
imgSrc:
|
|
1615
|
+
imgSrc: i.data.img,
|
|
1593
1616
|
styleConfig: {
|
|
1594
1617
|
paddingTop: "55px",
|
|
1595
1618
|
paddingRight: "12px",
|
|
@@ -1607,14 +1630,14 @@ class Wt extends Rt {
|
|
|
1607
1630
|
left: "79px",
|
|
1608
1631
|
top: "0px"
|
|
1609
1632
|
},
|
|
1610
|
-
bgClass: [
|
|
1633
|
+
bgClass: [i.data.theme]
|
|
1611
1634
|
// titleConfig: themeOptions.options.titleConfig,
|
|
1612
1635
|
// pageInfoConfig: themeOptions.options.pageInfoConfig,
|
|
1613
|
-
})),
|
|
1636
|
+
})), G(l, o), () => G(null, o);
|
|
1614
1637
|
},
|
|
1615
1638
|
options: {
|
|
1616
|
-
offset:
|
|
1617
|
-
...
|
|
1639
|
+
offset: i.data.pixelOffset,
|
|
1640
|
+
...i.data || {}
|
|
1618
1641
|
}
|
|
1619
1642
|
});
|
|
1620
1643
|
});
|
|
@@ -1623,9 +1646,9 @@ class Wt extends Rt {
|
|
|
1623
1646
|
setTagTheme(e) {
|
|
1624
1647
|
let { labelPool: t } = this.instance;
|
|
1625
1648
|
t.registerTheme(e.data.theme, {
|
|
1626
|
-
createElement(
|
|
1649
|
+
createElement(i, o) {
|
|
1627
1650
|
let a = o.data?.billboard?.[0];
|
|
1628
|
-
const n =
|
|
1651
|
+
const n = Bt(a, ["position", "options"]);
|
|
1629
1652
|
let l, s = {
|
|
1630
1653
|
...n,
|
|
1631
1654
|
text: a?.options?.text,
|
|
@@ -1652,7 +1675,7 @@ class Wt extends Rt {
|
|
|
1652
1675
|
"text-align": "center",
|
|
1653
1676
|
color: "white"
|
|
1654
1677
|
}
|
|
1655
|
-
}) : e.comType == 4 ? l = w(x(xe), s) : l = w(x(Z), s),
|
|
1678
|
+
}) : e.comType == 4 ? l = w(x(xe), s) : l = w(x(Z), s), G(l, i), () => G(null, i);
|
|
1656
1679
|
},
|
|
1657
1680
|
options: {
|
|
1658
1681
|
offset: e?.data?.pixelOffset || {}
|
|
@@ -1661,22 +1684,22 @@ class Wt extends Rt {
|
|
|
1661
1684
|
}
|
|
1662
1685
|
//标记监听事件
|
|
1663
1686
|
initTagListener(e, t) {
|
|
1664
|
-
let { viewer:
|
|
1665
|
-
e.addListener(
|
|
1687
|
+
let { viewer: i, tagListeningOptions: o } = t;
|
|
1688
|
+
e.addListener(D.Click, {
|
|
1666
1689
|
name: "marker:click",
|
|
1667
1690
|
fn: (a) => {
|
|
1668
|
-
t.runListener?.(I.标记左键点击, a.data), le(a.data?.onClick) && a.data?.onClick(a.data), a.data?.cameraPoint && a.data?.billboard[0]?.isFlyToCameraPoint &&
|
|
1691
|
+
t.runListener?.(I.标记左键点击, a.data), le(a.data?.onClick) && a.data?.onClick(a.data), a.data?.cameraPoint && a.data?.billboard[0]?.isFlyToCameraPoint && i?.camera?.flyTo({
|
|
1669
1692
|
duration: 1,
|
|
1670
1693
|
...a.data?.cameraPoint
|
|
1671
1694
|
});
|
|
1672
1695
|
}
|
|
1673
|
-
}), e.addListener(
|
|
1696
|
+
}), e.addListener(D.MouseEnter, {
|
|
1674
1697
|
name: "marker:mouseenter",
|
|
1675
1698
|
fn: (a) => {
|
|
1676
1699
|
let n = this.opt.Cesium, l = { x: 0, y: 0 };
|
|
1677
1700
|
try {
|
|
1678
1701
|
if (a.data?.billboard?.[0]?.position?.length > 2) {
|
|
1679
|
-
let s = a.data?.billboard[0]?.position,
|
|
1702
|
+
let s = a.data?.billboard[0]?.position, d = n.Cartesian3.fromDegrees(s[0], s[1], s[3] || 0), h = this.instance.labelPool.toWindowCoordinates(d);
|
|
1680
1703
|
l.x = h.x, l.y = h.y;
|
|
1681
1704
|
}
|
|
1682
1705
|
} catch (s) {
|
|
@@ -1684,13 +1707,13 @@ class Wt extends Rt {
|
|
|
1684
1707
|
}
|
|
1685
1708
|
t.runListener?.(I.标记移入, a.data, l);
|
|
1686
1709
|
}
|
|
1687
|
-
}), e.addListener(
|
|
1710
|
+
}), e.addListener(D.MouseLeave, {
|
|
1688
1711
|
name: "marker:mouseleave",
|
|
1689
1712
|
fn: (a) => {
|
|
1690
1713
|
let n = this.opt.Cesium, l = { x: 0, y: 0 };
|
|
1691
1714
|
try {
|
|
1692
1715
|
if (a.data?.billboard?.[0]?.position?.length > 2) {
|
|
1693
|
-
let s = a.data?.billboard[0]?.position,
|
|
1716
|
+
let s = a.data?.billboard[0]?.position, d = n.Cartesian3.fromDegrees(s[0], s[1], s[3] || 0), h = this.instance.labelPool.toWindowCoordinates(d);
|
|
1694
1717
|
l.x = h.x, l.y = h.y;
|
|
1695
1718
|
}
|
|
1696
1719
|
} catch (s) {
|
|
@@ -1704,78 +1727,78 @@ class Wt extends Rt {
|
|
|
1704
1727
|
}
|
|
1705
1728
|
// 兼容旧模式的材质注册
|
|
1706
1729
|
setMaterial(e) {
|
|
1707
|
-
const { type: t, material:
|
|
1730
|
+
const { type: t, material: i, materialKey: o, cover: a } = e, n = t ? t.toLowerCase() : "default";
|
|
1708
1731
|
this.MaterialManager.register({
|
|
1709
1732
|
themeKey: o,
|
|
1710
1733
|
// 兼容传入的是 { material: ... } 结构或者直接是材质对象
|
|
1711
|
-
material:
|
|
1734
|
+
material: i?.material || i,
|
|
1712
1735
|
force: a,
|
|
1713
1736
|
category: n
|
|
1714
1737
|
});
|
|
1715
1738
|
}
|
|
1716
1739
|
}
|
|
1717
|
-
const
|
|
1740
|
+
const Yt = /* @__PURE__ */ Me({
|
|
1718
1741
|
__name: "MarkerManage",
|
|
1719
|
-
props:
|
|
1742
|
+
props: Fe,
|
|
1720
1743
|
emits: ["register", "load", "marker-event"],
|
|
1721
|
-
setup(
|
|
1722
|
-
const
|
|
1744
|
+
setup(r, { expose: e, emit: t }) {
|
|
1745
|
+
const i = r, o = t, a = _e("leitingMethods");
|
|
1723
1746
|
let n = null;
|
|
1724
1747
|
const l = (h = {}) => {
|
|
1725
1748
|
if (n) return n;
|
|
1726
|
-
const
|
|
1727
|
-
...
|
|
1749
|
+
const c = {
|
|
1750
|
+
...i,
|
|
1728
1751
|
...h,
|
|
1729
|
-
Cesium: h.Cesium ||
|
|
1730
|
-
viewer: h.viewer ||
|
|
1731
|
-
runListener: (
|
|
1732
|
-
o("marker-event", { key:
|
|
1752
|
+
Cesium: h.Cesium || i.Cesium,
|
|
1753
|
+
viewer: h.viewer || i.viewer,
|
|
1754
|
+
runListener: (g, u, ...f) => {
|
|
1755
|
+
o("marker-event", { key: g, data: u, args: f });
|
|
1733
1756
|
}
|
|
1734
1757
|
};
|
|
1735
|
-
return !
|
|
1758
|
+
return !c.Cesium || !c.viewer ? null : (n = new Ut(c), h.methods && (h.methods.setTagTheme = n.setTagTheme.bind(n), h.methods.setMaterial = n.setMaterial.bind(n), h.methods.setEntityList = n.set.bind(n), h.methods.addComItem = n.add.bind(n), h.methods.deleteComItem = n.delete.bind(n), h.methods.updateComItem = n.update.bind(n), h.methods.getEntityByID = n.getById.bind(n), h.methods.getOptions = n.getOptions.bind(n)), o("load", n), n);
|
|
1736
1759
|
}, s = {
|
|
1737
1760
|
init: l,
|
|
1738
1761
|
set: (h) => n?.set(h),
|
|
1739
1762
|
add: (h) => n?.add(h),
|
|
1740
|
-
update: (h,
|
|
1763
|
+
update: (h, c) => n?.update(h, c),
|
|
1741
1764
|
getById: (h) => n?.getById(h),
|
|
1742
1765
|
getOptions: () => n?.getOptions(),
|
|
1743
1766
|
delete: (h) => n?.delete(h),
|
|
1744
|
-
setMarkerAggregationEnabled: (h,
|
|
1767
|
+
setMarkerAggregationEnabled: (h, c) => n?.setMarkerAggregationEnabled(h, c),
|
|
1745
1768
|
setDebugCurrentGridsEnabled: (h) => n?.setDebugCurrentGridsEnabled(h),
|
|
1746
1769
|
initThemes: (h) => n?.initThemes(h),
|
|
1747
1770
|
setTagTheme: (h) => n?.setTagTheme(h),
|
|
1748
1771
|
setMaterial: (h) => n?.setMaterial(h)
|
|
1749
1772
|
};
|
|
1750
1773
|
e(s), o("register", s);
|
|
1751
|
-
function
|
|
1774
|
+
function d() {
|
|
1752
1775
|
if (n) return n;
|
|
1753
|
-
const h = we(a),
|
|
1754
|
-
|
|
1776
|
+
const h = we(a), c = h?.getCesium?.(), g = h?.getViewer?.();
|
|
1777
|
+
c && g ? l({ Cesium: c, viewer: g, methods: h }) : i.Cesium && i.viewer && l({ methods: h });
|
|
1755
1778
|
}
|
|
1756
1779
|
return Pe(() => {
|
|
1757
|
-
|
|
1780
|
+
d();
|
|
1758
1781
|
}), Y(
|
|
1759
|
-
() => [
|
|
1760
|
-
([h,
|
|
1761
|
-
h &&
|
|
1782
|
+
() => [i.Cesium, i.viewer],
|
|
1783
|
+
([h, c]) => {
|
|
1784
|
+
h && c && !n && d();
|
|
1762
1785
|
}
|
|
1763
1786
|
), Y(
|
|
1764
1787
|
() => a?.value,
|
|
1765
|
-
(h,
|
|
1766
|
-
|
|
1788
|
+
(h, c) => {
|
|
1789
|
+
d();
|
|
1767
1790
|
},
|
|
1768
1791
|
{ deep: !1 }
|
|
1769
|
-
),
|
|
1770
|
-
}), (h,
|
|
1792
|
+
), Le(() => {
|
|
1793
|
+
}), (h, c) => Te(h.$slots, "default");
|
|
1771
1794
|
}
|
|
1772
|
-
}),
|
|
1795
|
+
}), ti = be(Yt);
|
|
1773
1796
|
export {
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1797
|
+
ti as CxMarkerManage,
|
|
1798
|
+
Ut as MarkerManage,
|
|
1799
|
+
Kt as MarkerManagerCore,
|
|
1777
1800
|
I as ReportListenerKey,
|
|
1778
|
-
|
|
1779
|
-
|
|
1801
|
+
ti as default,
|
|
1802
|
+
Fe as markerManageProps
|
|
1780
1803
|
};
|
|
1781
1804
|
//# sourceMappingURL=marker-manage.js.map
|