leiting-bim 2.1.157 → 2.1.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/leiting-bim.es.js +1 -1
- package/leiting-bim.umd.js +1 -1
- package/leitingbim.css +1 -1
- package/package.json +1 -1
- package/plugins/cesium-core/dist/cesium-core.mjs +177 -109
- package/plugins/cesium-core/dist/cesium-core.mjs.map +1 -1
- package/plugins/cesium-core/dist/cesium-core.umd.js +19 -19
- package/plugins/cesium-core/dist/cesium-core.umd.js.map +1 -1
- package/plugins/cesium-core/dist/components/draw/handlers/LineDrawer.d.ts +7 -0
- package/plugins/cesium-core/dist/components/draw/handlers/PolygonDrawer.d.ts +7 -0
- package/plugins/cesium-core/package.json +1 -1
- package/plugins/cesium-vue/dist/components/basic-audio.js.map +1 -1
- package/plugins/cesium-vue/dist/components/marker-manage.js +877 -576
- package/plugins/cesium-vue/dist/components/marker-manage.js.map +1 -1
- package/plugins/cesium-vue/dist/index-Kqi_S6KA.js.map +1 -1
- package/plugins/cesium-vue/package.json +1 -1
- package/plugins/theme-chalk/package.json +1 -1
- package/plugins/utils/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { w as
|
|
2
|
-
import { h as
|
|
3
|
-
import { M as
|
|
4
|
-
import { CxCardCarousel as
|
|
5
|
-
import { CxMarkerBubbleLine as
|
|
6
|
-
import { CxMarkerDefault as
|
|
7
|
-
import { CxMarkerHtml as
|
|
8
|
-
import { CxMarkerText as
|
|
9
|
-
import { i as
|
|
10
|
-
const
|
|
1
|
+
import { w as Ne } from "../create-DynflqE1.js";
|
|
2
|
+
import { h as x, markRaw as I, render as O, defineComponent as ke, inject as Be, onMounted as We, watch as te, onUnmounted as Fe, renderSlot as $e, unref as ze } from "vue";
|
|
3
|
+
import { M as G, H as ie, a as V } from "../HtmlOverlayLabelPool-CbiNlyAM.js";
|
|
4
|
+
import { CxCardCarousel as re } from "./card-carousel.js";
|
|
5
|
+
import { CxMarkerBubbleLine as Ve, CxMarkerBubble as Ke } from "./marker-bubble.js";
|
|
6
|
+
import { CxMarkerDefault as ae } from "./marker-default.js";
|
|
7
|
+
import { CxMarkerHtml as Xe } from "./marker-html.js";
|
|
8
|
+
import { CxMarkerText as Ye } from "./marker-text.js";
|
|
9
|
+
import { i as q, b as ce, a as P, S as R, d as ne, c as j, e as ge, f as Ue, g as de, M as ue, h as K, j as qe, k as je, l as Ze, m as fe, n as me, o as Je, p as Qe, q as et, r as tt, s as it, t as pe, u as rt, v as at, w as nt, x as ot } from "../index-McKGafjp.js";
|
|
10
|
+
const st = {
|
|
11
11
|
id: { type: String, default: "marker" },
|
|
12
12
|
Cesium: { type: Object },
|
|
13
13
|
viewer: { type: Object },
|
|
@@ -18,8 +18,8 @@ const Ze = {
|
|
|
18
18
|
themeConfig: { type: Object }
|
|
19
19
|
// Optional override
|
|
20
20
|
};
|
|
21
|
-
var
|
|
22
|
-
class
|
|
21
|
+
var H = /* @__PURE__ */ ((a) => (a.左建选中模型 = "MODEL_LEFT_CLICK", a.标记左键点击 = "TAG_LEFT_CLICK", a.标记移入 = "TAG_MOUSEENTER", a.标记移出 = "TAG_MOUSELEAVE", a.模型位置保存 = "SAVE_REGION", a.模型加载完成 = "MODEL_READY", a))(H || {});
|
|
22
|
+
class lt {
|
|
23
23
|
Cesium;
|
|
24
24
|
viewer;
|
|
25
25
|
labelPool;
|
|
@@ -56,10 +56,10 @@ class Je {
|
|
|
56
56
|
maxRefineLevels = 2;
|
|
57
57
|
constructor(e, t, i) {
|
|
58
58
|
this.Cesium = e, this.viewer = t, this.labelPool = i.labelPool, this.threshold = i.threshold ?? 10, this.displayLimit = i.displayLimit ?? 100, this.maxLevel = i.maxLevel ?? 5, this.debugCurrentGrids = i.debugCurrentGrids ?? !1, this.clusterTheme = i.clusterTheme ?? "cluster-label", this.pointTheme = i.pointTheme ?? "point-label", this.centralPointMode = i.centralPointMode ?? "central", this.minGlobalPointCount = i.minGlobalPointCount ?? 0, this.groupByTheme = i.groupByTheme ?? !1, this.terrainLevelOffset = i.terrainLevelOffset ?? 2;
|
|
59
|
-
const
|
|
60
|
-
this._lastTileProvider = o, this.tilingScheme = s, this.levels = this._createLevels(), this._buildLevels(), this._updateFn = this._update.bind(this), this.debugCurrentGrids && this._ensureDebugImageryLayer(),
|
|
59
|
+
const r = this.viewer.scene && this.viewer.scene.globe, n = r && r._surface, o = n && n._tileProvider, s = o?.tilingScheme || new this.Cesium.GeographicTilingScheme();
|
|
60
|
+
this._lastTileProvider = o, this.tilingScheme = s, this.levels = this._createLevels(), this._buildLevels(), this._updateFn = this._update.bind(this), this.debugCurrentGrids && this._ensureDebugImageryLayer(), r && (this._tileLoadListener = (h) => {
|
|
61
61
|
h === 0 && this._cameraDirty && (this._cameraDirty = !1, this._scheduleUpdate());
|
|
62
|
-
},
|
|
62
|
+
}, r.tileLoadProgressEvent.addEventListener(this._tileLoadListener)), this._cameraChangedHandler = () => {
|
|
63
63
|
this._update();
|
|
64
64
|
}, this.viewer.camera.changed.addEventListener(this._cameraChangedHandler);
|
|
65
65
|
}
|
|
@@ -80,21 +80,21 @@ class Je {
|
|
|
80
80
|
this.debugCurrentGrids = e, e ? this._ensureDebugImageryLayer() : (this._clearDebugGrids(), this._removeDebugImageryLayer()), t && this._update();
|
|
81
81
|
}
|
|
82
82
|
_syncTilingSchemeAndLevels() {
|
|
83
|
-
const e = this.viewer.scene && this.viewer.scene.globe, t = e && e._surface, i = t && t._tileProvider,
|
|
84
|
-
!
|
|
83
|
+
const e = this.viewer.scene && this.viewer.scene.globe, t = e && e._surface, i = t && t._tileProvider, r = i?.tilingScheme || new this.Cesium.GeographicTilingScheme(), n = i !== this._lastTileProvider, o = this.tilingScheme !== r;
|
|
84
|
+
!n && !o && this.levels && this.levels.length > 0 || (this._lastTileProvider = i, this.tilingScheme = r, this.levels = this._createLevels(), this._buildLevels(), this.debugCurrentGrids && (this._removeDebugImageryLayer(), this._ensureDebugImageryLayer()));
|
|
85
85
|
}
|
|
86
86
|
_createLevels() {
|
|
87
87
|
const e = [];
|
|
88
88
|
this.levelIndexByTileLevel = /* @__PURE__ */ new Map();
|
|
89
89
|
const t = 0, i = this.maxLevel;
|
|
90
|
-
let
|
|
91
|
-
for (let
|
|
92
|
-
const o = 360 / Math.pow(2,
|
|
90
|
+
let r = 0;
|
|
91
|
+
for (let n = t; n <= i; n++, r++) {
|
|
92
|
+
const o = 360 / Math.pow(2, n);
|
|
93
93
|
e.push({
|
|
94
|
-
level:
|
|
94
|
+
level: n,
|
|
95
95
|
size: o,
|
|
96
96
|
minViewWidth: o * 4
|
|
97
|
-
}), this.levelIndexByTileLevel.set(
|
|
97
|
+
}), this.levelIndexByTileLevel.set(n, r);
|
|
98
98
|
}
|
|
99
99
|
return e;
|
|
100
100
|
}
|
|
@@ -114,49 +114,49 @@ class Je {
|
|
|
114
114
|
}, this._updateDelay);
|
|
115
115
|
}
|
|
116
116
|
updatePoint(e) {
|
|
117
|
-
const t = this.points.findIndex((
|
|
117
|
+
const t = this.points.findIndex((n) => n.id === e.id);
|
|
118
118
|
if (t === -1) return;
|
|
119
119
|
const i = this.points[t];
|
|
120
|
-
for (const
|
|
121
|
-
const o =
|
|
120
|
+
for (const n of this.levels) {
|
|
121
|
+
const o = n.level, s = this.gridLayers.get(o);
|
|
122
122
|
if (!s) continue;
|
|
123
|
-
const h = this.Cesium.Cartographic.fromDegrees(i.lon, i.lat),
|
|
123
|
+
const h = this.Cesium.Cartographic.fromDegrees(i.lon, i.lat), g = this.tilingScheme.positionToTileXY(
|
|
124
124
|
h,
|
|
125
125
|
o,
|
|
126
126
|
new this.Cesium.Cartesian2()
|
|
127
127
|
);
|
|
128
|
-
if (!
|
|
129
|
-
const l = `${
|
|
128
|
+
if (!g) continue;
|
|
129
|
+
const l = `${g.x}_${g.y}`, c = s.get(l);
|
|
130
130
|
if (c) {
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
131
|
+
const d = c.allPoints.findIndex((f) => f.id === e.id);
|
|
132
|
+
if (d !== -1 && c.allPoints.splice(d, 1), i.data?.billboard?.[0]?.skipAggregation) {
|
|
133
133
|
const f = c.skipPoints.findIndex((u) => u.id === e.id);
|
|
134
134
|
f !== -1 && c.skipPoints.splice(f, 1);
|
|
135
135
|
} else {
|
|
136
136
|
const f = this.groupByTheme ? i.data?.theme : this.clusterTheme, u = c.groups.get(f);
|
|
137
137
|
if (u) {
|
|
138
|
-
const m = u.findIndex((
|
|
138
|
+
const m = u.findIndex((b) => b.id === e.id);
|
|
139
139
|
m !== -1 && u.splice(m, 1), u.length === 0 && c.groups.delete(f);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
const
|
|
145
|
-
this.points[t] =
|
|
144
|
+
const r = { ...i, ...e };
|
|
145
|
+
this.points[t] = r, this._addPointToGrid(r), this._update();
|
|
146
146
|
}
|
|
147
147
|
removePointsById(e) {
|
|
148
148
|
const t = new Set(e);
|
|
149
149
|
this.points = this.points.filter((i) => !t.has(i.id));
|
|
150
150
|
for (const i of this.levels) {
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
for (const [
|
|
151
|
+
const r = this.gridLayers.get(i.level);
|
|
152
|
+
if (r)
|
|
153
|
+
for (const [n, o] of r.entries()) {
|
|
154
154
|
o.allPoints = o.allPoints.filter((s) => !t.has(s.id)), o.skipPoints = o.skipPoints.filter((s) => !t.has(s.id));
|
|
155
155
|
for (const [s, h] of o.groups.entries()) {
|
|
156
|
-
const
|
|
157
|
-
|
|
156
|
+
const g = h.filter((l) => !t.has(l.id));
|
|
157
|
+
g.length === 0 ? o.groups.delete(s) : o.groups.set(s, g);
|
|
158
158
|
}
|
|
159
|
-
o.allPoints.length === 0 &&
|
|
159
|
+
o.allPoints.length === 0 && r.delete(n);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
this._update();
|
|
@@ -170,52 +170,52 @@ class Je {
|
|
|
170
170
|
}
|
|
171
171
|
_addPointToGrid(e) {
|
|
172
172
|
for (const t of this.levels) {
|
|
173
|
-
const i = t.level,
|
|
174
|
-
if (!
|
|
175
|
-
const
|
|
176
|
-
|
|
173
|
+
const i = t.level, r = this.gridLayers.get(i);
|
|
174
|
+
if (!r) continue;
|
|
175
|
+
const n = this.Cesium.Cartographic.fromDegrees(e.lon, e.lat), o = this.tilingScheme.positionToTileXY(
|
|
176
|
+
n,
|
|
177
177
|
i,
|
|
178
178
|
new this.Cesium.Cartesian2()
|
|
179
179
|
);
|
|
180
180
|
if (!o) continue;
|
|
181
181
|
const s = `${o.x}_${o.y}`;
|
|
182
|
-
let h =
|
|
182
|
+
let h = r.get(s);
|
|
183
183
|
if (h || (h = {
|
|
184
184
|
allPoints: [],
|
|
185
185
|
groups: /* @__PURE__ */ new Map(),
|
|
186
186
|
skipPoints: []
|
|
187
|
-
},
|
|
187
|
+
}, r.set(s, h)), h.allPoints.push(e), e.data?.billboard?.[0]?.skipAggregation)
|
|
188
188
|
h.skipPoints.push(e);
|
|
189
189
|
else {
|
|
190
|
-
const
|
|
191
|
-
h.groups.has(
|
|
190
|
+
const g = this.groupByTheme ? e.data?.billboard?.[0]?.theme : this.clusterTheme;
|
|
191
|
+
h.groups.has(g) || h.groups.set(g, []), h.groups.get(g).push(e);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
// 在添加/更新点时预计算并缓存地图层级区间
|
|
196
196
|
_preparePointLevelRange(e) {
|
|
197
197
|
const t = e.data || {};
|
|
198
|
-
let i = t.minLevel,
|
|
199
|
-
const
|
|
200
|
-
Array.isArray(
|
|
201
|
-
const o = i == null ? this.defaultMinLevel : Number(i) || this.defaultMinLevel, s =
|
|
198
|
+
let i = t.minLevel, r = t.maxLevel;
|
|
199
|
+
const n = t.levelRange;
|
|
200
|
+
Array.isArray(n) ? (n.length > 0 && i == null && (i = n[0]), n.length > 1 && r == null && (r = n[1])) : n && typeof n == "object" && (i == null && typeof n.min == "number" && (i = n.min), r == null && typeof n.max == "number" && (r = n.max));
|
|
201
|
+
const o = i == null ? this.defaultMinLevel : Number(i) || this.defaultMinLevel, s = r == null ? this.defaultMaxLevel : Number(r) || this.defaultMaxLevel;
|
|
202
202
|
e.__minLevel = o, e.__maxLevel = s;
|
|
203
203
|
}
|
|
204
204
|
_isVisibleAtLevel(e, t) {
|
|
205
205
|
if (t == null) return !0;
|
|
206
206
|
(e.__minLevel === void 0 || e.__maxLevel === void 0) && this._preparePointLevelRange(e);
|
|
207
|
-
const i = e.__minLevel ?? this.defaultMinLevel,
|
|
208
|
-
return t >= i && t <=
|
|
207
|
+
const i = e.__minLevel ?? this.defaultMinLevel, r = e.__maxLevel ?? this.defaultMaxLevel;
|
|
208
|
+
return t >= i && t <= r;
|
|
209
209
|
}
|
|
210
210
|
_update() {
|
|
211
211
|
if (!this.labelPool) return;
|
|
212
212
|
this._syncTilingSchemeAndLevels(), this.labelPool.reset(), this.debugCurrentGrids && this._clearDebugGrids();
|
|
213
213
|
const e = this.points.length < this.minGlobalPointCount ? 1 / 0 : this.threshold;
|
|
214
214
|
let t = 0;
|
|
215
|
-
const i = (
|
|
215
|
+
const i = (r, n, o, s) => {
|
|
216
216
|
t = this._processCell(
|
|
217
|
+
r,
|
|
217
218
|
n,
|
|
218
|
-
a,
|
|
219
219
|
o,
|
|
220
220
|
s,
|
|
221
221
|
e,
|
|
@@ -223,12 +223,12 @@ class Je {
|
|
|
223
223
|
);
|
|
224
224
|
};
|
|
225
225
|
try {
|
|
226
|
-
const
|
|
227
|
-
if (!
|
|
226
|
+
const r = this._getSurfaceTiles();
|
|
227
|
+
if (!r || r.length === 0) {
|
|
228
228
|
this._handleNoSurfaceTiles(t);
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
|
-
this._tilesRetryCount = 0, this._processTiles(
|
|
231
|
+
this._tilesRetryCount = 0, this._processTiles(r, i);
|
|
232
232
|
} catch {
|
|
233
233
|
this.labelPool.cleanup();
|
|
234
234
|
return;
|
|
@@ -258,21 +258,21 @@ class Je {
|
|
|
258
258
|
let t = this.levelIndexByTileLevel.get(e);
|
|
259
259
|
if (t !== void 0) return t;
|
|
260
260
|
if (this.levels.length === 0) return;
|
|
261
|
-
const i = this.levels[0].level,
|
|
262
|
-
if (e >
|
|
261
|
+
const i = this.levels[0].level, r = this.levels[this.levels.length - 1].level;
|
|
262
|
+
if (e > r)
|
|
263
263
|
return this.levels.length - 1;
|
|
264
264
|
if (e < i)
|
|
265
265
|
return 0;
|
|
266
|
-
let
|
|
266
|
+
let n = 0, o = 1 / 0;
|
|
267
267
|
for (let s = 0; s < this.levels.length; s++) {
|
|
268
268
|
const h = Math.abs(this.levels[s].level - e);
|
|
269
|
-
h < o && (o = h,
|
|
269
|
+
h < o && (o = h, n = s);
|
|
270
270
|
}
|
|
271
|
-
return
|
|
271
|
+
return n;
|
|
272
272
|
}
|
|
273
273
|
_isTerrainEnabled() {
|
|
274
|
-
const e = this.viewer.terrainProvider, t = this.viewer.scene, i = t && t.globe,
|
|
275
|
-
return
|
|
274
|
+
const e = this.viewer.terrainProvider, t = this.viewer.scene, i = t && t.globe, r = i && i.terrainProvider, n = e || r;
|
|
275
|
+
return n ? !(n instanceof this.Cesium.EllipsoidTerrainProvider) : !1;
|
|
276
276
|
}
|
|
277
277
|
_getGridRefLevel(e) {
|
|
278
278
|
let t = e;
|
|
@@ -283,79 +283,79 @@ class Je {
|
|
|
283
283
|
return t;
|
|
284
284
|
}
|
|
285
285
|
_processTiles(e, t) {
|
|
286
|
-
const i = /* @__PURE__ */ new Set(),
|
|
287
|
-
if (!
|
|
288
|
-
const f = this.tilingScheme.tileXYToRectangle(l, c,
|
|
286
|
+
const i = /* @__PURE__ */ new Set(), r = !this._isTerrainEnabled(), n = this.viewer.scene, o = n && n.globe, s = o && o.ellipsoid, h = s && n.camera.computeViewRectangle(s), g = (l, c, d) => {
|
|
287
|
+
if (!r || !h) return !0;
|
|
288
|
+
const f = this.tilingScheme.tileXYToRectangle(l, c, d);
|
|
289
289
|
return !(!f || f.east <= h.west || f.west >= h.east || f.north <= h.south || f.south >= h.north);
|
|
290
290
|
};
|
|
291
291
|
for (const l of e) {
|
|
292
|
-
const c = l.rectangle,
|
|
293
|
-
if (!c || typeof
|
|
294
|
-
const f = this._getGridRefLevel(
|
|
292
|
+
const c = l.rectangle, d = l._level ?? l.level;
|
|
293
|
+
if (!c || typeof d != "number") continue;
|
|
294
|
+
const f = this._getGridRefLevel(d), u = this._resolveLevelIndex(f);
|
|
295
295
|
if (u === void 0) continue;
|
|
296
|
-
const m = this.levels[u].level,
|
|
297
|
-
if (typeof
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
300
|
-
const
|
|
301
|
-
if (i.has(
|
|
302
|
-
i.add(
|
|
296
|
+
const m = this.levels[u].level, b = l._x ?? l.x, _ = l._y ?? l.y;
|
|
297
|
+
if (typeof b == "number" && typeof _ == "number") {
|
|
298
|
+
const L = d - m;
|
|
299
|
+
if (L >= 0) {
|
|
300
|
+
const T = 1 << L, M = Math.floor(b / T), D = Math.floor(_ / T), A = `${m}_${M}_${D}`;
|
|
301
|
+
if (i.has(A)) continue;
|
|
302
|
+
i.add(A), t(u, M, D, d);
|
|
303
303
|
} else {
|
|
304
|
-
const
|
|
305
|
-
for (let
|
|
306
|
-
for (let
|
|
307
|
-
const
|
|
308
|
-
if (!
|
|
309
|
-
const
|
|
310
|
-
i.has(
|
|
304
|
+
const M = 1 << Math.min(-L, this.maxRefineLevels), D = b * M, A = _ * M;
|
|
305
|
+
for (let W = 0; W < M; W++)
|
|
306
|
+
for (let F = 0; F < M; F++) {
|
|
307
|
+
const $ = D + W, z = A + F;
|
|
308
|
+
if (!g($, z, m)) continue;
|
|
309
|
+
const ee = `${m}_${$}_${z}`;
|
|
310
|
+
i.has(ee) || (i.add(ee), t(u, $, z, d));
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
continue;
|
|
314
314
|
}
|
|
315
|
-
const p = this.levels[u].size,
|
|
316
|
-
for (let
|
|
317
|
-
for (let
|
|
318
|
-
if (!
|
|
319
|
-
const
|
|
320
|
-
i.has(
|
|
315
|
+
const p = this.levels[u].size, S = this.Cesium.Math.toDegrees(c.west), k = this.Cesium.Math.toDegrees(c.east), E = this.Cesium.Math.toDegrees(c.south), B = this.Cesium.Math.toDegrees(c.north), Oe = Math.floor((S - -180) / p), Ge = Math.floor((k - -180) / p), He = Math.floor((E - -90) / p), Re = Math.floor((B - -90) / p);
|
|
316
|
+
for (let L = Oe; L <= Ge; L++)
|
|
317
|
+
for (let T = He; T <= Re; T++) {
|
|
318
|
+
if (!g(L, T, m)) continue;
|
|
319
|
+
const M = `${m}_${L}_${T}`;
|
|
320
|
+
i.has(M) || (i.add(M), t(u, L, T, d));
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
_processCell(e, t, i,
|
|
324
|
+
_processCell(e, t, i, r, n, o) {
|
|
325
325
|
if (o >= this.displayLimit || e < 0) return o;
|
|
326
326
|
e >= this.levels.length && (e = this.levels.length - 1);
|
|
327
|
-
const s = this._getCellContext(e, t, i,
|
|
328
|
-
return s ? (o = this._processCellSkipPoints(s, o), o >= this.displayLimit ? (this._debugDrawCell(s), o) : (o = this._processCellGroups(s,
|
|
327
|
+
const s = this._getCellContext(e, t, i, r);
|
|
328
|
+
return s ? (o = this._processCellSkipPoints(s, o), o >= this.displayLimit ? (this._debugDrawCell(s), o) : (o = this._processCellGroups(s, n, o), this._debugDrawCell(s), o)) : o;
|
|
329
329
|
}
|
|
330
|
-
_getCellContext(e, t, i,
|
|
330
|
+
_getCellContext(e, t, i, r) {
|
|
331
331
|
const o = this.levels[e].level, s = this.gridLayers.get(o);
|
|
332
332
|
if (!s) return null;
|
|
333
|
-
const h = `${t}_${i}`,
|
|
334
|
-
if (!
|
|
335
|
-
const l = this.tilingScheme.tileXYToRectangle(t, i, o), c = this.Cesium.Math.toDegrees(l.west),
|
|
333
|
+
const h = `${t}_${i}`, g = s.get(h);
|
|
334
|
+
if (!g) return null;
|
|
335
|
+
const l = this.tilingScheme.tileXYToRectangle(t, i, o), c = this.Cesium.Math.toDegrees(l.west), d = this.Cesium.Math.toDegrees(l.south), f = this.Cesium.Math.toDegrees(l.east), u = this.Cesium.Math.toDegrees(l.north), m = (c + f) / 2, b = (d + u) / 2;
|
|
336
336
|
return {
|
|
337
337
|
levelIdx: e,
|
|
338
338
|
tileLevel: o,
|
|
339
339
|
lonIdx: t,
|
|
340
340
|
latIdx: i,
|
|
341
341
|
key: h,
|
|
342
|
-
cell:
|
|
342
|
+
cell: g,
|
|
343
343
|
rect: l,
|
|
344
344
|
west: c,
|
|
345
|
-
south:
|
|
345
|
+
south: d,
|
|
346
346
|
east: f,
|
|
347
347
|
north: u,
|
|
348
348
|
centerLon: m,
|
|
349
|
-
centerLat:
|
|
350
|
-
viewTileLevel:
|
|
349
|
+
centerLat: b,
|
|
350
|
+
viewTileLevel: r
|
|
351
351
|
};
|
|
352
352
|
}
|
|
353
353
|
_processCellSkipPoints(e, t) {
|
|
354
|
-
const { cell: i, viewTileLevel:
|
|
354
|
+
const { cell: i, viewTileLevel: r } = e, n = r;
|
|
355
355
|
for (const o of i.skipPoints)
|
|
356
356
|
if (o.data?.show !== !1) {
|
|
357
357
|
if (t >= this.displayLimit) break;
|
|
358
|
-
this._isVisibleAtLevel(o,
|
|
358
|
+
this._isVisibleAtLevel(o, n) && (this.labelPool.add(o.data, {
|
|
359
359
|
id: `point-${o.id}`,
|
|
360
360
|
lon: o.lon,
|
|
361
361
|
lat: o.lat,
|
|
@@ -368,19 +368,19 @@ class Je {
|
|
|
368
368
|
}
|
|
369
369
|
_processCellGroups(e, t, i) {
|
|
370
370
|
const {
|
|
371
|
-
levelIdx:
|
|
372
|
-
lonIdx:
|
|
371
|
+
levelIdx: r,
|
|
372
|
+
lonIdx: n,
|
|
373
373
|
latIdx: o,
|
|
374
374
|
cell: s,
|
|
375
375
|
centerLon: h,
|
|
376
|
-
centerLat:
|
|
376
|
+
centerLat: g,
|
|
377
377
|
viewTileLevel: l
|
|
378
378
|
} = e, c = l;
|
|
379
|
-
for (const [
|
|
379
|
+
for (const [d, f] of s.groups) {
|
|
380
380
|
const u = f.filter((p) => p.data?.show !== !1);
|
|
381
381
|
if (u.length === 0) continue;
|
|
382
|
-
let m = h,
|
|
383
|
-
if (this.centralPointMode == "firstPoint" && (m = u[0]?.lon || 0,
|
|
382
|
+
let m = h, b = g, _ = u[0]?.height || 0;
|
|
383
|
+
if (this.centralPointMode == "firstPoint" && (m = u[0]?.lon || 0, b = u[0]?.lat || 0, _ = u[0]?.height || 0), r === this.levels.length - 1 || u.length < t)
|
|
384
384
|
for (const p of u) {
|
|
385
385
|
if (i >= this.displayLimit) break;
|
|
386
386
|
this._isVisibleAtLevel(p, c) && (this.labelPool.add(p.data, {
|
|
@@ -395,24 +395,24 @@ class Je {
|
|
|
395
395
|
else {
|
|
396
396
|
if (i >= this.displayLimit)
|
|
397
397
|
return i;
|
|
398
|
-
const p = c == null ? u : u.filter((
|
|
398
|
+
const p = c == null ? u : u.filter((B) => this._isVisibleAtLevel(B, c));
|
|
399
399
|
if (!p.length) return i;
|
|
400
|
-
const
|
|
400
|
+
const k = p[0]?.data?.billboard?.[0]?.theme || this.clusterTheme, E = this.groupByTheme ? `cluster-${r}-${n}-${o}-${d}` : `cluster-${r}-${n}-${o}`;
|
|
401
401
|
this.labelPool.add(
|
|
402
402
|
{
|
|
403
|
-
id:
|
|
403
|
+
id: E,
|
|
404
404
|
billboard: p[0]?.data?.billboard || [],
|
|
405
405
|
count: p.length,
|
|
406
|
-
gridKey: `${
|
|
406
|
+
gridKey: `${n}_${o}`,
|
|
407
407
|
points: p,
|
|
408
|
-
aggregationGroup:
|
|
408
|
+
aggregationGroup: d
|
|
409
409
|
},
|
|
410
410
|
{
|
|
411
|
-
id:
|
|
411
|
+
id: E,
|
|
412
412
|
lon: m,
|
|
413
|
-
lat:
|
|
414
|
-
height:
|
|
415
|
-
theme:
|
|
413
|
+
lat: b,
|
|
414
|
+
height: _,
|
|
415
|
+
theme: k
|
|
416
416
|
}
|
|
417
417
|
), i++;
|
|
418
418
|
}
|
|
@@ -421,28 +421,28 @@ class Je {
|
|
|
421
421
|
}
|
|
422
422
|
_debugDrawCell(e) {
|
|
423
423
|
if (!this.debugCurrentGrids) return;
|
|
424
|
-
const { levelIdx: t, west: i, south:
|
|
424
|
+
const { levelIdx: t, west: i, south: r, east: n, north: o, lonIdx: s, latIdx: h } = e, g = this.levels[t].level;
|
|
425
425
|
this._drawDebugGrid(
|
|
426
426
|
i,
|
|
427
|
+
r,
|
|
427
428
|
n,
|
|
428
|
-
a,
|
|
429
429
|
o,
|
|
430
|
-
`L:${
|
|
430
|
+
`L:${g} X:${s} Y:${h}`
|
|
431
431
|
);
|
|
432
432
|
}
|
|
433
433
|
refresh() {
|
|
434
434
|
this._update();
|
|
435
435
|
}
|
|
436
|
-
_drawDebugGrid(e, t, i,
|
|
437
|
-
const o = this.Cesium.Rectangle.fromDegrees(e, t, i,
|
|
436
|
+
_drawDebugGrid(e, t, i, r, n) {
|
|
437
|
+
const o = this.Cesium.Rectangle.fromDegrees(e, t, i, r), s = this.Cesium.Cartesian3.fromDegreesArray([
|
|
438
438
|
e,
|
|
439
439
|
t,
|
|
440
440
|
i,
|
|
441
441
|
t,
|
|
442
442
|
i,
|
|
443
|
-
|
|
443
|
+
r,
|
|
444
444
|
e,
|
|
445
|
-
|
|
445
|
+
r,
|
|
446
446
|
e,
|
|
447
447
|
t
|
|
448
448
|
]), h = this.viewer.entities.add({
|
|
@@ -463,7 +463,7 @@ class Je {
|
|
|
463
463
|
clampToGround: !0
|
|
464
464
|
},
|
|
465
465
|
label: {
|
|
466
|
-
text:
|
|
466
|
+
text: n,
|
|
467
467
|
font: "14px sans-serif",
|
|
468
468
|
fillColor: this.Cesium.Color.BLACK,
|
|
469
469
|
outlineColor: this.Cesium.Color.WHITE,
|
|
@@ -504,274 +504,274 @@ class Je {
|
|
|
504
504
|
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(), this._removeDebugImageryLayer();
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
var
|
|
508
|
-
function
|
|
509
|
-
return typeof
|
|
507
|
+
var ht = "[object Symbol]";
|
|
508
|
+
function Z(a) {
|
|
509
|
+
return typeof a == "symbol" || q(a) && ce(a) == ht;
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
for (var t = -1, i =
|
|
513
|
-
|
|
514
|
-
return
|
|
511
|
+
function ye(a, e) {
|
|
512
|
+
for (var t = -1, i = a == null ? 0 : a.length, r = Array(i); ++t < i; )
|
|
513
|
+
r[t] = e(a[t], t, a);
|
|
514
|
+
return r;
|
|
515
515
|
}
|
|
516
|
-
var
|
|
517
|
-
function
|
|
518
|
-
if (typeof
|
|
519
|
-
return
|
|
520
|
-
if (
|
|
521
|
-
return
|
|
522
|
-
if (
|
|
523
|
-
return
|
|
524
|
-
var e =
|
|
525
|
-
return e == "0" && 1 /
|
|
516
|
+
var oe = R ? R.prototype : void 0, se = oe ? oe.toString : void 0;
|
|
517
|
+
function ve(a) {
|
|
518
|
+
if (typeof a == "string")
|
|
519
|
+
return a;
|
|
520
|
+
if (P(a))
|
|
521
|
+
return ye(a, ve) + "";
|
|
522
|
+
if (Z(a))
|
|
523
|
+
return se ? se.call(a) : "";
|
|
524
|
+
var e = a + "";
|
|
525
|
+
return e == "0" && 1 / a == -1 / 0 ? "-0" : e;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
528
|
-
return
|
|
527
|
+
function be(a) {
|
|
528
|
+
return a;
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function ct(a, e, t) {
|
|
531
531
|
switch (t.length) {
|
|
532
532
|
case 0:
|
|
533
|
-
return
|
|
533
|
+
return a.call(e);
|
|
534
534
|
case 1:
|
|
535
|
-
return
|
|
535
|
+
return a.call(e, t[0]);
|
|
536
536
|
case 2:
|
|
537
|
-
return
|
|
537
|
+
return a.call(e, t[0], t[1]);
|
|
538
538
|
case 3:
|
|
539
|
-
return
|
|
539
|
+
return a.call(e, t[0], t[1], t[2]);
|
|
540
540
|
}
|
|
541
|
-
return
|
|
541
|
+
return a.apply(e, t);
|
|
542
542
|
}
|
|
543
|
-
var
|
|
544
|
-
function
|
|
543
|
+
var gt = 800, dt = 16, ut = Date.now;
|
|
544
|
+
function ft(a) {
|
|
545
545
|
var e = 0, t = 0;
|
|
546
546
|
return function() {
|
|
547
|
-
var i =
|
|
548
|
-
if (t = i,
|
|
549
|
-
if (++e >=
|
|
547
|
+
var i = ut(), r = dt - (i - t);
|
|
548
|
+
if (t = i, r > 0) {
|
|
549
|
+
if (++e >= gt)
|
|
550
550
|
return arguments[0];
|
|
551
551
|
} else
|
|
552
552
|
e = 0;
|
|
553
|
-
return
|
|
553
|
+
return a.apply(void 0, arguments);
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function mt(a) {
|
|
557
557
|
return function() {
|
|
558
|
-
return
|
|
558
|
+
return a;
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
|
-
var
|
|
562
|
-
return
|
|
561
|
+
var pt = ne ? function(a, e) {
|
|
562
|
+
return ne(a, "toString", {
|
|
563
563
|
configurable: !0,
|
|
564
564
|
enumerable: !1,
|
|
565
|
-
value:
|
|
565
|
+
value: mt(e),
|
|
566
566
|
writable: !0
|
|
567
567
|
});
|
|
568
|
-
} :
|
|
569
|
-
function
|
|
570
|
-
return e =
|
|
571
|
-
for (var i = arguments,
|
|
572
|
-
o[
|
|
573
|
-
|
|
574
|
-
for (var s = Array(e + 1); ++
|
|
575
|
-
s[
|
|
576
|
-
return s[e] = t(o),
|
|
568
|
+
} : be, Ce = ft(pt), le = Math.max;
|
|
569
|
+
function Me(a, e, t) {
|
|
570
|
+
return e = le(e === void 0 ? a.length - 1 : e, 0), function() {
|
|
571
|
+
for (var i = arguments, r = -1, n = le(i.length - e, 0), o = Array(n); ++r < n; )
|
|
572
|
+
o[r] = i[e + r];
|
|
573
|
+
r = -1;
|
|
574
|
+
for (var s = Array(e + 1); ++r < e; )
|
|
575
|
+
s[r] = i[r];
|
|
576
|
+
return s[e] = t(o), ct(a, this, s);
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
return
|
|
579
|
+
function yt(a, e) {
|
|
580
|
+
return Ce(Me(a, e, be), a + "");
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
if (!
|
|
582
|
+
function vt(a, e, t) {
|
|
583
|
+
if (!j(t))
|
|
584
584
|
return !1;
|
|
585
585
|
var i = typeof e;
|
|
586
|
-
return (i == "number" ?
|
|
586
|
+
return (i == "number" ? ge(t) && Ue(e, t.length) : i == "string" && e in t) ? de(t[e], a) : !1;
|
|
587
587
|
}
|
|
588
|
-
function
|
|
589
|
-
return
|
|
590
|
-
var i = -1,
|
|
591
|
-
for (
|
|
588
|
+
function bt(a) {
|
|
589
|
+
return yt(function(e, t) {
|
|
590
|
+
var i = -1, r = t.length, n = r > 1 ? t[r - 1] : void 0, o = r > 2 ? t[2] : void 0;
|
|
591
|
+
for (n = a.length > 3 && typeof n == "function" ? (r--, n) : void 0, o && vt(t[0], t[1], o) && (n = r < 3 ? void 0 : n, r = 1), e = Object(e); ++i < r; ) {
|
|
592
592
|
var s = t[i];
|
|
593
|
-
s &&
|
|
593
|
+
s && a(e, s, i, n);
|
|
594
594
|
}
|
|
595
595
|
return e;
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
|
-
var
|
|
599
|
-
function
|
|
600
|
-
if (
|
|
598
|
+
var Ct = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Mt = /^\w*$/;
|
|
599
|
+
function _t(a, e) {
|
|
600
|
+
if (P(a))
|
|
601
601
|
return !1;
|
|
602
|
-
var t = typeof
|
|
603
|
-
return t == "number" || t == "symbol" || t == "boolean" ||
|
|
602
|
+
var t = typeof a;
|
|
603
|
+
return t == "number" || t == "symbol" || t == "boolean" || a == null || Z(a) ? !0 : Mt.test(a) || !Ct.test(a) || e != null && a in Object(e);
|
|
604
604
|
}
|
|
605
|
-
var
|
|
606
|
-
function
|
|
607
|
-
if (typeof
|
|
608
|
-
throw new TypeError(
|
|
605
|
+
var Lt = "Expected a function";
|
|
606
|
+
function J(a, e) {
|
|
607
|
+
if (typeof a != "function" || e != null && typeof e != "function")
|
|
608
|
+
throw new TypeError(Lt);
|
|
609
609
|
var t = function() {
|
|
610
|
-
var i = arguments,
|
|
611
|
-
if (
|
|
612
|
-
return
|
|
613
|
-
var o =
|
|
614
|
-
return t.cache =
|
|
610
|
+
var i = arguments, r = e ? e.apply(this, i) : i[0], n = t.cache;
|
|
611
|
+
if (n.has(r))
|
|
612
|
+
return n.get(r);
|
|
613
|
+
var o = a.apply(this, i);
|
|
614
|
+
return t.cache = n.set(r, o) || n, o;
|
|
615
615
|
};
|
|
616
|
-
return t.cache = new (
|
|
616
|
+
return t.cache = new (J.Cache || ue)(), t;
|
|
617
617
|
}
|
|
618
|
-
|
|
619
|
-
var
|
|
620
|
-
function
|
|
621
|
-
var e =
|
|
622
|
-
return t.size ===
|
|
618
|
+
J.Cache = ue;
|
|
619
|
+
var Tt = 500;
|
|
620
|
+
function Pt(a) {
|
|
621
|
+
var e = J(a, function(i) {
|
|
622
|
+
return t.size === Tt && t.clear(), i;
|
|
623
623
|
}), t = e.cache;
|
|
624
624
|
return e;
|
|
625
625
|
}
|
|
626
|
-
var
|
|
626
|
+
var wt = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, xt = /\\(\\)?/g, It = Pt(function(a) {
|
|
627
627
|
var e = [];
|
|
628
|
-
return
|
|
629
|
-
e.push(
|
|
628
|
+
return a.charCodeAt(0) === 46 && e.push(""), a.replace(wt, function(t, i, r, n) {
|
|
629
|
+
e.push(r ? n.replace(xt, "$1") : i || t);
|
|
630
630
|
}), e;
|
|
631
631
|
});
|
|
632
|
-
function
|
|
633
|
-
return
|
|
632
|
+
function St(a) {
|
|
633
|
+
return a == null ? "" : ve(a);
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
return
|
|
635
|
+
function Q(a, e) {
|
|
636
|
+
return P(a) ? a : _t(a, e) ? [a] : It(St(a));
|
|
637
637
|
}
|
|
638
|
-
function
|
|
639
|
-
if (typeof
|
|
640
|
-
return
|
|
641
|
-
var e =
|
|
642
|
-
return e == "0" && 1 /
|
|
638
|
+
function X(a) {
|
|
639
|
+
if (typeof a == "string" || Z(a))
|
|
640
|
+
return a;
|
|
641
|
+
var e = a + "";
|
|
642
|
+
return e == "0" && 1 / a == -1 / 0 ? "-0" : e;
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
e =
|
|
646
|
-
for (var t = 0, i = e.length;
|
|
647
|
-
|
|
648
|
-
return t && t == i ?
|
|
644
|
+
function Et(a, e) {
|
|
645
|
+
e = Q(e, a);
|
|
646
|
+
for (var t = 0, i = e.length; a != null && t < i; )
|
|
647
|
+
a = a[X(e[t++])];
|
|
648
|
+
return t && t == i ? a : void 0;
|
|
649
649
|
}
|
|
650
|
-
var
|
|
651
|
-
function
|
|
652
|
-
return
|
|
650
|
+
var he = R ? R.isConcatSpreadable : void 0;
|
|
651
|
+
function Dt(a) {
|
|
652
|
+
return P(a) || K(a) || !!(he && a && a[he]);
|
|
653
653
|
}
|
|
654
|
-
function
|
|
655
|
-
var
|
|
656
|
-
for (t || (t =
|
|
657
|
-
var s =
|
|
658
|
-
t(s) ?
|
|
654
|
+
function At(a, e, t, i, r) {
|
|
655
|
+
var n = -1, o = a.length;
|
|
656
|
+
for (t || (t = Dt), r || (r = []); ++n < o; ) {
|
|
657
|
+
var s = a[n];
|
|
658
|
+
t(s) ? qe(r, s) : r[r.length] = s;
|
|
659
659
|
}
|
|
660
|
-
return
|
|
660
|
+
return r;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
663
|
-
var e =
|
|
664
|
-
return e ?
|
|
662
|
+
function Ot(a) {
|
|
663
|
+
var e = a == null ? 0 : a.length;
|
|
664
|
+
return e ? At(a) : [];
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
return
|
|
666
|
+
function Gt(a) {
|
|
667
|
+
return Ce(Me(a, void 0, Ot), a + "");
|
|
668
668
|
}
|
|
669
|
-
var
|
|
670
|
-
function
|
|
671
|
-
if (!
|
|
669
|
+
var Ht = "[object Object]", Rt = Function.prototype, Nt = Object.prototype, _e = Rt.toString, kt = Nt.hasOwnProperty, Bt = _e.call(Object);
|
|
670
|
+
function Le(a) {
|
|
671
|
+
if (!q(a) || ce(a) != Ht)
|
|
672
672
|
return !1;
|
|
673
|
-
var e =
|
|
673
|
+
var e = je(a);
|
|
674
674
|
if (e === null)
|
|
675
675
|
return !0;
|
|
676
|
-
var t =
|
|
677
|
-
return typeof t == "function" && t instanceof t &&
|
|
676
|
+
var t = kt.call(e, "constructor") && e.constructor;
|
|
677
|
+
return typeof t == "function" && t instanceof t && _e.call(t) == Bt;
|
|
678
678
|
}
|
|
679
|
-
function
|
|
680
|
-
var i = -1,
|
|
681
|
-
e < 0 && (e = -e >
|
|
682
|
-
for (var
|
|
683
|
-
|
|
684
|
-
return
|
|
679
|
+
function Wt(a, e, t) {
|
|
680
|
+
var i = -1, r = a.length;
|
|
681
|
+
e < 0 && (e = -e > r ? 0 : r + e), t = t > r ? r : t, t < 0 && (t += r), r = e > t ? 0 : t - e >>> 0, e >>>= 0;
|
|
682
|
+
for (var n = Array(r); ++i < r; )
|
|
683
|
+
n[i] = a[i + e];
|
|
684
|
+
return n;
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function Ft(a) {
|
|
687
687
|
return function(e, t, i) {
|
|
688
|
-
for (var
|
|
689
|
-
var h = o[++
|
|
690
|
-
if (t(
|
|
688
|
+
for (var r = -1, n = Object(e), o = i(e), s = o.length; s--; ) {
|
|
689
|
+
var h = o[++r];
|
|
690
|
+
if (t(n[h], h, n) === !1)
|
|
691
691
|
break;
|
|
692
692
|
}
|
|
693
693
|
return e;
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
|
-
var
|
|
697
|
-
function
|
|
698
|
-
(t !== void 0 && !
|
|
696
|
+
var $t = Ft();
|
|
697
|
+
function Y(a, e, t) {
|
|
698
|
+
(t !== void 0 && !de(a[e], t) || t === void 0 && !(e in a)) && Ze(a, e, t);
|
|
699
699
|
}
|
|
700
|
-
function
|
|
701
|
-
return
|
|
700
|
+
function zt(a) {
|
|
701
|
+
return q(a) && ge(a);
|
|
702
702
|
}
|
|
703
|
-
function
|
|
704
|
-
if (!(e === "constructor" && typeof
|
|
705
|
-
return
|
|
703
|
+
function U(a, e) {
|
|
704
|
+
if (!(e === "constructor" && typeof a[e] == "function") && e != "__proto__")
|
|
705
|
+
return a[e];
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
return
|
|
707
|
+
function Vt(a) {
|
|
708
|
+
return fe(a, me(a));
|
|
709
709
|
}
|
|
710
|
-
function
|
|
711
|
-
var s =
|
|
712
|
-
if (
|
|
713
|
-
|
|
710
|
+
function Kt(a, e, t, i, r, n, o) {
|
|
711
|
+
var s = U(a, t), h = U(e, t), g = o.get(h);
|
|
712
|
+
if (g) {
|
|
713
|
+
Y(a, t, g);
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
|
-
var l =
|
|
716
|
+
var l = n ? n(s, h, t + "", a, e, o) : void 0, c = l === void 0;
|
|
717
717
|
if (c) {
|
|
718
|
-
var
|
|
719
|
-
l = h,
|
|
718
|
+
var d = P(h), f = !d && Je(h), u = !d && !f && Qe(h);
|
|
719
|
+
l = h, d || f || u ? P(s) ? l = s : zt(s) ? l = et(s) : f ? (c = !1, l = tt(h, !0)) : u ? (c = !1, l = it(h, !0)) : l = [] : Le(h) || K(h) ? (l = s, K(s) ? l = Vt(s) : (!j(s) || pe(s)) && (l = rt(h))) : c = !1;
|
|
720
720
|
}
|
|
721
|
-
c && (o.set(h, l),
|
|
721
|
+
c && (o.set(h, l), r(l, h, i, n, o), o.delete(h)), Y(a, t, l);
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
|
|
725
|
-
if (
|
|
726
|
-
|
|
723
|
+
function Te(a, e, t, i, r) {
|
|
724
|
+
a !== e && $t(e, function(n, o) {
|
|
725
|
+
if (r || (r = new at()), j(n))
|
|
726
|
+
Kt(a, e, o, t, Te, i, r);
|
|
727
727
|
else {
|
|
728
|
-
var s = i ? i(
|
|
729
|
-
s === void 0 && (s =
|
|
728
|
+
var s = i ? i(U(a, o), n, o + "", a, e, r) : void 0;
|
|
729
|
+
s === void 0 && (s = n), Y(a, o, s);
|
|
730
730
|
}
|
|
731
|
-
},
|
|
731
|
+
}, me);
|
|
732
732
|
}
|
|
733
|
-
function
|
|
734
|
-
var e =
|
|
735
|
-
return e ?
|
|
733
|
+
function Xt(a) {
|
|
734
|
+
var e = a == null ? 0 : a.length;
|
|
735
|
+
return e ? a[e - 1] : void 0;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
738
|
-
return e.length < 2 ?
|
|
737
|
+
function Yt(a, e) {
|
|
738
|
+
return e.length < 2 ? a : Et(a, Wt(e, 0, -1));
|
|
739
739
|
}
|
|
740
|
-
var
|
|
741
|
-
|
|
742
|
-
}),
|
|
743
|
-
function
|
|
744
|
-
e =
|
|
740
|
+
var Ut = bt(function(a, e, t) {
|
|
741
|
+
Te(a, e, t);
|
|
742
|
+
}), qt = Object.prototype, jt = qt.hasOwnProperty;
|
|
743
|
+
function Zt(a, e) {
|
|
744
|
+
e = Q(e, a);
|
|
745
745
|
var t = -1, i = e.length;
|
|
746
746
|
if (!i)
|
|
747
747
|
return !0;
|
|
748
748
|
for (; ++t < i; ) {
|
|
749
|
-
var
|
|
750
|
-
if (
|
|
749
|
+
var r = X(e[t]);
|
|
750
|
+
if (r === "__proto__" && !jt.call(a, "__proto__") || (r === "constructor" || r === "prototype") && t < i - 1)
|
|
751
751
|
return !1;
|
|
752
752
|
}
|
|
753
|
-
var
|
|
754
|
-
return
|
|
753
|
+
var n = Yt(a, e);
|
|
754
|
+
return n == null || delete n[X(Xt(e))];
|
|
755
755
|
}
|
|
756
|
-
function
|
|
757
|
-
return
|
|
756
|
+
function Jt(a) {
|
|
757
|
+
return Le(a) ? void 0 : a;
|
|
758
758
|
}
|
|
759
|
-
var
|
|
759
|
+
var Qt = 1, ei = 2, ti = 4, ii = Gt(function(a, e) {
|
|
760
760
|
var t = {};
|
|
761
|
-
if (
|
|
761
|
+
if (a == null)
|
|
762
762
|
return t;
|
|
763
763
|
var i = !1;
|
|
764
|
-
e =
|
|
765
|
-
return
|
|
766
|
-
}),
|
|
767
|
-
for (var
|
|
768
|
-
|
|
764
|
+
e = ye(e, function(n) {
|
|
765
|
+
return n = Q(n, a), i || (i = n.length > 1), n;
|
|
766
|
+
}), fe(a, nt(a), t), i && (t = ot(t, Qt | ei | ti, Jt));
|
|
767
|
+
for (var r = e.length; r--; )
|
|
768
|
+
Zt(t, e[r]);
|
|
769
769
|
return t;
|
|
770
770
|
});
|
|
771
|
-
function
|
|
771
|
+
function ri(a, e) {
|
|
772
772
|
const t = e.materialType || "DynamicImgMaterial" + Date.now() + Math.floor(Math.random() * 1e3);
|
|
773
|
-
function i(
|
|
774
|
-
this._definitionChanged = new
|
|
773
|
+
function i(n) {
|
|
774
|
+
this._definitionChanged = new a.Event(), this._color = n.color, this._colorSubscription = void 0, this.color = n.color, this.duration = n.duration, this._time = Date.now();
|
|
775
775
|
}
|
|
776
776
|
Object.defineProperties(i.prototype, {
|
|
777
777
|
isConstant: {
|
|
@@ -784,33 +784,33 @@ function Ut(r, e) {
|
|
|
784
784
|
return this._definitionChanged;
|
|
785
785
|
}
|
|
786
786
|
},
|
|
787
|
-
color:
|
|
787
|
+
color: a.createPropertyDescriptor("color")
|
|
788
788
|
}), i.prototype.getType = function() {
|
|
789
789
|
return t;
|
|
790
|
-
}, i.prototype.getValue = function(
|
|
791
|
-
return
|
|
790
|
+
}, i.prototype.getValue = function(n, o) {
|
|
791
|
+
return a.defined(o) || (o = {}), o.color = a.Property.getValueOrClonedDefault(
|
|
792
792
|
this._color,
|
|
793
|
-
|
|
794
|
-
|
|
793
|
+
n,
|
|
794
|
+
a.Color.WHITE,
|
|
795
795
|
o.color
|
|
796
796
|
), o.image = e.image, o;
|
|
797
|
-
}, i.prototype.equals = function(
|
|
798
|
-
return this ===
|
|
797
|
+
}, i.prototype.equals = function(n) {
|
|
798
|
+
return this === n || n instanceof i && a.Property.equals(this._color, n._color);
|
|
799
799
|
};
|
|
800
|
-
const
|
|
800
|
+
const r = function(n) {
|
|
801
801
|
return `
|
|
802
802
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
803
803
|
{
|
|
804
804
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
805
805
|
vec2 st = materialInput.st;
|
|
806
|
-
float time = fract(mod(float(czm_frameNumber * 33.0) , float(${
|
|
807
|
-
${
|
|
806
|
+
float time = fract(mod(float(czm_frameNumber * 33.0) , float(${n.duration})) / float(${n.duration}));
|
|
807
|
+
${n.freely === "vertical" ? `vec4 colorImage = texture(image, vec2(fract(float(${n.count}) *st.t ${n.direction} time), fract(st.s)));` : `vec4 colorImage = texture(image, vec2(fract(float(${n.count}) *st.s ${n.direction} time), fract(st.t)));`}
|
|
808
808
|
material.diffuse = color.rgb;
|
|
809
809
|
material.alpha = colorImage.a;
|
|
810
810
|
return material;
|
|
811
811
|
}`;
|
|
812
812
|
};
|
|
813
|
-
return
|
|
813
|
+
return a.Material._materialCache.addMaterial(t, {
|
|
814
814
|
fabric: {
|
|
815
815
|
type: t,
|
|
816
816
|
uniforms: {
|
|
@@ -818,7 +818,7 @@ function Ut(r, e) {
|
|
|
818
818
|
image: e.image,
|
|
819
819
|
time: 1e3
|
|
820
820
|
},
|
|
821
|
-
source:
|
|
821
|
+
source: r({
|
|
822
822
|
count: e.count,
|
|
823
823
|
freely: e.freely || "",
|
|
824
824
|
direction: e.direction,
|
|
@@ -830,10 +830,10 @@ function Ut(r, e) {
|
|
|
830
830
|
}
|
|
831
831
|
}), new i(e);
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function Pe(a, e) {
|
|
834
834
|
const t = e.MaterialType || "wallType" + (/* @__PURE__ */ new Date()).getTime() + parseInt(Math.random() * 1e3 + "");
|
|
835
|
-
function i(
|
|
836
|
-
this._definitionChanged = new
|
|
835
|
+
function i(n) {
|
|
836
|
+
this._definitionChanged = new a.Event(), this._color = void 0, this._colorSubscription = void 0, this.color = n.color, this.duration = n.duration, this._time = (/* @__PURE__ */ new Date()).getTime();
|
|
837
837
|
}
|
|
838
838
|
Object.defineProperties(i.prototype, {
|
|
839
839
|
isConstant: {
|
|
@@ -846,23 +846,23 @@ function be(r, e) {
|
|
|
846
846
|
return this._definitionChanged;
|
|
847
847
|
}
|
|
848
848
|
},
|
|
849
|
-
color:
|
|
849
|
+
color: a.createPropertyDescriptor("color")
|
|
850
850
|
}), i.prototype.getType = function() {
|
|
851
851
|
return t;
|
|
852
|
-
}, i.prototype.getValue = function(
|
|
853
|
-
return
|
|
854
|
-
}, i.prototype.equals = function(
|
|
855
|
-
return this ===
|
|
852
|
+
}, i.prototype.getValue = function(n, o) {
|
|
853
|
+
return a.defined(o) || (o = {}), o.image = e.image, this.duration && (o.time = ((/* @__PURE__ */ new Date()).getTime() - this._time) % this.duration / this.duration), o;
|
|
854
|
+
}, i.prototype.equals = function(n) {
|
|
855
|
+
return this === n || n instanceof i && a.Property.equals(this._color, n._color);
|
|
856
856
|
};
|
|
857
|
-
const
|
|
857
|
+
const r = function(n) {
|
|
858
858
|
let o = `czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
859
859
|
{
|
|
860
860
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
861
861
|
vec2 st = materialInput.st;
|
|
862
862
|
|
|
863
863
|
`;
|
|
864
|
-
return
|
|
865
|
-
` : o += "vec4 colorImage = texture(image, vec2(fract(float(" +
|
|
864
|
+
return n.freely == "vertical" ? o += "vec4 colorImage = texture(image, vec2(fract(float(" + n.count + ")*st.t " + n.direction + ` time), fract(st.s)));
|
|
865
|
+
` : o += "vec4 colorImage = texture(image, vec2(fract(float(" + n.count + ")*st.s " + n.direction + ` time), fract(st.t)));
|
|
866
866
|
`, o += `vec4 fragColor;
|
|
867
867
|
fragColor.rgb = (color.rgb) / 1.0;
|
|
868
868
|
fragColor = czm_gammaCorrect(fragColor);
|
|
@@ -874,15 +874,15 @@ function be(r, e) {
|
|
|
874
874
|
}
|
|
875
875
|
`, o;
|
|
876
876
|
};
|
|
877
|
-
return
|
|
877
|
+
return a.Material._materialCache.addMaterial(t, {
|
|
878
878
|
fabric: {
|
|
879
879
|
type: t,
|
|
880
880
|
uniforms: {
|
|
881
|
-
color: e.color || new
|
|
881
|
+
color: e.color || new a.Color(1, 1, 1, 1),
|
|
882
882
|
image: e.image,
|
|
883
883
|
time: 0
|
|
884
884
|
},
|
|
885
|
-
source:
|
|
885
|
+
source: r({
|
|
886
886
|
count: e.count,
|
|
887
887
|
freely: e.freely,
|
|
888
888
|
direction: e.direction
|
|
@@ -893,11 +893,11 @@ function be(r, e) {
|
|
|
893
893
|
}
|
|
894
894
|
}), new i(e);
|
|
895
895
|
}
|
|
896
|
-
function
|
|
897
|
-
const t =
|
|
898
|
-
let
|
|
896
|
+
function ai(a, e) {
|
|
897
|
+
const t = a.Color, i = Object.defineProperties, r = a.Event, n = a.createPropertyDescriptor, o = a.Property, s = (c, d) => c === void 0 ? d : c, h = {};
|
|
898
|
+
let g = e.materialType || "PolylineFlow" + Date.now() + Math.floor(Math.random() * 1e3);
|
|
899
899
|
function l(c) {
|
|
900
|
-
c = s(c, h), this._definitionChanged = new
|
|
900
|
+
c = s(c, h), this._definitionChanged = new r(), this._color = void 0, this._colorSubscription = void 0, this.color = c.color || t.fromBytes(0, 255, 255, 255), this._duration = void 0, this._durationSubscription = void 0, this.duration = s(c.duration, 45);
|
|
901
901
|
}
|
|
902
902
|
return i(l.prototype, {
|
|
903
903
|
isConstant: {
|
|
@@ -911,22 +911,22 @@ function Xt(r, e) {
|
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
913
|
}), l.prototype.getType = function(c) {
|
|
914
|
-
return
|
|
915
|
-
}, l.prototype.getValue = function(c,
|
|
916
|
-
return
|
|
914
|
+
return g;
|
|
915
|
+
}, l.prototype.getValue = function(c, d) {
|
|
916
|
+
return d || (d = {}), d.color = o.getValueOrClonedDefault(
|
|
917
917
|
this._color,
|
|
918
918
|
c,
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
),
|
|
919
|
+
a.Color.WHITE,
|
|
920
|
+
d.color
|
|
921
|
+
), d.duration = this._duration, d;
|
|
922
922
|
}, l.prototype.equals = function(c) {
|
|
923
923
|
return this === c || c instanceof l && o.equals(this._color, c._color);
|
|
924
924
|
}, i(l.prototype, {
|
|
925
|
-
color:
|
|
926
|
-
duration:
|
|
927
|
-
}),
|
|
925
|
+
color: n("color"),
|
|
926
|
+
duration: n("duration")
|
|
927
|
+
}), a.PolylineFlowMaterialProperty = l, a.Material._materialCache.addMaterial(g, {
|
|
928
928
|
fabric: {
|
|
929
|
-
type:
|
|
929
|
+
type: g,
|
|
930
930
|
uniforms: {
|
|
931
931
|
color: new t(1, 1, 1, 1),
|
|
932
932
|
duration: 45
|
|
@@ -956,7 +956,7 @@ function Xt(r, e) {
|
|
|
956
956
|
}
|
|
957
957
|
}), new l(e);
|
|
958
958
|
}
|
|
959
|
-
class
|
|
959
|
+
class we {
|
|
960
960
|
categoryMap = /* @__PURE__ */ new Map();
|
|
961
961
|
CategoryGet = {};
|
|
962
962
|
constructor() {
|
|
@@ -969,15 +969,15 @@ class Le {
|
|
|
969
969
|
* 注册材质
|
|
970
970
|
*/
|
|
971
971
|
register(e) {
|
|
972
|
-
const { themeKey: t, material: i, force:
|
|
973
|
-
this.categoryMap.has(
|
|
974
|
-
const o = this.categoryMap.get(
|
|
972
|
+
const { themeKey: t, material: i, force: r = !1, category: n = "default" } = e;
|
|
973
|
+
this.categoryMap.has(n) || this.categoryMap.set(n, /* @__PURE__ */ new Map());
|
|
974
|
+
const o = this.categoryMap.get(n);
|
|
975
975
|
if (o.has(t))
|
|
976
|
-
if (
|
|
977
|
-
console.info(`[MaterialManager] themeKey '${t}' 在分类 '${
|
|
976
|
+
if (r)
|
|
977
|
+
console.info(`[MaterialManager] themeKey '${t}' 在分类 '${n}' 已被覆盖`);
|
|
978
978
|
else {
|
|
979
979
|
console.warn(
|
|
980
|
-
`[MaterialManager] 已存在 themeKey '${t}' 在分类 '${
|
|
980
|
+
`[MaterialManager] 已存在 themeKey '${t}' 在分类 '${n}',如需覆盖请设置 force = true`
|
|
981
981
|
);
|
|
982
982
|
return;
|
|
983
983
|
}
|
|
@@ -991,11 +991,14 @@ class Le {
|
|
|
991
991
|
category: t,
|
|
992
992
|
options: i
|
|
993
993
|
}) {
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
994
|
+
if (t = t || "default", this.CategoryGet[t])
|
|
995
|
+
return this.CategoryGet[t]({
|
|
996
|
+
themeKey: e,
|
|
997
|
+
materialMap: this.categoryMap,
|
|
998
|
+
options: i || {}
|
|
999
|
+
});
|
|
1000
|
+
const r = this.categoryMap.get(t)?.get(e);
|
|
1001
|
+
return typeof r == "function" && r.__materialFactory === !0 ? r(i || {}) : r;
|
|
999
1002
|
}
|
|
1000
1003
|
/**
|
|
1001
1004
|
* 是否存在
|
|
@@ -1009,8 +1012,8 @@ class Le {
|
|
|
1009
1012
|
remove(e, t = "default") {
|
|
1010
1013
|
const i = this.categoryMap.get(t);
|
|
1011
1014
|
if (!i) return;
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1015
|
+
const r = i.get(e);
|
|
1016
|
+
r?.destroy && r.destroy(), i.delete(e), i.size === 0 && this.categoryMap.delete(t);
|
|
1014
1017
|
}
|
|
1015
1018
|
/**
|
|
1016
1019
|
* 获取某分类下的所有 keys
|
|
@@ -1045,7 +1048,7 @@ class Le {
|
|
|
1045
1048
|
return [...this.categoryMap.keys()];
|
|
1046
1049
|
}
|
|
1047
1050
|
}
|
|
1048
|
-
class
|
|
1051
|
+
class ni {
|
|
1049
1052
|
id;
|
|
1050
1053
|
entities = [];
|
|
1051
1054
|
primitives = [];
|
|
@@ -1053,8 +1056,8 @@ class qt {
|
|
|
1053
1056
|
aggregator;
|
|
1054
1057
|
cardPool;
|
|
1055
1058
|
constructor(e) {
|
|
1056
|
-
const { id: t, entities: i = [], primitives:
|
|
1057
|
-
this.id = t, this.entities = i, this.primitives =
|
|
1059
|
+
const { id: t, entities: i = [], primitives: r = [], dataItem: n = {}, aggregator: o, cardPool: s } = e;
|
|
1060
|
+
this.id = t, this.entities = i, this.primitives = r, this.dataItem = n, this.aggregator = o, this.cardPool = s;
|
|
1058
1061
|
}
|
|
1059
1062
|
// 改造 setVisible 方法,支持 Entity 和 Primitive 的可见性控制
|
|
1060
1063
|
setVisible(e) {
|
|
@@ -1062,7 +1065,7 @@ class qt {
|
|
|
1062
1065
|
t && (t.show = e);
|
|
1063
1066
|
}), this.primitives.forEach((t) => {
|
|
1064
1067
|
t && (t.show = e);
|
|
1065
|
-
}), this.aggregator && Array.isArray(this.dataItem.billboard) && this.dataItem.billboard.map((i,
|
|
1068
|
+
}), this.aggregator && Array.isArray(this.dataItem.billboard) && this.dataItem.billboard.map((i, r) => ({
|
|
1066
1069
|
id: this.dataItem.id,
|
|
1067
1070
|
data: {
|
|
1068
1071
|
...this.dataItem,
|
|
@@ -1081,7 +1084,7 @@ class qt {
|
|
|
1081
1084
|
}), 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;
|
|
1082
1085
|
}
|
|
1083
1086
|
}
|
|
1084
|
-
class
|
|
1087
|
+
class oi {
|
|
1085
1088
|
id;
|
|
1086
1089
|
groupMap = /* @__PURE__ */ new Map();
|
|
1087
1090
|
Cesium;
|
|
@@ -1089,10 +1092,10 @@ class jt {
|
|
|
1089
1092
|
materialManager;
|
|
1090
1093
|
aggregator;
|
|
1091
1094
|
cardPool;
|
|
1092
|
-
constructor(e, t, i,
|
|
1093
|
-
this.id = e, this.Cesium = t, this.viewer = i, this.materialManager =
|
|
1095
|
+
constructor(e, t, i, r, n, o) {
|
|
1096
|
+
this.id = e, this.Cesium = t, this.viewer = i, this.materialManager = r, this.aggregator = n, this.cardPool = o, this.aggregator.labelPool.eventBus.addListener(G.Click, {
|
|
1094
1097
|
name: "BufferedHierarchicalAggregator_maker_click",
|
|
1095
|
-
fn: (h,
|
|
1098
|
+
fn: (h, g) => {
|
|
1096
1099
|
this.cardPool.showByIds([h.data.id]);
|
|
1097
1100
|
}
|
|
1098
1101
|
}), new t.ScreenSpaceEventHandler(i.scene.canvas).setInputAction(() => {
|
|
@@ -1106,14 +1109,14 @@ class jt {
|
|
|
1106
1109
|
themeKey: e.theme,
|
|
1107
1110
|
category: "polyline",
|
|
1108
1111
|
options: e
|
|
1109
|
-
}),
|
|
1110
|
-
let
|
|
1112
|
+
}), r = Array.isArray(e.positions[0]) ? e.positions.flat() : e.positions;
|
|
1113
|
+
let n = {
|
|
1111
1114
|
...e
|
|
1112
1115
|
};
|
|
1113
|
-
return i && (
|
|
1116
|
+
return i && (n.material = i), this.viewer.entities.add({
|
|
1114
1117
|
polyline: {
|
|
1115
|
-
...
|
|
1116
|
-
positions: this.Cesium.Cartesian3.fromDegreesArrayHeights(
|
|
1118
|
+
...n,
|
|
1119
|
+
positions: this.Cesium.Cartesian3.fromDegreesArrayHeights(r)
|
|
1117
1120
|
},
|
|
1118
1121
|
show: (e.show ?? !0) && t
|
|
1119
1122
|
});
|
|
@@ -1124,18 +1127,21 @@ class jt {
|
|
|
1124
1127
|
themeKey: e.theme,
|
|
1125
1128
|
category: "wall",
|
|
1126
1129
|
options: e
|
|
1127
|
-
}),
|
|
1128
|
-
|
|
1130
|
+
}), r = (y, p = 0) => {
|
|
1131
|
+
const S = Number(y);
|
|
1132
|
+
return Number.isFinite(S) ? S : p;
|
|
1133
|
+
}, n = e.positions.map((y) => r(y?.[2], 0)), o = r(e.minHeight, 0), s = r(e.maxHeight, 0), h = (y) => Array.isArray(y) && y.length === e.positions.length && y.every((p) => Math.abs(r(p, 0)) < 1e-6), g = n.some((y) => Math.abs(y) > 1e-6), d = (Array.isArray(e.minimumHeights) && e.minimumHeights.length === e.positions.length && !(h(e.minimumHeights) && g) ? e.minimumHeights.map((y) => r(y, 0)) : n).map((y) => y - o), m = (Array.isArray(e.maximumHeights) && e.maximumHeights.length === e.positions.length && !(h(e.maximumHeights) && g) ? e.maximumHeights.map((y) => r(y, 0)) : n).map((y) => y + s), b = e.positions.map(
|
|
1134
|
+
(y) => this.Cesium.Cartesian3.fromDegrees(y[0], y[1], y[2] || 0)
|
|
1129
1135
|
);
|
|
1130
|
-
let
|
|
1136
|
+
let _ = {
|
|
1131
1137
|
...e
|
|
1132
1138
|
};
|
|
1133
|
-
return i && (
|
|
1139
|
+
return i && (_.material = i), this.viewer.entities.add({
|
|
1134
1140
|
wall: {
|
|
1135
|
-
...
|
|
1136
|
-
positions:
|
|
1137
|
-
minimumHeights:
|
|
1138
|
-
maximumHeights:
|
|
1141
|
+
..._,
|
|
1142
|
+
positions: b,
|
|
1143
|
+
minimumHeights: d,
|
|
1144
|
+
maximumHeights: m
|
|
1139
1145
|
},
|
|
1140
1146
|
show: (e.show ?? !0) && t
|
|
1141
1147
|
});
|
|
@@ -1146,10 +1152,10 @@ class jt {
|
|
|
1146
1152
|
themeKey: e.theme,
|
|
1147
1153
|
category: "polygon",
|
|
1148
1154
|
options: e
|
|
1149
|
-
}),
|
|
1150
|
-
let l = Array.isArray(
|
|
1155
|
+
}), r = Array.isArray(e.hierarchy[0]) ? e.hierarchy.flat() : e.hierarchy, n = this.Cesium.Cartesian3.fromDegreesArrayHeights(r), o = e.holes?.map((g) => {
|
|
1156
|
+
let l = Array.isArray(g[0]) ? e.hierarchy.flat() : e.hole;
|
|
1151
1157
|
return this.Cesium.Cartesian3.fromDegreesArrayHeights(l.flat());
|
|
1152
|
-
}) || [], s = new this.Cesium.PolygonHierarchy(
|
|
1158
|
+
}) || [], s = new this.Cesium.PolygonHierarchy(n, o);
|
|
1153
1159
|
let h = {
|
|
1154
1160
|
...e
|
|
1155
1161
|
};
|
|
@@ -1164,12 +1170,12 @@ class jt {
|
|
|
1164
1170
|
}
|
|
1165
1171
|
createBillboardPoints(e) {
|
|
1166
1172
|
return !e.billboard?.length || !this.aggregator ? [] : e.billboard.map((t) => {
|
|
1167
|
-
const [i,
|
|
1173
|
+
const [i, r, n = 0] = t.position || [0, 0, 0];
|
|
1168
1174
|
return {
|
|
1169
1175
|
id: e.id,
|
|
1170
1176
|
lon: i,
|
|
1171
|
-
lat:
|
|
1172
|
-
height:
|
|
1177
|
+
lat: r,
|
|
1178
|
+
height: n,
|
|
1173
1179
|
name: t.options?.text || "",
|
|
1174
1180
|
data: e,
|
|
1175
1181
|
style: { zIndex: e.zIndex || "1" }
|
|
@@ -1192,22 +1198,22 @@ class jt {
|
|
|
1192
1198
|
addGroup(e, t = !0) {
|
|
1193
1199
|
const i = e.id || `${Date.now()}`;
|
|
1194
1200
|
this.removeGroup(i);
|
|
1195
|
-
const
|
|
1201
|
+
const r = [], n = e.show !== !1;
|
|
1196
1202
|
(e.polyline || []).forEach((h) => {
|
|
1197
|
-
const
|
|
1198
|
-
|
|
1203
|
+
const g = this.createPolyline(h, n);
|
|
1204
|
+
g && r.push(g);
|
|
1199
1205
|
}), (e.wall || []).forEach((h) => {
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1206
|
+
const g = this.createWall(h, n);
|
|
1207
|
+
g && r.push(g);
|
|
1202
1208
|
}), (e.polygon || []).forEach((h) => {
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1209
|
+
const g = this.createPolygon(h, n);
|
|
1210
|
+
g && r.push(g);
|
|
1205
1211
|
});
|
|
1206
1212
|
const o = this.createBillboardPoints(e);
|
|
1207
1213
|
o.length && t && this.aggregator.appendPoints(o, !1), this.createCard(e);
|
|
1208
|
-
const s = new
|
|
1214
|
+
const s = new ni({
|
|
1209
1215
|
id: i,
|
|
1210
|
-
entities:
|
|
1216
|
+
entities: r,
|
|
1211
1217
|
primitives: [],
|
|
1212
1218
|
dataItem: e,
|
|
1213
1219
|
aggregator: this.aggregator,
|
|
@@ -1216,7 +1222,7 @@ class jt {
|
|
|
1216
1222
|
return this.groupMap.set(i, s), o;
|
|
1217
1223
|
}
|
|
1218
1224
|
async addGroups(e) {
|
|
1219
|
-
const i = e.map((
|
|
1225
|
+
const i = e.map((r) => this.addGroup(r, !1)).flat();
|
|
1220
1226
|
i.length > 0 && this.aggregator && this.aggregator.appendPoints(i, !1);
|
|
1221
1227
|
}
|
|
1222
1228
|
removeGroup(e) {
|
|
@@ -1226,10 +1232,10 @@ class jt {
|
|
|
1226
1232
|
removeGroups(e) {
|
|
1227
1233
|
let t = [];
|
|
1228
1234
|
for (const i of e) {
|
|
1229
|
-
const
|
|
1230
|
-
if (
|
|
1231
|
-
let
|
|
1232
|
-
this.groupMap.delete(i), t.push(
|
|
1235
|
+
const r = this.groupMap.get(i);
|
|
1236
|
+
if (r) {
|
|
1237
|
+
let n = r.removeAll(this.viewer, !1);
|
|
1238
|
+
this.groupMap.delete(i), t.push(n);
|
|
1233
1239
|
}
|
|
1234
1240
|
}
|
|
1235
1241
|
this.aggregator.removePointsById(t), this.cardPool.removeByIds(t);
|
|
@@ -1239,10 +1245,10 @@ class jt {
|
|
|
1239
1245
|
t && (t.removeAll(this.viewer), this.groupMap.delete(e.id)), this.addGroup(e);
|
|
1240
1246
|
}
|
|
1241
1247
|
async updateGroups(e) {
|
|
1242
|
-
this.aggregator.removePointsById(e.map((
|
|
1243
|
-
const i = e.map((
|
|
1244
|
-
const
|
|
1245
|
-
return
|
|
1248
|
+
this.aggregator.removePointsById(e.map((r) => r.id)), this.cardPool.removeByIds(e.map((r) => r.id));
|
|
1249
|
+
const i = e.map((r) => {
|
|
1250
|
+
const n = this.groupMap.get(r.id);
|
|
1251
|
+
return n && (n.removeAll(this.viewer, !1), this.groupMap.delete(r.id)), this.addGroup(r, !1);
|
|
1246
1252
|
}).flat();
|
|
1247
1253
|
i.length > 0 && this.aggregator && this.aggregator.appendPoints(i, !1);
|
|
1248
1254
|
}
|
|
@@ -1253,20 +1259,20 @@ class jt {
|
|
|
1253
1259
|
this.groupMap.forEach((e) => e.removeAll(this.viewer)), this.groupMap.clear();
|
|
1254
1260
|
}
|
|
1255
1261
|
}
|
|
1256
|
-
class
|
|
1262
|
+
class si {
|
|
1257
1263
|
Cesium;
|
|
1258
1264
|
viewer;
|
|
1259
1265
|
layerMap = /* @__PURE__ */ new Map();
|
|
1260
1266
|
materialManager;
|
|
1261
1267
|
aggregator;
|
|
1262
1268
|
cardPool;
|
|
1263
|
-
constructor(e, t, i,
|
|
1264
|
-
this.Cesium = e, this.viewer = t, this.materialManager = i, this.aggregator =
|
|
1269
|
+
constructor(e, t, i, r, n) {
|
|
1270
|
+
this.Cesium = e, this.viewer = t, this.materialManager = i, this.aggregator = r, this.cardPool = n;
|
|
1265
1271
|
}
|
|
1266
1272
|
addLayer(e) {
|
|
1267
1273
|
this.layerMap.has(e) || this.layerMap.set(
|
|
1268
1274
|
e,
|
|
1269
|
-
new
|
|
1275
|
+
new oi(
|
|
1270
1276
|
e,
|
|
1271
1277
|
this.Cesium,
|
|
1272
1278
|
this.viewer,
|
|
@@ -1301,7 +1307,7 @@ class Zt {
|
|
|
1301
1307
|
this.layerMap.get(e)?.removeGroups(t);
|
|
1302
1308
|
}
|
|
1303
1309
|
}
|
|
1304
|
-
class
|
|
1310
|
+
class li {
|
|
1305
1311
|
labelId;
|
|
1306
1312
|
cardId;
|
|
1307
1313
|
opt;
|
|
@@ -1309,15 +1315,15 @@ class Jt {
|
|
|
1309
1315
|
MaterialManager;
|
|
1310
1316
|
instance;
|
|
1311
1317
|
constructor(e) {
|
|
1312
|
-
this.labelId = e.labelId, this.cardId = e.cardId, this.opt = e, this.MaterialManager = e.MaterialManager || new
|
|
1318
|
+
this.labelId = e.labelId, this.cardId = e.cardId, this.opt = e, this.MaterialManager = e.MaterialManager || new we(), this.instance = this.initCore(e, e.eventBus, e.cardEventBus);
|
|
1313
1319
|
}
|
|
1314
1320
|
//初始化标记管理
|
|
1315
1321
|
initCore(e, t, i) {
|
|
1316
|
-
let { Cesium:
|
|
1317
|
-
t || (t = new
|
|
1318
|
-
const s = new
|
|
1322
|
+
let { Cesium: r, viewer: n, aggregatorOptions: o } = e;
|
|
1323
|
+
t || (t = new V()), i || (i = new V());
|
|
1324
|
+
const s = new ie(r, n, this.labelId, t);
|
|
1319
1325
|
s.setOcclusionOptions({ distanceEpsilon: 1 }), s.setOcclusionEnabled(!1);
|
|
1320
|
-
const h = new
|
|
1326
|
+
const h = new ie(r, n, this.cardId, i, !1), g = new lt(r, n, {
|
|
1321
1327
|
//聚合
|
|
1322
1328
|
threshold: o?.threshold || 16,
|
|
1323
1329
|
displayLimit: o?.displayLimit || 300,
|
|
@@ -1331,15 +1337,15 @@ class Jt {
|
|
|
1331
1337
|
// 普通点的默认主题
|
|
1332
1338
|
...o,
|
|
1333
1339
|
labelPool: s
|
|
1334
|
-
}), l = this.MaterialManager, c = new
|
|
1340
|
+
}), l = this.MaterialManager, c = new si(
|
|
1335
1341
|
//实体图层管理
|
|
1342
|
+
r,
|
|
1336
1343
|
n,
|
|
1337
|
-
a,
|
|
1338
1344
|
l,
|
|
1339
|
-
|
|
1345
|
+
g,
|
|
1340
1346
|
h
|
|
1341
1347
|
);
|
|
1342
|
-
return { materialManager: l, entityLayerManager: c, cardPool: h, labelPool: s, aggregator:
|
|
1348
|
+
return { materialManager: l, entityLayerManager: c, cardPool: h, labelPool: s, aggregator: g, eventBus: t, cardEventBus: i };
|
|
1343
1349
|
}
|
|
1344
1350
|
//添加标记
|
|
1345
1351
|
set(e) {
|
|
@@ -1353,21 +1359,21 @@ class Jt {
|
|
|
1353
1359
|
//添加
|
|
1354
1360
|
add(e) {
|
|
1355
1361
|
let t = [];
|
|
1356
|
-
|
|
1362
|
+
P(e) ? t = e : t.push(e), t.forEach((i) => {
|
|
1357
1363
|
this.entityList.set(i.id, i);
|
|
1358
1364
|
}), this.instance.entityLayerManager.getLayer("Layer_default") || this.instance.entityLayerManager.addLayer("Layer_default"), this.instance.entityLayerManager.addGroupsToLayer("Layer_default", t);
|
|
1359
1365
|
}
|
|
1360
1366
|
//更新标记
|
|
1361
1367
|
update(e, t = !0) {
|
|
1362
1368
|
let i = [];
|
|
1363
|
-
|
|
1364
|
-
const
|
|
1365
|
-
const o = this.entityList.get(
|
|
1369
|
+
P(e) ? i = e : i.push(e);
|
|
1370
|
+
const r = i.map((n) => {
|
|
1371
|
+
const o = this.entityList.get(n.id);
|
|
1366
1372
|
if (!o) return;
|
|
1367
|
-
let s =
|
|
1368
|
-
return this.entityList.set(
|
|
1373
|
+
let s = Ut({}, o, n);
|
|
1374
|
+
return this.entityList.set(n.id, s), s;
|
|
1369
1375
|
}).filter(Boolean);
|
|
1370
|
-
t && this.instance.entityLayerManager.updateGroupToLayer("Layer_default",
|
|
1376
|
+
t && this.instance.entityLayerManager.updateGroupToLayer("Layer_default", r);
|
|
1371
1377
|
}
|
|
1372
1378
|
//获取标记
|
|
1373
1379
|
getById(e) {
|
|
@@ -1383,7 +1389,7 @@ class Jt {
|
|
|
1383
1389
|
//删除标记
|
|
1384
1390
|
delete(e) {
|
|
1385
1391
|
let t = [];
|
|
1386
|
-
|
|
1392
|
+
P(e) ? t = e : t.push(e), t.forEach((i) => {
|
|
1387
1393
|
this.entityList.delete(i);
|
|
1388
1394
|
}), this.instance.entityLayerManager.removeGroups("Layer_default", t);
|
|
1389
1395
|
}
|
|
@@ -1410,167 +1416,457 @@ class Jt {
|
|
|
1410
1416
|
return this.instance?.labelPool?.getOcclusionOptions?.() || null;
|
|
1411
1417
|
}
|
|
1412
1418
|
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1419
|
+
const w = {
|
|
1420
|
+
wallTileWidth: 2,
|
|
1421
|
+
wallTileHeight: 1,
|
|
1422
|
+
polygonTileWidth: 2,
|
|
1423
|
+
polygonTileHeight: 2
|
|
1424
|
+
};
|
|
1425
|
+
function v(a, e) {
|
|
1426
|
+
const t = Number(a);
|
|
1427
|
+
return Number.isFinite(t) ? t : e;
|
|
1428
|
+
}
|
|
1429
|
+
function C(a) {
|
|
1430
|
+
return Number.isFinite(a) ? Math.max(1, a) : 1;
|
|
1431
|
+
}
|
|
1432
|
+
function hi(a, e) {
|
|
1433
|
+
return Number.isFinite(a) ? Math.min(1, Math.max(0, a)) : e;
|
|
1434
|
+
}
|
|
1435
|
+
function ci(a) {
|
|
1436
|
+
const e = a?.repeat;
|
|
1437
|
+
if (Array.isArray(e) && e.length >= 2)
|
|
1438
|
+
return {
|
|
1439
|
+
x: C(v(e[0], 1)),
|
|
1440
|
+
y: C(v(e[1], 1))
|
|
1441
|
+
};
|
|
1442
|
+
if (e && typeof e == "object")
|
|
1443
|
+
return {
|
|
1444
|
+
x: C(v(e.x, 1)),
|
|
1445
|
+
y: C(v(e.y, 1))
|
|
1446
|
+
};
|
|
1447
|
+
const t = Number(a?.repeatX), i = Number(a?.repeatY);
|
|
1448
|
+
return Number.isFinite(t) && Number.isFinite(i) ? {
|
|
1449
|
+
x: C(t),
|
|
1450
|
+
y: C(i)
|
|
1451
|
+
} : null;
|
|
1452
|
+
}
|
|
1453
|
+
function xe(a, e) {
|
|
1454
|
+
const t = Array.isArray(e?.positions) ? e.positions : [];
|
|
1455
|
+
if (t.length < 2) return 1;
|
|
1456
|
+
let i = 0;
|
|
1457
|
+
for (let r = 1; r < t.length; r++) {
|
|
1458
|
+
const n = t[r - 1], o = t[r];
|
|
1459
|
+
if (!Array.isArray(n) || !Array.isArray(o)) continue;
|
|
1460
|
+
const s = a.Cartesian3.fromDegrees(
|
|
1461
|
+
v(n[0], 0),
|
|
1462
|
+
v(n[1], 0),
|
|
1463
|
+
v(n[2], 0)
|
|
1464
|
+
), h = a.Cartesian3.fromDegrees(
|
|
1465
|
+
v(o[0], 0),
|
|
1466
|
+
v(o[1], 0),
|
|
1467
|
+
v(o[2], 0)
|
|
1468
|
+
);
|
|
1469
|
+
i += a.Cartesian3.distance(s, h);
|
|
1470
|
+
}
|
|
1471
|
+
return i > 0 ? i : 1;
|
|
1472
|
+
}
|
|
1473
|
+
function Ie(a) {
|
|
1474
|
+
const e = a?.maximumHeights, t = a?.minimumHeights;
|
|
1475
|
+
if (Array.isArray(e) && Array.isArray(t) && e.length > 0 && e.length === t.length) {
|
|
1476
|
+
let n = 0, o = 0;
|
|
1477
|
+
for (let s = 0; s < e.length; s++) {
|
|
1478
|
+
const h = Number(e[s]) - Number(t[s]);
|
|
1479
|
+
Number.isFinite(h) && h > 0 && (n += h, o++);
|
|
1480
|
+
}
|
|
1481
|
+
if (o > 0) return n / o;
|
|
1482
|
+
}
|
|
1483
|
+
const i = Math.abs(v(a?.minHeight, 0)), r = Math.abs(v(a?.maxHeight, 0));
|
|
1484
|
+
return i > 0 || r > 0 ? i + r : 3;
|
|
1485
|
+
}
|
|
1486
|
+
function Se(a, e) {
|
|
1487
|
+
const t = e?.hierarchy;
|
|
1488
|
+
if (!Array.isArray(t) || t.length < 3)
|
|
1489
|
+
return { width: 1, height: 1 };
|
|
1490
|
+
const i = Array.isArray(t[0]) ? t.flat() : t;
|
|
1491
|
+
if (!Array.isArray(i) || i.length < 3) return { width: 1, height: 1 };
|
|
1492
|
+
let r = Number.POSITIVE_INFINITY, n = Number.NEGATIVE_INFINITY, o = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY;
|
|
1493
|
+
for (let u = 0; u < i.length; u += 3) {
|
|
1494
|
+
const m = Number(i[u]), b = Number(i[u + 1]);
|
|
1495
|
+
!Number.isFinite(m) || !Number.isFinite(b) || (r = Math.min(r, m), n = Math.max(n, m), o = Math.min(o, b), s = Math.max(s, b));
|
|
1496
|
+
}
|
|
1497
|
+
if (!Number.isFinite(r) || !Number.isFinite(o))
|
|
1498
|
+
return { width: 1, height: 1 };
|
|
1499
|
+
const h = (o + s) / 2, g = a.Ellipsoid.WGS84.maximumRadius, l = a.Math.toRadians(Math.abs(n - r)), c = a.Math.toRadians(Math.abs(s - o)), d = l * g * Math.cos(a.Math.toRadians(h)), f = c * g;
|
|
1500
|
+
return {
|
|
1501
|
+
width: d > 0 ? d : 1,
|
|
1502
|
+
height: f > 0 ? f : 1
|
|
1503
|
+
};
|
|
1504
|
+
}
|
|
1505
|
+
function Ee({
|
|
1506
|
+
Cesium: a,
|
|
1507
|
+
themeOptions: e,
|
|
1508
|
+
entityOptions: t,
|
|
1509
|
+
category: i
|
|
1510
|
+
}) {
|
|
1511
|
+
const r = ci(e);
|
|
1512
|
+
if (r) return r;
|
|
1513
|
+
if (e?.autoRepeat === !1)
|
|
1514
|
+
return { x: 1, y: 1 };
|
|
1515
|
+
if (i === "wall") {
|
|
1516
|
+
const h = xe(a, t), g = Ie(t), l = v(
|
|
1517
|
+
e?.tileWidth ?? e?.textureWidth,
|
|
1518
|
+
w.wallTileWidth
|
|
1519
|
+
), c = v(
|
|
1520
|
+
e?.tileHeight ?? e?.textureHeight,
|
|
1521
|
+
w.wallTileHeight
|
|
1522
|
+
);
|
|
1523
|
+
return {
|
|
1524
|
+
x: C(h / Math.max(l, 0.01)),
|
|
1525
|
+
y: C(g / Math.max(c, 0.01))
|
|
1526
|
+
};
|
|
1527
|
+
}
|
|
1528
|
+
const n = Se(a, t), o = v(
|
|
1529
|
+
e?.tileWidth ?? e?.textureWidth,
|
|
1530
|
+
w.polygonTileWidth
|
|
1531
|
+
), s = v(
|
|
1532
|
+
e?.tileHeight ?? e?.textureHeight,
|
|
1533
|
+
w.polygonTileHeight
|
|
1534
|
+
);
|
|
1535
|
+
return {
|
|
1536
|
+
x: C(n.width / Math.max(o, 0.01)),
|
|
1537
|
+
y: C(n.height / Math.max(s, 0.01))
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
function De({
|
|
1541
|
+
Cesium: a,
|
|
1542
|
+
themeOptions: e,
|
|
1543
|
+
entityOptions: t,
|
|
1544
|
+
category: i,
|
|
1545
|
+
freely: r
|
|
1546
|
+
}) {
|
|
1547
|
+
const n = Number(e?.count);
|
|
1548
|
+
if (Number.isFinite(n) && n > 0) return n;
|
|
1549
|
+
if (e?.autoRepeat === !1)
|
|
1550
|
+
return 1;
|
|
1551
|
+
if (i === "wall") {
|
|
1552
|
+
const l = xe(a, t), c = Ie(t), d = v(
|
|
1553
|
+
e?.tileWidth ?? e?.textureWidth,
|
|
1554
|
+
w.wallTileWidth
|
|
1555
|
+
), f = v(
|
|
1556
|
+
e?.tileHeight ?? e?.textureHeight,
|
|
1557
|
+
w.wallTileHeight
|
|
1558
|
+
), u = r === "vertical" ? c / Math.max(f, 0.01) : l / Math.max(d, 0.01);
|
|
1559
|
+
return C(Number(u.toFixed(2)));
|
|
1560
|
+
}
|
|
1561
|
+
const o = Se(a, t), s = v(
|
|
1562
|
+
e?.tileWidth ?? e?.textureWidth,
|
|
1563
|
+
w.polygonTileWidth
|
|
1564
|
+
), h = v(
|
|
1565
|
+
e?.tileHeight ?? e?.textureHeight,
|
|
1566
|
+
w.polygonTileHeight
|
|
1567
|
+
), g = r === "vertical" ? o.height / Math.max(h, 0.01) : o.width / Math.max(s, 0.01);
|
|
1568
|
+
return C(Number(g.toFixed(2)));
|
|
1569
|
+
}
|
|
1570
|
+
function N(a) {
|
|
1571
|
+
const e = a;
|
|
1572
|
+
return e.__materialFactory = !0, e;
|
|
1573
|
+
}
|
|
1574
|
+
function Ae(a) {
|
|
1575
|
+
const e = String(a?.wallVerticalMode ?? a?.verticalMode ?? "stretch");
|
|
1576
|
+
return e === "repeat" || e === "bottom" || e === "stretch" ? e : "stretch";
|
|
1577
|
+
}
|
|
1578
|
+
function gi({
|
|
1579
|
+
Cesium: a,
|
|
1580
|
+
themeOptions: e,
|
|
1581
|
+
entityOptions: t
|
|
1582
|
+
}) {
|
|
1583
|
+
const i = Ee({
|
|
1584
|
+
Cesium: a,
|
|
1585
|
+
themeOptions: e,
|
|
1586
|
+
entityOptions: t,
|
|
1587
|
+
category: "wall"
|
|
1588
|
+
});
|
|
1589
|
+
return Ae(e) === "repeat" ? i : { x: i.x, y: 1 };
|
|
1590
|
+
}
|
|
1591
|
+
function di(a, e) {
|
|
1592
|
+
const t = "WallBottomImageMaterial_" + Date.now() + "_" + Math.floor(Math.random() * 1e3);
|
|
1593
|
+
function i(r) {
|
|
1594
|
+
this._definitionChanged = new a.Event(), this._color = r.color, this.color = r.color;
|
|
1595
|
+
}
|
|
1596
|
+
return Object.defineProperties(i.prototype, {
|
|
1597
|
+
isConstant: {
|
|
1598
|
+
get() {
|
|
1599
|
+
return !1;
|
|
1600
|
+
}
|
|
1601
|
+
},
|
|
1602
|
+
definitionChanged: {
|
|
1603
|
+
get() {
|
|
1604
|
+
return this._definitionChanged;
|
|
1605
|
+
}
|
|
1606
|
+
},
|
|
1607
|
+
color: a.createPropertyDescriptor("color")
|
|
1608
|
+
}), i.prototype.getType = function() {
|
|
1609
|
+
return t;
|
|
1610
|
+
}, i.prototype.getValue = function(r, n) {
|
|
1611
|
+
return a.defined(n) || (n = {}), n.image = e.image, n.repeatX = e.repeatX, n.bottomHeightRatio = e.bottomHeightRatio, n.color = a.Property.getValueOrClonedDefault(
|
|
1612
|
+
this._color,
|
|
1613
|
+
r,
|
|
1614
|
+
a.Color.WHITE,
|
|
1615
|
+
n.color
|
|
1616
|
+
), n;
|
|
1617
|
+
}, i.prototype.equals = function(r) {
|
|
1618
|
+
return this === r || r instanceof i && a.Property.equals(this._color, r._color);
|
|
1619
|
+
}, a.Material._materialCache.addMaterial(t, {
|
|
1620
|
+
fabric: {
|
|
1621
|
+
type: t,
|
|
1622
|
+
uniforms: {
|
|
1623
|
+
image: e.image,
|
|
1624
|
+
repeatX: e.repeatX,
|
|
1625
|
+
bottomHeightRatio: e.bottomHeightRatio,
|
|
1626
|
+
color: e.color || a.Color.WHITE
|
|
1627
|
+
},
|
|
1628
|
+
source: `
|
|
1629
|
+
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
1630
|
+
{
|
|
1631
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
1632
|
+
vec2 st = materialInput.st;
|
|
1633
|
+
float ratio = max(bottomHeightRatio, 0.0001);
|
|
1634
|
+
if (st.t > ratio) {
|
|
1635
|
+
material.alpha = 0.0;
|
|
1636
|
+
return material;
|
|
1637
|
+
}
|
|
1638
|
+
vec2 uv = vec2(fract(st.s * repeatX), clamp(st.t / ratio, 0.0, 1.0));
|
|
1639
|
+
vec4 colorImage = texture(image, uv);
|
|
1640
|
+
material.diffuse = colorImage.rgb * color.rgb;
|
|
1641
|
+
material.alpha = colorImage.a * color.a;
|
|
1642
|
+
return material;
|
|
1643
|
+
}`
|
|
1644
|
+
},
|
|
1645
|
+
translucent: function() {
|
|
1646
|
+
return !0;
|
|
1647
|
+
}
|
|
1648
|
+
}), new i(e);
|
|
1649
|
+
}
|
|
1650
|
+
function ui({
|
|
1651
|
+
Cesium: a,
|
|
1415
1652
|
options: e,
|
|
1416
|
-
MaterialManager: t
|
|
1653
|
+
MaterialManager: t,
|
|
1654
|
+
force: i = !1
|
|
1417
1655
|
}) {
|
|
1418
1656
|
if (e.data?.theme) {
|
|
1419
1657
|
if (e.data?.lineType == "1") {
|
|
1420
|
-
let
|
|
1421
|
-
color: new
|
|
1658
|
+
let r = ai(a, {
|
|
1659
|
+
color: new a.Color.fromCssColorString(e?.options?.color || "#ffffff"),
|
|
1422
1660
|
duration: 100
|
|
1423
1661
|
});
|
|
1424
1662
|
t.register({
|
|
1425
1663
|
themeKey: e.data?.theme,
|
|
1426
|
-
material:
|
|
1664
|
+
material: r,
|
|
1665
|
+
force: i,
|
|
1427
1666
|
category: "polyline"
|
|
1428
1667
|
});
|
|
1429
1668
|
} else if (e.data?.lineType == "2") {
|
|
1430
|
-
let
|
|
1431
|
-
|
|
1669
|
+
let r = new a.PolylineArrowMaterialProperty(
|
|
1670
|
+
a.Color.fromCssColorString(e?.options?.color || "red")
|
|
1432
1671
|
);
|
|
1433
1672
|
t.register({
|
|
1434
1673
|
themeKey: e.data?.theme,
|
|
1435
|
-
material:
|
|
1674
|
+
material: r,
|
|
1675
|
+
force: i,
|
|
1436
1676
|
category: "polyline"
|
|
1437
1677
|
});
|
|
1438
1678
|
} else if (e.data?.lineType == "3") {
|
|
1439
|
-
let
|
|
1440
|
-
color:
|
|
1679
|
+
let r = new a.PolylineOutlineMaterialProperty({
|
|
1680
|
+
color: a.Color.fromCssColorString(e?.options?.color || "red"),
|
|
1441
1681
|
outlineWidth: 0
|
|
1442
1682
|
});
|
|
1443
1683
|
t.register({
|
|
1444
1684
|
themeKey: e.data?.theme,
|
|
1445
|
-
material:
|
|
1685
|
+
material: r,
|
|
1686
|
+
force: i,
|
|
1446
1687
|
category: "polyline"
|
|
1447
1688
|
});
|
|
1448
1689
|
} else if (e.data?.lineType == "4") {
|
|
1449
|
-
let
|
|
1450
|
-
color:
|
|
1690
|
+
let r = new a.PolylineDashMaterialProperty({
|
|
1691
|
+
color: a.Color.fromCssColorString(e?.options?.color || "red"),
|
|
1451
1692
|
dashLength: Number(e?.options?.dashLength || 30)
|
|
1452
|
-
//短划线长度
|
|
1453
1693
|
});
|
|
1454
1694
|
t.register({
|
|
1455
1695
|
themeKey: e.data?.theme,
|
|
1456
|
-
material:
|
|
1696
|
+
material: r,
|
|
1697
|
+
force: i,
|
|
1457
1698
|
category: "polyline"
|
|
1458
1699
|
});
|
|
1459
1700
|
} else if (e.data?.lineType == "5") {
|
|
1460
|
-
let
|
|
1701
|
+
let r = ri(a, {
|
|
1461
1702
|
image: e.img,
|
|
1462
|
-
color: new
|
|
1703
|
+
color: new a.Color.fromCssColorString(e?.options?.color || "#ffffff"),
|
|
1463
1704
|
duration: 5e3,
|
|
1464
|
-
// freely: 'vertical',
|
|
1465
1705
|
direction: "-",
|
|
1466
1706
|
count: 1
|
|
1467
1707
|
});
|
|
1468
1708
|
t.register({
|
|
1469
1709
|
themeKey: e.data?.theme,
|
|
1470
|
-
material:
|
|
1710
|
+
material: r,
|
|
1711
|
+
force: i,
|
|
1471
1712
|
category: "polyline"
|
|
1472
1713
|
});
|
|
1473
1714
|
}
|
|
1474
1715
|
}
|
|
1475
1716
|
}
|
|
1476
|
-
function
|
|
1477
|
-
Cesium:
|
|
1717
|
+
function fi({
|
|
1718
|
+
Cesium: a,
|
|
1478
1719
|
options: e,
|
|
1479
|
-
MaterialManager: t
|
|
1720
|
+
MaterialManager: t,
|
|
1721
|
+
force: i = !1
|
|
1480
1722
|
}) {
|
|
1481
1723
|
if (e.data?.theme) {
|
|
1482
1724
|
if (e.data?.polygonType == "colorMode") {
|
|
1483
|
-
let
|
|
1725
|
+
let r = new a.Color.fromCssColorString(e?.options?.color || "#ffffff");
|
|
1484
1726
|
t.register({
|
|
1485
1727
|
themeKey: e.data?.theme,
|
|
1486
|
-
material:
|
|
1728
|
+
material: r,
|
|
1729
|
+
force: i,
|
|
1487
1730
|
category: "polygon"
|
|
1488
1731
|
});
|
|
1489
1732
|
} else if (e.data?.polygonType == "img") {
|
|
1490
|
-
|
|
1491
|
-
image: e.img
|
|
1492
|
-
});
|
|
1733
|
+
const r = e?.options || {};
|
|
1493
1734
|
t.register({
|
|
1494
1735
|
themeKey: e.data?.theme,
|
|
1495
|
-
|
|
1496
|
-
|
|
1736
|
+
category: "polygon",
|
|
1737
|
+
force: i,
|
|
1738
|
+
material: N((n = {}) => {
|
|
1739
|
+
const o = Ee({
|
|
1740
|
+
Cesium: a,
|
|
1741
|
+
themeOptions: r,
|
|
1742
|
+
entityOptions: n,
|
|
1743
|
+
category: "polygon"
|
|
1744
|
+
});
|
|
1745
|
+
return new a.ImageMaterialProperty({
|
|
1746
|
+
image: e.img,
|
|
1747
|
+
repeat: new a.Cartesian2(o.x, o.y)
|
|
1748
|
+
});
|
|
1749
|
+
})
|
|
1497
1750
|
});
|
|
1498
1751
|
} else if (e.data?.polygonType == "DynamicImgMaterial") {
|
|
1499
|
-
|
|
1500
|
-
image: e.img,
|
|
1501
|
-
color: new r.Color.fromCssColorString(e?.options?.color),
|
|
1502
|
-
duration: 5e3,
|
|
1503
|
-
freely: e.data?.freely || "vertical",
|
|
1504
|
-
direction: "+",
|
|
1505
|
-
count: 1
|
|
1506
|
-
});
|
|
1752
|
+
const r = e?.options || {};
|
|
1507
1753
|
t.register({
|
|
1508
1754
|
themeKey: e.data?.theme,
|
|
1509
|
-
|
|
1510
|
-
|
|
1755
|
+
category: "polygon",
|
|
1756
|
+
force: i,
|
|
1757
|
+
material: N((n = {}) => {
|
|
1758
|
+
const o = e.data?.freely || "vertical", s = De({
|
|
1759
|
+
Cesium: a,
|
|
1760
|
+
themeOptions: r,
|
|
1761
|
+
entityOptions: n,
|
|
1762
|
+
category: "polygon",
|
|
1763
|
+
freely: o
|
|
1764
|
+
});
|
|
1765
|
+
return Pe(a, {
|
|
1766
|
+
image: e.img,
|
|
1767
|
+
color: new a.Color.fromCssColorString(r?.color || "#ffffff"),
|
|
1768
|
+
duration: v(r?.duration, 5e3),
|
|
1769
|
+
freely: o,
|
|
1770
|
+
direction: r?.direction || "+",
|
|
1771
|
+
count: s
|
|
1772
|
+
});
|
|
1773
|
+
})
|
|
1511
1774
|
});
|
|
1512
1775
|
}
|
|
1513
1776
|
}
|
|
1514
1777
|
}
|
|
1515
|
-
function
|
|
1516
|
-
Cesium:
|
|
1778
|
+
function mi({
|
|
1779
|
+
Cesium: a,
|
|
1517
1780
|
options: e,
|
|
1518
|
-
MaterialManager: t
|
|
1781
|
+
MaterialManager: t,
|
|
1782
|
+
force: i = !1
|
|
1519
1783
|
}) {
|
|
1520
1784
|
if (e.data?.theme) {
|
|
1521
1785
|
if (e.data?.wallType == "img") {
|
|
1522
|
-
|
|
1523
|
-
image: e.img
|
|
1524
|
-
});
|
|
1786
|
+
const r = e?.options || {};
|
|
1525
1787
|
t.register({
|
|
1526
1788
|
themeKey: e.data?.theme,
|
|
1527
|
-
|
|
1528
|
-
|
|
1789
|
+
category: "wall",
|
|
1790
|
+
force: i,
|
|
1791
|
+
material: N((n = {}) => {
|
|
1792
|
+
const o = Ae(r), s = gi({
|
|
1793
|
+
Cesium: a,
|
|
1794
|
+
themeOptions: r,
|
|
1795
|
+
entityOptions: n
|
|
1796
|
+
});
|
|
1797
|
+
if (o === "bottom") {
|
|
1798
|
+
const h = hi(
|
|
1799
|
+
v(r?.bottomHeightRatio, 0.3),
|
|
1800
|
+
0.3
|
|
1801
|
+
);
|
|
1802
|
+
return di(a, {
|
|
1803
|
+
image: e.img,
|
|
1804
|
+
repeatX: s.x,
|
|
1805
|
+
bottomHeightRatio: h,
|
|
1806
|
+
color: new a.Color.fromCssColorString(r?.color || "#ffffff")
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
return new a.ImageMaterialProperty({
|
|
1810
|
+
image: e.img,
|
|
1811
|
+
repeat: new a.Cartesian2(s.x, s.y),
|
|
1812
|
+
transparent: !0
|
|
1813
|
+
});
|
|
1814
|
+
})
|
|
1529
1815
|
});
|
|
1530
1816
|
} else if (e.data?.wallType == "DynamicImgMaterial") {
|
|
1531
|
-
|
|
1532
|
-
image: e.img,
|
|
1533
|
-
color: new r.Color.fromCssColorString(e?.options?.color),
|
|
1534
|
-
duration: 5e3,
|
|
1535
|
-
freely: e.data?.freely || "vertical",
|
|
1536
|
-
direction: "+",
|
|
1537
|
-
count: 1
|
|
1538
|
-
});
|
|
1817
|
+
const r = e?.options || {};
|
|
1539
1818
|
t.register({
|
|
1540
1819
|
themeKey: e.data?.theme,
|
|
1541
|
-
|
|
1542
|
-
|
|
1820
|
+
category: "wall",
|
|
1821
|
+
force: i,
|
|
1822
|
+
material: N((n = {}) => {
|
|
1823
|
+
const o = e.data?.freely || "vertical", s = De({
|
|
1824
|
+
Cesium: a,
|
|
1825
|
+
themeOptions: r,
|
|
1826
|
+
entityOptions: n,
|
|
1827
|
+
category: "wall",
|
|
1828
|
+
freely: o
|
|
1829
|
+
});
|
|
1830
|
+
return Pe(a, {
|
|
1831
|
+
image: e.img,
|
|
1832
|
+
color: new a.Color.fromCssColorString(r?.color || "#ffffff"),
|
|
1833
|
+
duration: v(r?.duration, 5e3),
|
|
1834
|
+
freely: o,
|
|
1835
|
+
direction: r?.direction || "+",
|
|
1836
|
+
count: s
|
|
1837
|
+
});
|
|
1838
|
+
})
|
|
1543
1839
|
});
|
|
1544
1840
|
}
|
|
1545
1841
|
}
|
|
1546
1842
|
}
|
|
1547
|
-
class
|
|
1843
|
+
class pi extends li {
|
|
1548
1844
|
constructor(e) {
|
|
1549
1845
|
const {
|
|
1550
1846
|
labelId: t = "report-marker",
|
|
1551
1847
|
cardId: i = "report-marker",
|
|
1552
|
-
tagThemeConfig:
|
|
1553
|
-
lineThemeConfig:
|
|
1848
|
+
tagThemeConfig: r = [],
|
|
1849
|
+
lineThemeConfig: n = [],
|
|
1554
1850
|
cardThemeConfig: o = [],
|
|
1555
1851
|
runListener: s = () => {
|
|
1556
1852
|
},
|
|
1557
|
-
MaterialManager: h = new
|
|
1558
|
-
aggregatorOptions:
|
|
1559
|
-
} = e, l = [...
|
|
1853
|
+
MaterialManager: h = new we(),
|
|
1854
|
+
aggregatorOptions: g
|
|
1855
|
+
} = e, l = [...r], c = [...n], d = [...o], f = {
|
|
1560
1856
|
clusterTheme: "Tag1007",
|
|
1561
1857
|
pointTheme: "Tag1001",
|
|
1562
1858
|
centralPointMode: "firstPoint",
|
|
1563
1859
|
debugCurrentGrids: !1,
|
|
1564
|
-
...
|
|
1860
|
+
...g || {}
|
|
1565
1861
|
}, u = {
|
|
1566
1862
|
...e,
|
|
1567
1863
|
labelId: t,
|
|
1568
1864
|
cardId: i,
|
|
1569
1865
|
MaterialManager: h,
|
|
1570
1866
|
aggregatorOptions: f,
|
|
1571
|
-
eventBus: new
|
|
1867
|
+
eventBus: new V()
|
|
1572
1868
|
};
|
|
1573
|
-
super(u), this.opt = { ...this.opt, ...u }, this.initTagListener(this.instance.eventBus, this.opt), this.loadTabThemeConfig(l), this.loadLineThemeConfig(c), this.loadCardThemeConfig(
|
|
1869
|
+
super(u), this.opt = { ...this.opt, ...u }, this.initTagListener(this.instance.eventBus, this.opt), this.loadTabThemeConfig(l), this.loadLineThemeConfig(c), this.loadCardThemeConfig(d), this.initDefaultLineMaterials(), this.initDefaultTagTheme();
|
|
1574
1870
|
}
|
|
1575
1871
|
initDefaultTagTheme() {
|
|
1576
1872
|
this.setTagTheme({
|
|
@@ -1668,40 +1964,44 @@ class ii extends Jt {
|
|
|
1668
1964
|
})
|
|
1669
1965
|
}
|
|
1670
1966
|
};
|
|
1671
|
-
Object.entries(t).forEach(([i,
|
|
1967
|
+
Object.entries(t).forEach(([i, r]) => {
|
|
1672
1968
|
this.MaterialManager.has(i, "polyline") || this.MaterialManager.register({
|
|
1673
1969
|
themeKey: i,
|
|
1674
|
-
material:
|
|
1970
|
+
material: r.material,
|
|
1675
1971
|
category: "polyline"
|
|
1676
1972
|
});
|
|
1677
1973
|
});
|
|
1678
1974
|
}
|
|
1679
1975
|
// Initialize dynamic themes from data
|
|
1680
|
-
initThemes(e) {
|
|
1976
|
+
initThemes(e, t = !1) {
|
|
1681
1977
|
if (!e) return;
|
|
1682
1978
|
e.tag && this.loadTabThemeConfig(e.tag), e.card && this.loadCardThemeConfig(e.card);
|
|
1683
|
-
const
|
|
1979
|
+
const i = this.opt.Cesium, r = this.instance.materialManager || this.opt.MaterialManager;
|
|
1684
1980
|
if (e.line?.length > 0)
|
|
1685
1981
|
for (let n of e.line)
|
|
1686
|
-
|
|
1982
|
+
ui({
|
|
1687
1983
|
options: n,
|
|
1688
|
-
Cesium:
|
|
1689
|
-
MaterialManager:
|
|
1984
|
+
Cesium: i,
|
|
1985
|
+
MaterialManager: r,
|
|
1986
|
+
force: t
|
|
1690
1987
|
});
|
|
1691
1988
|
if (e.polygon?.length > 0)
|
|
1692
1989
|
for (let n of e.polygon)
|
|
1693
|
-
|
|
1990
|
+
fi({
|
|
1694
1991
|
options: n,
|
|
1695
|
-
Cesium:
|
|
1696
|
-
MaterialManager:
|
|
1992
|
+
Cesium: i,
|
|
1993
|
+
MaterialManager: r,
|
|
1994
|
+
force: t
|
|
1697
1995
|
});
|
|
1698
1996
|
if (e.wall?.length > 0)
|
|
1699
1997
|
for (let n of e.wall)
|
|
1700
|
-
|
|
1998
|
+
mi({
|
|
1701
1999
|
options: n,
|
|
1702
|
-
Cesium:
|
|
1703
|
-
MaterialManager:
|
|
2000
|
+
Cesium: i,
|
|
2001
|
+
MaterialManager: r,
|
|
2002
|
+
force: t
|
|
1704
2003
|
});
|
|
2004
|
+
t && this.entityList.size > 0 && this.set(Array.from(this.entityList.values()));
|
|
1705
2005
|
}
|
|
1706
2006
|
extractOnEvents(e) {
|
|
1707
2007
|
const t = {};
|
|
@@ -1716,11 +2016,12 @@ class ii extends Jt {
|
|
|
1716
2016
|
});
|
|
1717
2017
|
}
|
|
1718
2018
|
//注册默认的线配置
|
|
1719
|
-
loadLineThemeConfig(e) {
|
|
1720
|
-
e.forEach((
|
|
1721
|
-
this.MaterialManager.has(
|
|
1722
|
-
themeKey:
|
|
1723
|
-
material:
|
|
2019
|
+
loadLineThemeConfig(e, t = !1) {
|
|
2020
|
+
e.forEach((i) => {
|
|
2021
|
+
!t && this.MaterialManager.has(i.data.theme, "polyline") || i.material && this.MaterialManager.register({
|
|
2022
|
+
themeKey: i.data.theme,
|
|
2023
|
+
material: i.material,
|
|
2024
|
+
force: t,
|
|
1724
2025
|
category: "polyline"
|
|
1725
2026
|
});
|
|
1726
2027
|
});
|
|
@@ -1729,9 +2030,9 @@ class ii extends Jt {
|
|
|
1729
2030
|
let t = this.instance.cardPool;
|
|
1730
2031
|
e.forEach((i) => {
|
|
1731
2032
|
t.registerTheme(i.data.theme, {
|
|
1732
|
-
createElement(
|
|
1733
|
-
let o =
|
|
1734
|
-
return i.comType == 1 ? s =
|
|
2033
|
+
createElement(r, n) {
|
|
2034
|
+
let o = n.data.data, s;
|
|
2035
|
+
return i.comType == 1 ? s = x(I(re), {
|
|
1735
2036
|
data: o || {},
|
|
1736
2037
|
imgSrc: i.data.img,
|
|
1737
2038
|
styleConfig: {
|
|
@@ -1752,7 +2053,7 @@ class ii extends Jt {
|
|
|
1752
2053
|
top: "0px"
|
|
1753
2054
|
},
|
|
1754
2055
|
bgClass: [i.data.theme]
|
|
1755
|
-
}) : i.comType == 3 && (s =
|
|
2056
|
+
}) : i.comType == 3 && (s = x(I(re), {
|
|
1756
2057
|
data: o || {},
|
|
1757
2058
|
imgSrc: i.data.img,
|
|
1758
2059
|
styleConfig: {
|
|
@@ -1775,7 +2076,7 @@ class ii extends Jt {
|
|
|
1775
2076
|
bgClass: [i.data.theme]
|
|
1776
2077
|
// titleConfig: themeOptions.options.titleConfig,
|
|
1777
2078
|
// pageInfoConfig: themeOptions.options.pageInfoConfig,
|
|
1778
|
-
})), O(s,
|
|
2079
|
+
})), O(s, r), () => O(null, r);
|
|
1779
2080
|
},
|
|
1780
2081
|
options: {
|
|
1781
2082
|
offset: i.data.pixelOffset,
|
|
@@ -1788,20 +2089,20 @@ class ii extends Jt {
|
|
|
1788
2089
|
setTagTheme(e) {
|
|
1789
2090
|
let { labelPool: t } = this.instance;
|
|
1790
2091
|
t.registerTheme(e.data.theme, {
|
|
1791
|
-
createElement(i,
|
|
1792
|
-
let
|
|
1793
|
-
const o =
|
|
2092
|
+
createElement(i, r) {
|
|
2093
|
+
let n = r.data?.billboard?.[0];
|
|
2094
|
+
const o = ii(n, ["position", "options"]);
|
|
1794
2095
|
let s, h = {
|
|
1795
2096
|
...o,
|
|
1796
|
-
text:
|
|
2097
|
+
text: n?.options?.text,
|
|
1797
2098
|
isFullLink: e?.isFullLink ?? !1,
|
|
1798
2099
|
img: e?.data?.options?.img,
|
|
1799
2100
|
textStyle: e?.data?.options?.textStyle,
|
|
1800
2101
|
imgStyle: e?.data?.options?.imgStyle
|
|
1801
2102
|
};
|
|
1802
|
-
if (
|
|
1803
|
-
s =
|
|
1804
|
-
text:
|
|
2103
|
+
if (r.data?.gridKey)
|
|
2104
|
+
s = x(I(ae), {
|
|
2105
|
+
text: r.data?.count,
|
|
1805
2106
|
isFullLink: e.isFullLink ?? !1,
|
|
1806
2107
|
img: e?.data.options.img,
|
|
1807
2108
|
imgStyle: e?.data.options?.imgStyle,
|
|
@@ -1822,28 +2123,28 @@ class ii extends Jt {
|
|
|
1822
2123
|
}
|
|
1823
2124
|
});
|
|
1824
2125
|
else if (e.comType == 4)
|
|
1825
|
-
s =
|
|
2126
|
+
s = x(I(Xe), h);
|
|
1826
2127
|
else if (e.comType == 5 || e.comType == 8) {
|
|
1827
|
-
const
|
|
1828
|
-
s =
|
|
2128
|
+
const g = n?.options || {}, l = e?.data?.options || {}, c = n?.pixelOffset || e?.data?.pixelOffset || { x: 0, y: 0 }, d = g.otherOffset ?? l.otherOffset ?? { x: 0, y: -0 }, f = g.isCanDraggable ?? l.isCanDraggable ?? e?.isCanDraggable ?? !1, u = e.comType == 8 ? Ve : Ke;
|
|
2129
|
+
s = x(I(u), {
|
|
1829
2130
|
...h,
|
|
1830
2131
|
pixelOffset: c,
|
|
1831
|
-
textStyle:
|
|
1832
|
-
lineStyle:
|
|
1833
|
-
otherOffset:
|
|
2132
|
+
textStyle: g.textStyle || l.textStyle,
|
|
2133
|
+
lineStyle: g.lineStyle || l.lineStyle,
|
|
2134
|
+
otherOffset: d,
|
|
1834
2135
|
isCanDraggable: f,
|
|
1835
|
-
onCanDraggable:
|
|
2136
|
+
onCanDraggable: g.onCanDraggable || e?.onCanDraggable,
|
|
1836
2137
|
onSetOtherOffset: (m) => {
|
|
1837
|
-
|
|
2138
|
+
r.data?.billboard?.[0]?.options && (r.data.billboard[0].options.otherOffset = m), g.onSetOtherOffset?.(m), e?.onSetOtherOffset?.(r.data, m);
|
|
1838
2139
|
},
|
|
1839
2140
|
onSetLineStake: (m) => {
|
|
1840
|
-
|
|
2141
|
+
r.data?.billboard?.[0]?.options && (r.data.billboard[0].options.lineStake = m), g.onSetLineStake?.(m), e?.onSetLineStake?.(r.data, m);
|
|
1841
2142
|
}
|
|
1842
2143
|
});
|
|
1843
|
-
} else e.comType == 6 || e.comType == 7 ? s =
|
|
2144
|
+
} else e.comType == 6 || e.comType == 7 ? s = x(I(Ye), {
|
|
1844
2145
|
text: h.text,
|
|
1845
2146
|
textStyle: h.textStyle
|
|
1846
|
-
}) : s =
|
|
2147
|
+
}) : s = x(I(ae), h);
|
|
1847
2148
|
return O(s, i), () => O(null, i);
|
|
1848
2149
|
},
|
|
1849
2150
|
options: {
|
|
@@ -1853,65 +2154,65 @@ class ii extends Jt {
|
|
|
1853
2154
|
}
|
|
1854
2155
|
//标记监听事件
|
|
1855
2156
|
initTagListener(e, t) {
|
|
1856
|
-
let { viewer: i, tagListeningOptions:
|
|
1857
|
-
e.addListener(
|
|
2157
|
+
let { viewer: i, tagListeningOptions: r } = t;
|
|
2158
|
+
e.addListener(G.Click, {
|
|
1858
2159
|
name: "marker:click",
|
|
1859
|
-
fn: (
|
|
1860
|
-
t.runListener?.(
|
|
2160
|
+
fn: (n) => {
|
|
2161
|
+
t.runListener?.(H.标记左键点击, n.data), pe(n.data?.onClick) && n.data?.onClick(n.data), n.data?.cameraPoint && n.data?.billboard[0]?.isFlyToCameraPoint && i?.camera?.flyTo({
|
|
1861
2162
|
duration: 1,
|
|
1862
|
-
...
|
|
2163
|
+
...n.data?.cameraPoint
|
|
1863
2164
|
});
|
|
1864
2165
|
}
|
|
1865
|
-
}), e.addListener(
|
|
2166
|
+
}), e.addListener(G.MouseEnter, {
|
|
1866
2167
|
name: "marker:mouseenter",
|
|
1867
|
-
fn: (
|
|
2168
|
+
fn: (n) => {
|
|
1868
2169
|
let o = this.opt.Cesium, s = { x: 0, y: 0 };
|
|
1869
2170
|
try {
|
|
1870
|
-
if (
|
|
1871
|
-
let h =
|
|
2171
|
+
if (n.data?.billboard?.[0]?.position?.length > 2) {
|
|
2172
|
+
let h = n.data?.billboard[0]?.position, g = o.Cartesian3.fromDegrees(h[0], h[1], h[3] || 0), l = this.instance.labelPool.toWindowCoordinates(g);
|
|
1872
2173
|
s.x = l.x, s.y = l.y;
|
|
1873
2174
|
}
|
|
1874
2175
|
} catch (h) {
|
|
1875
2176
|
console.log(h);
|
|
1876
2177
|
}
|
|
1877
|
-
t.runListener?.(
|
|
2178
|
+
t.runListener?.(H.标记移入, n.data, s);
|
|
1878
2179
|
}
|
|
1879
|
-
}), e.addListener(
|
|
2180
|
+
}), e.addListener(G.MouseLeave, {
|
|
1880
2181
|
name: "marker:mouseleave",
|
|
1881
|
-
fn: (
|
|
2182
|
+
fn: (n) => {
|
|
1882
2183
|
let o = this.opt.Cesium, s = { x: 0, y: 0 };
|
|
1883
2184
|
try {
|
|
1884
|
-
if (
|
|
1885
|
-
let h =
|
|
2185
|
+
if (n.data?.billboard?.[0]?.position?.length > 2) {
|
|
2186
|
+
let h = n.data?.billboard[0]?.position, g = o.Cartesian3.fromDegrees(h[0], h[1], h[3] || 0), l = this.instance.labelPool.toWindowCoordinates(g);
|
|
1886
2187
|
s.x = l.x, s.y = l.y;
|
|
1887
2188
|
}
|
|
1888
2189
|
} catch (h) {
|
|
1889
2190
|
console.log(h);
|
|
1890
2191
|
}
|
|
1891
|
-
t.runListener?.(
|
|
2192
|
+
t.runListener?.(H.标记移出, n.data, s);
|
|
1892
2193
|
}
|
|
1893
|
-
}),
|
|
1894
|
-
e.addListener(
|
|
2194
|
+
}), r?.forEach((n) => {
|
|
2195
|
+
e.addListener(n.key, n.ListenerItem, n.overwrite);
|
|
1895
2196
|
});
|
|
1896
2197
|
}
|
|
1897
2198
|
// 兼容旧模式的材质注册
|
|
1898
2199
|
setMaterial(e) {
|
|
1899
|
-
const { type: t, material: i, materialKey:
|
|
2200
|
+
const { type: t, material: i, materialKey: r, cover: n } = e, o = t ? t.toLowerCase() : "default";
|
|
1900
2201
|
this.MaterialManager.register({
|
|
1901
|
-
themeKey:
|
|
2202
|
+
themeKey: r,
|
|
1902
2203
|
// 兼容传入的是 { material: ... } 结构或者直接是材质对象
|
|
1903
2204
|
material: i?.material || i,
|
|
1904
|
-
force:
|
|
2205
|
+
force: n,
|
|
1905
2206
|
category: o
|
|
1906
2207
|
});
|
|
1907
2208
|
}
|
|
1908
2209
|
}
|
|
1909
|
-
const
|
|
2210
|
+
const yi = /* @__PURE__ */ ke({
|
|
1910
2211
|
__name: "MarkerManage",
|
|
1911
|
-
props:
|
|
2212
|
+
props: st,
|
|
1912
2213
|
emits: ["register", "load", "marker-event"],
|
|
1913
|
-
setup(
|
|
1914
|
-
const i =
|
|
2214
|
+
setup(a, { expose: e, emit: t }) {
|
|
2215
|
+
const i = a, r = t, n = Be("leitingMethods");
|
|
1915
2216
|
let o = null;
|
|
1916
2217
|
const s = (l = {}) => {
|
|
1917
2218
|
if (o) return o;
|
|
@@ -1920,11 +2221,11 @@ const ri = /* @__PURE__ */ Oe({
|
|
|
1920
2221
|
...l,
|
|
1921
2222
|
Cesium: l.Cesium || i.Cesium,
|
|
1922
2223
|
viewer: l.viewer || i.viewer,
|
|
1923
|
-
runListener: (
|
|
1924
|
-
|
|
2224
|
+
runListener: (d, f, ...u) => {
|
|
2225
|
+
r("marker-event", { key: d, data: f, args: u });
|
|
1925
2226
|
}
|
|
1926
2227
|
};
|
|
1927
|
-
return !c.Cesium || !c.viewer ? null : (o = new
|
|
2228
|
+
return !c.Cesium || !c.viewer ? null : (o = new pi(c), l.methods && (l.methods.setTagTheme = o.setTagTheme.bind(o), l.methods.setMaterial = o.setMaterial.bind(o), l.methods.setEntityList = o.set.bind(o), l.methods.addComItem = o.add.bind(o), l.methods.deleteComItem = o.delete.bind(o), l.methods.updateComItem = o.update.bind(o), l.methods.getEntityByID = o.getById.bind(o), l.methods.getOptions = o.getOptions.bind(o)), r("load", o), o);
|
|
1928
2229
|
}, h = {
|
|
1929
2230
|
init: s,
|
|
1930
2231
|
set: (l) => o?.set(l),
|
|
@@ -1943,35 +2244,35 @@ const ri = /* @__PURE__ */ Oe({
|
|
|
1943
2244
|
setTagTheme: (l) => o?.setTagTheme(l),
|
|
1944
2245
|
setMaterial: (l) => o?.setMaterial(l)
|
|
1945
2246
|
};
|
|
1946
|
-
e(h),
|
|
1947
|
-
function
|
|
2247
|
+
e(h), r("register", h);
|
|
2248
|
+
function g() {
|
|
1948
2249
|
if (o) return o;
|
|
1949
|
-
const l =
|
|
1950
|
-
c &&
|
|
2250
|
+
const l = ze(n), c = l?.getCesium?.(), d = l?.getViewer?.();
|
|
2251
|
+
c && d ? s({ Cesium: c, viewer: d, methods: l }) : i.Cesium && i.viewer && s({ methods: l });
|
|
1951
2252
|
}
|
|
1952
|
-
return
|
|
1953
|
-
|
|
1954
|
-
}),
|
|
2253
|
+
return We(() => {
|
|
2254
|
+
g();
|
|
2255
|
+
}), te(
|
|
1955
2256
|
() => [i.Cesium, i.viewer],
|
|
1956
2257
|
([l, c]) => {
|
|
1957
|
-
l && c && !o &&
|
|
2258
|
+
l && c && !o && g();
|
|
1958
2259
|
}
|
|
1959
|
-
),
|
|
1960
|
-
() =>
|
|
2260
|
+
), te(
|
|
2261
|
+
() => n?.value,
|
|
1961
2262
|
(l, c) => {
|
|
1962
|
-
|
|
2263
|
+
g();
|
|
1963
2264
|
},
|
|
1964
2265
|
{ deep: !1 }
|
|
1965
|
-
),
|
|
1966
|
-
}), (l, c) =>
|
|
2266
|
+
), Fe(() => {
|
|
2267
|
+
}), (l, c) => $e(l.$slots, "default");
|
|
1967
2268
|
}
|
|
1968
|
-
}),
|
|
2269
|
+
}), xi = Ne(yi);
|
|
1969
2270
|
export {
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
2271
|
+
xi as CxMarkerManage,
|
|
2272
|
+
pi as MarkerManage,
|
|
2273
|
+
li as MarkerManagerCore,
|
|
2274
|
+
H as ReportListenerKey,
|
|
2275
|
+
xi as default,
|
|
2276
|
+
st as markerManageProps
|
|
1976
2277
|
};
|
|
1977
2278
|
//# sourceMappingURL=marker-manage.js.map
|