leiting-bim 2.1.133 → 2.1.136
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 +10 -10
- package/leitingbim.css +1 -1
- package/package.json +1 -1
- package/plugins/cesium-core/dist/cesium-core.mjs +1505 -1315
- package/plugins/cesium-core/dist/cesium-core.mjs.map +1 -1
- package/plugins/cesium-core/dist/cesium-core.umd.js +25 -25
- package/plugins/cesium-core/dist/cesium-core.umd.js.map +1 -1
- package/plugins/cesium-core/dist/components/HtmlOverlayLabelPool.d.ts +36 -0
- package/plugins/cesium-core/dist/components/draw/handlers/LineDrawer.d.ts +1 -0
- package/plugins/cesium-core/dist/components/draw/handlers/PolygonDrawer.d.ts +1 -0
- package/plugins/cesium-core/package.json +1 -1
- package/plugins/cesium-vue/dist/HtmlOverlayLabelPool-CbiNlyAM.js +510 -0
- package/plugins/cesium-vue/dist/HtmlOverlayLabelPool-CbiNlyAM.js.map +1 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-bubble/index.d.ts +87 -1
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-manage/index.d.ts +12 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/index.d.ts +3 -2
- package/plugins/cesium-vue/dist/components/marker-bubble.js +200 -73
- package/plugins/cesium-vue/dist/components/marker-bubble.js.map +1 -1
- package/plugins/cesium-vue/dist/components/marker-manage.js +536 -511
- package/plugins/cesium-vue/dist/components/marker-manage.js.map +1 -1
- package/plugins/cesium-vue/dist/components/measurement.js +1 -1
- package/plugins/cesium-vue/dist/index.js +39 -37
- package/plugins/cesium-vue/dist/index.js.map +1 -1
- package/plugins/cesium-vue/package.json +1 -1
- package/plugins/theme-chalk/dist/theme-chalk.css +33 -0
- 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 { CxMarkerBubble as
|
|
6
|
-
import { CxMarkerDefault as
|
|
7
|
-
import { CxMarkerHtml as
|
|
8
|
-
import { CxMarkerText as
|
|
9
|
-
import { i as
|
|
10
|
-
const
|
|
1
|
+
import { w as xe } from "../create-DynflqE1.js";
|
|
2
|
+
import { h as _, markRaw as M, render as O, defineComponent as Oe, inject as Se, onMounted as Ee, watch as j, onUnmounted as De, renderSlot as Ie, unref as Ge } from "vue";
|
|
3
|
+
import { M as S, H as Z, a as $ } from "../HtmlOverlayLabelPool-CbiNlyAM.js";
|
|
4
|
+
import { CxCardCarousel as J } from "./card-carousel.js";
|
|
5
|
+
import { CxMarkerBubbleLine as Ae, CxMarkerBubble as ke } from "./marker-bubble.js";
|
|
6
|
+
import { CxMarkerDefault as Q } from "./marker-default.js";
|
|
7
|
+
import { CxMarkerHtml as Be } from "./marker-html.js";
|
|
8
|
+
import { CxMarkerText as Re } from "./marker-text.js";
|
|
9
|
+
import { i as K, b as ne, a as L, S as D, d as ee, c as W, e as oe, f as $e, g as se, M as le, h as H, j as He, k as Ne, l as ze, m as he, n as ce, o as Fe, p as Ke, q as We, r as Ve, s as Ye, t as de, u as Ue, v as Xe, w as qe, x as je } from "../index-McKGafjp.js";
|
|
10
|
+
const Ze = {
|
|
11
11
|
id: { type: String, default: "marker" },
|
|
12
12
|
Cesium: { type: Object },
|
|
13
13
|
viewer: { type: Object },
|
|
@@ -18,8 +18,8 @@ const qe = {
|
|
|
18
18
|
themeConfig: { type: Object }
|
|
19
19
|
// Optional override
|
|
20
20
|
};
|
|
21
|
-
var
|
|
22
|
-
class
|
|
21
|
+
var E = /* @__PURE__ */ ((r) => (r.左建选中模型 = "MODEL_LEFT_CLICK", r.标记左键点击 = "TAG_LEFT_CLICK", r.标记移入 = "TAG_MOUSEENTER", r.标记移出 = "TAG_MOUSELEAVE", r.模型位置保存 = "SAVE_REGION", r.模型加载完成 = "MODEL_READY", r))(E || {});
|
|
22
|
+
class Je {
|
|
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 =
|
|
59
|
+
const n = this.viewer.scene && this.viewer.scene.globe, a = n && n._surface, o = a && a._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(), n && (this._tileLoadListener = (h) => {
|
|
61
61
|
h === 0 && this._cameraDirty && (this._cameraDirty = !1, this._scheduleUpdate());
|
|
62
|
-
},
|
|
62
|
+
}, n.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
|
-
!a && !
|
|
83
|
+
const e = this.viewer.scene && this.viewer.scene.globe, t = e && e._surface, i = t && t._tileProvider, n = i?.tilingScheme || new this.Cesium.GeographicTilingScheme(), a = i !== this._lastTileProvider, o = this.tilingScheme !== n;
|
|
84
|
+
!a && !o && this.levels && this.levels.length > 0 || (this._lastTileProvider = i, this.tilingScheme = n, 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 a = t; a <= i; a++,
|
|
92
|
-
const
|
|
90
|
+
let n = 0;
|
|
91
|
+
for (let a = t; a <= i; a++, n++) {
|
|
92
|
+
const o = 360 / Math.pow(2, a);
|
|
93
93
|
e.push({
|
|
94
94
|
level: a,
|
|
95
|
-
size:
|
|
96
|
-
minViewWidth:
|
|
97
|
-
}), this.levelIndexByTileLevel.set(a,
|
|
95
|
+
size: o,
|
|
96
|
+
minViewWidth: o * 4
|
|
97
|
+
}), this.levelIndexByTileLevel.set(a, n);
|
|
98
98
|
}
|
|
99
99
|
return e;
|
|
100
100
|
}
|
|
@@ -118,45 +118,45 @@ class je {
|
|
|
118
118
|
if (t === -1) return;
|
|
119
119
|
const i = this.points[t];
|
|
120
120
|
for (const a of this.levels) {
|
|
121
|
-
const
|
|
121
|
+
const o = a.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), d = this.tilingScheme.positionToTileXY(
|
|
124
124
|
h,
|
|
125
|
-
|
|
125
|
+
o,
|
|
126
126
|
new this.Cesium.Cartesian2()
|
|
127
127
|
);
|
|
128
|
-
if (!
|
|
129
|
-
const l = `${
|
|
130
|
-
if (
|
|
131
|
-
const g =
|
|
132
|
-
if (g !== -1 &&
|
|
133
|
-
const f =
|
|
134
|
-
f !== -1 &&
|
|
128
|
+
if (!d) continue;
|
|
129
|
+
const l = `${d.x}_${d.y}`, c = s.get(l);
|
|
130
|
+
if (c) {
|
|
131
|
+
const g = c.allPoints.findIndex((f) => f.id === e.id);
|
|
132
|
+
if (g !== -1 && c.allPoints.splice(g, 1), i.data?.billboard?.[0]?.skipAggregation) {
|
|
133
|
+
const f = c.skipPoints.findIndex((u) => u.id === e.id);
|
|
134
|
+
f !== -1 && c.skipPoints.splice(f, 1);
|
|
135
135
|
} else {
|
|
136
|
-
const f = this.groupByTheme ? i.data?.theme : this.clusterTheme, u =
|
|
136
|
+
const f = this.groupByTheme ? i.data?.theme : this.clusterTheme, u = c.groups.get(f);
|
|
137
137
|
if (u) {
|
|
138
|
-
const
|
|
139
|
-
|
|
138
|
+
const m = u.findIndex((y) => y.id === e.id);
|
|
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 n = { ...i, ...e };
|
|
145
|
+
this.points[t] = n, this._addPointToGrid(n), 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 [a,
|
|
154
|
-
|
|
155
|
-
for (const [s, h] of
|
|
156
|
-
const
|
|
157
|
-
|
|
151
|
+
const n = this.gridLayers.get(i.level);
|
|
152
|
+
if (n)
|
|
153
|
+
for (const [a, o] of n.entries()) {
|
|
154
|
+
o.allPoints = o.allPoints.filter((s) => !t.has(s.id)), o.skipPoints = o.skipPoints.filter((s) => !t.has(s.id));
|
|
155
|
+
for (const [s, h] of o.groups.entries()) {
|
|
156
|
+
const d = h.filter((l) => !t.has(l.id));
|
|
157
|
+
d.length === 0 ? o.groups.delete(s) : o.groups.set(s, d);
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
o.allPoints.length === 0 && n.delete(a);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
this._update();
|
|
@@ -170,65 +170,65 @@ 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 a = this.Cesium.Cartographic.fromDegrees(e.lon, e.lat),
|
|
173
|
+
const i = t.level, n = this.gridLayers.get(i);
|
|
174
|
+
if (!n) continue;
|
|
175
|
+
const a = this.Cesium.Cartographic.fromDegrees(e.lon, e.lat), o = this.tilingScheme.positionToTileXY(
|
|
176
176
|
a,
|
|
177
177
|
i,
|
|
178
178
|
new this.Cesium.Cartesian2()
|
|
179
179
|
);
|
|
180
|
-
if (!
|
|
181
|
-
const s = `${
|
|
182
|
-
let h =
|
|
180
|
+
if (!o) continue;
|
|
181
|
+
const s = `${o.x}_${o.y}`;
|
|
182
|
+
let h = n.get(s);
|
|
183
183
|
if (h || (h = {
|
|
184
184
|
allPoints: [],
|
|
185
185
|
groups: /* @__PURE__ */ new Map(),
|
|
186
186
|
skipPoints: []
|
|
187
|
-
},
|
|
187
|
+
}, n.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 d = this.groupByTheme ? e.data?.billboard?.[0]?.theme : this.clusterTheme;
|
|
191
|
+
h.groups.has(d) || h.groups.set(d, []), h.groups.get(d).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,
|
|
198
|
+
let i = t.minLevel, n = t.maxLevel;
|
|
199
199
|
const a = t.levelRange;
|
|
200
|
-
Array.isArray(a) ? (a.length > 0 && i == null && (i = a[0]), a.length > 1 &&
|
|
201
|
-
const
|
|
202
|
-
e.__minLevel =
|
|
200
|
+
Array.isArray(a) ? (a.length > 0 && i == null && (i = a[0]), a.length > 1 && n == null && (n = a[1])) : a && typeof a == "object" && (i == null && typeof a.min == "number" && (i = a.min), n == null && typeof a.max == "number" && (n = a.max));
|
|
201
|
+
const o = i == null ? this.defaultMinLevel : Number(i) || this.defaultMinLevel, s = n == null ? this.defaultMaxLevel : Number(n) || this.defaultMaxLevel;
|
|
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, n = e.__maxLevel ?? this.defaultMaxLevel;
|
|
208
|
+
return t >= i && t <= n;
|
|
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 = (n, a, o, s) => {
|
|
216
216
|
t = this._processCell(
|
|
217
|
-
o,
|
|
218
|
-
a,
|
|
219
217
|
n,
|
|
218
|
+
a,
|
|
219
|
+
o,
|
|
220
220
|
s,
|
|
221
221
|
e,
|
|
222
222
|
t
|
|
223
223
|
);
|
|
224
224
|
};
|
|
225
225
|
try {
|
|
226
|
-
const
|
|
227
|
-
if (!
|
|
226
|
+
const n = this._getSurfaceTiles();
|
|
227
|
+
if (!n || n.length === 0) {
|
|
228
228
|
this._handleNoSurfaceTiles(t);
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
|
-
this._tilesRetryCount = 0, this._processTiles(
|
|
231
|
+
this._tilesRetryCount = 0, this._processTiles(n, i);
|
|
232
232
|
} catch {
|
|
233
233
|
this.labelPool.cleanup();
|
|
234
234
|
return;
|
|
@@ -258,20 +258,20 @@ 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, n = this.levels[this.levels.length - 1].level;
|
|
262
|
+
if (e > n)
|
|
263
263
|
return this.levels.length - 1;
|
|
264
264
|
if (e < i)
|
|
265
265
|
return 0;
|
|
266
|
-
let a = 0,
|
|
266
|
+
let a = 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 <
|
|
269
|
+
h < o && (o = h, a = s);
|
|
270
270
|
}
|
|
271
271
|
return a;
|
|
272
272
|
}
|
|
273
273
|
_isTerrainEnabled() {
|
|
274
|
-
const e = this.viewer.terrainProvider, t = this.viewer.scene, i = t && t.globe,
|
|
274
|
+
const e = this.viewer.terrainProvider, t = this.viewer.scene, i = t && t.globe, n = i && i.terrainProvider, a = e || n;
|
|
275
275
|
return a ? !(a instanceof this.Cesium.EllipsoidTerrainProvider) : !1;
|
|
276
276
|
}
|
|
277
277
|
_getGridRefLevel(e) {
|
|
@@ -283,136 +283,136 @@ class je {
|
|
|
283
283
|
return t;
|
|
284
284
|
}
|
|
285
285
|
_processTiles(e, t) {
|
|
286
|
-
const i = /* @__PURE__ */ new Set(),
|
|
287
|
-
if (!
|
|
288
|
-
const
|
|
289
|
-
return !(!
|
|
286
|
+
const i = /* @__PURE__ */ new Set(), n = !this._isTerrainEnabled(), a = this.viewer.scene, o = a && a.globe, s = o && o.ellipsoid, h = s && a.camera.computeViewRectangle(s), d = (l, c, g) => {
|
|
287
|
+
if (!n || !h) return !0;
|
|
288
|
+
const f = this.tilingScheme.tileXYToRectangle(l, c, g);
|
|
289
|
+
return !(!f || f.east <= h.west || f.west >= h.east || f.north <= h.south || f.south >= h.north);
|
|
290
290
|
};
|
|
291
|
-
for (const
|
|
292
|
-
const
|
|
293
|
-
if (!
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
296
|
-
const
|
|
297
|
-
if (typeof
|
|
298
|
-
const C =
|
|
291
|
+
for (const l of e) {
|
|
292
|
+
const c = l.rectangle, g = l._level ?? l.level;
|
|
293
|
+
if (!c || typeof g != "number") continue;
|
|
294
|
+
const f = this._getGridRefLevel(g), u = this._resolveLevelIndex(f);
|
|
295
|
+
if (u === void 0) continue;
|
|
296
|
+
const m = this.levels[u].level, y = l._x ?? l.x, T = l._y ?? l.y;
|
|
297
|
+
if (typeof y == "number" && typeof T == "number") {
|
|
298
|
+
const C = g - m;
|
|
299
299
|
if (C >= 0) {
|
|
300
|
-
const b = 1 << C, v = Math.floor(
|
|
300
|
+
const b = 1 << C, v = Math.floor(y / b), w = Math.floor(T / b), x = `${m}_${v}_${w}`;
|
|
301
301
|
if (i.has(x)) continue;
|
|
302
|
-
i.add(x), t(
|
|
302
|
+
i.add(x), t(u, v, w, g);
|
|
303
303
|
} else {
|
|
304
|
-
const v = 1 << Math.min(-C, this.maxRefineLevels), w =
|
|
305
|
-
for (let
|
|
306
|
-
for (let
|
|
307
|
-
const
|
|
308
|
-
if (!
|
|
309
|
-
const
|
|
310
|
-
i.has(
|
|
304
|
+
const v = 1 << Math.min(-C, this.maxRefineLevels), w = y * v, x = T * v;
|
|
305
|
+
for (let A = 0; A < v; A++)
|
|
306
|
+
for (let k = 0; k < v; k++) {
|
|
307
|
+
const B = w + A, R = x + k;
|
|
308
|
+
if (!d(B, R, m)) continue;
|
|
309
|
+
const q = `${m}_${B}_${R}`;
|
|
310
|
+
i.has(q) || (i.add(q), t(u, B, R, g));
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
continue;
|
|
314
314
|
}
|
|
315
|
-
const
|
|
316
|
-
for (let C =
|
|
317
|
-
for (let b =
|
|
318
|
-
if (!
|
|
319
|
-
const v = `${
|
|
320
|
-
i.has(v) || (i.add(v), t(
|
|
315
|
+
const p = this.levels[u].size, X = this.Cesium.Math.toDegrees(c.west), I = this.Cesium.Math.toDegrees(c.east), P = this.Cesium.Math.toDegrees(c.south), G = this.Cesium.Math.toDegrees(c.north), Me = Math.floor((X - -180) / p), Te = Math.floor((I - -180) / p), Pe = Math.floor((P - -90) / p), we = Math.floor((G - -90) / p);
|
|
316
|
+
for (let C = Me; C <= Te; C++)
|
|
317
|
+
for (let b = Pe; b <= we; b++) {
|
|
318
|
+
if (!d(C, b, m)) continue;
|
|
319
|
+
const v = `${m}_${C}_${b}`;
|
|
320
|
+
i.has(v) || (i.add(v), t(u, C, b, g));
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
_processCell(e, t, i,
|
|
325
|
-
if (
|
|
324
|
+
_processCell(e, t, i, n, a, o) {
|
|
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 ? (
|
|
327
|
+
const s = this._getCellContext(e, t, i, n);
|
|
328
|
+
return s ? (o = this._processCellSkipPoints(s, o), o >= this.displayLimit ? (this._debugDrawCell(s), o) : (o = this._processCellGroups(s, a, o), this._debugDrawCell(s), o)) : o;
|
|
329
329
|
}
|
|
330
|
-
_getCellContext(e, t, i,
|
|
331
|
-
const
|
|
330
|
+
_getCellContext(e, t, i, n) {
|
|
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,
|
|
333
|
+
const h = `${t}_${i}`, d = s.get(h);
|
|
334
|
+
if (!d) return null;
|
|
335
|
+
const l = this.tilingScheme.tileXYToRectangle(t, i, o), c = this.Cesium.Math.toDegrees(l.west), g = this.Cesium.Math.toDegrees(l.south), f = this.Cesium.Math.toDegrees(l.east), u = this.Cesium.Math.toDegrees(l.north), m = (c + f) / 2, y = (g + u) / 2;
|
|
336
336
|
return {
|
|
337
337
|
levelIdx: e,
|
|
338
|
-
tileLevel:
|
|
338
|
+
tileLevel: o,
|
|
339
339
|
lonIdx: t,
|
|
340
340
|
latIdx: i,
|
|
341
341
|
key: h,
|
|
342
|
-
cell:
|
|
342
|
+
cell: d,
|
|
343
343
|
rect: l,
|
|
344
|
-
west:
|
|
344
|
+
west: c,
|
|
345
345
|
south: g,
|
|
346
346
|
east: f,
|
|
347
347
|
north: u,
|
|
348
|
-
centerLon:
|
|
348
|
+
centerLon: m,
|
|
349
349
|
centerLat: y,
|
|
350
|
-
viewTileLevel:
|
|
350
|
+
viewTileLevel: n
|
|
351
351
|
};
|
|
352
352
|
}
|
|
353
353
|
_processCellSkipPoints(e, t) {
|
|
354
|
-
const { cell: i, viewTileLevel:
|
|
355
|
-
for (const
|
|
356
|
-
if (
|
|
354
|
+
const { cell: i, viewTileLevel: n } = e, a = n;
|
|
355
|
+
for (const o of i.skipPoints)
|
|
356
|
+
if (o.data?.show !== !1) {
|
|
357
357
|
if (t >= this.displayLimit) break;
|
|
358
|
-
this._isVisibleAtLevel(
|
|
359
|
-
id: `point-${
|
|
360
|
-
lon:
|
|
361
|
-
lat:
|
|
362
|
-
height:
|
|
363
|
-
theme:
|
|
364
|
-
style:
|
|
358
|
+
this._isVisibleAtLevel(o, a) && (this.labelPool.add(o.data, {
|
|
359
|
+
id: `point-${o.id}`,
|
|
360
|
+
lon: o.lon,
|
|
361
|
+
lat: o.lat,
|
|
362
|
+
height: o.height,
|
|
363
|
+
theme: o.data?.billboard?.[0]?.theme || this.pointTheme,
|
|
364
|
+
style: o.style
|
|
365
365
|
}), t++);
|
|
366
366
|
}
|
|
367
367
|
return t;
|
|
368
368
|
}
|
|
369
369
|
_processCellGroups(e, t, i) {
|
|
370
370
|
const {
|
|
371
|
-
levelIdx:
|
|
371
|
+
levelIdx: n,
|
|
372
372
|
lonIdx: a,
|
|
373
|
-
latIdx:
|
|
373
|
+
latIdx: o,
|
|
374
374
|
cell: s,
|
|
375
375
|
centerLon: h,
|
|
376
|
-
centerLat:
|
|
376
|
+
centerLat: d,
|
|
377
377
|
viewTileLevel: l
|
|
378
|
-
} = e,
|
|
378
|
+
} = e, c = l;
|
|
379
379
|
for (const [g, f] of s.groups) {
|
|
380
|
-
const u = f.filter((
|
|
380
|
+
const u = f.filter((p) => p.data?.show !== !1);
|
|
381
381
|
if (u.length === 0) continue;
|
|
382
|
-
let
|
|
383
|
-
if (this.centralPointMode == "firstPoint" && (
|
|
384
|
-
for (const
|
|
382
|
+
let m = h, y = d, T = u[0]?.height || 0;
|
|
383
|
+
if (this.centralPointMode == "firstPoint" && (m = u[0]?.lon || 0, y = u[0]?.lat || 0, T = u[0]?.height || 0), n === this.levels.length - 1 || u.length < t)
|
|
384
|
+
for (const p of u) {
|
|
385
385
|
if (i >= this.displayLimit) break;
|
|
386
|
-
this._isVisibleAtLevel(
|
|
387
|
-
id: `point-${
|
|
388
|
-
lon:
|
|
389
|
-
lat:
|
|
390
|
-
height:
|
|
391
|
-
theme:
|
|
392
|
-
style:
|
|
386
|
+
this._isVisibleAtLevel(p, c) && (this.labelPool.add(p.data, {
|
|
387
|
+
id: `point-${p.id}`,
|
|
388
|
+
lon: p.lon,
|
|
389
|
+
lat: p.lat,
|
|
390
|
+
height: p.height,
|
|
391
|
+
theme: p.data?.billboard?.[0]?.theme || this.pointTheme,
|
|
392
|
+
style: p.style
|
|
393
393
|
}), i++);
|
|
394
394
|
}
|
|
395
395
|
else {
|
|
396
396
|
if (i >= this.displayLimit)
|
|
397
397
|
return i;
|
|
398
|
-
const
|
|
399
|
-
if (!
|
|
400
|
-
const
|
|
398
|
+
const p = c == null ? u : u.filter((G) => this._isVisibleAtLevel(G, c));
|
|
399
|
+
if (!p.length) return i;
|
|
400
|
+
const I = p[0]?.data?.billboard?.[0]?.theme || this.clusterTheme, P = this.groupByTheme ? `cluster-${n}-${a}-${o}-${g}` : `cluster-${n}-${a}-${o}`;
|
|
401
401
|
this.labelPool.add(
|
|
402
402
|
{
|
|
403
403
|
id: P,
|
|
404
|
-
billboard:
|
|
405
|
-
count:
|
|
406
|
-
gridKey: `${a}_${
|
|
407
|
-
points:
|
|
404
|
+
billboard: p[0]?.data?.billboard || [],
|
|
405
|
+
count: p.length,
|
|
406
|
+
gridKey: `${a}_${o}`,
|
|
407
|
+
points: p,
|
|
408
408
|
aggregationGroup: g
|
|
409
409
|
},
|
|
410
410
|
{
|
|
411
411
|
id: P,
|
|
412
|
-
lon:
|
|
412
|
+
lon: m,
|
|
413
413
|
lat: y,
|
|
414
|
-
height:
|
|
415
|
-
theme:
|
|
414
|
+
height: T,
|
|
415
|
+
theme: I
|
|
416
416
|
}
|
|
417
417
|
), i++;
|
|
418
418
|
}
|
|
@@ -421,33 +421,33 @@ 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: n, east: a, north: o, lonIdx: s, latIdx: h } = e, d = this.levels[t].level;
|
|
425
425
|
this._drawDebugGrid(
|
|
426
426
|
i,
|
|
427
|
-
o,
|
|
428
|
-
a,
|
|
429
427
|
n,
|
|
430
|
-
|
|
428
|
+
a,
|
|
429
|
+
o,
|
|
430
|
+
`L:${d} X:${s} Y:${h}`
|
|
431
431
|
);
|
|
432
432
|
}
|
|
433
433
|
refresh() {
|
|
434
434
|
this._update();
|
|
435
435
|
}
|
|
436
|
-
_drawDebugGrid(e, t, i,
|
|
437
|
-
const
|
|
436
|
+
_drawDebugGrid(e, t, i, n, a) {
|
|
437
|
+
const o = this.Cesium.Rectangle.fromDegrees(e, t, i, n), s = this.Cesium.Cartesian3.fromDegreesArray([
|
|
438
438
|
e,
|
|
439
439
|
t,
|
|
440
440
|
i,
|
|
441
441
|
t,
|
|
442
442
|
i,
|
|
443
|
-
|
|
443
|
+
n,
|
|
444
444
|
e,
|
|
445
|
-
|
|
445
|
+
n,
|
|
446
446
|
e,
|
|
447
447
|
t
|
|
448
448
|
]), h = this.viewer.entities.add({
|
|
449
449
|
rectangle: {
|
|
450
|
-
coordinates:
|
|
450
|
+
coordinates: o,
|
|
451
451
|
material: this.Cesium.Color.YELLOW.withAlpha(0.2),
|
|
452
452
|
outline: !0,
|
|
453
453
|
outlineColor: this.Cesium.Color.RED,
|
|
@@ -504,30 +504,30 @@ 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 r == "symbol" ||
|
|
507
|
+
var Qe = "[object Symbol]";
|
|
508
|
+
function V(r) {
|
|
509
|
+
return typeof r == "symbol" || K(r) && ne(r) == Qe;
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
for (var t = -1, i = r == null ? 0 : r.length,
|
|
513
|
-
|
|
514
|
-
return
|
|
511
|
+
function ge(r, e) {
|
|
512
|
+
for (var t = -1, i = r == null ? 0 : r.length, n = Array(i); ++t < i; )
|
|
513
|
+
n[t] = e(r[t], t, r);
|
|
514
|
+
return n;
|
|
515
515
|
}
|
|
516
|
-
var
|
|
517
|
-
function
|
|
516
|
+
var te = D ? D.prototype : void 0, ie = te ? te.toString : void 0;
|
|
517
|
+
function ue(r) {
|
|
518
518
|
if (typeof r == "string")
|
|
519
519
|
return r;
|
|
520
|
-
if (
|
|
521
|
-
return
|
|
522
|
-
if (
|
|
523
|
-
return
|
|
520
|
+
if (L(r))
|
|
521
|
+
return ge(r, ue) + "";
|
|
522
|
+
if (V(r))
|
|
523
|
+
return ie ? ie.call(r) : "";
|
|
524
524
|
var e = r + "";
|
|
525
525
|
return e == "0" && 1 / r == -1 / 0 ? "-0" : e;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function fe(r) {
|
|
528
528
|
return r;
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function et(r, e, t) {
|
|
531
531
|
switch (t.length) {
|
|
532
532
|
case 0:
|
|
533
533
|
return r.call(e);
|
|
@@ -540,153 +540,153 @@ function Je(r, e, t) {
|
|
|
540
540
|
}
|
|
541
541
|
return r.apply(e, t);
|
|
542
542
|
}
|
|
543
|
-
var
|
|
544
|
-
function
|
|
543
|
+
var tt = 800, it = 16, rt = Date.now;
|
|
544
|
+
function at(r) {
|
|
545
545
|
var e = 0, t = 0;
|
|
546
546
|
return function() {
|
|
547
|
-
var i =
|
|
548
|
-
if (t = i,
|
|
549
|
-
if (++e >=
|
|
547
|
+
var i = rt(), n = it - (i - t);
|
|
548
|
+
if (t = i, n > 0) {
|
|
549
|
+
if (++e >= tt)
|
|
550
550
|
return arguments[0];
|
|
551
551
|
} else
|
|
552
552
|
e = 0;
|
|
553
553
|
return r.apply(void 0, arguments);
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function nt(r) {
|
|
557
557
|
return function() {
|
|
558
558
|
return r;
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
|
-
var
|
|
562
|
-
return
|
|
561
|
+
var ot = ee ? function(r, e) {
|
|
562
|
+
return ee(r, "toString", {
|
|
563
563
|
configurable: !0,
|
|
564
564
|
enumerable: !1,
|
|
565
|
-
value:
|
|
565
|
+
value: nt(e),
|
|
566
566
|
writable: !0
|
|
567
567
|
});
|
|
568
|
-
} :
|
|
569
|
-
function
|
|
570
|
-
return e =
|
|
571
|
-
for (var i = arguments,
|
|
572
|
-
n
|
|
573
|
-
|
|
574
|
-
for (var s = Array(e + 1); ++
|
|
575
|
-
s[
|
|
576
|
-
return s[e] = t(
|
|
568
|
+
} : fe, me = at(ot), re = Math.max;
|
|
569
|
+
function pe(r, e, t) {
|
|
570
|
+
return e = re(e === void 0 ? r.length - 1 : e, 0), function() {
|
|
571
|
+
for (var i = arguments, n = -1, a = re(i.length - e, 0), o = Array(a); ++n < a; )
|
|
572
|
+
o[n] = i[e + n];
|
|
573
|
+
n = -1;
|
|
574
|
+
for (var s = Array(e + 1); ++n < e; )
|
|
575
|
+
s[n] = i[n];
|
|
576
|
+
return s[e] = t(o), et(r, this, s);
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
return pe(
|
|
579
|
+
function st(r, e) {
|
|
580
|
+
return me(pe(r, e, fe), r + "");
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
if (!
|
|
582
|
+
function lt(r, e, t) {
|
|
583
|
+
if (!W(t))
|
|
584
584
|
return !1;
|
|
585
585
|
var i = typeof e;
|
|
586
|
-
return (i == "number" ?
|
|
586
|
+
return (i == "number" ? oe(t) && $e(e, t.length) : i == "string" && e in t) ? se(t[e], r) : !1;
|
|
587
587
|
}
|
|
588
|
-
function
|
|
589
|
-
return
|
|
590
|
-
var i = -1,
|
|
591
|
-
for (a = r.length > 3 && typeof a == "function" ? (
|
|
588
|
+
function ht(r) {
|
|
589
|
+
return st(function(e, t) {
|
|
590
|
+
var i = -1, n = t.length, a = n > 1 ? t[n - 1] : void 0, o = n > 2 ? t[2] : void 0;
|
|
591
|
+
for (a = r.length > 3 && typeof a == "function" ? (n--, a) : void 0, o && lt(t[0], t[1], o) && (a = n < 3 ? void 0 : a, n = 1), e = Object(e); ++i < n; ) {
|
|
592
592
|
var s = t[i];
|
|
593
593
|
s && r(e, s, i, a);
|
|
594
594
|
}
|
|
595
595
|
return e;
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
|
-
var
|
|
599
|
-
function
|
|
600
|
-
if (
|
|
598
|
+
var ct = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, dt = /^\w*$/;
|
|
599
|
+
function gt(r, e) {
|
|
600
|
+
if (L(r))
|
|
601
601
|
return !1;
|
|
602
602
|
var t = typeof r;
|
|
603
|
-
return t == "number" || t == "symbol" || t == "boolean" || r == null ||
|
|
603
|
+
return t == "number" || t == "symbol" || t == "boolean" || r == null || V(r) ? !0 : dt.test(r) || !ct.test(r) || e != null && r in Object(e);
|
|
604
604
|
}
|
|
605
|
-
var
|
|
606
|
-
function
|
|
605
|
+
var ut = "Expected a function";
|
|
606
|
+
function Y(r, e) {
|
|
607
607
|
if (typeof r != "function" || e != null && typeof e != "function")
|
|
608
|
-
throw new TypeError(
|
|
608
|
+
throw new TypeError(ut);
|
|
609
609
|
var t = function() {
|
|
610
|
-
var i = arguments,
|
|
611
|
-
if (a.has(
|
|
612
|
-
return a.get(
|
|
613
|
-
var
|
|
614
|
-
return t.cache = a.set(
|
|
610
|
+
var i = arguments, n = e ? e.apply(this, i) : i[0], a = t.cache;
|
|
611
|
+
if (a.has(n))
|
|
612
|
+
return a.get(n);
|
|
613
|
+
var o = r.apply(this, i);
|
|
614
|
+
return t.cache = a.set(n, o) || a, o;
|
|
615
615
|
};
|
|
616
|
-
return t.cache = new (
|
|
616
|
+
return t.cache = new (Y.Cache || le)(), t;
|
|
617
617
|
}
|
|
618
|
-
|
|
619
|
-
var
|
|
620
|
-
function
|
|
621
|
-
var e =
|
|
622
|
-
return t.size ===
|
|
618
|
+
Y.Cache = le;
|
|
619
|
+
var ft = 500;
|
|
620
|
+
function mt(r) {
|
|
621
|
+
var e = Y(r, function(i) {
|
|
622
|
+
return t.size === ft && t.clear(), i;
|
|
623
623
|
}), t = e.cache;
|
|
624
624
|
return e;
|
|
625
625
|
}
|
|
626
|
-
var
|
|
626
|
+
var pt = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, yt = /\\(\\)?/g, vt = mt(function(r) {
|
|
627
627
|
var e = [];
|
|
628
|
-
return r.charCodeAt(0) === 46 && e.push(""), r.replace(
|
|
629
|
-
e.push(
|
|
628
|
+
return r.charCodeAt(0) === 46 && e.push(""), r.replace(pt, function(t, i, n, a) {
|
|
629
|
+
e.push(n ? a.replace(yt, "$1") : i || t);
|
|
630
630
|
}), e;
|
|
631
631
|
});
|
|
632
|
-
function
|
|
633
|
-
return r == null ? "" :
|
|
632
|
+
function Ct(r) {
|
|
633
|
+
return r == null ? "" : ue(r);
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
return
|
|
635
|
+
function U(r, e) {
|
|
636
|
+
return L(r) ? r : gt(r, e) ? [r] : vt(Ct(r));
|
|
637
637
|
}
|
|
638
|
-
function
|
|
639
|
-
if (typeof r == "string" ||
|
|
638
|
+
function N(r) {
|
|
639
|
+
if (typeof r == "string" || V(r))
|
|
640
640
|
return r;
|
|
641
641
|
var e = r + "";
|
|
642
642
|
return e == "0" && 1 / r == -1 / 0 ? "-0" : e;
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
e =
|
|
644
|
+
function bt(r, e) {
|
|
645
|
+
e = U(e, r);
|
|
646
646
|
for (var t = 0, i = e.length; r != null && t < i; )
|
|
647
|
-
r = r[
|
|
647
|
+
r = r[N(e[t++])];
|
|
648
648
|
return t && t == i ? r : void 0;
|
|
649
649
|
}
|
|
650
|
-
var
|
|
651
|
-
function
|
|
652
|
-
return
|
|
650
|
+
var ae = D ? D.isConcatSpreadable : void 0;
|
|
651
|
+
function Lt(r) {
|
|
652
|
+
return L(r) || H(r) || !!(ae && r && r[ae]);
|
|
653
653
|
}
|
|
654
|
-
function
|
|
655
|
-
var a = -1,
|
|
656
|
-
for (t || (t =
|
|
654
|
+
function _t(r, e, t, i, n) {
|
|
655
|
+
var a = -1, o = r.length;
|
|
656
|
+
for (t || (t = Lt), n || (n = []); ++a < o; ) {
|
|
657
657
|
var s = r[a];
|
|
658
|
-
t(s) ?
|
|
658
|
+
t(s) ? He(n, s) : n[n.length] = s;
|
|
659
659
|
}
|
|
660
|
-
return
|
|
660
|
+
return n;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function Mt(r) {
|
|
663
663
|
var e = r == null ? 0 : r.length;
|
|
664
|
-
return e ?
|
|
664
|
+
return e ? _t(r) : [];
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
return pe(
|
|
666
|
+
function Tt(r) {
|
|
667
|
+
return me(pe(r, void 0, Mt), r + "");
|
|
668
668
|
}
|
|
669
|
-
var
|
|
670
|
-
function
|
|
671
|
-
if (!
|
|
669
|
+
var Pt = "[object Object]", wt = Function.prototype, xt = Object.prototype, ye = wt.toString, Ot = xt.hasOwnProperty, St = ye.call(Object);
|
|
670
|
+
function ve(r) {
|
|
671
|
+
if (!K(r) || ne(r) != Pt)
|
|
672
672
|
return !1;
|
|
673
|
-
var e =
|
|
673
|
+
var e = Ne(r);
|
|
674
674
|
if (e === null)
|
|
675
675
|
return !0;
|
|
676
|
-
var t =
|
|
677
|
-
return typeof t == "function" && t instanceof t &&
|
|
676
|
+
var t = Ot.call(e, "constructor") && e.constructor;
|
|
677
|
+
return typeof t == "function" && t instanceof t && ye.call(t) == St;
|
|
678
678
|
}
|
|
679
|
-
function
|
|
680
|
-
var i = -1,
|
|
681
|
-
e < 0 && (e = -e >
|
|
682
|
-
for (var a = Array(
|
|
679
|
+
function Et(r, e, t) {
|
|
680
|
+
var i = -1, n = r.length;
|
|
681
|
+
e < 0 && (e = -e > n ? 0 : n + e), t = t > n ? n : t, t < 0 && (t += n), n = e > t ? 0 : t - e >>> 0, e >>>= 0;
|
|
682
|
+
for (var a = Array(n); ++i < n; )
|
|
683
683
|
a[i] = r[i + e];
|
|
684
684
|
return a;
|
|
685
685
|
}
|
|
686
686
|
function Dt(r) {
|
|
687
687
|
return function(e, t, i) {
|
|
688
|
-
for (var
|
|
689
|
-
var h =
|
|
688
|
+
for (var n = -1, a = Object(e), o = i(e), s = o.length; s--; ) {
|
|
689
|
+
var h = o[++n];
|
|
690
690
|
if (t(a[h], h, a) === !1)
|
|
691
691
|
break;
|
|
692
692
|
}
|
|
@@ -694,81 +694,81 @@ function Dt(r) {
|
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
696
|
var It = Dt();
|
|
697
|
-
function
|
|
698
|
-
(t !== void 0 && !
|
|
697
|
+
function z(r, e, t) {
|
|
698
|
+
(t !== void 0 && !se(r[e], t) || t === void 0 && !(e in r)) && ze(r, e, t);
|
|
699
699
|
}
|
|
700
|
-
function
|
|
701
|
-
return
|
|
700
|
+
function Gt(r) {
|
|
701
|
+
return K(r) && oe(r);
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function F(r, e) {
|
|
704
704
|
if (!(e === "constructor" && typeof r[e] == "function") && e != "__proto__")
|
|
705
705
|
return r[e];
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
return
|
|
707
|
+
function At(r) {
|
|
708
|
+
return he(r, ce(r));
|
|
709
709
|
}
|
|
710
|
-
function
|
|
711
|
-
var s =
|
|
712
|
-
if (
|
|
713
|
-
|
|
710
|
+
function kt(r, e, t, i, n, a, o) {
|
|
711
|
+
var s = F(r, t), h = F(e, t), d = o.get(h);
|
|
712
|
+
if (d) {
|
|
713
|
+
z(r, t, d);
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
|
-
var l = a ? a(s, h, t + "", r, e,
|
|
717
|
-
if (
|
|
718
|
-
var g =
|
|
719
|
-
l = h, g || f || u ?
|
|
716
|
+
var l = a ? a(s, h, t + "", r, e, o) : void 0, c = l === void 0;
|
|
717
|
+
if (c) {
|
|
718
|
+
var g = L(h), f = !g && Fe(h), u = !g && !f && Ke(h);
|
|
719
|
+
l = h, g || f || u ? L(s) ? l = s : Gt(s) ? l = We(s) : f ? (c = !1, l = Ve(h, !0)) : u ? (c = !1, l = Ye(h, !0)) : l = [] : ve(h) || H(h) ? (l = s, H(s) ? l = At(s) : (!W(s) || de(s)) && (l = Ue(h))) : c = !1;
|
|
720
720
|
}
|
|
721
|
-
|
|
721
|
+
c && (o.set(h, l), n(l, h, i, a, o), o.delete(h)), z(r, t, l);
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
r !== e && It(e, function(a,
|
|
725
|
-
if (
|
|
726
|
-
|
|
723
|
+
function Ce(r, e, t, i, n) {
|
|
724
|
+
r !== e && It(e, function(a, o) {
|
|
725
|
+
if (n || (n = new Xe()), W(a))
|
|
726
|
+
kt(r, e, o, t, Ce, i, n);
|
|
727
727
|
else {
|
|
728
|
-
var s = i ? i(
|
|
729
|
-
s === void 0 && (s = a),
|
|
728
|
+
var s = i ? i(F(r, o), a, o + "", r, e, n) : void 0;
|
|
729
|
+
s === void 0 && (s = a), z(r, o, s);
|
|
730
730
|
}
|
|
731
|
-
},
|
|
731
|
+
}, ce);
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function Bt(r) {
|
|
734
734
|
var e = r == null ? 0 : r.length;
|
|
735
735
|
return e ? r[e - 1] : void 0;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
738
|
-
return e.length < 2 ? r :
|
|
737
|
+
function Rt(r, e) {
|
|
738
|
+
return e.length < 2 ? r : bt(r, Et(e, 0, -1));
|
|
739
739
|
}
|
|
740
|
-
var
|
|
741
|
-
|
|
742
|
-
}),
|
|
743
|
-
function
|
|
744
|
-
e =
|
|
740
|
+
var $t = ht(function(r, e, t) {
|
|
741
|
+
Ce(r, e, t);
|
|
742
|
+
}), Ht = Object.prototype, Nt = Ht.hasOwnProperty;
|
|
743
|
+
function zt(r, e) {
|
|
744
|
+
e = U(e, r);
|
|
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 n = N(e[t]);
|
|
750
|
+
if (n === "__proto__" && !Nt.call(r, "__proto__") || (n === "constructor" || n === "prototype") && t < i - 1)
|
|
751
751
|
return !1;
|
|
752
752
|
}
|
|
753
|
-
var a =
|
|
754
|
-
return a == null || delete a[
|
|
753
|
+
var a = Rt(r, e);
|
|
754
|
+
return a == null || delete a[N(Bt(e))];
|
|
755
755
|
}
|
|
756
|
-
function
|
|
757
|
-
return
|
|
756
|
+
function Ft(r) {
|
|
757
|
+
return ve(r) ? void 0 : r;
|
|
758
758
|
}
|
|
759
|
-
var
|
|
759
|
+
var Kt = 1, Wt = 2, Vt = 4, Yt = Tt(function(r, e) {
|
|
760
760
|
var t = {};
|
|
761
761
|
if (r == null)
|
|
762
762
|
return t;
|
|
763
763
|
var i = !1;
|
|
764
|
-
e =
|
|
765
|
-
return a =
|
|
766
|
-
}),
|
|
767
|
-
for (var
|
|
768
|
-
|
|
764
|
+
e = ge(e, function(a) {
|
|
765
|
+
return a = U(a, r), i || (i = a.length > 1), a;
|
|
766
|
+
}), he(r, qe(r), t), i && (t = je(t, Kt | Wt | Vt, Ft));
|
|
767
|
+
for (var n = e.length; n--; )
|
|
768
|
+
zt(t, e[n]);
|
|
769
769
|
return t;
|
|
770
770
|
});
|
|
771
|
-
function
|
|
771
|
+
function Ut(r, e) {
|
|
772
772
|
const t = e.materialType || "DynamicImgMaterial" + Date.now() + Math.floor(Math.random() * 1e3);
|
|
773
773
|
function i(a) {
|
|
774
774
|
this._definitionChanged = new r.Event(), this._color = a.color, this._colorSubscription = void 0, this.color = a.color, this.duration = a.duration, this._time = Date.now();
|
|
@@ -787,17 +787,17 @@ function Vt(r, e) {
|
|
|
787
787
|
color: r.createPropertyDescriptor("color")
|
|
788
788
|
}), i.prototype.getType = function() {
|
|
789
789
|
return t;
|
|
790
|
-
}, i.prototype.getValue = function(a,
|
|
791
|
-
return r.defined(
|
|
790
|
+
}, i.prototype.getValue = function(a, o) {
|
|
791
|
+
return r.defined(o) || (o = {}), o.color = r.Property.getValueOrClonedDefault(
|
|
792
792
|
this._color,
|
|
793
793
|
a,
|
|
794
794
|
r.Color.WHITE,
|
|
795
|
-
|
|
796
|
-
),
|
|
795
|
+
o.color
|
|
796
|
+
), o.image = e.image, o;
|
|
797
797
|
}, i.prototype.equals = function(a) {
|
|
798
798
|
return this === a || a instanceof i && r.Property.equals(this._color, a._color);
|
|
799
799
|
};
|
|
800
|
-
const
|
|
800
|
+
const n = function(a) {
|
|
801
801
|
return `
|
|
802
802
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
803
803
|
{
|
|
@@ -818,7 +818,7 @@ function Vt(r, e) {
|
|
|
818
818
|
image: e.image,
|
|
819
819
|
time: 1e3
|
|
820
820
|
},
|
|
821
|
-
source:
|
|
821
|
+
source: n({
|
|
822
822
|
count: e.count,
|
|
823
823
|
freely: e.freely || "",
|
|
824
824
|
direction: e.direction,
|
|
@@ -830,7 +830,7 @@ function Vt(r, e) {
|
|
|
830
830
|
}
|
|
831
831
|
}), new i(e);
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function be(r, e) {
|
|
834
834
|
const t = e.MaterialType || "wallType" + (/* @__PURE__ */ new Date()).getTime() + parseInt(Math.random() * 1e3 + "");
|
|
835
835
|
function i(a) {
|
|
836
836
|
this._definitionChanged = new r.Event(), this._color = void 0, this._colorSubscription = void 0, this.color = a.color, this.duration = a.duration, this._time = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -849,30 +849,30 @@ function _e(r, e) {
|
|
|
849
849
|
color: r.createPropertyDescriptor("color")
|
|
850
850
|
}), i.prototype.getType = function() {
|
|
851
851
|
return t;
|
|
852
|
-
}, i.prototype.getValue = function(a,
|
|
853
|
-
return r.defined(
|
|
852
|
+
}, i.prototype.getValue = function(a, o) {
|
|
853
|
+
return r.defined(o) || (o = {}), o.image = e.image, this.duration && (o.time = ((/* @__PURE__ */ new Date()).getTime() - this._time) % this.duration / this.duration), o;
|
|
854
854
|
}, i.prototype.equals = function(a) {
|
|
855
855
|
return this === a || a instanceof i && r.Property.equals(this._color, a._color);
|
|
856
856
|
};
|
|
857
|
-
const
|
|
858
|
-
let
|
|
857
|
+
const n = function(a) {
|
|
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 a.freely == "vertical" ?
|
|
865
|
-
` :
|
|
866
|
-
`,
|
|
864
|
+
return a.freely == "vertical" ? o += "vec4 colorImage = texture(image, vec2(fract(float(" + a.count + ")*st.t " + a.direction + ` time), fract(st.s)));
|
|
865
|
+
` : o += "vec4 colorImage = texture(image, vec2(fract(float(" + a.count + ")*st.s " + a.direction + ` time), fract(st.t)));
|
|
866
|
+
`, o += `vec4 fragColor;
|
|
867
867
|
fragColor.rgb = (color.rgb) / 1.0;
|
|
868
868
|
fragColor = czm_gammaCorrect(fragColor);
|
|
869
|
-
`,
|
|
869
|
+
`, o += ` material.diffuse = color.rgb;
|
|
870
870
|
material.alpha = colorImage.a * color.a;
|
|
871
871
|
material.emission = fragColor.rgb;
|
|
872
872
|
|
|
873
873
|
return material;
|
|
874
874
|
}
|
|
875
|
-
`,
|
|
875
|
+
`, o;
|
|
876
876
|
};
|
|
877
877
|
return r.Material._materialCache.addMaterial(t, {
|
|
878
878
|
fabric: {
|
|
@@ -882,7 +882,7 @@ function _e(r, e) {
|
|
|
882
882
|
image: e.image,
|
|
883
883
|
time: 0
|
|
884
884
|
},
|
|
885
|
-
source:
|
|
885
|
+
source: n({
|
|
886
886
|
count: e.count,
|
|
887
887
|
freely: e.freely,
|
|
888
888
|
direction: e.direction
|
|
@@ -893,11 +893,11 @@ function _e(r, e) {
|
|
|
893
893
|
}
|
|
894
894
|
}), new i(e);
|
|
895
895
|
}
|
|
896
|
-
function
|
|
897
|
-
const t = r.Color, i = Object.defineProperties,
|
|
898
|
-
let
|
|
899
|
-
function l(
|
|
900
|
-
|
|
896
|
+
function Xt(r, e) {
|
|
897
|
+
const t = r.Color, i = Object.defineProperties, n = r.Event, a = r.createPropertyDescriptor, o = r.Property, s = (c, g) => c === void 0 ? g : c, h = {};
|
|
898
|
+
let d = e.materialType || "PolylineFlow" + Date.now() + Math.floor(Math.random() * 1e3);
|
|
899
|
+
function l(c) {
|
|
900
|
+
c = s(c, h), this._definitionChanged = new n(), 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: {
|
|
@@ -910,23 +910,23 @@ function Yt(r, e) {
|
|
|
910
910
|
return this._definitionChanged;
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
|
-
}), l.prototype.getType = function(
|
|
914
|
-
return
|
|
915
|
-
}, l.prototype.getValue = function(
|
|
916
|
-
return g || (g = {}), g.color =
|
|
913
|
+
}), l.prototype.getType = function(c) {
|
|
914
|
+
return d;
|
|
915
|
+
}, l.prototype.getValue = function(c, g) {
|
|
916
|
+
return g || (g = {}), g.color = o.getValueOrClonedDefault(
|
|
917
917
|
this._color,
|
|
918
|
-
|
|
918
|
+
c,
|
|
919
919
|
r.Color.WHITE,
|
|
920
920
|
g.color
|
|
921
921
|
), g.duration = this._duration, g;
|
|
922
|
-
}, l.prototype.equals = function(
|
|
923
|
-
return this ===
|
|
922
|
+
}, l.prototype.equals = function(c) {
|
|
923
|
+
return this === c || c instanceof l && o.equals(this._color, c._color);
|
|
924
924
|
}, i(l.prototype, {
|
|
925
925
|
color: a("color"),
|
|
926
926
|
duration: a("duration")
|
|
927
|
-
}), r.PolylineFlowMaterialProperty = l, r.Material._materialCache.addMaterial(
|
|
927
|
+
}), r.PolylineFlowMaterialProperty = l, r.Material._materialCache.addMaterial(d, {
|
|
928
928
|
fabric: {
|
|
929
|
-
type:
|
|
929
|
+
type: d,
|
|
930
930
|
uniforms: {
|
|
931
931
|
color: new t(1, 1, 1, 1),
|
|
932
932
|
duration: 45
|
|
@@ -969,11 +969,11 @@ class Le {
|
|
|
969
969
|
* 注册材质
|
|
970
970
|
*/
|
|
971
971
|
register(e) {
|
|
972
|
-
const { themeKey: t, material: i, force:
|
|
972
|
+
const { themeKey: t, material: i, force: n = !1, category: a = "default" } = e;
|
|
973
973
|
this.categoryMap.has(a) || this.categoryMap.set(a, /* @__PURE__ */ new Map());
|
|
974
|
-
const
|
|
975
|
-
if (
|
|
976
|
-
if (
|
|
974
|
+
const o = this.categoryMap.get(a);
|
|
975
|
+
if (o.has(t))
|
|
976
|
+
if (n)
|
|
977
977
|
console.info(`[MaterialManager] themeKey '${t}' 在分类 '${a}' 已被覆盖`);
|
|
978
978
|
else {
|
|
979
979
|
console.warn(
|
|
@@ -981,7 +981,7 @@ class Le {
|
|
|
981
981
|
);
|
|
982
982
|
return;
|
|
983
983
|
}
|
|
984
|
-
|
|
984
|
+
o.set(t, i);
|
|
985
985
|
}
|
|
986
986
|
/**
|
|
987
987
|
* 获取材质
|
|
@@ -1009,8 +1009,8 @@ class Le {
|
|
|
1009
1009
|
remove(e, t = "default") {
|
|
1010
1010
|
const i = this.categoryMap.get(t);
|
|
1011
1011
|
if (!i) return;
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1012
|
+
const n = i.get(e);
|
|
1013
|
+
n?.destroy && n.destroy(), i.delete(e), i.size === 0 && this.categoryMap.delete(t);
|
|
1014
1014
|
}
|
|
1015
1015
|
/**
|
|
1016
1016
|
* 获取某分类下的所有 keys
|
|
@@ -1045,7 +1045,7 @@ class Le {
|
|
|
1045
1045
|
return [...this.categoryMap.keys()];
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
|
-
class
|
|
1048
|
+
class qt {
|
|
1049
1049
|
id;
|
|
1050
1050
|
entities = [];
|
|
1051
1051
|
primitives = [];
|
|
@@ -1053,8 +1053,8 @@ class Ut {
|
|
|
1053
1053
|
aggregator;
|
|
1054
1054
|
cardPool;
|
|
1055
1055
|
constructor(e) {
|
|
1056
|
-
const { id: t, entities: i = [], primitives:
|
|
1057
|
-
this.id = t, this.entities = i, this.primitives =
|
|
1056
|
+
const { id: t, entities: i = [], primitives: n = [], dataItem: a = {}, aggregator: o, cardPool: s } = e;
|
|
1057
|
+
this.id = t, this.entities = i, this.primitives = n, this.dataItem = a, this.aggregator = o, this.cardPool = s;
|
|
1058
1058
|
}
|
|
1059
1059
|
// 改造 setVisible 方法,支持 Entity 和 Primitive 的可见性控制
|
|
1060
1060
|
setVisible(e) {
|
|
@@ -1062,7 +1062,7 @@ class Ut {
|
|
|
1062
1062
|
t && (t.show = e);
|
|
1063
1063
|
}), this.primitives.forEach((t) => {
|
|
1064
1064
|
t && (t.show = e);
|
|
1065
|
-
}), this.aggregator && Array.isArray(this.dataItem.billboard) && this.dataItem.billboard.map((i,
|
|
1065
|
+
}), this.aggregator && Array.isArray(this.dataItem.billboard) && this.dataItem.billboard.map((i, n) => ({
|
|
1066
1066
|
id: this.dataItem.id,
|
|
1067
1067
|
data: {
|
|
1068
1068
|
...this.dataItem,
|
|
@@ -1081,7 +1081,7 @@ class Ut {
|
|
|
1081
1081
|
}), 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
1082
|
}
|
|
1083
1083
|
}
|
|
1084
|
-
class
|
|
1084
|
+
class jt {
|
|
1085
1085
|
id;
|
|
1086
1086
|
groupMap = /* @__PURE__ */ new Map();
|
|
1087
1087
|
Cesium;
|
|
@@ -1089,10 +1089,10 @@ class Xt {
|
|
|
1089
1089
|
materialManager;
|
|
1090
1090
|
aggregator;
|
|
1091
1091
|
cardPool;
|
|
1092
|
-
constructor(e, t, i,
|
|
1093
|
-
this.id = e, this.Cesium = t, this.viewer = i, this.materialManager =
|
|
1092
|
+
constructor(e, t, i, n, a, o) {
|
|
1093
|
+
this.id = e, this.Cesium = t, this.viewer = i, this.materialManager = n, this.aggregator = a, this.cardPool = o, this.aggregator.labelPool.eventBus.addListener(S.Click, {
|
|
1094
1094
|
name: "BufferedHierarchicalAggregator_maker_click",
|
|
1095
|
-
fn: (h,
|
|
1095
|
+
fn: (h, d) => {
|
|
1096
1096
|
this.cardPool.showByIds([h.data.id]);
|
|
1097
1097
|
}
|
|
1098
1098
|
}), new t.ScreenSpaceEventHandler(i.scene.canvas).setInputAction(() => {
|
|
@@ -1106,14 +1106,14 @@ class Xt {
|
|
|
1106
1106
|
themeKey: e.theme,
|
|
1107
1107
|
category: "polyline",
|
|
1108
1108
|
options: e
|
|
1109
|
-
}),
|
|
1109
|
+
}), n = Array.isArray(e.positions[0]) ? e.positions.flat() : e.positions;
|
|
1110
1110
|
let a = {
|
|
1111
1111
|
...e
|
|
1112
1112
|
};
|
|
1113
1113
|
return i && (a.material = i), this.viewer.entities.add({
|
|
1114
1114
|
polyline: {
|
|
1115
1115
|
...a,
|
|
1116
|
-
positions: this.Cesium.Cartesian3.fromDegreesArrayHeights(
|
|
1116
|
+
positions: this.Cesium.Cartesian3.fromDegreesArrayHeights(n)
|
|
1117
1117
|
},
|
|
1118
1118
|
show: (e.show ?? !0) && t
|
|
1119
1119
|
});
|
|
@@ -1124,7 +1124,7 @@ class Xt {
|
|
|
1124
1124
|
themeKey: e.theme,
|
|
1125
1125
|
category: "wall",
|
|
1126
1126
|
options: e
|
|
1127
|
-
}),
|
|
1127
|
+
}), n = e.positions.length === e.minimumHeights?.length ? e.minimumHeights.map((h) => h - Number(e.minHeight || 0)) : e.positions.map((h) => (h[2] || 0) - Number(e.minHeight || 0)), a = e.positions.length === e.maximumHeights?.length ? e.maximumHeights.map((h) => h + Number(e.maxHeight || 0)) : e.positions.map((h) => (h[2] || 0) + Number(e.maxHeight || 0)), o = e.positions.map(
|
|
1128
1128
|
(h) => this.Cesium.Cartesian3.fromDegrees(h[0], h[1], h[2] || 0)
|
|
1129
1129
|
);
|
|
1130
1130
|
let s = {
|
|
@@ -1133,8 +1133,8 @@ class Xt {
|
|
|
1133
1133
|
return i && (s.material = i), this.viewer.entities.add({
|
|
1134
1134
|
wall: {
|
|
1135
1135
|
...s,
|
|
1136
|
-
positions:
|
|
1137
|
-
minimumHeights:
|
|
1136
|
+
positions: o,
|
|
1137
|
+
minimumHeights: n,
|
|
1138
1138
|
maximumHeights: a
|
|
1139
1139
|
},
|
|
1140
1140
|
show: (e.show ?? !0) && t
|
|
@@ -1146,10 +1146,10 @@ class Xt {
|
|
|
1146
1146
|
themeKey: e.theme,
|
|
1147
1147
|
category: "polygon",
|
|
1148
1148
|
options: e
|
|
1149
|
-
}),
|
|
1150
|
-
let l = Array.isArray(
|
|
1149
|
+
}), n = Array.isArray(e.hierarchy[0]) ? e.hierarchy.flat() : e.hierarchy, a = this.Cesium.Cartesian3.fromDegreesArrayHeights(n), o = e.holes?.map((d) => {
|
|
1150
|
+
let l = Array.isArray(d[0]) ? e.hierarchy.flat() : e.hole;
|
|
1151
1151
|
return this.Cesium.Cartesian3.fromDegreesArrayHeights(l.flat());
|
|
1152
|
-
}) || [], s = new this.Cesium.PolygonHierarchy(a,
|
|
1152
|
+
}) || [], s = new this.Cesium.PolygonHierarchy(a, o);
|
|
1153
1153
|
let h = {
|
|
1154
1154
|
...e
|
|
1155
1155
|
};
|
|
@@ -1164,11 +1164,11 @@ class Xt {
|
|
|
1164
1164
|
}
|
|
1165
1165
|
createBillboardPoints(e) {
|
|
1166
1166
|
return !e.billboard?.length || !this.aggregator ? [] : e.billboard.map((t) => {
|
|
1167
|
-
const [i,
|
|
1167
|
+
const [i, n, a = 0] = t.position || [0, 0, 0];
|
|
1168
1168
|
return {
|
|
1169
1169
|
id: e.id,
|
|
1170
1170
|
lon: i,
|
|
1171
|
-
lat:
|
|
1171
|
+
lat: n,
|
|
1172
1172
|
height: a,
|
|
1173
1173
|
name: t.options?.text || "",
|
|
1174
1174
|
data: e,
|
|
@@ -1192,31 +1192,31 @@ class Xt {
|
|
|
1192
1192
|
addGroup(e, t = !0) {
|
|
1193
1193
|
const i = e.id || `${Date.now()}`;
|
|
1194
1194
|
this.removeGroup(i);
|
|
1195
|
-
const
|
|
1195
|
+
const n = [], a = e.show !== !1;
|
|
1196
1196
|
(e.polyline || []).forEach((h) => {
|
|
1197
|
-
const
|
|
1198
|
-
|
|
1197
|
+
const d = this.createPolyline(h, a);
|
|
1198
|
+
d && n.push(d);
|
|
1199
1199
|
}), (e.wall || []).forEach((h) => {
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1200
|
+
const d = this.createWall(h, a);
|
|
1201
|
+
d && n.push(d);
|
|
1202
1202
|
}), (e.polygon || []).forEach((h) => {
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1203
|
+
const d = this.createPolygon(h, a);
|
|
1204
|
+
d && n.push(d);
|
|
1205
1205
|
});
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1208
|
-
const s = new
|
|
1206
|
+
const o = this.createBillboardPoints(e);
|
|
1207
|
+
o.length && t && this.aggregator.appendPoints(o, !1), this.createCard(e);
|
|
1208
|
+
const s = new qt({
|
|
1209
1209
|
id: i,
|
|
1210
|
-
entities:
|
|
1210
|
+
entities: n,
|
|
1211
1211
|
primitives: [],
|
|
1212
1212
|
dataItem: e,
|
|
1213
1213
|
aggregator: this.aggregator,
|
|
1214
1214
|
cardPool: this.cardPool
|
|
1215
1215
|
});
|
|
1216
|
-
return this.groupMap.set(i, s),
|
|
1216
|
+
return this.groupMap.set(i, s), o;
|
|
1217
1217
|
}
|
|
1218
1218
|
async addGroups(e) {
|
|
1219
|
-
const i = e.map((
|
|
1219
|
+
const i = e.map((n) => this.addGroup(n, !1)).flat();
|
|
1220
1220
|
i.length > 0 && this.aggregator && this.aggregator.appendPoints(i, !1);
|
|
1221
1221
|
}
|
|
1222
1222
|
removeGroup(e) {
|
|
@@ -1226,9 +1226,9 @@ class Xt {
|
|
|
1226
1226
|
removeGroups(e) {
|
|
1227
1227
|
let t = [];
|
|
1228
1228
|
for (const i of e) {
|
|
1229
|
-
const
|
|
1230
|
-
if (
|
|
1231
|
-
let a =
|
|
1229
|
+
const n = this.groupMap.get(i);
|
|
1230
|
+
if (n) {
|
|
1231
|
+
let a = n.removeAll(this.viewer, !1);
|
|
1232
1232
|
this.groupMap.delete(i), t.push(a);
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
@@ -1239,10 +1239,10 @@ class Xt {
|
|
|
1239
1239
|
t && (t.removeAll(this.viewer), this.groupMap.delete(e.id)), this.addGroup(e);
|
|
1240
1240
|
}
|
|
1241
1241
|
async updateGroups(e) {
|
|
1242
|
-
this.aggregator.removePointsById(e.map((
|
|
1243
|
-
const i = e.map((
|
|
1244
|
-
const a = this.groupMap.get(
|
|
1245
|
-
return a && (a.removeAll(this.viewer, !1), this.groupMap.delete(
|
|
1242
|
+
this.aggregator.removePointsById(e.map((n) => n.id)), this.cardPool.removeByIds(e.map((n) => n.id));
|
|
1243
|
+
const i = e.map((n) => {
|
|
1244
|
+
const a = this.groupMap.get(n.id);
|
|
1245
|
+
return a && (a.removeAll(this.viewer, !1), this.groupMap.delete(n.id)), this.addGroup(n, !1);
|
|
1246
1246
|
}).flat();
|
|
1247
1247
|
i.length > 0 && this.aggregator && this.aggregator.appendPoints(i, !1);
|
|
1248
1248
|
}
|
|
@@ -1253,20 +1253,20 @@ class Xt {
|
|
|
1253
1253
|
this.groupMap.forEach((e) => e.removeAll(this.viewer)), this.groupMap.clear();
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
|
-
class
|
|
1256
|
+
class Zt {
|
|
1257
1257
|
Cesium;
|
|
1258
1258
|
viewer;
|
|
1259
1259
|
layerMap = /* @__PURE__ */ new Map();
|
|
1260
1260
|
materialManager;
|
|
1261
1261
|
aggregator;
|
|
1262
1262
|
cardPool;
|
|
1263
|
-
constructor(e, t, i,
|
|
1264
|
-
this.Cesium = e, this.viewer = t, this.materialManager = i, this.aggregator =
|
|
1263
|
+
constructor(e, t, i, n, a) {
|
|
1264
|
+
this.Cesium = e, this.viewer = t, this.materialManager = i, this.aggregator = n, this.cardPool = a;
|
|
1265
1265
|
}
|
|
1266
1266
|
addLayer(e) {
|
|
1267
1267
|
this.layerMap.has(e) || this.layerMap.set(
|
|
1268
1268
|
e,
|
|
1269
|
-
new
|
|
1269
|
+
new jt(
|
|
1270
1270
|
e,
|
|
1271
1271
|
this.Cesium,
|
|
1272
1272
|
this.viewer,
|
|
@@ -1301,7 +1301,7 @@ class qt {
|
|
|
1301
1301
|
this.layerMap.get(e)?.removeGroups(t);
|
|
1302
1302
|
}
|
|
1303
1303
|
}
|
|
1304
|
-
class
|
|
1304
|
+
class Jt {
|
|
1305
1305
|
labelId;
|
|
1306
1306
|
cardId;
|
|
1307
1307
|
opt;
|
|
@@ -1313,31 +1313,33 @@ class jt {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
//初始化标记管理
|
|
1315
1315
|
initCore(e, t, i) {
|
|
1316
|
-
let { Cesium:
|
|
1317
|
-
t || (t = new
|
|
1318
|
-
const s = new
|
|
1316
|
+
let { Cesium: n, viewer: a, aggregatorOptions: o } = e;
|
|
1317
|
+
t || (t = new $()), i || (i = new $());
|
|
1318
|
+
const s = new Z(n, a, this.labelId, t);
|
|
1319
|
+
s.setOcclusionOptions({ distanceEpsilon: 1 }), s.setOcclusionEnabled(!1);
|
|
1320
|
+
const h = new Z(n, a, this.cardId, i, !1), d = new Je(n, a, {
|
|
1319
1321
|
//聚合
|
|
1320
|
-
threshold:
|
|
1321
|
-
displayLimit:
|
|
1322
|
-
maxLevel:
|
|
1323
|
-
debugCurrentGrids:
|
|
1324
|
-
groupByTheme:
|
|
1322
|
+
threshold: o?.threshold || 16,
|
|
1323
|
+
displayLimit: o?.displayLimit || 300,
|
|
1324
|
+
maxLevel: o?.maxLevel || 20,
|
|
1325
|
+
debugCurrentGrids: o?.debugCurrentGrids || !1,
|
|
1326
|
+
groupByTheme: o?.groupByTheme ?? !0,
|
|
1325
1327
|
//clusterTheme: aggregatorOptions?.clusterTheme || 'Tag1007', // 这里可以改成你自定义的默认聚合点主题k
|
|
1326
|
-
pointTheme:
|
|
1328
|
+
pointTheme: o?.pointTheme || "Tag1001",
|
|
1327
1329
|
// 普通点的默认主题
|
|
1328
|
-
centralPointMode:
|
|
1330
|
+
centralPointMode: o?.centralPointMode || "firstPoint",
|
|
1329
1331
|
// 普通点的默认主题
|
|
1330
|
-
...
|
|
1332
|
+
...o,
|
|
1331
1333
|
labelPool: s
|
|
1332
|
-
}), l = this.MaterialManager,
|
|
1334
|
+
}), l = this.MaterialManager, c = new Zt(
|
|
1333
1335
|
//实体图层管理
|
|
1334
|
-
|
|
1336
|
+
n,
|
|
1335
1337
|
a,
|
|
1336
1338
|
l,
|
|
1337
|
-
|
|
1339
|
+
d,
|
|
1338
1340
|
h
|
|
1339
1341
|
);
|
|
1340
|
-
return { materialManager: l, entityLayerManager:
|
|
1342
|
+
return { materialManager: l, entityLayerManager: c, cardPool: h, labelPool: s, aggregator: d, eventBus: t, cardEventBus: i };
|
|
1341
1343
|
}
|
|
1342
1344
|
//添加标记
|
|
1343
1345
|
set(e) {
|
|
@@ -1351,21 +1353,21 @@ class jt {
|
|
|
1351
1353
|
//添加
|
|
1352
1354
|
add(e) {
|
|
1353
1355
|
let t = [];
|
|
1354
|
-
|
|
1356
|
+
L(e) ? t = e : t.push(e), t.forEach((i) => {
|
|
1355
1357
|
this.entityList.set(i.id, i);
|
|
1356
1358
|
}), this.instance.entityLayerManager.getLayer("Layer_default") || this.instance.entityLayerManager.addLayer("Layer_default"), this.instance.entityLayerManager.addGroupsToLayer("Layer_default", t);
|
|
1357
1359
|
}
|
|
1358
1360
|
//更新标记
|
|
1359
1361
|
update(e, t = !0) {
|
|
1360
1362
|
let i = [];
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
const
|
|
1364
|
-
if (!
|
|
1365
|
-
let s =
|
|
1363
|
+
L(e) ? i = e : i.push(e);
|
|
1364
|
+
const n = i.map((a) => {
|
|
1365
|
+
const o = this.entityList.get(a.id);
|
|
1366
|
+
if (!o) return;
|
|
1367
|
+
let s = $t({}, o, a);
|
|
1366
1368
|
return this.entityList.set(a.id, s), s;
|
|
1367
1369
|
}).filter(Boolean);
|
|
1368
|
-
t && this.instance.entityLayerManager.updateGroupToLayer("Layer_default",
|
|
1370
|
+
t && this.instance.entityLayerManager.updateGroupToLayer("Layer_default", n);
|
|
1369
1371
|
}
|
|
1370
1372
|
//获取标记
|
|
1371
1373
|
getById(e) {
|
|
@@ -1381,7 +1383,7 @@ class jt {
|
|
|
1381
1383
|
//删除标记
|
|
1382
1384
|
delete(e) {
|
|
1383
1385
|
let t = [];
|
|
1384
|
-
|
|
1386
|
+
L(e) ? t = e : t.push(e), t.forEach((i) => {
|
|
1385
1387
|
this.entityList.delete(i);
|
|
1386
1388
|
}), this.instance.entityLayerManager.removeGroups("Layer_default", t);
|
|
1387
1389
|
}
|
|
@@ -1391,15 +1393,31 @@ class jt {
|
|
|
1391
1393
|
setDebugCurrentGridsEnabled(e) {
|
|
1392
1394
|
this.instance.aggregator.setDebugCurrentGrids(e || !1);
|
|
1393
1395
|
}
|
|
1396
|
+
setLabelOcclusionEnabled(e) {
|
|
1397
|
+
this.instance?.labelPool?.setOcclusionEnabled?.(!!e);
|
|
1398
|
+
}
|
|
1399
|
+
setLabelOcclusionDistanceEpsilon(e) {
|
|
1400
|
+
this.instance?.labelPool?.setOcclusionOptions?.({
|
|
1401
|
+
distanceEpsilon: Math.max(0, Number(e) || 0)
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
setLabelOcclusionOptions(e = {}) {
|
|
1405
|
+
typeof e.enabled == "boolean" && this.setLabelOcclusionEnabled(e.enabled);
|
|
1406
|
+
const t = {};
|
|
1407
|
+
e.distanceEpsilon != null && (t.distanceEpsilon = Math.max(0, Number(e.distanceEpsilon) || 0)), e.throttleMs != null && (t.throttleMs = Math.max(0, Number(e.throttleMs) || 0)), Object.keys(t).length > 0 && this.instance?.labelPool?.setOcclusionOptions?.(t);
|
|
1408
|
+
}
|
|
1409
|
+
getLabelOcclusionOptions() {
|
|
1410
|
+
return this.instance?.labelPool?.getOcclusionOptions?.() || null;
|
|
1411
|
+
}
|
|
1394
1412
|
}
|
|
1395
|
-
function
|
|
1413
|
+
function Qt({
|
|
1396
1414
|
Cesium: r,
|
|
1397
1415
|
options: e,
|
|
1398
1416
|
MaterialManager: t
|
|
1399
1417
|
}) {
|
|
1400
1418
|
if (e.data?.theme) {
|
|
1401
1419
|
if (e.data?.lineType == "1") {
|
|
1402
|
-
let i =
|
|
1420
|
+
let i = Xt(r, {
|
|
1403
1421
|
color: new r.Color.fromCssColorString(e?.options?.color || "#ffffff"),
|
|
1404
1422
|
duration: 100
|
|
1405
1423
|
});
|
|
@@ -1439,7 +1457,7 @@ function Zt({
|
|
|
1439
1457
|
category: "polyline"
|
|
1440
1458
|
});
|
|
1441
1459
|
} else if (e.data?.lineType == "5") {
|
|
1442
|
-
let i =
|
|
1460
|
+
let i = Ut(r, {
|
|
1443
1461
|
image: e.img,
|
|
1444
1462
|
color: new r.Color.fromCssColorString(e?.options?.color || "#ffffff"),
|
|
1445
1463
|
duration: 5e3,
|
|
@@ -1455,7 +1473,7 @@ function Zt({
|
|
|
1455
1473
|
}
|
|
1456
1474
|
}
|
|
1457
1475
|
}
|
|
1458
|
-
function
|
|
1476
|
+
function ei({
|
|
1459
1477
|
Cesium: r,
|
|
1460
1478
|
options: e,
|
|
1461
1479
|
MaterialManager: t
|
|
@@ -1478,7 +1496,7 @@ function Jt({
|
|
|
1478
1496
|
category: "polygon"
|
|
1479
1497
|
});
|
|
1480
1498
|
} else if (e.data?.polygonType == "DynamicImgMaterial") {
|
|
1481
|
-
let i =
|
|
1499
|
+
let i = be(r, {
|
|
1482
1500
|
image: e.img,
|
|
1483
1501
|
color: new r.Color.fromCssColorString(e?.options?.color),
|
|
1484
1502
|
duration: 5e3,
|
|
@@ -1494,7 +1512,7 @@ function Jt({
|
|
|
1494
1512
|
}
|
|
1495
1513
|
}
|
|
1496
1514
|
}
|
|
1497
|
-
function
|
|
1515
|
+
function ti({
|
|
1498
1516
|
Cesium: r,
|
|
1499
1517
|
options: e,
|
|
1500
1518
|
MaterialManager: t
|
|
@@ -1510,7 +1528,7 @@ function Qt({
|
|
|
1510
1528
|
category: "wall"
|
|
1511
1529
|
});
|
|
1512
1530
|
} else if (e.data?.wallType == "DynamicImgMaterial") {
|
|
1513
|
-
let i =
|
|
1531
|
+
let i = be(r, {
|
|
1514
1532
|
image: e.img,
|
|
1515
1533
|
color: new r.Color.fromCssColorString(e?.options?.color),
|
|
1516
1534
|
duration: 5e3,
|
|
@@ -1526,33 +1544,33 @@ function Qt({
|
|
|
1526
1544
|
}
|
|
1527
1545
|
}
|
|
1528
1546
|
}
|
|
1529
|
-
class
|
|
1547
|
+
class ii extends Jt {
|
|
1530
1548
|
constructor(e) {
|
|
1531
1549
|
const {
|
|
1532
1550
|
labelId: t = "report-marker",
|
|
1533
1551
|
cardId: i = "report-marker",
|
|
1534
|
-
tagThemeConfig:
|
|
1552
|
+
tagThemeConfig: n = [],
|
|
1535
1553
|
lineThemeConfig: a = [],
|
|
1536
|
-
cardThemeConfig:
|
|
1554
|
+
cardThemeConfig: o = [],
|
|
1537
1555
|
runListener: s = () => {
|
|
1538
1556
|
},
|
|
1539
1557
|
MaterialManager: h = new Le(),
|
|
1540
|
-
aggregatorOptions:
|
|
1541
|
-
} = e, l = [...
|
|
1558
|
+
aggregatorOptions: d
|
|
1559
|
+
} = e, l = [...n], c = [...a], g = [...o], f = {
|
|
1542
1560
|
clusterTheme: "Tag1007",
|
|
1543
1561
|
pointTheme: "Tag1001",
|
|
1544
1562
|
centralPointMode: "firstPoint",
|
|
1545
1563
|
debugCurrentGrids: !1,
|
|
1546
|
-
...
|
|
1564
|
+
...d || {}
|
|
1547
1565
|
}, u = {
|
|
1548
1566
|
...e,
|
|
1549
1567
|
labelId: t,
|
|
1550
1568
|
cardId: i,
|
|
1551
1569
|
MaterialManager: h,
|
|
1552
1570
|
aggregatorOptions: f,
|
|
1553
|
-
eventBus: new
|
|
1571
|
+
eventBus: new $()
|
|
1554
1572
|
};
|
|
1555
|
-
super(u), this.opt = { ...this.opt, ...u }, this.initTagListener(this.instance.eventBus, this.opt), this.loadTabThemeConfig(l), this.loadLineThemeConfig(
|
|
1573
|
+
super(u), this.opt = { ...this.opt, ...u }, this.initTagListener(this.instance.eventBus, this.opt), this.loadTabThemeConfig(l), this.loadLineThemeConfig(c), this.loadCardThemeConfig(g), this.initDefaultLineMaterials(), this.initDefaultTagTheme();
|
|
1556
1574
|
}
|
|
1557
1575
|
initDefaultTagTheme() {
|
|
1558
1576
|
this.setTagTheme({
|
|
@@ -1650,10 +1668,10 @@ class ei extends jt {
|
|
|
1650
1668
|
})
|
|
1651
1669
|
}
|
|
1652
1670
|
};
|
|
1653
|
-
Object.entries(t).forEach(([i,
|
|
1671
|
+
Object.entries(t).forEach(([i, n]) => {
|
|
1654
1672
|
this.MaterialManager.has(i, "polyline") || this.MaterialManager.register({
|
|
1655
1673
|
themeKey: i,
|
|
1656
|
-
material:
|
|
1674
|
+
material: n.material,
|
|
1657
1675
|
category: "polyline"
|
|
1658
1676
|
});
|
|
1659
1677
|
});
|
|
@@ -1664,23 +1682,23 @@ class ei extends jt {
|
|
|
1664
1682
|
e.tag && this.loadTabThemeConfig(e.tag), e.card && this.loadCardThemeConfig(e.card);
|
|
1665
1683
|
const t = this.opt.Cesium, i = this.instance.materialManager || this.opt.MaterialManager;
|
|
1666
1684
|
if (e.line?.length > 0)
|
|
1667
|
-
for (let
|
|
1668
|
-
|
|
1669
|
-
options:
|
|
1685
|
+
for (let n of e.line)
|
|
1686
|
+
Qt({
|
|
1687
|
+
options: n,
|
|
1670
1688
|
Cesium: t,
|
|
1671
1689
|
MaterialManager: i
|
|
1672
1690
|
});
|
|
1673
1691
|
if (e.polygon?.length > 0)
|
|
1674
|
-
for (let
|
|
1675
|
-
|
|
1676
|
-
options:
|
|
1692
|
+
for (let n of e.polygon)
|
|
1693
|
+
ei({
|
|
1694
|
+
options: n,
|
|
1677
1695
|
Cesium: t,
|
|
1678
1696
|
MaterialManager: i
|
|
1679
1697
|
});
|
|
1680
1698
|
if (e.wall?.length > 0)
|
|
1681
|
-
for (let
|
|
1682
|
-
|
|
1683
|
-
options:
|
|
1699
|
+
for (let n of e.wall)
|
|
1700
|
+
ti({
|
|
1701
|
+
options: n,
|
|
1684
1702
|
Cesium: t,
|
|
1685
1703
|
MaterialManager: i
|
|
1686
1704
|
});
|
|
@@ -1711,10 +1729,10 @@ class ei extends jt {
|
|
|
1711
1729
|
let t = this.instance.cardPool;
|
|
1712
1730
|
e.forEach((i) => {
|
|
1713
1731
|
t.registerTheme(i.data.theme, {
|
|
1714
|
-
createElement(
|
|
1715
|
-
let
|
|
1716
|
-
return i.comType == 1 ? s =
|
|
1717
|
-
data:
|
|
1732
|
+
createElement(n, a) {
|
|
1733
|
+
let o = a.data.data, s;
|
|
1734
|
+
return i.comType == 1 ? s = _(M(J), {
|
|
1735
|
+
data: o || {},
|
|
1718
1736
|
imgSrc: i.data.img,
|
|
1719
1737
|
styleConfig: {
|
|
1720
1738
|
paddingTop: "50px",
|
|
@@ -1734,8 +1752,8 @@ class ei extends jt {
|
|
|
1734
1752
|
top: "0px"
|
|
1735
1753
|
},
|
|
1736
1754
|
bgClass: [i.data.theme]
|
|
1737
|
-
}) : i.comType == 3 && (s =
|
|
1738
|
-
data:
|
|
1755
|
+
}) : i.comType == 3 && (s = _(M(J), {
|
|
1756
|
+
data: o || {},
|
|
1739
1757
|
imgSrc: i.data.img,
|
|
1740
1758
|
styleConfig: {
|
|
1741
1759
|
paddingTop: "55px",
|
|
@@ -1757,7 +1775,7 @@ class ei extends jt {
|
|
|
1757
1775
|
bgClass: [i.data.theme]
|
|
1758
1776
|
// titleConfig: themeOptions.options.titleConfig,
|
|
1759
1777
|
// pageInfoConfig: themeOptions.options.pageInfoConfig,
|
|
1760
|
-
})),
|
|
1778
|
+
})), O(s, n), () => O(null, n);
|
|
1761
1779
|
},
|
|
1762
1780
|
options: {
|
|
1763
1781
|
offset: i.data.pixelOffset,
|
|
@@ -1770,20 +1788,20 @@ class ei extends jt {
|
|
|
1770
1788
|
setTagTheme(e) {
|
|
1771
1789
|
let { labelPool: t } = this.instance;
|
|
1772
1790
|
t.registerTheme(e.data.theme, {
|
|
1773
|
-
createElement(i,
|
|
1774
|
-
let a =
|
|
1775
|
-
const
|
|
1791
|
+
createElement(i, n) {
|
|
1792
|
+
let a = n.data?.billboard?.[0];
|
|
1793
|
+
const o = Yt(a, ["position", "options"]);
|
|
1776
1794
|
let s, h = {
|
|
1777
|
-
...
|
|
1795
|
+
...o,
|
|
1778
1796
|
text: a?.options?.text,
|
|
1779
1797
|
isFullLink: e?.isFullLink ?? !1,
|
|
1780
1798
|
img: e?.data?.options?.img,
|
|
1781
1799
|
textStyle: e?.data?.options?.textStyle,
|
|
1782
1800
|
imgStyle: e?.data?.options?.imgStyle
|
|
1783
1801
|
};
|
|
1784
|
-
if (
|
|
1785
|
-
s =
|
|
1786
|
-
text:
|
|
1802
|
+
if (n.data?.gridKey)
|
|
1803
|
+
s = _(M(Q), {
|
|
1804
|
+
text: n.data?.count,
|
|
1787
1805
|
isFullLink: e.isFullLink ?? !1,
|
|
1788
1806
|
img: e?.data.options.img,
|
|
1789
1807
|
imgStyle: e?.data.options?.imgStyle,
|
|
@@ -1804,149 +1822,156 @@ class ei extends jt {
|
|
|
1804
1822
|
}
|
|
1805
1823
|
});
|
|
1806
1824
|
else if (e.comType == 4)
|
|
1807
|
-
s =
|
|
1808
|
-
else if (e.comType == 5) {
|
|
1809
|
-
const
|
|
1810
|
-
s =
|
|
1825
|
+
s = _(M(Be), h);
|
|
1826
|
+
else if (e.comType == 5 || e.comType == 8) {
|
|
1827
|
+
const d = a?.options || {}, l = e?.data?.options || {}, c = a?.pixelOffset || e?.data?.pixelOffset || { x: 0, y: 0 }, g = d.otherOffset ?? l.otherOffset ?? { x: 0, y: -0 }, f = d.isCanDraggable ?? l.isCanDraggable ?? e?.isCanDraggable ?? !1, u = e.comType == 8 ? Ae : ke;
|
|
1828
|
+
s = _(M(u), {
|
|
1811
1829
|
...h,
|
|
1812
|
-
pixelOffset:
|
|
1813
|
-
textStyle:
|
|
1814
|
-
lineStyle:
|
|
1830
|
+
pixelOffset: c,
|
|
1831
|
+
textStyle: d.textStyle || l.textStyle,
|
|
1832
|
+
lineStyle: d.lineStyle || l.lineStyle,
|
|
1815
1833
|
otherOffset: g,
|
|
1816
1834
|
isCanDraggable: f,
|
|
1817
|
-
onCanDraggable:
|
|
1818
|
-
onSetOtherOffset: (
|
|
1819
|
-
|
|
1835
|
+
onCanDraggable: d.onCanDraggable || e?.onCanDraggable,
|
|
1836
|
+
onSetOtherOffset: (m) => {
|
|
1837
|
+
n.data?.billboard?.[0]?.options && (n.data.billboard[0].options.otherOffset = m), d.onSetOtherOffset?.(m), e?.onSetOtherOffset?.(n.data, m);
|
|
1838
|
+
},
|
|
1839
|
+
onSetLineStake: (m) => {
|
|
1840
|
+
n.data?.billboard?.[0]?.options && (n.data.billboard[0].options.lineStake = m), d.onSetLineStake?.(m), e?.onSetLineStake?.(n.data, m);
|
|
1820
1841
|
}
|
|
1821
1842
|
});
|
|
1822
|
-
} else e.comType == 6 || e.comType == 7 ? s =
|
|
1843
|
+
} else e.comType == 6 || e.comType == 7 ? s = _(M(Re), {
|
|
1823
1844
|
text: h.text,
|
|
1824
1845
|
textStyle: h.textStyle
|
|
1825
|
-
}) : s =
|
|
1826
|
-
return
|
|
1846
|
+
}) : s = _(M(Q), h);
|
|
1847
|
+
return O(s, i), () => O(null, i);
|
|
1827
1848
|
},
|
|
1828
1849
|
options: {
|
|
1829
|
-
offset: e.comType == 5 ? {} : e?.data?.pixelOffset || {}
|
|
1850
|
+
offset: e.comType == 5 || e.comType == 8 ? {} : e?.data?.pixelOffset || {}
|
|
1830
1851
|
}
|
|
1831
1852
|
});
|
|
1832
1853
|
}
|
|
1833
1854
|
//标记监听事件
|
|
1834
1855
|
initTagListener(e, t) {
|
|
1835
|
-
let { viewer: i, tagListeningOptions:
|
|
1836
|
-
e.addListener(
|
|
1856
|
+
let { viewer: i, tagListeningOptions: n } = t;
|
|
1857
|
+
e.addListener(S.Click, {
|
|
1837
1858
|
name: "marker:click",
|
|
1838
1859
|
fn: (a) => {
|
|
1839
|
-
t.runListener?.(
|
|
1860
|
+
t.runListener?.(E.标记左键点击, a.data), de(a.data?.onClick) && a.data?.onClick(a.data), a.data?.cameraPoint && a.data?.billboard[0]?.isFlyToCameraPoint && i?.camera?.flyTo({
|
|
1840
1861
|
duration: 1,
|
|
1841
1862
|
...a.data?.cameraPoint
|
|
1842
1863
|
});
|
|
1843
1864
|
}
|
|
1844
|
-
}), e.addListener(
|
|
1865
|
+
}), e.addListener(S.MouseEnter, {
|
|
1845
1866
|
name: "marker:mouseenter",
|
|
1846
1867
|
fn: (a) => {
|
|
1847
|
-
let
|
|
1868
|
+
let o = this.opt.Cesium, s = { x: 0, y: 0 };
|
|
1848
1869
|
try {
|
|
1849
1870
|
if (a.data?.billboard?.[0]?.position?.length > 2) {
|
|
1850
|
-
let h = a.data?.billboard[0]?.position,
|
|
1871
|
+
let h = a.data?.billboard[0]?.position, d = o.Cartesian3.fromDegrees(h[0], h[1], h[3] || 0), l = this.instance.labelPool.toWindowCoordinates(d);
|
|
1851
1872
|
s.x = l.x, s.y = l.y;
|
|
1852
1873
|
}
|
|
1853
1874
|
} catch (h) {
|
|
1854
1875
|
console.log(h);
|
|
1855
1876
|
}
|
|
1856
|
-
t.runListener?.(
|
|
1877
|
+
t.runListener?.(E.标记移入, a.data, s);
|
|
1857
1878
|
}
|
|
1858
|
-
}), e.addListener(
|
|
1879
|
+
}), e.addListener(S.MouseLeave, {
|
|
1859
1880
|
name: "marker:mouseleave",
|
|
1860
1881
|
fn: (a) => {
|
|
1861
|
-
let
|
|
1882
|
+
let o = this.opt.Cesium, s = { x: 0, y: 0 };
|
|
1862
1883
|
try {
|
|
1863
1884
|
if (a.data?.billboard?.[0]?.position?.length > 2) {
|
|
1864
|
-
let h = a.data?.billboard[0]?.position,
|
|
1885
|
+
let h = a.data?.billboard[0]?.position, d = o.Cartesian3.fromDegrees(h[0], h[1], h[3] || 0), l = this.instance.labelPool.toWindowCoordinates(d);
|
|
1865
1886
|
s.x = l.x, s.y = l.y;
|
|
1866
1887
|
}
|
|
1867
1888
|
} catch (h) {
|
|
1868
1889
|
console.log(h);
|
|
1869
1890
|
}
|
|
1870
|
-
t.runListener?.(
|
|
1891
|
+
t.runListener?.(E.标记移出, a.data, s);
|
|
1871
1892
|
}
|
|
1872
|
-
}),
|
|
1893
|
+
}), n?.forEach((a) => {
|
|
1873
1894
|
e.addListener(a.key, a.ListenerItem, a.overwrite);
|
|
1874
1895
|
});
|
|
1875
1896
|
}
|
|
1876
1897
|
// 兼容旧模式的材质注册
|
|
1877
1898
|
setMaterial(e) {
|
|
1878
|
-
const { type: t, material: i, materialKey:
|
|
1899
|
+
const { type: t, material: i, materialKey: n, cover: a } = e, o = t ? t.toLowerCase() : "default";
|
|
1879
1900
|
this.MaterialManager.register({
|
|
1880
|
-
themeKey:
|
|
1901
|
+
themeKey: n,
|
|
1881
1902
|
// 兼容传入的是 { material: ... } 结构或者直接是材质对象
|
|
1882
1903
|
material: i?.material || i,
|
|
1883
1904
|
force: a,
|
|
1884
|
-
category:
|
|
1905
|
+
category: o
|
|
1885
1906
|
});
|
|
1886
1907
|
}
|
|
1887
1908
|
}
|
|
1888
|
-
const
|
|
1909
|
+
const ri = /* @__PURE__ */ Oe({
|
|
1889
1910
|
__name: "MarkerManage",
|
|
1890
|
-
props:
|
|
1911
|
+
props: Ze,
|
|
1891
1912
|
emits: ["register", "load", "marker-event"],
|
|
1892
1913
|
setup(r, { expose: e, emit: t }) {
|
|
1893
|
-
const i = r,
|
|
1894
|
-
let
|
|
1914
|
+
const i = r, n = t, a = Se("leitingMethods");
|
|
1915
|
+
let o = null;
|
|
1895
1916
|
const s = (l = {}) => {
|
|
1896
|
-
if (
|
|
1897
|
-
const
|
|
1917
|
+
if (o) return o;
|
|
1918
|
+
const c = {
|
|
1898
1919
|
...i,
|
|
1899
1920
|
...l,
|
|
1900
1921
|
Cesium: l.Cesium || i.Cesium,
|
|
1901
1922
|
viewer: l.viewer || i.viewer,
|
|
1902
1923
|
runListener: (g, f, ...u) => {
|
|
1903
|
-
|
|
1924
|
+
n("marker-event", { key: g, data: f, args: u });
|
|
1904
1925
|
}
|
|
1905
1926
|
};
|
|
1906
|
-
return !
|
|
1927
|
+
return !c.Cesium || !c.viewer ? null : (o = new ii(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)), n("load", o), o);
|
|
1907
1928
|
}, h = {
|
|
1908
1929
|
init: s,
|
|
1909
|
-
set: (l) =>
|
|
1910
|
-
add: (l) =>
|
|
1911
|
-
update: (l,
|
|
1912
|
-
getById: (l) =>
|
|
1913
|
-
getOptions: () =>
|
|
1914
|
-
delete: (l) =>
|
|
1915
|
-
setMarkerAggregationEnabled: (l,
|
|
1916
|
-
setDebugCurrentGridsEnabled: (l) =>
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1930
|
+
set: (l) => o?.set(l),
|
|
1931
|
+
add: (l) => o?.add(l),
|
|
1932
|
+
update: (l, c) => o?.update(l, c),
|
|
1933
|
+
getById: (l) => o?.getById(l),
|
|
1934
|
+
getOptions: () => o?.getOptions(),
|
|
1935
|
+
delete: (l) => o?.delete(l),
|
|
1936
|
+
setMarkerAggregationEnabled: (l, c) => o?.setMarkerAggregationEnabled(l, c),
|
|
1937
|
+
setDebugCurrentGridsEnabled: (l) => o?.setDebugCurrentGridsEnabled(l),
|
|
1938
|
+
setLabelOcclusionEnabled: (l) => o?.setLabelOcclusionEnabled(l),
|
|
1939
|
+
setLabelOcclusionDistanceEpsilon: (l) => o?.setLabelOcclusionDistanceEpsilon(l),
|
|
1940
|
+
setLabelOcclusionOptions: (l) => o?.setLabelOcclusionOptions(l),
|
|
1941
|
+
getLabelOcclusionOptions: () => o?.getLabelOcclusionOptions(),
|
|
1942
|
+
initThemes: (l) => o?.initThemes(l),
|
|
1943
|
+
setTagTheme: (l) => o?.setTagTheme(l),
|
|
1944
|
+
setMaterial: (l) => o?.setMaterial(l)
|
|
1920
1945
|
};
|
|
1921
|
-
e(h),
|
|
1922
|
-
function
|
|
1923
|
-
if (
|
|
1924
|
-
const l =
|
|
1925
|
-
|
|
1946
|
+
e(h), n("register", h);
|
|
1947
|
+
function d() {
|
|
1948
|
+
if (o) return o;
|
|
1949
|
+
const l = Ge(a), c = l?.getCesium?.(), g = l?.getViewer?.();
|
|
1950
|
+
c && g ? s({ Cesium: c, viewer: g, methods: l }) : i.Cesium && i.viewer && s({ methods: l });
|
|
1926
1951
|
}
|
|
1927
|
-
return
|
|
1928
|
-
|
|
1929
|
-
}),
|
|
1952
|
+
return Ee(() => {
|
|
1953
|
+
d();
|
|
1954
|
+
}), j(
|
|
1930
1955
|
() => [i.Cesium, i.viewer],
|
|
1931
|
-
([l,
|
|
1932
|
-
l &&
|
|
1956
|
+
([l, c]) => {
|
|
1957
|
+
l && c && !o && d();
|
|
1933
1958
|
}
|
|
1934
|
-
),
|
|
1959
|
+
), j(
|
|
1935
1960
|
() => a?.value,
|
|
1936
|
-
(l,
|
|
1937
|
-
|
|
1961
|
+
(l, c) => {
|
|
1962
|
+
d();
|
|
1938
1963
|
},
|
|
1939
1964
|
{ deep: !1 }
|
|
1940
|
-
),
|
|
1941
|
-
}), (l,
|
|
1965
|
+
), De(() => {
|
|
1966
|
+
}), (l, c) => Ie(l.$slots, "default");
|
|
1942
1967
|
}
|
|
1943
|
-
}),
|
|
1968
|
+
}), ui = xe(ri);
|
|
1944
1969
|
export {
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1970
|
+
ui as CxMarkerManage,
|
|
1971
|
+
ii as MarkerManage,
|
|
1972
|
+
Jt as MarkerManagerCore,
|
|
1973
|
+
E as ReportListenerKey,
|
|
1974
|
+
ui as default,
|
|
1975
|
+
Ze as markerManageProps
|
|
1951
1976
|
};
|
|
1952
1977
|
//# sourceMappingURL=marker-manage.js.map
|