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