leiting-bim 2.2.48 → 2.2.50
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/leitingbim.css +1 -1
- package/package.json +1 -1
- package/plugins/cesium-core/dist/cesium-core.mjs.map +0 -1
- package/plugins/cesium-core/dist/cesium-core.umd.js.map +0 -1
- package/plugins/cesium-vue/dist/HtmlOverlayLabelPool-CbiNlyAM.js +0 -510
- package/plugins/cesium-vue/dist/HtmlOverlayLabelPool-CbiNlyAM.js.map +0 -1
- package/plugins/cesium-vue/dist/HtmlOverlayLabelPool-DgCFnmr3.js +0 -352
- package/plugins/cesium-vue/dist/HtmlOverlayLabelPool-DgCFnmr3.js.map +0 -1
- package/plugins/cesium-vue/dist/_commonjsHelpers-DaMA6jEr.js.map +0 -1
- package/plugins/cesium-vue/dist/components/basic-audio.js.map +0 -1
- package/plugins/cesium-vue/dist/components/basic-video.js.map +0 -1
- package/plugins/cesium-vue/dist/components/card-carousel.js.map +0 -1
- package/plugins/cesium-vue/dist/components/card-content.js.map +0 -1
- package/plugins/cesium-vue/dist/components/card-page.js.map +0 -1
- package/plugins/cesium-vue/dist/components/carousel-img.js.map +0 -1
- package/plugins/cesium-vue/dist/components/echarts-pro.js.map +0 -1
- package/plugins/cesium-vue/dist/components/marker-bubble.js.map +0 -1
- package/plugins/cesium-vue/dist/components/marker-default.js.map +0 -1
- package/plugins/cesium-vue/dist/components/marker-html.js.map +0 -1
- package/plugins/cesium-vue/dist/components/marker-manage.js.map +0 -1
- package/plugins/cesium-vue/dist/components/marker-text.js.map +0 -1
- package/plugins/cesium-vue/dist/components/measurement.js.map +0 -1
- package/plugins/cesium-vue/dist/components/position-picker.js.map +0 -1
- package/plugins/cesium-vue/dist/create-DynflqE1.js.map +0 -1
- package/plugins/cesium-vue/dist/index-2u2tr1fF.js +0 -1457
- package/plugins/cesium-vue/dist/index-CUs_hd1V.js +0 -404
- package/plugins/cesium-vue/dist/index-CUs_hd1V.js.map +0 -1
- package/plugins/cesium-vue/dist/index-Kdqw0FJN.js +0 -45856
- package/plugins/cesium-vue/dist/index-Kdqw0FJN.js.map +0 -1
- package/plugins/cesium-vue/dist/index-Kqi_S6KA.js.map +0 -1
- package/plugins/cesium-vue/dist/index-McKGafjp.js +0 -45856
- package/plugins/cesium-vue/dist/index-McKGafjp.js.map +0 -1
- package/plugins/cesium-vue/dist/index.js.map +0 -1
- package/skybox/023/nx.jpg +0 -0
- package/skybox/023/ny.jpg +0 -0
- package/skybox/023/nz.jpg +0 -0
- package/skybox/023/px.jpg +0 -0
- package/skybox/023/py.jpg +0 -0
- package/skybox/023/pz.jpg +0 -0
- package/skybox/035/nx.png +0 -0
- package/skybox/035/ny.png +0 -0
- package/skybox/035/nz.png +0 -0
- package/skybox/035/px.png +0 -0
- package/skybox/035/py.png +0 -0
- package/skybox/035/pz.png +0 -0
- package/skybox/037/nx.png +0 -0
- package/skybox/037/ny.png +0 -0
- package/skybox/037/nz.png +0 -0
- package/skybox/037/px.png +0 -0
- package/skybox/037/py.png +0 -0
- package/skybox/037/pz.png +0 -0
|
@@ -1,510 +0,0 @@
|
|
|
1
|
-
var m = /* @__PURE__ */ ((h) => (h.Click = "marker:click", h.DoubleClick = "marker:dblclick", h.RightClick = "marker:rightclick", h.MouseEnter = "marker:mouseenter", h.MouseLeave = "marker:mouseleave", h.MouseDown = "marker:mousedown", h.MouseUp = "marker:mouseup", h))(m || {});
|
|
2
|
-
class _ {
|
|
3
|
-
listenerMap = /* @__PURE__ */ new Map();
|
|
4
|
-
/**
|
|
5
|
-
* 添加监听器
|
|
6
|
-
* @param key 事件 key
|
|
7
|
-
* @param listener 监听器项
|
|
8
|
-
* @param overwrite 是否覆盖同名监听器
|
|
9
|
-
* @returns 是否成功添加
|
|
10
|
-
*/
|
|
11
|
-
addListener(e, t, s = !1) {
|
|
12
|
-
let i = this.listenerMap.get(e);
|
|
13
|
-
return i || (i = /* @__PURE__ */ new Map(), this.listenerMap.set(e, i)), i.has(t.name) ? s ? (console.warn(
|
|
14
|
-
`[MarkerEventBus] Overwriting listener "${t.name}" for event "${e}".`
|
|
15
|
-
), i.set(t.name, t), !0) : (console.warn(
|
|
16
|
-
`[MarkerEventBus] Listener "${t.name}" for event "${e}" already exists. Use overwrite=true to replace it.`
|
|
17
|
-
), !1) : (i.set(t.name, t), !0);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* 移除某个 key 的所有监听器
|
|
21
|
-
*/
|
|
22
|
-
removeListenerByKey(e) {
|
|
23
|
-
const t = this.listenerMap.has(e);
|
|
24
|
-
return this.listenerMap.set(e, /* @__PURE__ */ new Map()), t;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* 移除某个 key 下的指定名字的监听器
|
|
28
|
-
*/
|
|
29
|
-
removeListenerByKeyAndName(e, t) {
|
|
30
|
-
const s = this.listenerMap.get(e);
|
|
31
|
-
return s ? s.delete(t) : !1;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* 运行监听器
|
|
35
|
-
*/
|
|
36
|
-
runListener(e, t, s) {
|
|
37
|
-
const i = this.listenerMap.get(e);
|
|
38
|
-
if (i)
|
|
39
|
-
for (const [o, l] of i.entries()) {
|
|
40
|
-
try {
|
|
41
|
-
l.fn(t, s);
|
|
42
|
-
} catch (n) {
|
|
43
|
-
console.error(`Error in listener "${o}" for event "${e}":`, n);
|
|
44
|
-
}
|
|
45
|
-
l.once && i.delete(o);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const O = {
|
|
50
|
-
[m.Click]: "click",
|
|
51
|
-
[m.DoubleClick]: "dblclick",
|
|
52
|
-
[m.RightClick]: "contextmenu",
|
|
53
|
-
[m.MouseEnter]: "mouseenter",
|
|
54
|
-
[m.MouseLeave]: "mouseleave",
|
|
55
|
-
[m.MouseDown]: "mousedown",
|
|
56
|
-
[m.MouseUp]: "mouseup"
|
|
57
|
-
};
|
|
58
|
-
class L {
|
|
59
|
-
viewer;
|
|
60
|
-
Cesium;
|
|
61
|
-
container;
|
|
62
|
-
labels = /* @__PURE__ */ new Map();
|
|
63
|
-
activeIds = /* @__PURE__ */ new Set();
|
|
64
|
-
occludedIds = /* @__PURE__ */ new Set();
|
|
65
|
-
_updateFn;
|
|
66
|
-
_cameraChangedFn;
|
|
67
|
-
themes = {};
|
|
68
|
-
occlusionCheckLogs = [];
|
|
69
|
-
occlusionLogEnabled = !1;
|
|
70
|
-
occlusionLogMax = 1e4;
|
|
71
|
-
occlusionOptions = {
|
|
72
|
-
enabled: !1,
|
|
73
|
-
throttleMs: 120,
|
|
74
|
-
distanceEpsilon: 1
|
|
75
|
-
};
|
|
76
|
-
_occlusionTimer = null;
|
|
77
|
-
_lastOcclusionAt = 0;
|
|
78
|
-
_occlusionChecking = !1;
|
|
79
|
-
_occlusionPending = !1;
|
|
80
|
-
eventBus;
|
|
81
|
-
openWheel = !0;
|
|
82
|
-
/**
|
|
83
|
-
* 构造函数
|
|
84
|
-
* @param Cesium Cesium 命名空间
|
|
85
|
-
* @param viewer Cesium Viewer 实例
|
|
86
|
-
* @param containerId HTML 容器 ID(默认:"html-label-container")
|
|
87
|
-
* @param eventBus 可选:自定义事件总线
|
|
88
|
-
*/
|
|
89
|
-
constructor(e, t, s = "html-label-container", i, o = !0) {
|
|
90
|
-
this.Cesium = e, this.viewer = t, this.container = this._createContainer(s), this._updateFn = this._update.bind(this), this.viewer.scene.postRender.addEventListener(this._updateFn), this._cameraChangedFn = this._scheduleOcclusionCheck.bind(this), this.viewer.camera.changed.addEventListener(this._cameraChangedFn), this.eventBus = i || new _(), this.openWheel = o, this.runOcclusionCheckNow();
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* 创建标签容器
|
|
94
|
-
*/
|
|
95
|
-
_createContainer(e) {
|
|
96
|
-
let t = document.getElementById(e);
|
|
97
|
-
return t || (t = document.createElement("div"), t.id = e, Object.assign(t.style, {
|
|
98
|
-
position: "absolute",
|
|
99
|
-
top: "0",
|
|
100
|
-
left: "0",
|
|
101
|
-
pointerEvents: "none",
|
|
102
|
-
width: "100%",
|
|
103
|
-
height: "100%",
|
|
104
|
-
zIndex: "100",
|
|
105
|
-
overflow: "hidden"
|
|
106
|
-
}), document.body.appendChild(t)), t;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* 注册标签主题
|
|
110
|
-
*/
|
|
111
|
-
registerTheme(e, t) {
|
|
112
|
-
this.themes[e] = t;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* 添加单个标签
|
|
116
|
-
*/
|
|
117
|
-
add(e, t) {
|
|
118
|
-
const {
|
|
119
|
-
id: s,
|
|
120
|
-
lon: i,
|
|
121
|
-
lat: o,
|
|
122
|
-
height: l = 0,
|
|
123
|
-
theme: n,
|
|
124
|
-
show: a = !0,
|
|
125
|
-
notCreateElement: r = !1,
|
|
126
|
-
style: f
|
|
127
|
-
} = t, u = this.themes[n];
|
|
128
|
-
if (!u) {
|
|
129
|
-
console.warn(`Theme "${n}" not registered`);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
let c = this.labels.get(s);
|
|
133
|
-
if (c) {
|
|
134
|
-
c.theme = n, c.data = e, c.notCreateElement = r;
|
|
135
|
-
try {
|
|
136
|
-
c.unload = u.createElement(c.el, { id: s, theme: n, data: e }, u), (!r || a) && this.container.appendChild(c.el);
|
|
137
|
-
} catch (d) {
|
|
138
|
-
console.error(`Error updating label element for id "${s}":`, d);
|
|
139
|
-
}
|
|
140
|
-
} else {
|
|
141
|
-
const d = document.createElement("div");
|
|
142
|
-
Object.assign(d.style, {
|
|
143
|
-
position: "absolute",
|
|
144
|
-
transform: "translate(0, 0)",
|
|
145
|
-
pointerEvents: "auto",
|
|
146
|
-
...t.style || {}
|
|
147
|
-
});
|
|
148
|
-
for (const [C, v] of Object.entries(O)) {
|
|
149
|
-
d.addEventListener(v, (g) => {
|
|
150
|
-
g.stopPropagation();
|
|
151
|
-
const b = this.labels.get(s);
|
|
152
|
-
this.eventBus.runListener(C, b, g);
|
|
153
|
-
});
|
|
154
|
-
let w = 0;
|
|
155
|
-
d.addEventListener("wheel", (g) => {
|
|
156
|
-
if (!this.openWheel) return;
|
|
157
|
-
const b = g.currentTarget;
|
|
158
|
-
w = Date.now();
|
|
159
|
-
const y = w;
|
|
160
|
-
b.style.pointerEvents = "none", setTimeout(() => {
|
|
161
|
-
w === y && (b.style.pointerEvents = "auto");
|
|
162
|
-
}, 2e3);
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
let p = null;
|
|
166
|
-
if (!r || a) {
|
|
167
|
-
try {
|
|
168
|
-
p = u.createElement(d, { id: s, theme: n, data: e }, u) || {};
|
|
169
|
-
} catch (C) {
|
|
170
|
-
console.error(`Error updating label element for id "${s}":`, C);
|
|
171
|
-
}
|
|
172
|
-
this.container.appendChild(d);
|
|
173
|
-
}
|
|
174
|
-
c = { id: s, el: d, theme: n, data: e, notCreateElement: r, unload: p }, this.labels.set(s, c);
|
|
175
|
-
}
|
|
176
|
-
c.el.dataset.lon = String(i), c.el.dataset.lat = String(o), c.el.dataset.height = String(l), c.el.style.zIndex = f?.zIndex || "1", c.el.style.display = a ? "block" : "none", a && this.activeIds.add(s), a ? this._scheduleOcclusionCheck() : this.occludedIds.delete(s);
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* 批量添加标签
|
|
180
|
-
*/
|
|
181
|
-
addBatch(e) {
|
|
182
|
-
for (const { data: t, options: s } of e)
|
|
183
|
-
this.add(t, s);
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* 根据 ID 批量移除标签
|
|
187
|
-
*/
|
|
188
|
-
removeByIds(e) {
|
|
189
|
-
for (const t of e) {
|
|
190
|
-
const s = this.labels.get(t);
|
|
191
|
-
s && (this.unloadByLabel(s), this.labels.delete(t), this.activeIds.delete(t), this.occludedIds.delete(t));
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
unloadByLabel(e) {
|
|
195
|
-
e.el.remove(), e?.unload && typeof e.unload == "function" && e?.unload(), e.unload = null;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* 移除所有标签
|
|
199
|
-
*/
|
|
200
|
-
removeAll() {
|
|
201
|
-
for (const e of this.labels.values())
|
|
202
|
-
this.unloadByLabel(e);
|
|
203
|
-
this.labels.clear(), this.activeIds.clear(), this.occludedIds.clear();
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* 更新标签的数据并刷新内容
|
|
207
|
-
*/
|
|
208
|
-
update(e, t) {
|
|
209
|
-
const s = this.labels.get(e);
|
|
210
|
-
if (!s) {
|
|
211
|
-
console.warn(`Label with id "${e}" not found for update.`);
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
const i = this.themes[s.theme];
|
|
215
|
-
if (!i) {
|
|
216
|
-
console.warn(`Theme "${s.theme}" not registered.`);
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
try {
|
|
220
|
-
i.createElement(s.el, { id: e, theme: s.theme, data: t }, i);
|
|
221
|
-
} catch (o) {
|
|
222
|
-
console.error(`Failed to update label "${e}":`, o);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* 根据 ID 批量隐藏标签
|
|
227
|
-
*/
|
|
228
|
-
hideByIds(e) {
|
|
229
|
-
for (const t of e) {
|
|
230
|
-
const s = this.labels.get(t);
|
|
231
|
-
s && (s.notCreateElement && this.unloadByLabel(s), s.el.style.display = "none", this.activeIds.delete(t), this.occludedIds.delete(t));
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* 隐藏所有标签
|
|
236
|
-
*/
|
|
237
|
-
hideAll() {
|
|
238
|
-
for (const e of this.labels.values())
|
|
239
|
-
e.notCreateElement && this.unloadByLabel(e), e.el.style.display = "none", this.activeIds.delete(e.id), this.occludedIds.delete(e.id);
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* 条件过滤隐藏标签
|
|
243
|
-
*/
|
|
244
|
-
hideFilter(e) {
|
|
245
|
-
for (const t of this.labels.values())
|
|
246
|
-
e(t.data) && (t.notCreateElement && this.unloadByLabel(t), t.el.style.display = "none", this.activeIds.delete(t.id), this.occludedIds.delete(t.id));
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* 根据 ID 显示标签
|
|
250
|
-
*/
|
|
251
|
-
showByIds(e) {
|
|
252
|
-
for (const t of e) {
|
|
253
|
-
const s = this.labels.get(t);
|
|
254
|
-
if (s) {
|
|
255
|
-
if ((s.notCreateElement || !s.el.parentNode) && this.container.appendChild(s.el), !s.unload)
|
|
256
|
-
try {
|
|
257
|
-
const i = this.themes[s.theme];
|
|
258
|
-
if (!i) {
|
|
259
|
-
console.warn(`Theme "${s.theme}" not registered`);
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
s.unload = i.createElement(
|
|
263
|
-
s.el,
|
|
264
|
-
{ id: t, theme: s.theme, data: s.data },
|
|
265
|
-
i
|
|
266
|
-
) || {};
|
|
267
|
-
} catch (i) {
|
|
268
|
-
console.error(`Error creating label element for theme "${s.theme}":`, i);
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
s.el.style.display = "block", this.activeIds.add(t), this.occludedIds.delete(t);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
this._scheduleOcclusionCheck();
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* 检查标签是否存在
|
|
278
|
-
*/
|
|
279
|
-
has(e) {
|
|
280
|
-
return this.labels.has(e);
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* 清空活跃 ID 列表(不影响 DOM)
|
|
284
|
-
*/
|
|
285
|
-
reset() {
|
|
286
|
-
for (const e of this.activeIds.values()) {
|
|
287
|
-
let t = this.labels.get(e);
|
|
288
|
-
t && this.unloadByLabel(t);
|
|
289
|
-
}
|
|
290
|
-
this.activeIds.clear();
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* 清理当前未活跃的标签(隐藏而不移除 DOM)
|
|
294
|
-
*/
|
|
295
|
-
cleanup() {
|
|
296
|
-
for (const [e, t] of this.labels.entries())
|
|
297
|
-
this.activeIds.has(e) || (t.el.style.display = "none", this.occludedIds.delete(e));
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* 经纬度 -> 自动地形高度修正 -> Cartesian3 -> 屏幕坐标
|
|
301
|
-
*/
|
|
302
|
-
async toWindowPositionByLonLat(e, t) {
|
|
303
|
-
const s = this.Cesium, i = this.viewer.scene, o = [s.Cartographic.fromDegrees(e, t)];
|
|
304
|
-
let l;
|
|
305
|
-
try {
|
|
306
|
-
l = await i.clampToHeightMostDetailed(o);
|
|
307
|
-
} catch {
|
|
308
|
-
console.warn("clampToHeightMostDetailed failed, fallback to ellipsoid height.");
|
|
309
|
-
}
|
|
310
|
-
let n = 0;
|
|
311
|
-
l && l[0] && l[0].height != null ? n = l[0].height : n = 0;
|
|
312
|
-
const a = s.Cartesian3.fromDegrees(e, t, n);
|
|
313
|
-
return this.toWindowCoordinates(a);
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* 坐标转换:经纬度 -> 屏幕像素坐标
|
|
317
|
-
*/
|
|
318
|
-
toWindowCoordinates(e) {
|
|
319
|
-
const t = this.viewer.scene, s = this.Cesium.SceneTransforms;
|
|
320
|
-
if (typeof s?.wgs84ToWindowCoordinates == "function")
|
|
321
|
-
return s.wgs84ToWindowCoordinates(t, e);
|
|
322
|
-
if (typeof s?.worldToWindowCoordinates == "function")
|
|
323
|
-
return s.worldToWindowCoordinates(t, e);
|
|
324
|
-
console.warn("No compatible window coordinate transform function found.");
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* 检查经纬度是否有效
|
|
328
|
-
* @param lon 经度
|
|
329
|
-
* @param lat 纬度
|
|
330
|
-
* @returns 是否有效
|
|
331
|
-
*/
|
|
332
|
-
_isValidCoordinate(e, t) {
|
|
333
|
-
return !(Number.isNaN(e) || Number.isNaN(t) || e === 0 && t === 0 || e < -180 || e > 180 || t < -90 || t > 90);
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* 每帧刷新所有活跃标签的位置
|
|
337
|
-
*/
|
|
338
|
-
async _update() {
|
|
339
|
-
for (const e of this.activeIds) {
|
|
340
|
-
const t = this.labels.get(e);
|
|
341
|
-
if (!t) continue;
|
|
342
|
-
const s = parseFloat(t.el.dataset.lon), i = parseFloat(t.el.dataset.lat), o = parseFloat(t.el.dataset.height || "0");
|
|
343
|
-
if (!this._isValidCoordinate(s, i)) {
|
|
344
|
-
t.el.style.display = "none";
|
|
345
|
-
continue;
|
|
346
|
-
}
|
|
347
|
-
const l = this.Cesium.Cartesian3.fromDegrees(s, i, o), n = this.toWindowCoordinates(l);
|
|
348
|
-
if (this.Cesium.defined(n)) {
|
|
349
|
-
const r = this.themes[t.theme].options?.offset || {}, f = r.x || 0, u = r.y || 0, c = this.occludedIds.has(e);
|
|
350
|
-
t.el.style.left = `${n.x}px`, t.el.style.top = `${n.y}px`, t.el.style.transform = `translate(${f}px, ${u}px)`, t.el.style.display = c ? "none" : "block";
|
|
351
|
-
} else
|
|
352
|
-
t.el.style.display = "none";
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
_scheduleOcclusionCheck() {
|
|
356
|
-
if (!this.occlusionOptions.enabled) return;
|
|
357
|
-
const e = Date.now(), t = Math.max(0, Number(this.occlusionOptions.throttleMs) || 0), s = e - this._lastOcclusionAt, i = Math.max(0, t - s);
|
|
358
|
-
if (i === 0) {
|
|
359
|
-
this.runOcclusionCheckNow();
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
this._occlusionTimer === null && (this._occlusionTimer = window.setTimeout(() => {
|
|
363
|
-
this._occlusionTimer = null, this.runOcclusionCheckNow();
|
|
364
|
-
}, i));
|
|
365
|
-
}
|
|
366
|
-
_pushOcclusionLog(e) {
|
|
367
|
-
this.occlusionLogEnabled && (this.occlusionCheckLogs.push(e), this.occlusionCheckLogs.length > this.occlusionLogMax && this.occlusionCheckLogs.splice(0, this.occlusionCheckLogs.length - this.occlusionLogMax));
|
|
368
|
-
}
|
|
369
|
-
_computeLabelOccluded(e, t, s, i, o, l) {
|
|
370
|
-
const n = this.viewer?.scene, a = this.viewer?.camera, r = this.Cesium;
|
|
371
|
-
if (!n || !a || !r)
|
|
372
|
-
return this._pushOcclusionLog({
|
|
373
|
-
timestamp: Date.now(),
|
|
374
|
-
id: e,
|
|
375
|
-
lon: i,
|
|
376
|
-
lat: o,
|
|
377
|
-
height: l,
|
|
378
|
-
occluded: !0,
|
|
379
|
-
reason: "runtime-missing"
|
|
380
|
-
}), !0;
|
|
381
|
-
if (!n.pickPositionSupported || !s)
|
|
382
|
-
return this._pushOcclusionLog({
|
|
383
|
-
timestamp: Date.now(),
|
|
384
|
-
id: e,
|
|
385
|
-
lon: i,
|
|
386
|
-
lat: o,
|
|
387
|
-
height: l,
|
|
388
|
-
occluded: !0,
|
|
389
|
-
reason: "pick-unsupported"
|
|
390
|
-
}), !0;
|
|
391
|
-
try {
|
|
392
|
-
const f = n.pickPosition(s);
|
|
393
|
-
if (!f || !a.positionWC)
|
|
394
|
-
return this._pushOcclusionLog({
|
|
395
|
-
timestamp: Date.now(),
|
|
396
|
-
id: e,
|
|
397
|
-
lon: i,
|
|
398
|
-
lat: o,
|
|
399
|
-
height: l,
|
|
400
|
-
occluded: !0,
|
|
401
|
-
reason: "pick-empty"
|
|
402
|
-
}), !0;
|
|
403
|
-
const u = Number(this.occlusionOptions.distanceEpsilon) || 0, c = r.Cartesian3.distance(a.positionWC, t), d = r.Cartesian3.distance(a.positionWC, f), p = d + u < c;
|
|
404
|
-
return this._pushOcclusionLog({
|
|
405
|
-
timestamp: Date.now(),
|
|
406
|
-
id: e,
|
|
407
|
-
lon: i,
|
|
408
|
-
lat: o,
|
|
409
|
-
height: l,
|
|
410
|
-
occluded: p,
|
|
411
|
-
reason: "distance-compare",
|
|
412
|
-
epsilon: u,
|
|
413
|
-
labelDistance: c,
|
|
414
|
-
pickedDistance: d
|
|
415
|
-
}), p;
|
|
416
|
-
} catch {
|
|
417
|
-
return this._pushOcclusionLog({
|
|
418
|
-
timestamp: Date.now(),
|
|
419
|
-
id: e,
|
|
420
|
-
lon: i,
|
|
421
|
-
lat: o,
|
|
422
|
-
height: l,
|
|
423
|
-
occluded: !0,
|
|
424
|
-
reason: "pick-error"
|
|
425
|
-
}), !0;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
runOcclusionCheckNow() {
|
|
429
|
-
if (!this.occlusionOptions.enabled) {
|
|
430
|
-
this.occludedIds.clear();
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
if (this._occlusionChecking) {
|
|
434
|
-
this._occlusionPending = !0;
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
437
|
-
this._occlusionChecking = !0;
|
|
438
|
-
try {
|
|
439
|
-
for (const e of this.activeIds) {
|
|
440
|
-
const t = this.labels.get(e);
|
|
441
|
-
if (!t) {
|
|
442
|
-
this.occludedIds.delete(e), this._pushOcclusionLog({
|
|
443
|
-
timestamp: Date.now(),
|
|
444
|
-
id: e,
|
|
445
|
-
occluded: !1,
|
|
446
|
-
reason: "label-missing"
|
|
447
|
-
});
|
|
448
|
-
continue;
|
|
449
|
-
}
|
|
450
|
-
const s = parseFloat(t.el.dataset.lon), i = parseFloat(t.el.dataset.lat), o = parseFloat(t.el.dataset.height || "0");
|
|
451
|
-
if (!this._isValidCoordinate(s, i)) {
|
|
452
|
-
this.occludedIds.delete(e), this._pushOcclusionLog({
|
|
453
|
-
timestamp: Date.now(),
|
|
454
|
-
id: e,
|
|
455
|
-
lon: s,
|
|
456
|
-
lat: i,
|
|
457
|
-
height: o,
|
|
458
|
-
occluded: !1,
|
|
459
|
-
reason: "invalid-coordinate"
|
|
460
|
-
});
|
|
461
|
-
continue;
|
|
462
|
-
}
|
|
463
|
-
const l = this.Cesium.Cartesian3.fromDegrees(s, i, o), n = this.toWindowCoordinates(l);
|
|
464
|
-
if (!this.Cesium.defined(n)) {
|
|
465
|
-
this.occludedIds.delete(e), this._pushOcclusionLog({
|
|
466
|
-
timestamp: Date.now(),
|
|
467
|
-
id: e,
|
|
468
|
-
lon: s,
|
|
469
|
-
lat: i,
|
|
470
|
-
height: o,
|
|
471
|
-
occluded: !1,
|
|
472
|
-
reason: "screen-position-undefined"
|
|
473
|
-
});
|
|
474
|
-
continue;
|
|
475
|
-
}
|
|
476
|
-
this._computeLabelOccluded(e, l, n, s, i, o) ? this.occludedIds.add(e) : this.occludedIds.delete(e);
|
|
477
|
-
}
|
|
478
|
-
} finally {
|
|
479
|
-
this._lastOcclusionAt = Date.now(), this._occlusionChecking = !1, this._occlusionPending && (this._occlusionPending = !1, this._scheduleOcclusionCheck());
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
setOcclusionEnabled(e) {
|
|
483
|
-
this.occlusionOptions.enabled = !!e, this.occlusionOptions.enabled ? this.runOcclusionCheckNow() : (this.occludedIds.clear(), this._occlusionTimer !== null && (clearTimeout(this._occlusionTimer), this._occlusionTimer = null));
|
|
484
|
-
}
|
|
485
|
-
getOcclusionOptions() {
|
|
486
|
-
return {
|
|
487
|
-
enabled: this.occlusionOptions.enabled,
|
|
488
|
-
throttleMs: this.occlusionOptions.throttleMs,
|
|
489
|
-
distanceEpsilon: this.occlusionOptions.distanceEpsilon
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
setOcclusionOptions(e) {
|
|
493
|
-
e.throttleMs != null && (this.occlusionOptions.throttleMs = Math.max(0, Number(e.throttleMs) || 0)), e.distanceEpsilon != null && (this.occlusionOptions.distanceEpsilon = Math.max(0, Number(e.distanceEpsilon) || 0)), this.occlusionOptions.enabled && this._scheduleOcclusionCheck();
|
|
494
|
-
}
|
|
495
|
-
setOcclusionLogEnabled(e, t = !1) {
|
|
496
|
-
this.occlusionLogEnabled = !!e, t && (this.occlusionCheckLogs = []);
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* 销毁标签池,清理监听器和 DOM
|
|
500
|
-
*/
|
|
501
|
-
destroy() {
|
|
502
|
-
this.viewer.scene.postRender.removeEventListener(this._updateFn), this.viewer.camera.changed.removeEventListener(this._cameraChangedFn), this._occlusionTimer !== null && (clearTimeout(this._occlusionTimer), this._occlusionTimer = null), this.labels.clear(), this.activeIds.clear(), this.occludedIds.clear();
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
export {
|
|
506
|
-
L as H,
|
|
507
|
-
m as M,
|
|
508
|
-
_ as a
|
|
509
|
-
};
|
|
510
|
-
//# sourceMappingURL=HtmlOverlayLabelPool-CbiNlyAM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HtmlOverlayLabelPool-CbiNlyAM.js","sources":["../../cesium-core/src/components/MarkerEvent.ts","../../cesium-core/src/components/HtmlOverlayLabelPool.ts"],"sourcesContent":["export enum MarkerEventKey {\r\n Click = 'marker:click',\r\n DoubleClick = 'marker:dblclick',\r\n RightClick = 'marker:rightclick',\r\n MouseEnter = 'marker:mouseenter',\r\n MouseLeave = 'marker:mouseleave',\r\n MouseDown = 'marker:mousedown',\r\n MouseUp = 'marker:mouseup',\r\n}\r\n\r\ninterface ListenerItem<T = any> {\r\n name: string;\r\n fn: (data: T, event: Event) => void;\r\n once?: boolean;\r\n}\r\n\r\nexport { ListenerItem };\r\n\r\nexport class MarkerEventBus {\r\n private listenerMap = new Map<MarkerEventKey, Map<string, ListenerItem>>();\r\n\r\n /**\r\n * 添加监听器\r\n * @param key 事件 key\r\n * @param listener 监听器项\r\n * @param overwrite 是否覆盖同名监听器\r\n * @returns 是否成功添加\r\n */\r\n addListener(key: MarkerEventKey, listener: ListenerItem, overwrite: boolean = false): boolean {\r\n let map = this.listenerMap.get(key);\r\n if (!map) {\r\n map = new Map();\r\n this.listenerMap.set(key, map);\r\n }\r\n\r\n if (map.has(listener.name)) {\r\n if (overwrite) {\r\n console.warn(\r\n `[MarkerEventBus] Overwriting listener \"${listener.name}\" for event \"${key}\".`,\r\n );\r\n map.set(listener.name, listener);\r\n return true;\r\n } else {\r\n console.warn(\r\n `[MarkerEventBus] Listener \"${listener.name}\" for event \"${key}\" already exists. Use overwrite=true to replace it.`,\r\n );\r\n return false;\r\n }\r\n }\r\n\r\n map.set(listener.name, listener);\r\n return true;\r\n }\r\n\r\n /**\r\n * 移除某个 key 的所有监听器\r\n */\r\n removeListenerByKey(key: MarkerEventKey): boolean {\r\n const existed = this.listenerMap.has(key);\r\n this.listenerMap.set(key, new Map());\r\n return existed;\r\n }\r\n\r\n /**\r\n * 移除某个 key 下的指定名字的监听器\r\n */\r\n removeListenerByKeyAndName(key: MarkerEventKey, name: string): boolean {\r\n const map = this.listenerMap.get(key);\r\n if (!map) return false;\r\n return map.delete(name);\r\n }\r\n\r\n /**\r\n * 运行监听器\r\n */\r\n runListener<T = any>(key: MarkerEventKey, data: T, e: Event) {\r\n const map = this.listenerMap.get(key);\r\n if (!map) return;\r\n\r\n for (const [name, listener] of map.entries()) {\r\n try {\r\n listener.fn(data, e);\r\n } catch (err) {\r\n console.error(`Error in listener \"${name}\" for event \"${key}\":`, err);\r\n }\r\n\r\n if (listener.once) {\r\n map.delete(name);\r\n }\r\n }\r\n }\r\n}\r\n","import { MarkerEventKey, MarkerEventBus } from './MarkerEvent';\r\n\r\n/**\r\n * 单个标签实例\r\n */\r\ninterface LabelInstance {\r\n id: string;\r\n el: HTMLDivElement;\r\n theme: string;\r\n data?: any;\r\n notCreateElement?: boolean;\r\n unload?: any;\r\n}\r\n\r\n/**\r\n * 主题配置项\r\n */\r\ninterface ThemeOptions {\r\n /**\r\n * 创建标签 DOM 内容的方法\r\n */\r\n createElement: (\r\n el: HTMLDivElement,\r\n context: { id: string; theme: string; data: any },\r\n options: ThemeOptions,\r\n ) => any;\r\n\r\n /**\r\n * 可选配置,如偏移量\r\n */\r\n options?: {\r\n offset?: { x?: number; y?: number };\r\n };\r\n}\r\n\r\n/**\r\n * 标签添加时的参数\r\n */\r\ninterface LabelOptions {\r\n id: string;\r\n lon: number;\r\n lat: number;\r\n height?: number;\r\n theme: string;\r\n show?: boolean;\r\n notCreateElement?: boolean;\r\n style?: {\r\n [key: string]: string;\r\n };\r\n}\r\nexport { LabelOptions, LabelInstance, ThemeOptions };\r\n\r\n/**\r\n * 自定义事件与 DOM 事件的映射\r\n */\r\nexport const DOM_EVENT_MAP: Record<MarkerEventKey, keyof HTMLElementEventMap> = {\r\n [MarkerEventKey.Click]: 'click',\r\n [MarkerEventKey.DoubleClick]: 'dblclick',\r\n [MarkerEventKey.RightClick]: 'contextmenu',\r\n [MarkerEventKey.MouseEnter]: 'mouseenter',\r\n [MarkerEventKey.MouseLeave]: 'mouseleave',\r\n [MarkerEventKey.MouseDown]: 'mousedown',\r\n [MarkerEventKey.MouseUp]: 'mouseup',\r\n};\r\n\r\ninterface OcclusionOptions {\r\n enabled: boolean;\r\n throttleMs: number;\r\n distanceEpsilon: number;\r\n}\r\n\r\ntype OcclusionCheckReason =\r\n | 'label-missing'\r\n | 'invalid-coordinate'\r\n | 'screen-position-undefined'\r\n | 'runtime-missing'\r\n | 'pick-unsupported'\r\n | 'pick-empty'\r\n | 'pick-error'\r\n | 'distance-compare';\r\n\r\ninterface OcclusionCheckLog {\r\n timestamp: number;\r\n id: string;\r\n lon?: number;\r\n lat?: number;\r\n height?: number;\r\n occluded: boolean;\r\n reason: OcclusionCheckReason;\r\n epsilon?: number;\r\n labelDistance?: number;\r\n pickedDistance?: number;\r\n}\r\n\r\n/**\r\n * 用于管理 Cesium HTML 标签的池,支持主题渲染、事件分发、动态更新等功能\r\n */\r\nexport class HtmlOverlayLabelPool {\r\n private viewer: any;\r\n private Cesium: any;\r\n private container: HTMLDivElement;\r\n private labels: Map<string, LabelInstance> = new Map();\r\n private activeIds: Set<string> = new Set();\r\n private occludedIds: Set<string> = new Set();\r\n private _updateFn: () => void;\r\n private _cameraChangedFn: () => void;\r\n private themes: Record<string, ThemeOptions> = {};\r\n public occlusionCheckLogs: OcclusionCheckLog[] = [];\r\n private occlusionLogEnabled = false;\r\n private occlusionLogMax = 10000;\r\n private occlusionOptions: OcclusionOptions = {\r\n enabled: false,\r\n throttleMs: 120,\r\n distanceEpsilon: 1.0,\r\n };\r\n private _occlusionTimer: number | null = null;\r\n private _lastOcclusionAt: number = 0;\r\n private _occlusionChecking = false;\r\n private _occlusionPending = false;\r\n public eventBus: MarkerEventBus;\r\n public openWheel = true;\r\n /**\r\n * 构造函数\r\n * @param Cesium Cesium 命名空间\r\n * @param viewer Cesium Viewer 实例\r\n * @param containerId HTML 容器 ID(默认:\"html-label-container\")\r\n * @param eventBus 可选:自定义事件总线\r\n */\r\n constructor(\r\n Cesium: any,\r\n viewer: any,\r\n containerId: string = 'html-label-container',\r\n eventBus?: MarkerEventBus,\r\n openWheel: boolean = true,\r\n ) {\r\n this.Cesium = Cesium;\r\n this.viewer = viewer;\r\n this.container = this._createContainer(containerId);\r\n this._updateFn = this._update.bind(this);\r\n this.viewer.scene.postRender.addEventListener(this._updateFn);\r\n this._cameraChangedFn = this._scheduleOcclusionCheck.bind(this);\r\n this.viewer.camera.changed.addEventListener(this._cameraChangedFn);\r\n this.eventBus = eventBus || new MarkerEventBus();\r\n this.openWheel = openWheel;\r\n\r\n this.runOcclusionCheckNow();\r\n }\r\n\r\n /**\r\n * 创建标签容器\r\n */\r\n private _createContainer(id: string): HTMLDivElement {\r\n let container = document.getElementById(id) as HTMLDivElement;\r\n if (!container) {\r\n container = document.createElement('div');\r\n container.id = id;\r\n Object.assign(container.style, {\r\n position: 'absolute',\r\n top: '0',\r\n left: '0',\r\n pointerEvents: 'none',\r\n width: '100%',\r\n height: '100%',\r\n zIndex: '100',\r\n overflow: 'hidden',\r\n });\r\n document.body.appendChild(container);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * 注册标签主题\r\n */\r\n registerTheme(themeName: string, options: ThemeOptions) {\r\n this.themes[themeName] = options;\r\n }\r\n\r\n /**\r\n * 添加单个标签\r\n */\r\n add(data: any, options: LabelOptions) {\r\n const {\r\n id,\r\n lon,\r\n lat,\r\n height = 0,\r\n theme,\r\n show = true,\r\n notCreateElement = false,\r\n style,\r\n } = options;\r\n\r\n const themeOptions = this.themes[theme];\r\n if (!themeOptions) {\r\n console.warn(`Theme \"${theme}\" not registered`);\r\n return;\r\n }\r\n\r\n let label = this.labels.get(id);\r\n if (!label) {\r\n const el = document.createElement('div');\r\n Object.assign(el.style, {\r\n position: 'absolute',\r\n transform: 'translate(0, 0)',\r\n pointerEvents: 'auto',\r\n ...(options.style || {}),\r\n });\r\n\r\n // 绑定 DOM 事件到事件总线\r\n for (const [key, domEvent] of Object.entries(DOM_EVENT_MAP)) {\r\n el.addEventListener(domEvent, (e: Event) => {\r\n e.stopPropagation();\r\n const labelData = this.labels.get(id);\r\n this.eventBus.runListener(key as MarkerEventKey, labelData, e);\r\n });\r\n\r\n // 滚轮期间禁止点击\r\n let lastTime = 0;\r\n el.addEventListener('wheel', (event) => {\r\n if (!this.openWheel) return;\r\n const dom = event.currentTarget as HTMLElement;\r\n lastTime = Date.now();\r\n const currTime = lastTime;\r\n dom.style.pointerEvents = 'none';\r\n setTimeout(() => {\r\n if (lastTime === currTime) {\r\n dom.style.pointerEvents = 'auto';\r\n }\r\n }, 2000);\r\n });\r\n }\r\n\r\n let unload = null;\r\n if (!notCreateElement || show) {\r\n try {\r\n unload = themeOptions.createElement(el, { id, theme, data }, themeOptions) || {};\r\n } catch (err) {\r\n console.error(`Error updating label element for id \"${id}\":`, err);\r\n }\r\n this.container.appendChild(el);\r\n }\r\n label = { id, el, theme, data, notCreateElement, unload: unload };\r\n this.labels.set(id, label);\r\n } else {\r\n label.theme = theme;\r\n label.data = data;\r\n label.notCreateElement = notCreateElement;\r\n\r\n // 若已存在,则更新 DOM 内容\r\n try {\r\n label.unload = themeOptions.createElement(label.el, { id, theme, data }, themeOptions);\r\n if (!notCreateElement || show) {\r\n this.container.appendChild(label.el);\r\n }\r\n } catch (err) {\r\n console.error(`Error updating label element for id \"${id}\":`, err);\r\n }\r\n }\r\n\r\n // 存储坐标用于后续位置更新\r\n label.el.dataset.lon = String(lon);\r\n label.el.dataset.lat = String(lat);\r\n label.el.dataset.height = String(height);\r\n\r\n label.el.style.zIndex = style?.zIndex || '1';\r\n label.el.style.display = show ? 'block' : 'none';\r\n if (show) {\r\n this.activeIds.add(id);\r\n }\r\n if (!show) {\r\n this.occludedIds.delete(id);\r\n } else {\r\n this._scheduleOcclusionCheck();\r\n }\r\n }\r\n\r\n /**\r\n * 批量添加标签\r\n */\r\n addBatch(items: Array<{ data: any; options: LabelOptions }>) {\r\n for (const { data, options } of items) {\r\n this.add(data, options);\r\n }\r\n }\r\n\r\n /**\r\n * 根据 ID 批量移除标签\r\n */\r\n removeByIds(ids: string[]) {\r\n for (const id of ids) {\r\n const label = this.labels.get(id);\r\n if (label) {\r\n this.unloadByLabel(label);\r\n this.labels.delete(id);\r\n this.activeIds.delete(id);\r\n this.occludedIds.delete(id);\r\n }\r\n }\r\n }\r\n\r\n unloadByLabel(label: LabelInstance) {\r\n label.el.remove();\r\n if (label?.unload && typeof label.unload === 'function') label?.unload();\r\n label.unload = null;\r\n }\r\n\r\n /**\r\n * 移除所有标签\r\n */\r\n removeAll() {\r\n for (const label of this.labels.values()) {\r\n this.unloadByLabel(label);\r\n }\r\n this.labels.clear();\r\n this.activeIds.clear();\r\n this.occludedIds.clear();\r\n }\r\n\r\n /**\r\n * 更新标签的数据并刷新内容\r\n */\r\n update(id: string, newData: any) {\r\n const label = this.labels.get(id);\r\n if (!label) {\r\n console.warn(`Label with id \"${id}\" not found for update.`);\r\n return;\r\n }\r\n\r\n const theme = this.themes[label.theme];\r\n if (!theme) {\r\n console.warn(`Theme \"${label.theme}\" not registered.`);\r\n return;\r\n }\r\n\r\n try {\r\n theme.createElement(label.el, { id, theme: label.theme, data: newData }, theme);\r\n } catch (err) {\r\n console.error(`Failed to update label \"${id}\":`, err);\r\n }\r\n }\r\n\r\n /**\r\n * 根据 ID 批量隐藏标签\r\n */\r\n hideByIds(ids: string[]) {\r\n for (const id of ids) {\r\n const label = this.labels.get(id);\r\n if (label) {\r\n if (label.notCreateElement) {\r\n this.unloadByLabel(label);\r\n }\r\n label.el.style.display = 'none';\r\n this.activeIds.delete(id);\r\n this.occludedIds.delete(id);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * 隐藏所有标签\r\n */\r\n hideAll() {\r\n for (const label of this.labels.values()) {\r\n if (label.notCreateElement) {\r\n this.unloadByLabel(label);\r\n }\r\n label.el.style.display = 'none';\r\n this.activeIds.delete(label.id);\r\n this.occludedIds.delete(label.id);\r\n }\r\n }\r\n\r\n /**\r\n * 条件过滤隐藏标签\r\n */\r\n hideFilter(filter: (data: any) => boolean) {\r\n for (const label of this.labels.values()) {\r\n if (!filter(label.data)) continue;\r\n if (label.notCreateElement) {\r\n this.unloadByLabel(label);\r\n }\r\n label.el.style.display = 'none';\r\n this.activeIds.delete(label.id);\r\n this.occludedIds.delete(label.id);\r\n }\r\n }\r\n\r\n /**\r\n * 根据 ID 显示标签\r\n */\r\n showByIds(ids: string[]) {\r\n for (const id of ids) {\r\n const label = this.labels.get(id);\r\n if (label) {\r\n if (label.notCreateElement || !label.el.parentNode) {\r\n this.container.appendChild(label.el);\r\n }\r\n if (!label.unload) {\r\n try {\r\n const themeOptions = this.themes[label.theme];\r\n if (!themeOptions) {\r\n console.warn(`Theme \"${label.theme}\" not registered`);\r\n return;\r\n }\r\n label.unload =\r\n themeOptions.createElement(\r\n label.el,\r\n { id, theme: label.theme, data: label.data },\r\n themeOptions,\r\n ) || {};\r\n } catch (err) {\r\n console.error(`Error creating label element for theme \"${label.theme}\":`, err);\r\n return;\r\n }\r\n }\r\n\r\n label.el.style.display = 'block';\r\n this.activeIds.add(id);\r\n this.occludedIds.delete(id);\r\n }\r\n }\r\n this._scheduleOcclusionCheck();\r\n }\r\n\r\n /**\r\n * 检查标签是否存在\r\n */\r\n has(id: string): boolean {\r\n return this.labels.has(id);\r\n }\r\n\r\n /**\r\n * 清空活跃 ID 列表(不影响 DOM)\r\n */\r\n reset() {\r\n for (const id of this.activeIds.values()) {\r\n let label = this.labels.get(id);\r\n label && this.unloadByLabel(label);\r\n }\r\n this.activeIds.clear();\r\n }\r\n\r\n /**\r\n * 清理当前未活跃的标签(隐藏而不移除 DOM)\r\n */\r\n cleanup() {\r\n for (const [id, label] of this.labels.entries()) {\r\n if (!this.activeIds.has(id)) {\r\n label.el.style.display = 'none';\r\n this.occludedIds.delete(id);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * 经纬度 -> 自动地形高度修正 -> Cartesian3 -> 屏幕坐标\r\n */\r\n async toWindowPositionByLonLat(lon: number, lat: number): Promise<any> {\r\n const Cesium = this.Cesium;\r\n const scene = this.viewer.scene;\r\n\r\n // 1. 经纬度列表\r\n const positions = [Cesium.Cartographic.fromDegrees(lon, lat)];\r\n\r\n // 2. 使用 clampToHeightMostDetailed 获取真实地形高度\r\n let heightResult;\r\n try {\r\n heightResult = await scene.clampToHeightMostDetailed(positions);\r\n } catch (e) {\r\n console.warn('clampToHeightMostDetailed failed, fallback to ellipsoid height.');\r\n }\r\n\r\n let finalHeight = 0;\r\n if (heightResult && heightResult[0] && heightResult[0].height != null) {\r\n finalHeight = heightResult[0].height; // 用户偏好:height[0].height\r\n } else {\r\n // 如果地形未开启,则 fallback 椭球高度\r\n finalHeight = 0;\r\n }\r\n\r\n // 3. 生成真实位置 Cartesian3\r\n const worldPos = Cesium.Cartesian3.fromDegrees(lon, lat, finalHeight);\r\n\r\n // 4. 转屏幕像素坐标\r\n return this.toWindowCoordinates(worldPos);\r\n }\r\n\r\n /**\r\n * 坐标转换:经纬度 -> 屏幕像素坐标\r\n */\r\n toWindowCoordinates(position: any): any {\r\n const scene = this.viewer.scene;\r\n const st = this.Cesium.SceneTransforms;\r\n if (typeof st?.wgs84ToWindowCoordinates === 'function') {\r\n return st.wgs84ToWindowCoordinates(scene, position);\r\n }\r\n if (typeof st?.worldToWindowCoordinates === 'function') {\r\n return st.worldToWindowCoordinates(scene, position);\r\n }\r\n\r\n console.warn('No compatible window coordinate transform function found.');\r\n return undefined;\r\n }\r\n\r\n /**\r\n * 检查经纬度是否有效\r\n * @param lon 经度\r\n * @param lat 纬度\r\n * @returns 是否有效\r\n */\r\n private _isValidCoordinate(lon: number, lat: number): boolean {\r\n // 检查是否为 NaN\r\n if (Number.isNaN(lon) || Number.isNaN(lat)) return false;\r\n // 检查是否为 0(用户要求 0,0 时不显示)\r\n if (lon === 0 && lat === 0) return false;\r\n // 检查是否在有效范围内\r\n if (lon < -180 || lon > 180 || lat < -90 || lat > 90) return false;\r\n return true;\r\n }\r\n\r\n /**\r\n * 每帧刷新所有活跃标签的位置\r\n */\r\n private async _update() {\r\n for (const id of this.activeIds) {\r\n const label = this.labels.get(id);\r\n if (!label) continue;\r\n\r\n const lon = parseFloat(label.el.dataset.lon!);\r\n const lat = parseFloat(label.el.dataset.lat!);\r\n const height = parseFloat(label.el.dataset.height || '0');\r\n\r\n // 检查经纬度是否有效,无效则隐藏标签\r\n if (!this._isValidCoordinate(lon, lat)) {\r\n label.el.style.display = 'none';\r\n continue;\r\n }\r\n\r\n const position = this.Cesium.Cartesian3.fromDegrees(lon, lat, height);\r\n const screenPosition = this.toWindowCoordinates(position);\r\n\r\n if (this.Cesium.defined(screenPosition)) {\r\n const theme = this.themes[label.theme];\r\n const offset = theme.options?.offset || {};\r\n const offsetX = offset.x || 0;\r\n const offsetY = offset.y || 0;\r\n const occluded = this.occludedIds.has(id);\r\n\r\n label.el.style.left = `${screenPosition.x}px`;\r\n label.el.style.top = `${screenPosition.y}px`;\r\n label.el.style.transform = `translate(${offsetX}px, ${offsetY}px)`;\r\n label.el.style.display = occluded ? 'none' : 'block';\r\n } else {\r\n label.el.style.display = 'none';\r\n }\r\n }\r\n }\r\n\r\n private _scheduleOcclusionCheck() {\r\n if (!this.occlusionOptions.enabled) return;\r\n\r\n const now = Date.now();\r\n const throttleMs = Math.max(0, Number(this.occlusionOptions.throttleMs) || 0);\r\n const elapsed = now - this._lastOcclusionAt;\r\n const waitMs = Math.max(0, throttleMs - elapsed);\r\n\r\n if (waitMs === 0) {\r\n this.runOcclusionCheckNow();\r\n return;\r\n }\r\n\r\n if (this._occlusionTimer !== null) return;\r\n this._occlusionTimer = window.setTimeout(() => {\r\n this._occlusionTimer = null;\r\n this.runOcclusionCheckNow();\r\n }, waitMs);\r\n }\r\n\r\n private _pushOcclusionLog(log: OcclusionCheckLog) {\r\n if (!this.occlusionLogEnabled) return;\r\n this.occlusionCheckLogs.push(log);\r\n if (this.occlusionCheckLogs.length > this.occlusionLogMax) {\r\n this.occlusionCheckLogs.splice(0, this.occlusionCheckLogs.length - this.occlusionLogMax);\r\n }\r\n }\r\n\r\n private _computeLabelOccluded(\r\n id: string,\r\n worldPosition: any,\r\n windowPosition: any,\r\n lon?: number,\r\n lat?: number,\r\n height?: number,\r\n ): boolean {\r\n const scene = this.viewer?.scene;\r\n const camera = this.viewer?.camera;\r\n const Cesium = this.Cesium;\r\n if (!scene || !camera || !Cesium) {\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: true,\r\n reason: 'runtime-missing',\r\n });\r\n return true;\r\n }\r\n\r\n if (!scene.pickPositionSupported || !windowPosition) {\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: true,\r\n reason: 'pick-unsupported',\r\n });\r\n return true;\r\n }\r\n\r\n try {\r\n const pickedPosition = scene.pickPosition(windowPosition);\r\n if (!pickedPosition || !camera.positionWC) {\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: true,\r\n reason: 'pick-empty',\r\n });\r\n return true;\r\n }\r\n const epsilon = Number(this.occlusionOptions.distanceEpsilon) || 0;\r\n const labelDistance = Cesium.Cartesian3.distance(camera.positionWC, worldPosition);\r\n const pickedDistance = Cesium.Cartesian3.distance(camera.positionWC, pickedPosition);\r\n const occluded = pickedDistance + epsilon < labelDistance;\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded,\r\n reason: 'distance-compare',\r\n epsilon,\r\n labelDistance,\r\n pickedDistance,\r\n });\r\n return occluded;\r\n } catch (error) {\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: true,\r\n reason: 'pick-error',\r\n });\r\n return true;\r\n }\r\n }\r\n\r\n runOcclusionCheckNow() {\r\n if (!this.occlusionOptions.enabled) {\r\n this.occludedIds.clear();\r\n return;\r\n }\r\n\r\n if (this._occlusionChecking) {\r\n this._occlusionPending = true;\r\n return;\r\n }\r\n\r\n this._occlusionChecking = true;\r\n try {\r\n for (const id of this.activeIds) {\r\n const label = this.labels.get(id);\r\n if (!label) {\r\n this.occludedIds.delete(id);\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n occluded: false,\r\n reason: 'label-missing',\r\n });\r\n continue;\r\n }\r\n\r\n const lon = parseFloat(label.el.dataset.lon!);\r\n const lat = parseFloat(label.el.dataset.lat!);\r\n const height = parseFloat(label.el.dataset.height || '0');\r\n if (!this._isValidCoordinate(lon, lat)) {\r\n this.occludedIds.delete(id);\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: false,\r\n reason: 'invalid-coordinate',\r\n });\r\n continue;\r\n }\r\n\r\n const worldPosition = this.Cesium.Cartesian3.fromDegrees(lon, lat, height);\r\n const screenPosition = this.toWindowCoordinates(worldPosition);\r\n if (!this.Cesium.defined(screenPosition)) {\r\n this.occludedIds.delete(id);\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: false,\r\n reason: 'screen-position-undefined',\r\n });\r\n continue;\r\n }\r\n\r\n const occluded = this._computeLabelOccluded(id, worldPosition, screenPosition, lon, lat, height);\r\n if (occluded) this.occludedIds.add(id);\r\n else this.occludedIds.delete(id);\r\n }\r\n } finally {\r\n this._lastOcclusionAt = Date.now();\r\n this._occlusionChecking = false;\r\n if (this._occlusionPending) {\r\n this._occlusionPending = false;\r\n this._scheduleOcclusionCheck();\r\n }\r\n }\r\n }\r\n\r\n setOcclusionEnabled(enabled: boolean) {\r\n this.occlusionOptions.enabled = Boolean(enabled);\r\n if (!this.occlusionOptions.enabled) {\r\n this.occludedIds.clear();\r\n if (this._occlusionTimer !== null) {\r\n clearTimeout(this._occlusionTimer);\r\n this._occlusionTimer = null;\r\n }\r\n } else {\r\n this.runOcclusionCheckNow();\r\n }\r\n }\r\n\r\n getOcclusionOptions(): OcclusionOptions {\r\n return {\r\n enabled: this.occlusionOptions.enabled,\r\n throttleMs: this.occlusionOptions.throttleMs,\r\n distanceEpsilon: this.occlusionOptions.distanceEpsilon,\r\n };\r\n }\r\n\r\n setOcclusionOptions(options: Partial<Pick<OcclusionOptions, 'throttleMs' | 'distanceEpsilon'>>) {\r\n if (options.throttleMs != null) {\r\n this.occlusionOptions.throttleMs = Math.max(0, Number(options.throttleMs) || 0);\r\n }\r\n if (options.distanceEpsilon != null) {\r\n this.occlusionOptions.distanceEpsilon = Math.max(0, Number(options.distanceEpsilon) || 0);\r\n }\r\n if (this.occlusionOptions.enabled) {\r\n this._scheduleOcclusionCheck();\r\n }\r\n }\r\n\r\n setOcclusionLogEnabled(enabled: boolean, clearExisting: boolean = false) {\r\n this.occlusionLogEnabled = Boolean(enabled);\r\n if (clearExisting) {\r\n this.occlusionCheckLogs = [];\r\n }\r\n }\r\n\r\n /**\r\n * 销毁标签池,清理监听器和 DOM\r\n */\r\n destroy() {\r\n this.viewer.scene.postRender.removeEventListener(this._updateFn);\r\n this.viewer.camera.changed.removeEventListener(this._cameraChangedFn);\r\n if (this._occlusionTimer !== null) {\r\n clearTimeout(this._occlusionTimer);\r\n this._occlusionTimer = null;\r\n }\r\n // this.container.remove();\r\n this.labels.clear();\r\n this.activeIds.clear();\r\n this.occludedIds.clear();\r\n }\r\n}\r\n"],"names":["MarkerEventKey","MarkerEventBus","key","listener","overwrite","map","existed","name","data","e","err","DOM_EVENT_MAP","HtmlOverlayLabelPool","Cesium","viewer","containerId","eventBus","openWheel","id","container","themeName","options","lon","lat","height","theme","show","notCreateElement","style","themeOptions","label","el","domEvent","labelData","lastTime","event","dom","currTime","unload","items","ids","newData","filter","scene","positions","heightResult","finalHeight","worldPos","position","st","screenPosition","offset","offsetX","offsetY","occluded","now","throttleMs","elapsed","waitMs","log","worldPosition","windowPosition","camera","pickedPosition","epsilon","labelDistance","pickedDistance","enabled","clearExisting"],"mappings":"AAAO,IAAKA,sBAAAA,OACVA,EAAA,QAAQ,gBACRA,EAAA,cAAc,mBACdA,EAAA,aAAa,qBACbA,EAAA,aAAa,qBACbA,EAAA,aAAa,qBACbA,EAAA,YAAY,oBACZA,EAAA,UAAU,kBAPAA,IAAAA,KAAA,CAAA,CAAA;AAkBL,MAAMC,EAAe;AAAA,EAClB,kCAAkB,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS1B,YAAYC,GAAqBC,GAAwBC,IAAqB,IAAgB;AAC5F,QAAIC,IAAM,KAAK,YAAY,IAAIH,CAAG;AAMlC,WALKG,MACHA,wBAAU,IAAA,GACV,KAAK,YAAY,IAAIH,GAAKG,CAAG,IAG3BA,EAAI,IAAIF,EAAS,IAAI,IACnBC,KACF,QAAQ;AAAA,MACN,0CAA0CD,EAAS,IAAI,gBAAgBD,CAAG;AAAA,IAAA,GAE5EG,EAAI,IAAIF,EAAS,MAAMA,CAAQ,GACxB,OAEP,QAAQ;AAAA,MACN,8BAA8BA,EAAS,IAAI,gBAAgBD,CAAG;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