@skzz/components-gis 0.0.4 → 0.0.5

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/dist/index.es.js CHANGED
@@ -4458,11 +4458,395 @@ var La = {
4458
4458
  }
4459
4459
  };
4460
4460
  //#endregion
4461
+ //#region src/zz-layer/zz-layer-shp-zzts/shpZztsRenderer.js
4462
+ function Ra() {
4463
+ let e = Math.random() * 360;
4464
+ return D.Color.fromHsl(e / 360, .7, .5);
4465
+ }
4466
+ function za(e) {
4467
+ let t = performance.now(), n = [], r = new DataView(e), i = r.getInt32(0, !0);
4468
+ if (i <= 0 || i > 1e5) return console.warn(`[ShpZzts] tileCount 异常: ${i},跳过解析`), n;
4469
+ console.log(`[ShpZzts] 瓦片数量: ${i}`);
4470
+ let a = 4;
4471
+ for (let t = 0; t < i; t++) {
4472
+ let i = r.getInt32(a, !0);
4473
+ if (a += 4, i <= 0 || i > 100 * 1024 * 1024) {
4474
+ console.error(`[ShpZzts] dataLen 异常: ${i},跳过瓦片 ${t}`), a += Math.max(0, i);
4475
+ continue;
4476
+ }
4477
+ let o = new Uint8Array(e, a, i), s = new DataView(o.buffer, o.byteOffset, o.byteLength);
4478
+ a += i;
4479
+ let c = 0, l = s.getInt32(c, !0);
4480
+ c += 4;
4481
+ let u = s.getInt32(c, !0);
4482
+ if (c += 4, l % 8 != 0 || u % 4 != 0) {
4483
+ console.error(`[ShpZzts] 数据对齐异常 positionsByteLen=${l} indicesByteLen=${u},跳过瓦片 ${t}`);
4484
+ continue;
4485
+ }
4486
+ let d = l / 8 / 3, f = u / 4;
4487
+ if (d === 0 || f === 0) {
4488
+ console.warn(`[ShpZzts] 空几何体 tile=${t},跳过`);
4489
+ continue;
4490
+ }
4491
+ let p = o.slice(c, c + l), m = new Float64Array(p.buffer, p.byteOffset, d * 3);
4492
+ c += l;
4493
+ let h = o.slice(c, c + u), g = new Uint32Array(h.buffer, h.byteOffset, f);
4494
+ c += u;
4495
+ let _ = !1;
4496
+ for (let e = 0; e < m.length && !_; e++) isFinite(m[e]) || (_ = !0);
4497
+ if (_) {
4498
+ console.error(`[ShpZzts] NaN/Inf 坐标 tile=${t},跳过`);
4499
+ continue;
4500
+ }
4501
+ let v = 0;
4502
+ for (let e = 0; e < g.length; e++) g[e] > v && (v = g[e]);
4503
+ if (v >= d) {
4504
+ console.error(`[ShpZzts] 索引越界 tile=${t} maxIdx=${v} vertexCount=${d},跳过`);
4505
+ continue;
4506
+ }
4507
+ n.push({
4508
+ positions: m,
4509
+ indices: g,
4510
+ vertexCount: d,
4511
+ indexCount: f,
4512
+ featureId: String(t)
4513
+ });
4514
+ }
4515
+ let o = (performance.now() - t).toFixed(1);
4516
+ return console.log(`[ShpZzts] 解析完成: ${n.length} 要素, ${o}ms`), n;
4517
+ }
4518
+ var Ba = class {
4519
+ constructor(e, t = {}) {
4520
+ this.viewer = e, this.id = t.layerId || "", this.calTilesUrl = t.calTilesUrl || "/v1/zzts/layer/shp/calTiles", this.tileUrl = t.tileUrl || "/v1/zzts/layer/3d/getVectorTile", this.opacity = this._normOpacity(t.opacity), this.batchSize = t.batchSize || 2e3, this.transitionDuration = t.transitionDuration || 50, this.currentLod = -1, this.lodPrimitives = /* @__PURE__ */ new Map(), this.transitionAnimId = null, this.requestInProgress = !1, this.debounceTimer = null, this.destroyed = !1, this.globalInstanceId = 0, this.stackIndex = t.stackIndex ?? -1, this.subStackIndex = t.subStackIndex ?? 0, this.groupKey = t.groupKey || String(this.id), this._moveHandler = null;
4521
+ }
4522
+ _normOpacity(e) {
4523
+ let t = Number(e);
4524
+ return Number.isFinite(t) ? Math.max(0, Math.min(1, t)) : 1;
4525
+ }
4526
+ _getScreenBounds() {
4527
+ let e = this.viewer.scene.canvas, t = this.viewer.camera.computeViewRectangle();
4528
+ return t ? {
4529
+ region: [
4530
+ D.Math.toDegrees(t.west),
4531
+ D.Math.toDegrees(t.south),
4532
+ 0,
4533
+ D.Math.toDegrees(t.east),
4534
+ D.Math.toDegrees(t.north),
4535
+ 10
4536
+ ],
4537
+ width: e.clientWidth,
4538
+ height: e.clientHeight
4539
+ } : null;
4540
+ }
4541
+ _updatePrimitiveAlpha(e, t) {
4542
+ if (e) {
4543
+ for (let n of e) if (!(!n.primitive || n.primitive.isDestroyed?.())) for (let e = 0; e < n.instanceIds.length; e++) {
4544
+ let r = n.instanceColors[e], i = new D.Color(r.red, r.green, r.blue, t);
4545
+ try {
4546
+ let t = n.primitive.getGeometryInstanceAttributes(n.instanceIds[e]);
4547
+ t?.color && (t.color = D.ColorGeometryInstanceAttribute.toValue(i));
4548
+ } catch {}
4549
+ }
4550
+ }
4551
+ }
4552
+ _destroyLodPrimitives(e) {
4553
+ let t = this.lodPrimitives.get(e);
4554
+ if (t) {
4555
+ for (let e of t) e.primitive && !e.primitive.isDestroyed?.() && this.viewer.scene.primitives.remove(e.primitive);
4556
+ this.lodPrimitives.delete(e);
4557
+ }
4558
+ }
4559
+ _crossFadeLod(e, t) {
4560
+ this.transitionAnimId !== null && (cancelAnimationFrame(this.transitionAnimId), this.transitionAnimId = null);
4561
+ let n = this.lodPrimitives.get(e) ?? void 0, r = this.lodPrimitives.get(t);
4562
+ if (!r) return;
4563
+ this._updatePrimitiveAlpha(r, 0);
4564
+ let i = performance.now(), a = this.transitionDuration, o = () => {
4565
+ let t = Math.min((performance.now() - i) / a, 1);
4566
+ if (this._updatePrimitiveAlpha(r, t), n && this._updatePrimitiveAlpha(n, 1 - t), t < 1) this.transitionAnimId = requestAnimationFrame(o);
4567
+ else {
4568
+ if (n) {
4569
+ for (let e of n) e.primitive && !e.primitive.isDestroyed?.() && this.viewer.scene.primitives.remove(e.primitive);
4570
+ this.lodPrimitives.delete(e);
4571
+ }
4572
+ this.transitionAnimId = null;
4573
+ }
4574
+ };
4575
+ this.transitionAnimId = requestAnimationFrame(o);
4576
+ }
4577
+ _renderBatched(e, t, n, r) {
4578
+ let i = [], a = [];
4579
+ for (let t = 0; t < e.length; t += this.batchSize) a.push(e.slice(t, t + this.batchSize));
4580
+ let o = 0, s = (c) => {
4581
+ if (c >= a.length) return;
4582
+ let l = a[c], u = [], d = [], f = [];
4583
+ for (let e of l) {
4584
+ let t = this.globalInstanceId++;
4585
+ u.push(t);
4586
+ let r = Ra();
4587
+ d.push(r);
4588
+ let i = new D.Color(r.red, r.green, r.blue, n);
4589
+ try {
4590
+ f.push(new D.GeometryInstance({
4591
+ geometry: new D.Geometry({
4592
+ attributes: { position: new D.GeometryAttribute({
4593
+ componentDatatype: D.ComponentDatatype.DOUBLE,
4594
+ componentsPerAttribute: 3,
4595
+ values: e.positions,
4596
+ normalize: !1
4597
+ }) },
4598
+ indices: e.indices,
4599
+ primitiveType: D.PrimitiveType.TRIANGLES,
4600
+ boundingSphere: D.BoundingSphere.fromVertices(e.positions)
4601
+ }),
4602
+ id: t,
4603
+ attributes: { color: D.ColorGeometryInstanceAttribute.fromColor(i) }
4604
+ }));
4605
+ } catch (e) {
4606
+ console.error(`[ShpZzts] Geometry 创建失败 instanceId=${t}`, e), u.pop(), d.pop();
4607
+ }
4608
+ }
4609
+ if (f.length === 0) {
4610
+ o++, o < a.length ? requestAnimationFrame(() => s(c + 1)) : (this.lodPrimitives.set(t, i), r && requestAnimationFrame(() => r()));
4611
+ return;
4612
+ }
4613
+ let p = new D.Primitive({
4614
+ geometryInstances: f,
4615
+ appearance: new D.PerInstanceColorAppearance({
4616
+ flat: !0,
4617
+ translucent: !0
4618
+ }),
4619
+ asynchronous: !1,
4620
+ compressVertices: !1,
4621
+ releaseGeometryInstances: !0
4622
+ });
4623
+ this.viewer.scene.primitives.add(p), i.push({
4624
+ primitive: p,
4625
+ instanceIds: u,
4626
+ instanceColors: d
4627
+ }), o++, o < a.length ? requestAnimationFrame(() => s(c + 1)) : (this.lodPrimitives.set(t, i), console.log(`[ShpZzts] LOD ${t} 渲染完成: ${e.length} 要素 / ${a.length} 批`), r && requestAnimationFrame(() => r()));
4628
+ };
4629
+ return s(0), i;
4630
+ }
4631
+ async _getVectorTileData(e, t) {
4632
+ let n = await k.request({
4633
+ method: "GET",
4634
+ url: this.tileUrl,
4635
+ headers: { Accept: "application/octet-stream" },
4636
+ params: {
4637
+ layerId: this.id,
4638
+ geosot: e,
4639
+ level: t
4640
+ },
4641
+ responseType: "arraybuffer",
4642
+ timeout: 3e5
4643
+ }), r = n?.data ?? n;
4644
+ if (!r || r.byteLength === 0) throw Error("Response data is empty");
4645
+ return {
4646
+ geosot: e,
4647
+ data: r
4648
+ };
4649
+ }
4650
+ async loadAndRender() {
4651
+ if (this.requestInProgress) {
4652
+ console.log("[ShpZzts] 请求进行中,跳过");
4653
+ return;
4654
+ }
4655
+ let e = this._getScreenBounds();
4656
+ if (!e) return;
4657
+ let t = Math.abs(e.region[3] - e.region[0]), n = Math.abs(e.region[4] - e.region[1]);
4658
+ if (t > 20 || n > 20) {
4659
+ console.warn(`[ShpZzts] 视窗范围过大,跳过请求 (lonSpan=${t.toFixed(2)}°, latSpan=${n.toFixed(2)}°, 限制=20°)`);
4660
+ return;
4661
+ }
4662
+ this.requestInProgress = !0;
4663
+ let r = performance.now();
4664
+ try {
4665
+ let t = await k.request({
4666
+ method: "GET",
4667
+ url: this.calTilesUrl,
4668
+ params: {
4669
+ region: e.region.join(","),
4670
+ height: e.height,
4671
+ width: e.width
4672
+ }
4673
+ }), { lodLevel: n = -1, tiles: i = [] } = t?.data ?? t ?? {};
4674
+ if (console.log(`[ShpZzts] LOD ${n} | 瓦片数: ${i.length}`), !i || i.length === 0) {
4675
+ console.warn("[ShpZzts] 没有需要加载的瓦片");
4676
+ return;
4677
+ }
4678
+ let a = i.map((e) => this._getVectorTileData(e.geoSot, n));
4679
+ console.log(`[ShpZzts] 开始并行加载 ${a.length} 个瓦片...`);
4680
+ let o = await Promise.allSettled(a), s = [];
4681
+ for (let e = 0; e < o.length; e++) {
4682
+ let t = o[e];
4683
+ if (t.status === "fulfilled") {
4684
+ let { geosot: e, data: n } = t.value;
4685
+ if (n instanceof ArrayBuffer && n.byteLength > 0 && (console.log(`[ShpZzts] 瓦片 ${e} 数据长度: ${n.byteLength}`), n.byteLength > 100)) {
4686
+ let e = za(n);
4687
+ e && e.length > 0 && (s = s.concat(e));
4688
+ }
4689
+ } else console.error(`[ShpZzts] 瓦片 ${i[e]?.geoSot} 加载失败:`, t.reason);
4690
+ }
4691
+ if (console.log(`[ShpZzts] 所有瓦片加载完成,总几何体数量: ${s.length}`), s.length > 0) {
4692
+ let e = this.currentLod;
4693
+ this.currentLod !== -1 && this.currentLod !== n ? (console.log(`[ShpZzts-SILOD] LOD 变化: ${e} → ${n}`), this._destroyLodPrimitives(n), this._renderBatched(s, n, 0, () => {
4694
+ console.log(`[ShpZzts-SILOD] 新 LOD ${n} 分批渲染完成,启动交叉淡化`), this._crossFadeLod(e, n);
4695
+ })) : (this._destroyLodPrimitives(n), this._renderBatched(s, n, 1)), this.currentLod = n;
4696
+ }
4697
+ let c = (performance.now() - r).toFixed(0);
4698
+ console.log(`[ShpZzts] 加载+渲染完成: ${s.length} 要素, ${c}ms`);
4699
+ } catch (e) {
4700
+ console.error("[ShpZzts] 加载失败:", e);
4701
+ } finally {
4702
+ this.requestInProgress = !1;
4703
+ }
4704
+ }
4705
+ _onCameraMoveEnd() {
4706
+ this.debounceTimer && clearTimeout(this.debounceTimer), this.debounceTimer = setTimeout(() => {
4707
+ this.destroyed || (console.log("[ShpZzts] 地图移动/缩放结束,重新加载瓦片"), this.loadAndRender());
4708
+ }, 300);
4709
+ }
4710
+ _setupMoveHandler() {
4711
+ this._moveHandler = () => this._onCameraMoveEnd(), this.viewer.camera.moveEnd.addEventListener(this._moveHandler);
4712
+ }
4713
+ _teardownMoveHandler() {
4714
+ if (this._moveHandler) {
4715
+ try {
4716
+ this.viewer.camera.moveEnd.removeEventListener(this._moveHandler);
4717
+ } catch {}
4718
+ this._moveHandler = null;
4719
+ }
4720
+ }
4721
+ async init() {
4722
+ this.destroyed || (this._setupMoveHandler(), setTimeout(() => {
4723
+ this.destroyed || this.loadAndRender();
4724
+ }, 500), console.log(`[ShpZzts] 图层 ${this.id} 初始化完成`));
4725
+ }
4726
+ remove() {
4727
+ this.destroyed = !0, this.transitionAnimId !== null && (cancelAnimationFrame(this.transitionAnimId), this.transitionAnimId = null), this.debounceTimer &&= (clearTimeout(this.debounceTimer), null), this._teardownMoveHandler();
4728
+ for (let e of this.lodPrimitives.keys()) this._destroyLodPrimitives(e);
4729
+ console.log(`[ShpZzts] 图层 ${this.id} 已移除`);
4730
+ }
4731
+ updateOptions(e = {}) {
4732
+ e.opacity !== void 0 && (this.opacity = this._normOpacity(e.opacity)), e.stackIndex !== void 0 && (this.stackIndex = e.stackIndex), e.subStackIndex !== void 0 && (this.subStackIndex = e.subStackIndex), e.groupKey !== void 0 && (this.groupKey = e.groupKey), console.log(`[ShpZzts] 图层 ${this.id} 配置已更新`, {
4733
+ opacity: this.opacity,
4734
+ stackIndex: this.stackIndex
4735
+ });
4736
+ }
4737
+ }, Va = new class {
4738
+ constructor() {
4739
+ this.layers = /* @__PURE__ */ new Map();
4740
+ }
4741
+ async createLayer(e, t = {}) {
4742
+ let n = t?.layerId || t?.id;
4743
+ if (!n) return console.error("[ShpZzts] 创建图层失败:缺少 layerId"), null;
4744
+ this.layers.has(n) && (console.warn(`[ShpZzts] 图层 ${n} 已存在,移除旧图层后重建`), this.removeLayer(n));
4745
+ let r = new Ba(e, t);
4746
+ return await r.init(), this.layers.set(n, r), r;
4747
+ }
4748
+ removeLayer(e) {
4749
+ let t = this.layers.get(e);
4750
+ t && (t.remove(), this.layers.delete(e), console.log(`[ShpZzts] 图层 ${e} 已移除`));
4751
+ }
4752
+ getLayer(e) {
4753
+ return this.layers.get(e);
4754
+ }
4755
+ removeAllLayers() {
4756
+ this.layers.forEach((e) => e.remove()), this.layers.clear();
4757
+ }
4758
+ }(), Ha = async (e, t) => Va.createLayer(e, t), Ua = (e) => {
4759
+ Va.removeLayer(e);
4760
+ }, Wa = (e) => Va.getLayer(e), Ga = {
4761
+ __name: "index",
4762
+ props: {
4763
+ config: {
4764
+ type: Object,
4765
+ default: () => ({})
4766
+ },
4767
+ stackIndex: {
4768
+ type: Number,
4769
+ default: -1
4770
+ },
4771
+ subStackIndex: {
4772
+ type: Number,
4773
+ default: 0
4774
+ },
4775
+ groupKey: {
4776
+ type: String,
4777
+ default: ""
4778
+ }
4779
+ },
4780
+ setup(e) {
4781
+ let n = c("cesiumViewer"), r = e, i = {
4782
+ layerId: "",
4783
+ calTilesUrl: "/v1/zzts/layer/shp/calTiles",
4784
+ tileUrl: "/v1/zzts/layer/3d/getVectorTile",
4785
+ opacity: 1,
4786
+ batchSize: 2e3,
4787
+ transitionDuration: 50
4788
+ }, a = t(() => ({
4789
+ ...i,
4790
+ ...r.config
4791
+ })), o = "", s = async () => {
4792
+ let e = a.value;
4793
+ if (!e.layerId) {
4794
+ console.warn("[zzLayerShpZzts] 缺少 layerId,跳过初始化", e);
4795
+ return;
4796
+ }
4797
+ let t = {
4798
+ layerId: e.layerId,
4799
+ calTilesUrl: e.calTilesUrl,
4800
+ tileUrl: e.tileUrl,
4801
+ opacity: e.opacity,
4802
+ batchSize: e.batchSize,
4803
+ transitionDuration: e.transitionDuration,
4804
+ stackIndex: r.stackIndex,
4805
+ subStackIndex: r.subStackIndex,
4806
+ groupKey: r.groupKey || e.layerId
4807
+ };
4808
+ console.log("[zzLayerShpZzts] initLayer 入参 =", {
4809
+ layerId: t.layerId,
4810
+ calTilesUrl: t.calTilesUrl,
4811
+ tileUrl: t.tileUrl,
4812
+ opacity: t.opacity
4813
+ }), await Ha(n.value, t), o = e.layerId;
4814
+ }, l = () => {
4815
+ Ua(a.value.layerId);
4816
+ };
4817
+ return w(() => r.config, async () => {
4818
+ console.log("[zzLayerShpZzts] props.config changed =", JSON.parse(JSON.stringify(r.config || {}))), await s();
4819
+ }, {
4820
+ deep: !0,
4821
+ immediate: !0
4822
+ }), w(() => [
4823
+ r.stackIndex,
4824
+ r.subStackIndex,
4825
+ r.groupKey
4826
+ ], () => {
4827
+ let e = a.value, t = Wa(e.layerId);
4828
+ if (t && typeof t.updateOptions == "function") {
4829
+ t.updateOptions({
4830
+ stackIndex: r.stackIndex,
4831
+ subStackIndex: r.subStackIndex,
4832
+ groupKey: r.groupKey || e.layerId
4833
+ });
4834
+ return;
4835
+ }
4836
+ s();
4837
+ }), d(() => {
4838
+ console.log("[zzLayerShpZzts] 组件挂载");
4839
+ }), f(() => {
4840
+ console.log("[zzLayerShpZzts] 组件卸载,开始清理资源..."), o ? Ua(o) : l();
4841
+ }), (e, t) => null;
4842
+ }
4843
+ };
4844
+ //#endregion
4461
4845
  //#region src/zz-layer/zz-layer-zzts3d-point/pointTileUtils.js
4462
- function Ra(e) {
4846
+ function Ka(e) {
4463
4847
  return e instanceof ArrayBuffer ? e : ArrayBuffer.isView(e) ? e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength) : null;
4464
4848
  }
4465
- function za(e) {
4849
+ function qa(e) {
4466
4850
  if (!e || e.byteLength === 0) return null;
4467
4851
  let t = new Uint8Array(e), n = t.find((e) => e > 32);
4468
4852
  if (n !== 123 && n !== 91) return null;
@@ -4472,41 +4856,41 @@ function za(e) {
4472
4856
  return null;
4473
4857
  }
4474
4858
  }
4475
- function Ba(e, t = {}) {
4859
+ function Ja(e, t = {}) {
4476
4860
  return console.warn("[zzts3d-point] skip invalid tile data:", e, t), [];
4477
4861
  }
4478
- var Va = [
4862
+ var Ya = [
4479
4863
  13,
4480
4864
  14,
4481
4865
  15,
4482
4866
  16,
4483
4867
  18
4484
- ], Ha = 16;
4485
- function Ua(e, t = Ha) {
4868
+ ], Xa = 16;
4869
+ function Za(e, t = Xa) {
4486
4870
  let n = Number(e);
4487
- if (Number.isFinite(n) && n > 0) return Va.find((e) => n <= e) || Va[Va.length - 1];
4871
+ if (Number.isFinite(n) && n > 0) return Ya.find((e) => n <= e) || Ya[Ya.length - 1];
4488
4872
  let r = Number(t);
4489
- return Number.isFinite(r) && r > 0 ? Va.find((e) => r <= e) || Va[Va.length - 1] : Ha;
4873
+ return Number.isFinite(r) && r > 0 ? Ya.find((e) => r <= e) || Ya[Ya.length - 1] : Xa;
4490
4874
  }
4491
- function Wa(e, t) {
4875
+ function Qa(e, t) {
4492
4876
  let n = (String(e ?? "").split("_")[0].match(/\d/g) || []).length;
4493
- return n > 0 ? Ua(n, t) : Ua(t);
4877
+ return n > 0 ? Za(n, t) : Za(t);
4494
4878
  }
4495
- function Ga(e, t) {
4496
- let n = Ra(e);
4497
- if (!n || n.byteLength < 4 || za(n)) return [];
4879
+ function $a(e, t) {
4880
+ let n = Ka(e);
4881
+ if (!n || n.byteLength < 4 || qa(n)) return [];
4498
4882
  let r = [], i = new DataView(n), a = 0, o = i.getInt32(a, !0);
4499
- if (a += 4, o < 0 || o > 1e5) return Ba("invalid entity count", {
4883
+ if (a += 4, o < 0 || o > 1e5) return Ja("invalid entity count", {
4500
4884
  entityCount: o,
4501
4885
  byteLength: n.byteLength
4502
4886
  });
4503
4887
  for (let e = 0; e < o; e++) {
4504
- if (a + 4 > n.byteLength) return Ba("missing compressed chunk length", {
4888
+ if (a + 4 > n.byteLength) return Ja("missing compressed chunk length", {
4505
4889
  offset: a,
4506
4890
  byteLength: n.byteLength
4507
4891
  });
4508
4892
  let e = i.getInt32(a, !0);
4509
- if (a += 4, e <= 0 || a + e > n.byteLength) return Ba("invalid compressed chunk length", {
4893
+ if (a += 4, e <= 0 || a + e > n.byteLength) return Ja("invalid compressed chunk length", {
4510
4894
  compressedLength: e,
4511
4895
  offset: a,
4512
4896
  byteLength: n.byteLength
@@ -4520,11 +4904,11 @@ function Ga(e, t) {
4520
4904
  } catch {
4521
4905
  s = new DataView(o.buffer, o.byteOffset, o.byteLength);
4522
4906
  }
4523
- if (s.byteLength < 12) return Ba("chunk too small", { byteLength: s.byteLength });
4907
+ if (s.byteLength < 12) return Ja("chunk too small", { byteLength: s.byteLength });
4524
4908
  let c = 0, l = s.getBigInt64(c, !0);
4525
4909
  c += 8;
4526
4910
  let u = s.getInt32(c, !0);
4527
- if (c += 4, u < 0 || u % 12 != 0 || c + u > s.byteLength) return Ba("invalid positions byte length", {
4911
+ if (c += 4, u < 0 || u % 12 != 0 || c + u > s.byteLength) return Ja("invalid positions byte length", {
4528
4912
  positionsByteLength: u,
4529
4913
  innerOffset: c,
4530
4914
  byteLength: s.byteLength
@@ -4540,12 +4924,12 @@ function Ga(e, t) {
4540
4924
  }
4541
4925
  return r;
4542
4926
  }
4543
- function Ka({ destroyed: e, currentVersion: t, requestVersion: n, cancelToken: r } = {}) {
4927
+ function eo({ destroyed: e, currentVersion: t, requestVersion: n, cancelToken: r } = {}) {
4544
4928
  return !e && t === n && !r?.token?.reason;
4545
4929
  }
4546
4930
  //#endregion
4547
4931
  //#region src/zz-layer/zz-layer-zzts3d-point/entityGrid.js
4548
- var qa = class {
4932
+ var to = class {
4549
4933
  constructor(e, t = !1, n = null, r = "255,255,255", i = 5, a = 1, o = {}) {
4550
4934
  this.id = e, this.isStatic = t, this.loadedTiles = /* @__PURE__ */ new Map(), this.currentTileIds = /* @__PURE__ */ new Set(), this.currentNewLevel = g(n || 15), this.gridDb = null, this.entityNum = 0, this.handlers = null, this.requestController = null, this.pendingRequests = /* @__PURE__ */ new Map(), this.fadeAnimations = /* @__PURE__ */ new Map(), this.lastTime = 0, this.pointSize = i, this.opacity = a, this.fixedLevel = n, this.dictCode = o.dictCode || "", this.serviceName = o.serviceName || "", this.enableServiceColor = o.enableServiceColor === !0, this.modelColorUrl = o.modelColorUrl || "/v1/zzts/style/render/modelColors", this.modelColorCache = /* @__PURE__ */ new Map(), this.requestVersion = 0, this.destroyed = !1, this.initTimer = null, this.levels_add = window.levels_add_plus || 0, this.tileColor = r, this.tileSleepTime = window.tileSleepTime || 400, this.highlightModelId = null, this.highlightColor = "255,255,0", this.highlightOpacity = 1, this.highlightPointSize = null, this.modelPointIndex = /* @__PURE__ */ new Map(), this.tilePointIndex = /* @__PURE__ */ new Map();
4551
4935
  }
@@ -4772,7 +5156,7 @@ var qa = class {
4772
5156
  e.forEach((e) => {
4773
5157
  if (this.isStatic && this.fixedLevel) e.geoSot = e.geoSot, e.level = t;
4774
5158
  else {
4775
- let r = Wa(e.geoSot, t), i = Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees((e.xmax + e.xmin) / 2, (e.ymax + e.ymin) / 2, 0), Cesium.Cartesian3.fromDegrees(n.x, n.y, n.z));
5159
+ let r = Qa(e.geoSot, t), i = Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees((e.xmax + e.xmin) / 2, (e.ymax + e.ymin) / 2, 0), Cesium.Cartesian3.fromDegrees(n.x, n.y, n.z));
4776
5160
  N.entityGridLevels.filter((e) => e.max >= i && e.min <= i), e.geoSot = e.geoSot, e.level = r;
4777
5161
  }
4778
5162
  });
@@ -4802,7 +5186,7 @@ var qa = class {
4802
5186
  this.fadeAnimations.set(t, { interval: i });
4803
5187
  }
4804
5188
  isActiveRequest(e, t) {
4805
- return Ka({
5189
+ return eo({
4806
5190
  destroyed: this.destroyed,
4807
5191
  currentVersion: this.requestVersion,
4808
5192
  requestVersion: e,
@@ -4960,7 +5344,7 @@ var qa = class {
4960
5344
  this.handlers &&= (viewer.camera.changed.removeEventListener(this.handlers), null), this.clearAllTiles(), this.requestController &&= (this.requestController.abort(), null);
4961
5345
  }
4962
5346
  parseCompressedMeshData(e, t) {
4963
- return Ga(e, t);
5347
+ return $a(e, t);
4964
5348
  }
4965
5349
  showPoint(e, t, n, r) {
4966
5350
  viewer.entities.add({
@@ -4981,7 +5365,7 @@ var qa = class {
4981
5365
  }
4982
5366
  });
4983
5367
  }
4984
- }, Ja = new class {
5368
+ }, no = new class {
4985
5369
  constructor() {
4986
5370
  this.layers = /* @__PURE__ */ new Map();
4987
5371
  }
@@ -4993,7 +5377,7 @@ var qa = class {
4993
5377
  let i = this.layers.get(t), a = ja(i.renderSignature, e || {});
4994
5378
  return n && (i.tileColor = n), i.dictCode = e?.dictCode || i.dictCode || "", i.serviceName = e?.serviceName || i.serviceName || "", e?.enableServiceColor !== void 0 && (i.enableServiceColor = !!e.enableServiceColor), i.modelColorUrl = e?.modelColorUrl || i.modelColorUrl || "/v1/zzts/style/render/modelColors", r != null && (i.fixedLevel = r, i.currentNewLevel.value = r), a && (i.renderSignature = Aa(e || {}), i.modelColorCache.clear(), i.clearAllTiles(), i.getViewportInfo()), i;
4995
5379
  }
4996
- let s = new qa(t, i, r, n, a, o, e);
5380
+ let s = new to(t, i, r, n, a, o, e);
4997
5381
  s.renderSignature = Aa(e || {}), this.layers.set(t, s);
4998
5382
  try {
4999
5383
  return await s.init(), s.destroyed ? (this.layers.delete(t), null) : s;
@@ -5022,20 +5406,20 @@ var qa = class {
5022
5406
  let t = this.layers.get(e);
5023
5407
  t && t.getViewportInfo();
5024
5408
  }
5025
- }(), Ya = async (e) => Ja.createLayer(e, !1), Xa = (e) => {
5026
- Ja.removeLayer(e);
5027
- }, Za = (e) => Ja.getLayer(e);
5409
+ }(), ro = async (e) => no.createLayer(e, !1), io = (e) => {
5410
+ no.removeLayer(e);
5411
+ }, ao = (e) => no.getLayer(e);
5028
5412
  t(() => {
5029
- let e = Ja.getLayerIds();
5413
+ let e = no.getLayerIds();
5030
5414
  if (e.length > 0) {
5031
- let t = Ja.getLayer(e[0]);
5415
+ let t = no.getLayer(e[0]);
5032
5416
  return t ? t.getCurrentLevel() : 15;
5033
5417
  }
5034
5418
  return 15;
5035
5419
  });
5036
5420
  //#endregion
5037
5421
  //#region src/zz-layer/zz-layer-zzts3d-point/index.vue
5038
- var Qa = {
5422
+ var oo = {
5039
5423
  __name: "index",
5040
5424
  props: { config: {
5041
5425
  type: Object,
@@ -5099,8 +5483,8 @@ var Qa = {
5099
5483
  let S = async () => {
5100
5484
  let e = ++u, t = _.value;
5101
5485
  if (!t.layerId) return;
5102
- let n = x(t), i = Za(t.layerId);
5103
- if (i && !ja(i.renderSignature, n) ? s.value = i : s.value = await Ya(n), !(m || e !== u)) {
5486
+ let n = x(t), i = ao(t.layerId);
5487
+ if (i && !ja(i.renderSignature, n) ? s.value = i : s.value = await ro(n), !(m || e !== u)) {
5104
5488
  if (l.value && _.value.highlightEnabled && s.value?.setHighlight && s.value.setHighlight(l.value, {
5105
5489
  highlightColor: _.value.highlightColor,
5106
5490
  highlightOpacity: _.value.highlightOpacity,
@@ -5140,7 +5524,7 @@ var Qa = {
5140
5524
  }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
5141
5525
  }
5142
5526
  }, C = () => {
5143
- b(), v(), s.value = null, Xa(_.value.layerId || i.config.layerId);
5527
+ b(), v(), s.value = null, io(_.value.layerId || i.config.layerId);
5144
5528
  };
5145
5529
  return w(_, () => {
5146
5530
  S();
@@ -5151,7 +5535,7 @@ var Qa = {
5151
5535
  console.log("组件卸载,开始清理资源..."), m = !0, u++, d++, p?.abort(), p = null, C();
5152
5536
  }), (e, t) => null;
5153
5537
  }
5154
- }, $a = {
5538
+ }, so = {
5155
5539
  __name: "queryPoint",
5156
5540
  props: {
5157
5541
  config: {
@@ -5334,7 +5718,7 @@ var Qa = {
5334
5718
  C(), x([]);
5335
5719
  }), (e, t) => null;
5336
5720
  }
5337
- }, eo = "__zzts3dGridPickable", to = {
5721
+ }, co = "__zzts3dGridPickable", lo = {
5338
5722
  __name: "index",
5339
5723
  props: { config: {
5340
5724
  type: Object,
@@ -5434,7 +5818,7 @@ var Qa = {
5434
5818
  b && y.remove(b), x && y.remove(x);
5435
5819
  } catch {}
5436
5820
  try {
5437
- b && delete b[eo], x && delete x[eo];
5821
+ b && delete b[co], x && delete x[co];
5438
5822
  } catch {}
5439
5823
  b = null, x = null;
5440
5824
  }
@@ -5453,7 +5837,7 @@ var Qa = {
5453
5837
  return t.startsWith("grid_outline_") ? t.slice(13) : t;
5454
5838
  }
5455
5839
  function j() {
5456
- b && (b[eo] = !0), x && (x[eo] = !0);
5840
+ b && (b[co] = !0), x && (x[co] = !0);
5457
5841
  }
5458
5842
  function M(e, t) {
5459
5843
  return Cesium.ColorGeometryInstanceAttribute.toValue(C(e, t));
@@ -5496,7 +5880,7 @@ var Qa = {
5496
5880
  if (!t?.length) return null;
5497
5881
  for (let e = 0; e < t.length; e++) {
5498
5882
  let n = t[e], r = n?.primitive;
5499
- if (r && (r[eo] === !0 || r === b || r === x)) return n;
5883
+ if (r && (r[co] === !0 || r === b || r === x)) return n;
5500
5884
  }
5501
5885
  return null;
5502
5886
  }
@@ -5642,11 +6026,11 @@ var Qa = {
5642
6026
  p++, m++, v.forEach((e) => e.abort()), v.clear(), _.clear(), h = "", R();
5643
6027
  }), (e, t) => null;
5644
6028
  }
5645
- }, no = (e, t) => {
6029
+ }, uo = (e, t) => {
5646
6030
  let n = e.__vccOpts || e;
5647
6031
  for (let [e, r] of t) n[e] = r;
5648
6032
  return n;
5649
- }, ro = "__zzts3dGridColorPickable", io = /* @__PURE__ */ no({
6033
+ }, fo = "__zzts3dGridColorPickable", po = /* @__PURE__ */ uo({
5650
6034
  __name: "color",
5651
6035
  props: { config: {
5652
6036
  type: Object,
@@ -5747,7 +6131,7 @@ var Qa = {
5747
6131
  D && E.remove(D), O && E.remove(O);
5748
6132
  } catch {}
5749
6133
  try {
5750
- D && delete D[ro], O && delete O[ro];
6134
+ D && delete D[fo], O && delete O[fo];
5751
6135
  } catch {}
5752
6136
  D = null, O = null;
5753
6137
  }
@@ -5777,7 +6161,7 @@ var Qa = {
5777
6161
  return Number.isFinite(r) ? r : -1;
5778
6162
  }
5779
6163
  function ee() {
5780
- D && (D[ro] = !0), O && (O[ro] = !0);
6164
+ D && (D[fo] = !0), O && (O[fo] = !0);
5781
6165
  }
5782
6166
  function te(e, t) {
5783
6167
  return Cesium.ColorGeometryInstanceAttribute.toValue(j(e, t));
@@ -5825,7 +6209,7 @@ var Qa = {
5825
6209
  if (!t?.length) return null;
5826
6210
  for (let e = 0; e < t.length; e++) {
5827
6211
  let n = t[e], r = n?.primitive;
5828
- if (r && (r[ro] === !0 || r === D || r === O)) return n;
6212
+ if (r && (r[fo] === !0 || r === D || r === O)) return n;
5829
6213
  }
5830
6214
  return null;
5831
6215
  }
@@ -5992,7 +6376,7 @@ var Qa = {
5992
6376
  })
5993
6377
  }, null, 4)) : r("", !0);
5994
6378
  }
5995
- }, [["__scopeId", "data-v-719d18e0"]]), ao = {
6379
+ }, [["__scopeId", "data-v-719d18e0"]]), mo = {
5996
6380
  __name: "query",
5997
6381
  props: {
5998
6382
  config: {
@@ -6225,7 +6609,7 @@ var Qa = {
6225
6609
  u++, h.forEach((e) => e.abort()), h.clear(), p.clear(), m.clear(), d = "", D();
6226
6610
  }), (e, t) => null;
6227
6611
  }
6228
- }, oo = {
6612
+ }, ho = {
6229
6613
  __name: "interpolation",
6230
6614
  props: { config: {
6231
6615
  type: Object,
@@ -6430,7 +6814,7 @@ var Qa = {
6430
6814
  o++, u.forEach((e) => e.abort()), u.clear(), l.clear(), s = "", x();
6431
6815
  }), (e, t) => null;
6432
6816
  }
6433
- }, so = {
6817
+ }, go = {
6434
6818
  __name: "index",
6435
6819
  props: { config: {
6436
6820
  type: Object,
@@ -6468,7 +6852,7 @@ var Qa = {
6468
6852
  e && u();
6469
6853
  }), (e, t) => null;
6470
6854
  }
6471
- }, co = {
6855
+ }, _o = {
6472
6856
  excavations: [],
6473
6857
  globalStyle: {
6474
6858
  show: !0,
@@ -6495,38 +6879,38 @@ var Qa = {
6495
6879
  maxArea: 5e3 * 1e3 * 1e3,
6496
6880
  maxPerimeter: 5e3 * 1e3
6497
6881
  }
6498
- }, lo = (e = {}) => ({
6499
- ...co,
6882
+ }, vo = (e = {}) => ({
6883
+ ..._o,
6500
6884
  ...e,
6501
6885
  globalStyle: {
6502
- ...co.globalStyle,
6886
+ ..._o.globalStyle,
6503
6887
  ...e.globalStyle
6504
6888
  },
6505
6889
  limits: {
6506
- ...co.limits,
6890
+ ..._o.limits,
6507
6891
  ...e.limits
6508
6892
  },
6509
6893
  excavations: e.excavations || []
6510
- }), uo = (e, t, n = 1) => {
6894
+ }), yo = (e, t, n = 1) => {
6511
6895
  try {
6512
6896
  return D.Color.fromCssColorString(e).withAlpha(n);
6513
6897
  } catch {
6514
6898
  return D.Color.fromCssColorString(t).withAlpha(n);
6515
6899
  }
6516
- }, fo = (e, t, n, r, i) => e ? D.Material.fromType("Image", {
6900
+ }, bo = (e, t, n, r, i) => e ? D.Material.fromType("Image", {
6517
6901
  image: e,
6518
6902
  color: D.Color.WHITE.withAlpha(n),
6519
6903
  repeat: i || new D.Cartesian2(1, 1)
6520
- }) : D.Material.fromType("Color", { color: uo(t, r, n) }), po = (e) => {
6904
+ }) : D.Material.fromType("Color", { color: yo(t, r, n) }), xo = (e) => {
6521
6905
  if (e.length < 2) return 0;
6522
6906
  let t = 0;
6523
6907
  for (let n = 0; n < e.length - 1; n += 1) t += D.Cartesian3.distance(e[n], e[n + 1]);
6524
6908
  return t;
6525
- }, mo = (e, t) => {
6909
+ }, So = (e, t) => {
6526
6910
  if (!e) return;
6527
- let n = po(t), r = Math.max(Math.ceil(n / 100), 1);
6911
+ let n = xo(t), r = Math.max(Math.ceil(n / 100), 1);
6528
6912
  return new D.Cartesian2(r, 1);
6529
- }, ho = (e, t, n, r = !1) => {
6913
+ }, Co = (e, t, n, r = !1) => {
6530
6914
  let i = r ? {
6531
6915
  perPositionHeight: !1,
6532
6916
  heightReference: D.HeightReference.CLAMP_TO_GROUND
@@ -6546,7 +6930,7 @@ var Qa = {
6546
6930
  clampToGround: r
6547
6931
  }
6548
6932
  });
6549
- }, go = (e, t, n = !1) => {
6933
+ }, wo = (e, t, n = !1) => {
6550
6934
  let r = n ? {
6551
6935
  perPositionHeight: !1,
6552
6936
  heightReference: D.HeightReference.CLAMP_TO_GROUND
@@ -6566,19 +6950,19 @@ var Qa = {
6566
6950
  clampToGround: n
6567
6951
  }
6568
6952
  });
6569
- }, _o = async (e = 260) => {
6953
+ }, To = async (e = 260) => {
6570
6954
  await new Promise((t) => window.setTimeout(t, e));
6571
- }, vo = (e, t = e.height || 0) => D.Cartesian3.fromDegrees(e.lng, e.lat, t), yo = (e) => D.Cartesian3.fromDegrees(e.lng, e.lat), bo = (e, t) => D.Math.equalsEpsilon(e.lng, t.lng, D.Math.EPSILON12) && D.Math.equalsEpsilon(e.lat, t.lat, D.Math.EPSILON12), xo = (e) => {
6955
+ }, Eo = (e, t = e.height || 0) => D.Cartesian3.fromDegrees(e.lng, e.lat, t), Do = (e) => D.Cartesian3.fromDegrees(e.lng, e.lat), Oo = (e, t) => D.Math.equalsEpsilon(e.lng, t.lng, D.Math.EPSILON12) && D.Math.equalsEpsilon(e.lat, t.lat, D.Math.EPSILON12), ko = (e) => {
6572
6956
  let t = e.reduce((e, t) => {
6573
6957
  let n = e.at(-1);
6574
- return (!n || !bo(n, t)) && e.push(t), e;
6958
+ return (!n || !Oo(n, t)) && e.push(t), e;
6575
6959
  }, []);
6576
- return t.length > 1 && bo(t[0], t[t.length - 1]) && t.pop(), t;
6577
- }, So = (e) => e <= 50 ? 5 : e <= 200 ? 10 : e <= 1e3 ? 20 : 50, Co = (e) => {
6578
- let t = So(e);
6960
+ return t.length > 1 && Oo(t[0], t[t.length - 1]) && t.pop(), t;
6961
+ }, Ao = (e) => e <= 50 ? 5 : e <= 200 ? 10 : e <= 1e3 ? 20 : 50, jo = (e) => {
6962
+ let t = Ao(e);
6579
6963
  return Math.min(Math.max(Math.ceil(e / t), 1), 800);
6580
- }, wo = (e) => e.map((t, n) => {
6581
- let r = e[(n + 1) % e.length], i = D.Cartographic.fromDegrees(t.lng, t.lat), a = D.Cartographic.fromDegrees(r.lng, r.lat), o = new D.EllipsoidGeodesic(i, a), s = Co(o.surfaceDistance), c = [t];
6964
+ }, Mo = (e) => e.map((t, n) => {
6965
+ let r = e[(n + 1) % e.length], i = D.Cartographic.fromDegrees(t.lng, t.lat), a = D.Cartographic.fromDegrees(r.lng, r.lat), o = new D.EllipsoidGeodesic(i, a), s = jo(o.surfaceDistance), c = [t];
6582
6966
  for (let e = 1; e < s; e += 1) {
6583
6967
  let n = e / s, i = o.interpolateUsingFraction(n);
6584
6968
  c.push({
@@ -6588,10 +6972,10 @@ var Qa = {
6588
6972
  });
6589
6973
  }
6590
6974
  return c.push(r), { points: c };
6591
- }), To = (e) => e.flatMap((t, n) => {
6975
+ }), No = (e) => e.flatMap((t, n) => {
6592
6976
  let r = n === 0 ? t.points : t.points.slice(1);
6593
- return n === e.length - 1 && r.length > 0 && bo(r[r.length - 1], e[0].points[0]) ? r.slice(0, -1) : r;
6594
- }), Eo = (e) => {
6977
+ return n === e.length - 1 && r.length > 0 && Oo(r[r.length - 1], e[0].points[0]) ? r.slice(0, -1) : r;
6978
+ }), Po = (e) => {
6595
6979
  if (e.length < 2) return 0;
6596
6980
  let t = 0;
6597
6981
  for (let n = 0; n < e.length; n += 1) {
@@ -6599,10 +6983,10 @@ var Qa = {
6599
6983
  t += s.surfaceDistance;
6600
6984
  }
6601
6985
  return t;
6602
- }, Do = (e) => {
6986
+ }, Fo = (e) => {
6603
6987
  if (e.length < 3) return 0;
6604
6988
  let t = e[0].lng, n = D.Math.toRadians(e.reduce((e, t) => e + t.lat, 0) / e.length), r = D.Ellipsoid.WGS84.maximumRadius, i = e.map((e) => {
6605
- let i = Oo(e.lng, t);
6989
+ let i = Io(e.lng, t);
6606
6990
  return {
6607
6991
  x: D.Math.toRadians(i) * r * Math.cos(n),
6608
6992
  y: D.Math.toRadians(e.lat) * r
@@ -6613,20 +6997,20 @@ var Qa = {
6613
6997
  a += t.x * n.y - n.x * t.y;
6614
6998
  }
6615
6999
  return Math.abs(a) / 2;
6616
- }, Oo = (e, t) => {
7000
+ }, Io = (e, t) => {
6617
7001
  let n = e;
6618
7002
  for (; n - t > 180;) n -= 360;
6619
7003
  for (; n - t < -180;) n += 360;
6620
7004
  return n;
6621
- }, ko = (e) => e >= 1e3 ? `${(e / 1e3).toFixed(2)}公里` : `${Math.round(e)}米`, Ao = (e) => e >= 1e3 * 1e3 ? `${(e / 1e3 / 1e3).toFixed(2)}平方公里` : `${Math.round(e)}平方米`, jo = (e, t) => {
6622
- let n = Do(e);
6623
- if (t.maxArea > 0 && n > t.maxArea) return `绘制区域过大,面积约 ${Ao(n)},已超过 ${Ao(t.maxArea)},请缩小范围或分块开挖`;
6624
- let r = Eo(e);
6625
- return t.maxPerimeter > 0 && r > t.maxPerimeter ? `绘制区域过大,周长约 ${ko(r)},已超过 ${ko(t.maxPerimeter)},请缩小范围或分块开挖` : "";
6626
- }, Mo = (e, t) => {
7005
+ }, Lo = (e) => e >= 1e3 ? `${(e / 1e3).toFixed(2)}公里` : `${Math.round(e)}米`, Ro = (e) => e >= 1e3 * 1e3 ? `${(e / 1e3 / 1e3).toFixed(2)}平方公里` : `${Math.round(e)}平方米`, zo = (e, t) => {
7006
+ let n = Fo(e);
7007
+ if (t.maxArea > 0 && n > t.maxArea) return `绘制区域过大,面积约 ${Ro(n)},已超过 ${Ro(t.maxArea)},请缩小范围或分块开挖`;
7008
+ let r = Po(e);
7009
+ return t.maxPerimeter > 0 && r > t.maxPerimeter ? `绘制区域过大,周长约 ${Lo(r)},已超过 ${Lo(t.maxPerimeter)},请缩小范围或分块开挖` : "";
7010
+ }, Bo = (e, t) => {
6627
7011
  let n = t[0], r = 0;
6628
7012
  return e.map((i, a) => {
6629
- let o = a === e.length - 1 && i.points.length > 0 && e[0].points.length > 0 && bo(i.points[i.points.length - 1], e[0].points[0]), s = i.points.length - (a === 0 ? 0 : 1) - !!o, c = t.slice(r, r + s);
7013
+ let o = a === e.length - 1 && i.points.length > 0 && e[0].points.length > 0 && Oo(i.points[i.points.length - 1], e[0].points[0]), s = i.points.length - (a === 0 ? 0 : 1) - !!o, c = t.slice(r, r + s);
6630
7014
  if (r += s, a === 0) return o ? [...c, n] : c;
6631
7015
  let l = t[r - s - 1];
6632
7016
  return o ? [
@@ -6635,10 +7019,10 @@ var Qa = {
6635
7019
  n
6636
7020
  ] : [l, ...c];
6637
7021
  });
6638
- }, No = (e, t) => {
7022
+ }, Vo = (e, t) => {
6639
7023
  let n = Math.min(...e);
6640
7024
  return e.map(() => n - t);
6641
- }, Po = (e, t, n) => ({
7025
+ }, Ho = (e, t, n) => ({
6642
7026
  id: e.id || n(),
6643
7027
  positions: e.positions || [],
6644
7028
  height: e.height ?? t.height,
@@ -6655,12 +7039,12 @@ var Qa = {
6655
7039
  showSide: e.showSide ?? t.showSide,
6656
7040
  showBottom: e.showBottom ?? t.showBottom,
6657
7041
  showEdge: e.showEdge ?? t.showEdge
6658
- }), Fo = (e, t) => {
7042
+ }), Uo = (e, t) => {
6659
7043
  e.clippingPolygons = t;
6660
- }, Io = (e) => new D.ClippingPolygon({ positions: e.map((e) => yo(e)) }), Lo = (e) => new D.ClippingPolygonCollection({
6661
- polygons: e.filter((e) => e.length >= 3).map(Io),
7044
+ }, Wo = (e) => new D.ClippingPolygon({ positions: e.map((e) => Do(e)) }), Go = (e) => new D.ClippingPolygonCollection({
7045
+ polygons: e.filter((e) => e.length >= 3).map(Wo),
6662
7046
  inverse: !1
6663
- }), Ro = (e, t, n, r, i) => {
7047
+ }), Ko = (e, t, n, r, i) => {
6664
7048
  let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map(), c = null, l = !1, u = !1, d = !1, f = () => `excavation-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`, p = async (r) => {
6665
7049
  let i = e(), a = t(), o = r.map((e) => D.Cartographic.fromDegrees(e.lng, e.lat));
6666
7050
  if (i && a.sampleTerrain && !(i.terrainProvider instanceof D.EllipsoidTerrainProvider)) try {
@@ -6672,7 +7056,7 @@ var Qa = {
6672
7056
  let n = o[t], r = i?.scene.globe.getHeight(n);
6673
7057
  return e.height ?? r ?? 0;
6674
7058
  });
6675
- }, m = (e) => Po(e, t().globalStyle, f), h = (e) => {
7059
+ }, m = (e) => Ho(e, t().globalStyle, f), h = (e) => {
6676
7060
  let n = t();
6677
7061
  return JSON.stringify({
6678
7062
  item: e,
@@ -6686,9 +7070,9 @@ var Qa = {
6686
7070
  e.height ?? null
6687
7071
  ])), n = s.get(t);
6688
7072
  if (n) return n;
6689
- let r = wo(e), i = {
7073
+ let r = Mo(e), i = {
6690
7074
  renderBoundarySegments: r,
6691
- renderBoundaryPositions: To(r),
7075
+ renderBoundaryPositions: No(r),
6692
7076
  clipBoundaryPositions: e,
6693
7077
  bottomBoundaryPositions: e
6694
7078
  };
@@ -6701,13 +7085,13 @@ var Qa = {
6701
7085
  y();
6702
7086
  return;
6703
7087
  }
6704
- l ||= (c = n.scene.globe.clippingPolygons, !0), Fo(n.scene.globe, Lo(i)), n.scene.requestRender();
7088
+ l ||= (c = n.scene.globe.clippingPolygons, !0), Uo(n.scene.globe, Go(i)), n.scene.requestRender();
6705
7089
  }, v = () => {
6706
7090
  let n = e(), r = t();
6707
7091
  n && (d ||= (u = n.scene.globe.depthTestAgainstTerrain, !0), n.scene.globe.depthTestAgainstTerrain = r.depthTestAgainstTerrain, n.scene.requestRender());
6708
7092
  }, y = () => {
6709
7093
  let t = e();
6710
- t && (l &&= (Fo(t.scene.globe, c || void 0), c = null, !1), t.scene.requestRender());
7094
+ t && (l &&= (Uo(t.scene.globe, c || void 0), c = null, !1), t.scene.requestRender());
6711
7095
  }, b = () => {
6712
7096
  let t = e();
6713
7097
  !t || !d || (t.scene.globe.depthTestAgainstTerrain = u, d = !1, t.scene.requestRender());
@@ -6717,10 +7101,10 @@ var Qa = {
6717
7101
  }, S = async (r) => {
6718
7102
  let a = e();
6719
7103
  if (!a) return null;
6720
- let o = m(r), s = xo(o.positions);
7104
+ let o = m(r), s = ko(o.positions);
6721
7105
  if (!s || s.length < 3) return n("excavation-error", /* @__PURE__ */ Error("地形开挖至少需要 3 个多边形点位")), null;
6722
7106
  let c = (e) => {
6723
- let r = go(a, s.map((e) => vo(e, e.height || 0)), t().depthTestAgainstTerrain);
7107
+ let r = wo(a, s.map((e) => Eo(e, e.height || 0)), t().depthTestAgainstTerrain);
6724
7108
  return r.show = o.show, a.scene.requestRender(), n("excavation-error", Error(e)), P.warning(e), {
6725
7109
  item: {
6726
7110
  ...o,
@@ -6730,14 +7114,14 @@ var Qa = {
6730
7114
  primitives: [],
6731
7115
  terrainClipEnabled: !1
6732
7116
  };
6733
- }, l = jo(s, t().limits);
7117
+ }, l = zo(s, t().limits);
6734
7118
  if (l) return c(l);
6735
- let { renderBoundarySegments: u, renderBoundaryPositions: d, bottomBoundaryPositions: f } = g(s), h = ho(a, o.id, s.map((e) => vo(e, e.height || 0)), t().depthTestAgainstTerrain);
7119
+ let { renderBoundarySegments: u, renderBoundaryPositions: d, bottomBoundaryPositions: f } = g(s), h = Co(a, o.id, s.map((e) => Eo(e, e.height || 0)), t().depthTestAgainstTerrain);
6736
7120
  a.scene.requestRender();
6737
7121
  let _ = [], v = [];
6738
7122
  try {
6739
- await Promise.all([_o(), i?.() || Promise.resolve()]);
6740
- let e = await p(d), t = No(e, o.height), n = Math.min(...e) - o.height, r = f.map((e) => vo(e, n)), s = d.map((t, n) => vo(t, e[n])), c = Mo(u, e), l = Mo(u, t), m = D.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, h = {
7123
+ await Promise.all([To(), i?.() || Promise.resolve()]);
7124
+ let e = await p(d), t = Vo(e, o.height), n = Math.min(...e) - o.height, r = f.map((e) => Eo(e, n)), s = d.map((t, n) => Eo(t, e[n])), c = Bo(u, e), l = Bo(u, t), m = D.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, h = {
6741
7125
  depthTest: { enabled: !0 },
6742
7126
  depthMask: !0
6743
7127
  };
@@ -6753,7 +7137,7 @@ var Qa = {
6753
7137
  })
6754
7138
  }),
6755
7139
  appearance: new D.MaterialAppearance({
6756
- material: fo(o.bottomTexture, o.bottomColor, o.bottomOpacity, co.globalStyle.bottomColor),
7140
+ material: bo(o.bottomTexture, o.bottomColor, o.bottomOpacity, _o.globalStyle.bottomColor),
6757
7141
  materialSupport: D.MaterialAppearance.MaterialSupport.TEXTURED,
6758
7142
  faceForward: !0,
6759
7143
  renderState: h
@@ -6763,7 +7147,7 @@ var Qa = {
6763
7147
  v.push(e);
6764
7148
  }
6765
7149
  if (o.showSide) for (let e = 0; e < u.length; e += 1) {
6766
- let t = u[e].points.map((e) => vo(e)), n = l[e], r = c[e], i = mo(o.sideTexture, t), s = a.scene.primitives.add(new D.Primitive({
7150
+ let t = u[e].points.map((e) => Eo(e)), n = l[e], r = c[e], i = So(o.sideTexture, t), s = a.scene.primitives.add(new D.Primitive({
6767
7151
  show: !1,
6768
7152
  geometryInstances: new D.GeometryInstance({
6769
7153
  id: `${o.id}-wall-${e}`,
@@ -6775,7 +7159,7 @@ var Qa = {
6775
7159
  })
6776
7160
  }),
6777
7161
  appearance: new D.MaterialAppearance({
6778
- material: fo(o.sideTexture, o.sideColor, o.sideOpacity, co.globalStyle.bottomColor, i),
7162
+ material: bo(o.sideTexture, o.sideColor, o.sideOpacity, _o.globalStyle.bottomColor, i),
6779
7163
  materialSupport: D.MaterialAppearance.MaterialSupport.TEXTURED,
6780
7164
  faceForward: !0,
6781
7165
  renderState: h
@@ -6791,7 +7175,7 @@ var Qa = {
6791
7175
  polyline: {
6792
7176
  positions: e,
6793
7177
  width: o.edgeWidth,
6794
- material: uo(o.edgeColor, co.globalStyle.bottomColor, o.edgeOpacity),
7178
+ material: yo(o.edgeColor, _o.globalStyle.bottomColor, o.edgeOpacity),
6795
7179
  clampToGround: !1
6796
7180
  }
6797
7181
  });
@@ -6860,7 +7244,7 @@ var Qa = {
6860
7244
  for (let t of i.excavations) {
6861
7245
  let n = m(t), r = {
6862
7246
  ...n,
6863
- positions: xo(n.positions)
7247
+ positions: ko(n.positions)
6864
7248
  }, i = h(r), o = r.id;
6865
7249
  s.add(o);
6866
7250
  let c = a.get(o);
@@ -6907,7 +7291,7 @@ var Qa = {
6907
7291
  restoreDepthTestAgainstTerrain: b,
6908
7292
  getMethods: A
6909
7293
  };
6910
- }, zo = /* @__PURE__ */ s({
7294
+ }, qo = /* @__PURE__ */ s({
6911
7295
  __name: "index",
6912
7296
  props: { config: {} },
6913
7297
  emits: [
@@ -6918,7 +7302,7 @@ var Qa = {
6918
7302
  "excavation-error"
6919
7303
  ],
6920
7304
  setup(e, { expose: n, emit: r }) {
6921
- let i = c("cesiumViewer"), a = r, o = e, s = t(() => lo(o.config)), l = () => i?.value, u = () => {
7305
+ let i = c("cesiumViewer"), a = r, o = e, s = t(() => vo(o.config)), l = () => i?.value, u = () => {
6922
7306
  let e = l();
6923
7307
  return e ? !(e.terrainProvider instanceof D.EllipsoidTerrainProvider) : !1;
6924
7308
  }, d = t(() => JSON.stringify({
@@ -6936,7 +7320,7 @@ var Qa = {
6936
7320
  });
6937
7321
  }, b = () => {
6938
7322
  !v() || _.size === 0 || (_.forEach((e) => e()), _.clear());
6939
- }, x = Ro(l, () => s.value, p, () => m, y);
7323
+ }, x = Ko(l, () => s.value, p, () => m, y);
6940
7324
  m = x.getMethods();
6941
7325
  let S = async (e) => {
6942
7326
  l() && await x.syncExcavations(e);
@@ -6964,7 +7348,7 @@ var Qa = {
6964
7348
  _.clear(), h?.(), h = null, x.clearExcavations(), x.restoreDepthTestAgainstTerrain();
6965
7349
  }), n(m), (e, t) => null;
6966
7350
  }
6967
- }), Bo = {
7351
+ }), Jo = {
6968
7352
  __name: "index",
6969
7353
  props: {
6970
7354
  config: {
@@ -7017,7 +7401,7 @@ var Qa = {
7017
7401
  u();
7018
7402
  }), (e, t) => null;
7019
7403
  }
7020
- }, Vo = {
7404
+ }, Yo = {
7021
7405
  __name: "index",
7022
7406
  props: { config: {
7023
7407
  type: Object,
@@ -7081,7 +7465,7 @@ var Qa = {
7081
7465
  u();
7082
7466
  }), (e, t) => null;
7083
7467
  }
7084
- }, Ho = {
7468
+ }, Xo = {
7085
7469
  __name: "index",
7086
7470
  props: { config: {
7087
7471
  type: Object,
@@ -7270,7 +7654,7 @@ var Qa = {
7270
7654
  b();
7271
7655
  }), (e, t) => null;
7272
7656
  }
7273
- }, Uo = {
7657
+ }, Zo = {
7274
7658
  __name: "index",
7275
7659
  props: { config: {
7276
7660
  type: Object,
@@ -7457,7 +7841,7 @@ var Qa = {
7457
7841
  b();
7458
7842
  }), (e, t) => null;
7459
7843
  }
7460
- }, Wo = {
7844
+ }, Qo = {
7461
7845
  __name: "index",
7462
7846
  props: { config: {
7463
7847
  type: Object,
@@ -7657,16 +8041,16 @@ var Qa = {
7657
8041
  b();
7658
8042
  }), (e, t) => null;
7659
8043
  }
7660
- }, Go = { class: "legend-panel__header" }, Ko = { class: "legend-panel__title" }, qo = { class: "legend-panel__body" }, Jo = {
8044
+ }, $o = { class: "legend-panel__header" }, es = { class: "legend-panel__title" }, ts = { class: "legend-panel__body" }, ns = {
7661
8045
  key: 0,
7662
8046
  class: "legend-panel__multiband"
7663
- }, Yo = { class: "legend-panel__multiband-labels" }, Xo = { class: "legend-panel__multiband-label legend-panel__multiband-label--top" }, Zo = { class: "legend-panel__multiband-label legend-panel__multiband-label--bottom" }, Qo = {
8047
+ }, rs = { class: "legend-panel__multiband-labels" }, is = { class: "legend-panel__multiband-label legend-panel__multiband-label--top" }, as = { class: "legend-panel__multiband-label legend-panel__multiband-label--bottom" }, os = {
7664
8048
  key: 1,
7665
8049
  class: "legend-panel__list"
7666
- }, $o = {
8050
+ }, ss = {
7667
8051
  key: 0,
7668
8052
  class: "legend-panel__symbol legend-panel__symbol--line"
7669
- }, es = { class: "legend-panel__label" }, ts = /* @__PURE__ */ s({
8053
+ }, cs = { class: "legend-panel__label" }, ls = /* @__PURE__ */ s({
7670
8054
  __name: "index",
7671
8055
  props: {
7672
8056
  visible: { type: Boolean },
@@ -7752,7 +8136,7 @@ var Qa = {
7752
8136
  return s.visible ? (p(), i("div", {
7753
8137
  key: 0,
7754
8138
  class: l(["legend-panel", g.value])
7755
- }, [a("div", Go, [a("span", Ko, x(v.value), 1), o(f, {
8139
+ }, [a("div", $o, [a("span", es, x(v.value), 1), o(f, {
7756
8140
  text: "",
7757
8141
  size: "small",
7758
8142
  class: "legend-panel__toggle",
@@ -7763,14 +8147,14 @@ var Qa = {
7763
8147
  _: 1
7764
8148
  })]),
7765
8149
  _: 1
7766
- })]), a("div", qo, [c[1] ||= a("div", { class: "legend-panel__section-title" }, "图例", -1), S.value && w.value ? (p(), i("div", Jo, [a("div", {
8150
+ })]), a("div", ts, [c[1] ||= a("div", { class: "legend-panel__section-title" }, "图例", -1), S.value && w.value ? (p(), i("div", ns, [a("div", {
7767
8151
  class: "legend-panel__multiband-bar",
7768
8152
  style: u(M.value)
7769
- }, null, 4), a("div", Yo, [a("div", Xo, x(w.value.MultibandValueNameTop), 1), a("div", Zo, x(w.value.MultibandValueNameBot), 1)])])) : D.value.length ? (p(), i("div", Qo, [(p(!0), i(e, null, _(D.value, (e, t) => (p(), i("div", {
8153
+ }, null, 4), a("div", rs, [a("div", is, x(w.value.MultibandValueNameTop), 1), a("div", as, x(w.value.MultibandValueNameBot), 1)])])) : D.value.length ? (p(), i("div", os, [(p(!0), i(e, null, _(D.value, (e, t) => (p(), i("div", {
7770
8154
  key: R(e, t),
7771
8155
  class: l(["legend-panel__item", { "is-item-hidden": O.value && A(e) }])
7772
8156
  }, [
7773
- P(e) === "line" ? (p(), i("div", $o, [a("span", {
8157
+ P(e) === "line" ? (p(), i("div", ss, [a("span", {
7774
8158
  class: "legend-panel__line-bar",
7775
8159
  style: u(te(e))
7776
8160
  }, null, 4)])) : (p(), i("div", {
@@ -7778,7 +8162,7 @@ var Qa = {
7778
8162
  class: l(["legend-panel__symbol", N(e)]),
7779
8163
  style: u(ne(e))
7780
8164
  }, null, 6)),
7781
- a("div", es, x(e.valueName || "-"), 1),
8165
+ a("div", cs, x(e.valueName || "-"), 1),
7782
8166
  O.value ? (p(), n(m, {
7783
8167
  key: 2,
7784
8168
  content: A(e) ? "显示" : "隐藏",
@@ -7801,8 +8185,8 @@ var Qa = {
7801
8185
  }))])], 2)) : r("", !0);
7802
8186
  };
7803
8187
  }
7804
- }), ns = (e) => {
7805
- e.component("zzViewer", xe), e.component("zz-viewer", xe), e.component("zzLayerWmts", Fe), e.component("zz-layer-wmts", Fe), e.component("zzLayerXyz", Ie), e.component("zz-layer-xyz", Ie), e.component("zzLayerWms", Le), e.component("zz-layer-wms", Le), e.component("zzLayerZzts", ze), e.component("zz-layer-zzts", ze), e.component("zzLayerZzts3d", La), e.component("zz-layer-zzts3d", La), e.component("zzLayerZzts3dPoint", Qa), e.component("zz-layer-zzts3d-point", Qa), e.component("zzLayerZzts3dPointQuery", $a), e.component("zz-layer-zzts3d-point-query", $a), e.component("zzLayerZzts3dGrid", to), e.component("zz-layer-zzts3d-grid", to), e.component("zzLayerZzts3dGridColor", io), e.component("zz-layer-zzts3d-grid-color", io), e.component("zzLayerZzts3dGridQuery", ao), e.component("zz-layer-zzts3d-grid-query", ao), e.component("zzLayerZzts3dGridInterpolation", oo), e.component("zz-layer-zzts3d-grid-interpolation", oo), e.component("zzLayerGeojson", Be), e.component("zz-layer-geojson", Be), e.component("zzLayerMvt", He), e.component("zz-layer-mvt", He), e.component("zzTerrain", so), e.component("zz-terrain", so), e.component("zzTerrainExcavation", zo), e.component("zz-terrain-excavation", zo), e.component("zz3dtiles", Bo), e.component("zz-3dtiles", Bo), e.component("zzGltf", Vo), e.component("zz-gltf", Vo), e.component("zzEntityPoint", Ho), e.component("zz-entity-point", Ho), e.component("zzEntityPolyline", Uo), e.component("zz-entity-polyline", Uo), e.component("zzEntityPolygon", Wo), e.component("zz-entity-polygon", Wo), e.component("zzLegend", ts), e.component("zz-legend", ts);
8188
+ }), us = (e) => {
8189
+ e.component("zzViewer", xe), e.component("zz-viewer", xe), e.component("zzLayerWmts", Fe), e.component("zz-layer-wmts", Fe), e.component("zzLayerXyz", Ie), e.component("zz-layer-xyz", Ie), e.component("zzLayerWms", Le), e.component("zz-layer-wms", Le), e.component("zzLayerZzts", ze), e.component("zz-layer-zzts", ze), e.component("zzLayerZzts3d", La), e.component("zz-layer-zzts3d", La), e.component("zzLayerShpZzts", Ga), e.component("zz-layer-shp-zzts", Ga), e.component("zzLayerZzts3dPoint", oo), e.component("zz-layer-zzts3d-point", oo), e.component("zzLayerZzts3dPointQuery", so), e.component("zz-layer-zzts3d-point-query", so), e.component("zzLayerZzts3dGrid", lo), e.component("zz-layer-zzts3d-grid", lo), e.component("zzLayerZzts3dGridColor", po), e.component("zz-layer-zzts3d-grid-color", po), e.component("zzLayerZzts3dGridQuery", mo), e.component("zz-layer-zzts3d-grid-query", mo), e.component("zzLayerZzts3dGridInterpolation", ho), e.component("zz-layer-zzts3d-grid-interpolation", ho), e.component("zzLayerGeojson", Be), e.component("zz-layer-geojson", Be), e.component("zzLayerMvt", He), e.component("zz-layer-mvt", He), e.component("zzTerrain", go), e.component("zz-terrain", go), e.component("zzTerrainExcavation", qo), e.component("zz-terrain-excavation", qo), e.component("zz3dtiles", Jo), e.component("zz-3dtiles", Jo), e.component("zzGltf", Yo), e.component("zz-gltf", Yo), e.component("zzEntityPoint", Xo), e.component("zz-entity-point", Xo), e.component("zzEntityPolyline", Zo), e.component("zz-entity-polyline", Zo), e.component("zzEntityPolygon", Qo), e.component("zz-entity-polygon", Qo), e.component("zzLegend", ls), e.component("zz-legend", ls);
7806
8190
  };
7807
8191
  //#endregion
7808
- export { R as LAYER_TYPE_BAND, ve as addImageryLayerWithStackIndex, ye as addPrimitiveWithStackIndex, he as applyImageryStackIndex, _e as applyPrimitiveStackIndex, ns as default, oe as moveImageryLayerToIndex, ge as moveImageryLayersToStackIndex, ce as movePrimitiveToIndex, pe as scheduleImageryLayerStackSync, me as schedulePrimitiveStackSync, le as syncImageryLayerStack, ue as syncPrimitiveStack, B as tagImageryLayerStackMeta, ae as tagPrimitiveStackMeta, Bo as zz3dtiles, Ho as zzEntityPoint, Wo as zzEntityPolygon, Uo as zzEntityPolyline, Vo as zzGltf, Be as zzLayerGeojson, He as zzLayerMvt, Le as zzLayerWms, Fe as zzLayerWmts, Ie as zzLayerXyz, ze as zzLayerZzts, ts as zzLegendPanel, so as zzTerrain, zo as zzTerrainExcavation, xe as zzViewer };
8192
+ export { R as LAYER_TYPE_BAND, ve as addImageryLayerWithStackIndex, ye as addPrimitiveWithStackIndex, he as applyImageryStackIndex, _e as applyPrimitiveStackIndex, us as default, oe as moveImageryLayerToIndex, ge as moveImageryLayersToStackIndex, ce as movePrimitiveToIndex, pe as scheduleImageryLayerStackSync, me as schedulePrimitiveStackSync, le as syncImageryLayerStack, ue as syncPrimitiveStack, B as tagImageryLayerStackMeta, ae as tagPrimitiveStackMeta, Jo as zz3dtiles, Xo as zzEntityPoint, Qo as zzEntityPolygon, Zo as zzEntityPolyline, Yo as zzGltf, Be as zzLayerGeojson, He as zzLayerMvt, Ga as zzLayerShpZzts, Le as zzLayerWms, Fe as zzLayerWmts, Ie as zzLayerXyz, ze as zzLayerZzts, ls as zzLegendPanel, go as zzTerrain, qo as zzTerrainExcavation, xe as zzViewer };