@skzz/components-gis 0.1.3 → 0.1.4

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
@@ -29,14 +29,14 @@ function te(e) {
29
29
  let t = e;
30
30
  return !!t._zzAppPrimitive && t._zzStackIndex !== void 0 && t._zzStackIndex >= 0;
31
31
  }
32
- function ne(e, t, n, r, i, a, o, s) {
32
+ function B(e, t, n, r, i, a, o, s) {
33
33
  return e === t ? n === r ? i === a ? o - s : i.localeCompare(a) : n - r : e - t;
34
34
  }
35
- function B(e, t) {
36
- return ne(e._zzStackIndex ?? 0, t._zzStackIndex ?? 0, e._zzSubStackIndex ?? 0, t._zzSubStackIndex ?? 0, e._zzGroupKey ?? "", t._zzGroupKey ?? "", e._zzTileOrder ?? 0, t._zzTileOrder ?? 0);
37
- }
38
35
  function V(e, t) {
39
- return ne(e._zzStackIndex ?? 0, t._zzStackIndex ?? 0, e._zzSubStackIndex ?? 0, t._zzSubStackIndex ?? 0, e._zzGroupKey ?? "", t._zzGroupKey ?? "", e._zzTileOrder ?? 0, t._zzTileOrder ?? 0);
36
+ return B(e._zzStackIndex ?? 0, t._zzStackIndex ?? 0, e._zzSubStackIndex ?? 0, t._zzSubStackIndex ?? 0, e._zzGroupKey ?? "", t._zzGroupKey ?? "", e._zzTileOrder ?? 0, t._zzTileOrder ?? 0);
37
+ }
38
+ function ne(e, t) {
39
+ return B(e._zzStackIndex ?? 0, t._zzStackIndex ?? 0, e._zzSubStackIndex ?? 0, t._zzSubStackIndex ?? 0, e._zzGroupKey ?? "", t._zzGroupKey ?? "", e._zzTileOrder ?? 0, t._zzTileOrder ?? 0);
40
40
  }
41
41
  function H(e, t) {
42
42
  let n = e;
@@ -88,7 +88,7 @@ function se(e) {
88
88
  n.push(i);
89
89
  }
90
90
  if (r.length === 0) return;
91
- let i = [...r].sort(B), a = [...n, ...i];
91
+ let i = [...r].sort(V), a = [...n, ...i];
92
92
  for (let t = a.length - 1; t >= 0; t--) ie(e, a[t], t);
93
93
  }
94
94
  function U(e) {
@@ -103,7 +103,7 @@ function U(e) {
103
103
  n.push(i);
104
104
  }
105
105
  if (r.length === 0) return;
106
- let i = [...r].sort(V), a = [...n, ...i];
106
+ let i = [...r].sort(ne), a = [...n, ...i];
107
107
  for (let t = a.length - 1; t >= 0; t--) oe(e, a[t], t);
108
108
  }
109
109
  var ce = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap();
@@ -849,7 +849,7 @@ var Me = {
849
849
  f(d, t);
850
850
  return;
851
851
  }
852
- for (let e of u) B(e.id, e, 0, i);
852
+ for (let e of u) V(e.id, e, 0, i);
853
853
  console.log("newTiles", u), console.log("grouplayer", o), setTimeout(() => {
854
854
  l || i !== h || (f(d, t), U());
855
855
  }, 500);
@@ -892,7 +892,7 @@ var Me = {
892
892
  if (!e || !t) return !1;
893
893
  let n = t?.id ? String(t.id) : "", r = R(t?.extent);
894
894
  return !!(n && e._zzTileId === n || r && e._zzTileExtentKey === r);
895
- }, ne = (e) => {
895
+ }, B = (e) => {
896
896
  let t = n.value?.imageryLayers;
897
897
  if (t) {
898
898
  for (let n = t.length - 1; n >= 0; n--) {
@@ -901,14 +901,14 @@ var Me = {
901
901
  }
902
902
  o = o.filter((t) => !te(t, e));
903
903
  }
904
- }, B = async (e, t, r = 0, i = h) => {
904
+ }, V = async (e, t, r = 0, i = h) => {
905
905
  if (r === 3 || l || i !== h) return;
906
906
  let a = new Image();
907
907
  u.add(a);
908
908
  let s = t.extent;
909
909
  a.crossOrigin = "anonymous", a.onload = () => {
910
910
  if (u.delete(a), l || i !== h) return;
911
- ne(t);
911
+ B(t);
912
912
  let e = D.Rectangle.fromDegrees(s.xmin, s.ymin, s.xmax, s.ymax), r = A(), c = t.url;
913
913
  if (r) try {
914
914
  c = Ae(a, r, e, new D.GeographicProjection()).toDataURL("image/png");
@@ -938,11 +938,11 @@ var Me = {
938
938
  }, a.onerror = () => {
939
939
  u.delete(a);
940
940
  let n = setTimeout(() => {
941
- p.delete(n), !l && i === h && B(e, t, r + 1, i);
941
+ p.delete(n), !l && i === h && V(e, t, r + 1, i);
942
942
  }, 500);
943
943
  p.add(n);
944
944
  }, a.src = t.url;
945
- }, V = () => {
945
+ }, ne = () => {
946
946
  try {
947
947
  l = !0, h++, s &&= (clearTimeout(s), null);
948
948
  try {
@@ -1056,7 +1056,7 @@ var Me = {
1056
1056
  });
1057
1057
  };
1058
1058
  return w(S, (e, t) => {
1059
- !e || e === t || (V(), l = !1, P());
1059
+ !e || e === t || (ne(), l = !1, P());
1060
1060
  }), w(C, () => {
1061
1061
  o.length > 0 && H();
1062
1062
  }, { deep: !0 }), w(() => [
@@ -1070,7 +1070,7 @@ var Me = {
1070
1070
  }), d(() => {
1071
1071
  console.log("组件挂载,开始初始化..."), P();
1072
1072
  }), f(() => {
1073
- console.log("组件卸载,开始清理资源..."), p.forEach((e) => clearTimeout(e)), p.clear(), m.forEach((e) => e.abort()), m.clear(), V();
1073
+ console.log("组件卸载,开始清理资源..."), p.forEach((e) => clearTimeout(e)), p.clear(), m.forEach((e) => e.abort()), m.clear(), ne();
1074
1074
  }), (e, t) => null;
1075
1075
  }
1076
1076
  };
@@ -1375,17 +1375,17 @@ var Xe = {
1375
1375
  let t = String(e || "").trim();
1376
1376
  return t ? z[t] ? z[t] : t.includes(",") ? t : /[\u4e00-\u9fff]/.test(t) || /\s/.test(t) ? `"${t}", sans-serif` : `${t}, sans-serif` : "\"Microsoft YaHei\", \"PingFang SC\", sans-serif";
1377
1377
  }
1378
- function ne(e, t) {
1378
+ function B(e, t) {
1379
1379
  return `${Number(e ?? 14)}px ${te(t)}`;
1380
1380
  }
1381
- function B(e) {
1381
+ function V(e) {
1382
1382
  try {
1383
1383
  return D.Color.fromCssColorString(e);
1384
1384
  } catch {
1385
1385
  return console.warn("无效的颜色字符串,使用默认颜色:", e), D.Color.YELLOW;
1386
1386
  }
1387
1387
  }
1388
- function V(e = {}, t = {}) {
1388
+ function ne(e = {}, t = {}) {
1389
1389
  let n = e.type || "solid", r = e.outlineColor || e.color || "#409EFF", i = e.fill || "rgba(198,53,4, 0.4)", a = Number(e.outlineWidth ?? t.outlineWidth ?? 1), o = Number(e.dashLength ?? t.dashLength ?? (n === "dashed" ? 8 : 0)), s = Number(e.gapLength ?? t.gapLength ?? (n === "dashed" ? 4 : 0));
1390
1390
  return n === "dashed" && (o ||= 8, s ||= 4), {
1391
1391
  type: n,
@@ -1421,7 +1421,7 @@ var Xe = {
1421
1421
  color: "#000",
1422
1422
  fontSize: "12px"
1423
1423
  },
1424
- stroke: V(t.stroke || {}, {
1424
+ stroke: ne(t.stroke || {}, {
1425
1425
  outlineColor: t.stroke?.outlineColor || t.borderColor || "#FFFFFF",
1426
1426
  outlineWidth: 1
1427
1427
  })
@@ -1429,7 +1429,7 @@ var Xe = {
1429
1429
  line: {
1430
1430
  ...n,
1431
1431
  strokeVisible: n.stroke?.visible !== !1,
1432
- stroke: V(n.stroke || n, {
1432
+ stroke: ne(n.stroke || n, {
1433
1433
  outlineColor: o,
1434
1434
  outlineWidth: s,
1435
1435
  color: o
@@ -1440,7 +1440,7 @@ var Xe = {
1440
1440
  outlineColor: i,
1441
1441
  outlineWidth: a,
1442
1442
  strokeVisible: r.stroke?.visible !== !1,
1443
- stroke: V(r.stroke || {}, {
1443
+ stroke: ne(r.stroke || {}, {
1444
1444
  outlineColor: i,
1445
1445
  outlineWidth: a,
1446
1446
  color: i,
@@ -1452,14 +1452,14 @@ var Xe = {
1452
1452
  }
1453
1453
  function re(e) {
1454
1454
  return (e.type === "dashed" || e.dashLength > 0) && e.gapLength > 0 ? new D.PolylineDashMaterialProperty({
1455
- color: B(e.color),
1455
+ color: V(e.color),
1456
1456
  dashLength: e.dashLength,
1457
1457
  gapLength: e.gapLength
1458
1458
  }) : e.borderWidth > 0 ? new D.PolylineOutlineMaterialProperty({
1459
- color: B(e.color),
1460
- outlineColor: B(e.borderColor),
1459
+ color: V(e.color),
1460
+ outlineColor: V(e.borderColor),
1461
1461
  outlineWidth: e.borderWidth
1462
- }) : new D.ColorMaterialProperty(B(e.color));
1462
+ }) : new D.ColorMaterialProperty(V(e.color));
1463
1463
  }
1464
1464
  function ie(e) {
1465
1465
  let t = e && typeof e == "object" ? { ...e } : e;
@@ -1701,7 +1701,7 @@ var Xe = {
1701
1701
  if (!i) return;
1702
1702
  e.position = new D.ConstantPositionProperty(i), e.label ||= new D.LabelGraphics();
1703
1703
  let a = Number(n.fontSize ?? 14), o = n.fontColor || "#000", s = Number(r.pixelOffsetX ?? n.pixelOffsetX ?? 0), c = Number(r.pixelOffsetY ?? n.pixelOffsetY ?? 0), l = r.verticalOrigin ?? D.VerticalOrigin.CENTER, u = r.horizontalOrigin ?? D.HorizontalOrigin.CENTER;
1704
- e.label.show = new D.ConstantProperty(!0), e.label.text = new D.ConstantProperty(t), e.label.font = new D.ConstantProperty(ne(a, n.fontFamily)), e.label.fillColor = new D.ConstantProperty(B(o)), e.label.outlineColor = new D.ConstantProperty(B(o)), e.label.outlineWidth = new D.ConstantProperty(0), e.label.style = D.LabelStyle.FILL_AND_OUTLINE, e.label.showBackground = new D.ConstantProperty(!1), e.label.backgroundColor = new D.ConstantProperty(D.Color.TRANSPARENT), e.label.backgroundPadding = new D.Cartesian2(0, 0), e.label.verticalOrigin = l, e.label.horizontalOrigin = u, e.label.pixelOffset = new D.Cartesian2(s, c), e.label.distanceDisplayCondition = new D.DistanceDisplayCondition(0, 5e5), e.label.scale = new D.ConstantProperty(1), n.translucencyByDistance && (e.label.translucencyByDistance = n.translucencyByDistance), n.pixelOffsetScaleByDistance && (e.label.pixelOffsetScaleByDistance = n.pixelOffsetScaleByDistance);
1704
+ e.label.show = new D.ConstantProperty(!0), e.label.text = new D.ConstantProperty(t), e.label.font = new D.ConstantProperty(B(a, n.fontFamily)), e.label.fillColor = new D.ConstantProperty(V(o)), e.label.outlineColor = new D.ConstantProperty(V(o)), e.label.outlineWidth = new D.ConstantProperty(0), e.label.style = D.LabelStyle.FILL_AND_OUTLINE, e.label.showBackground = new D.ConstantProperty(!1), e.label.backgroundColor = new D.ConstantProperty(D.Color.TRANSPARENT), e.label.backgroundPadding = new D.Cartesian2(0, 0), e.label.verticalOrigin = l, e.label.horizontalOrigin = u, e.label.pixelOffset = new D.Cartesian2(s, c), e.label.distanceDisplayCondition = new D.DistanceDisplayCondition(0, 5e5), e.label.scale = new D.ConstantProperty(1), n.translucencyByDistance && (e.label.translucencyByDistance = n.translucencyByDistance), n.pixelOffsetScaleByDistance && (e.label.pixelOffsetScaleByDistance = n.pixelOffsetScaleByDistance);
1705
1705
  }
1706
1706
  function Ne(e, t, n) {
1707
1707
  let r = n?.fieldName, i = R(M(t, r), n);
@@ -1713,7 +1713,7 @@ var Xe = {
1713
1713
  if (!e.position) return;
1714
1714
  e.label ||= new D.LabelGraphics();
1715
1715
  let a = Number(n.fontSize ?? 14), o = n.fontColor || "#000";
1716
- e.label.show = new D.ConstantProperty(!0), e.label.text = new D.ConstantProperty(i), e.label.font = new D.ConstantProperty(ne(a, n.fontFamily)), e.label.fillColor = new D.ConstantProperty(B(o)), e.label.outlineWidth = new D.ConstantProperty(0), e.label.showBackground = new D.ConstantProperty(!1), e.label.backgroundColor = new D.ConstantProperty(D.Color.TRANSPARENT), e.label.backgroundPadding = new D.Cartesian2(0, 0), e.label.verticalOrigin = D.VerticalOrigin.BOTTOM, e.label.horizontalOrigin = D.HorizontalOrigin.CENTER;
1716
+ e.label.show = new D.ConstantProperty(!0), e.label.text = new D.ConstantProperty(i), e.label.font = new D.ConstantProperty(B(a, n.fontFamily)), e.label.fillColor = new D.ConstantProperty(V(o)), e.label.outlineWidth = new D.ConstantProperty(0), e.label.showBackground = new D.ConstantProperty(!1), e.label.backgroundColor = new D.ConstantProperty(D.Color.TRANSPARENT), e.label.backgroundPadding = new D.Cartesian2(0, 0), e.label.verticalOrigin = D.VerticalOrigin.BOTTOM, e.label.horizontalOrigin = D.HorizontalOrigin.CENTER;
1717
1717
  let s = Number(e.point?.pixelSize?.getValue?.(D.JulianDate.now()) ?? H(l.value).point.radius ?? 8), c = Number(e.point?.outlineWidth?.getValue?.(D.JulianDate.now()) ?? 0), u = n.pixelOffsetY ?? -(s + c + a * .55 + 8);
1718
1718
  e.label.pixelOffset = new D.Cartesian2(Number(n.pixelOffsetX ?? 0), u), e.label.distanceDisplayCondition = new D.DistanceDisplayCondition(0, 5e5), e.label.scale = new D.ConstantProperty(1);
1719
1719
  }
@@ -1737,7 +1737,7 @@ var Xe = {
1737
1737
  return;
1738
1738
  }
1739
1739
  let s = n.strokeVisible !== !1 && r.outlineWidth > 0, c = Oe(a, "polygon", i), u = Number(x.value ?? 0), d = Number.isFinite(u) && u > 0 && p.value;
1740
- e.polygon.material = new D.ColorMaterialProperty(B(c)), d ? e.polygon.zIndex = new D.ConstantProperty(u) : e.polygon.zIndex = void 0, e.polygon.outline = s && o, e.polygon.outlineColor = new D.ConstantProperty(s && o ? B(r.outlineColor) : D.Color.TRANSPARENT), e.polygon.outlineWidth = new D.ConstantProperty(s && o ? r.outlineWidth : 0), e.polyline = {
1740
+ e.polygon.material = new D.ColorMaterialProperty(V(c)), d ? e.polygon.zIndex = new D.ConstantProperty(u) : e.polygon.zIndex = void 0, e.polygon.outline = s && o, e.polygon.outlineColor = new D.ConstantProperty(s && o ? V(r.outlineColor) : D.Color.TRANSPARENT), e.polygon.outlineWidth = new D.ConstantProperty(s && o ? r.outlineWidth : 0), e.polyline = {
1741
1741
  positions: e.polygon.hierarchy._value.positions,
1742
1742
  show: s && o,
1743
1743
  width: r.outlineWidth,
@@ -1785,7 +1785,7 @@ var Xe = {
1785
1785
  function ze(e, t) {
1786
1786
  e.point ||= new D.PointGraphics();
1787
1787
  let n = t.strokeVisible !== !1 && Number(t.borderWidth) > 0;
1788
- e.point.show = new D.ConstantProperty(!0), e.point.pixelSize = new D.ConstantProperty(t.radius), e.point.color = new D.ConstantProperty(B(t.color || t.fill)), e.point.outlineColor = new D.ConstantProperty(n ? B(t.borderColor) : D.Color.TRANSPARENT), e.point.outlineWidth = new D.ConstantProperty(n ? t.borderWidth : 0);
1788
+ e.point.show = new D.ConstantProperty(!0), e.point.pixelSize = new D.ConstantProperty(t.radius), e.point.color = new D.ConstantProperty(V(t.color || t.fill)), e.point.outlineColor = new D.ConstantProperty(n ? V(t.borderColor) : D.Color.TRANSPARENT), e.point.outlineWidth = new D.ConstantProperty(n ? t.borderWidth : 0);
1789
1789
  }
1790
1790
  function Be(e, t) {
1791
1791
  e.billboard ||= new D.BillboardGraphics(), e.billboard.show = new D.ConstantProperty(!0), e.billboard.image = new D.ConstantProperty(t.url), e.billboard.width = new D.ConstantProperty(t.width), e.billboard.height = new D.ConstantProperty(t.height), e.billboard.verticalOrigin = D.VerticalOrigin.BOTTOM;
@@ -1797,9 +1797,9 @@ var Xe = {
1797
1797
  let e = M(t, n.field);
1798
1798
  e != null && (r = String(e));
1799
1799
  }
1800
- e.label.showBackground = new D.ConstantProperty(n.bgColor !== ""), e.label.backgroundColor = new D.ConstantProperty(B(n.bgColor)), e.label.show = new D.ConstantProperty(r !== ""), e.label.text = new D.ConstantProperty(r);
1800
+ e.label.showBackground = new D.ConstantProperty(n.bgColor !== ""), e.label.backgroundColor = new D.ConstantProperty(V(n.bgColor)), e.label.show = new D.ConstantProperty(r !== ""), e.label.text = new D.ConstantProperty(r);
1801
1801
  let i = parseInt(String(n.fontSize || "12"), 10) || 12;
1802
- e.label.font = new D.ConstantProperty(ne(i, n.fontFamily)), e.label.fillColor = new D.ConstantProperty(B(n.color)), e.label.outlineColor = new D.ConstantProperty(D.Color.BLACK), e.label.outlineWidth = new D.ConstantProperty(1), e.label.verticalOrigin = D.VerticalOrigin.BOTTOM, e.label.pixelOffset = n.pixelOffset, e.label.distanceDisplayCondition = new D.DistanceDisplayCondition(0, 5e5);
1802
+ e.label.font = new D.ConstantProperty(B(i, n.fontFamily)), e.label.fillColor = new D.ConstantProperty(V(n.color)), e.label.outlineColor = new D.ConstantProperty(D.Color.BLACK), e.label.outlineWidth = new D.ConstantProperty(1), e.label.verticalOrigin = D.VerticalOrigin.BOTTOM, e.label.pixelOffset = n.pixelOffset, e.label.distanceDisplayCondition = new D.DistanceDisplayCondition(0, 5e5);
1803
1803
  }
1804
1804
  function He(e) {
1805
1805
  if (!e?.properties) return {};
@@ -2020,11 +2020,11 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2020
2020
  if (!L.value || z.value) return !1;
2021
2021
  let e = O.value;
2022
2022
  return e.dictCode && e.layer && !(e.wfsBasePath || k.value.labelOverlay?.wfsUrl) && console.warn("[zz-layer-mvt] 面注记缺少 dictCode/wfsBasePath,回退 MapLibre 落点"), !0;
2023
- }, ne = (e) => {
2023
+ }, B = (e) => {
2024
2024
  if (e == null) return "";
2025
2025
  let t = String(e).trim(), n = Number(t);
2026
2026
  return !Number.isNaN(n) && t !== "" ? String(n) : t;
2027
- }, B = (e = {}) => {
2027
+ }, V = (e = {}) => {
2028
2028
  if (e.point) {
2029
2029
  let t = e.point || {};
2030
2030
  return {
@@ -2078,7 +2078,7 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2078
2078
  }
2079
2079
  };
2080
2080
  }
2081
- }, V = () => {
2081
+ }, ne = () => {
2082
2082
  if (!N.value) return null;
2083
2083
  let e = O.value, t = k.value, n = e.sourceLayer || e.layer, r = D(e.layer || n), i = e.url ? [e.url] : [], a = t.styleByProperty || {}, o = a.type || "", s = a.fieldName || "", c = Array.isArray(a.colorListArray) ? a.colorListArray : [], l = a.colorList || {}, u = l.point || l.line || l.polygon ? l : a.point || a.line || a.polygon ? a : l, d = t.note || {}, f = E(t.opacity);
2084
2084
  console.log("[zz-layer-mvt] buildStyle", {
@@ -2092,7 +2092,7 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2092
2092
  noteFontFamily: d.fontFamily || "",
2093
2093
  noteGlyphs: t.glyphs || ""
2094
2094
  });
2095
- let p = B(u);
2095
+ let p = V(u);
2096
2096
  if (!p) return console.warn("[zz-layer-mvt] colorList missing point/line/polygon style", u), null;
2097
2097
  let m = typeof d.fieldName == "string" ? d.fieldName.trim() : "", h = !!m, g = h ? b(t, d) : "", _ = h ? C(m, d) : null, v = {
2098
2098
  "text-color": d.fontColor || "#000",
@@ -2106,7 +2106,7 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2106
2106
  };
2107
2107
  return h && g && (e.glyphs = g), e;
2108
2108
  }, x = new Set((Array.isArray(t.hiddenValues) ? t.hiddenValues : []).map(String)), S = "rgba(0,0,0,0)", w = a.strictClassifiedStyle === !0 && ["uniqueShp", "gradedColor"].includes(o), T = (e) => {
2109
- let t = ne(e?.value);
2109
+ let t = B(e?.value);
2110
2110
  return x.has(t) || x.has(String(e?.value ?? ""));
2111
2111
  }, A = (e) => {
2112
2112
  let t = `${e?.valueMin}..${e?.valueMax}`, n = `${Number(e?.valueMin)}..${Number(e?.valueMax)}`;
@@ -2138,7 +2138,7 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2138
2138
  if (o === "uniqueShp") {
2139
2139
  if (c.length === 0) return M(p.fill);
2140
2140
  let e = ["match", ["to-string", ["get", s]]];
2141
- for (let t of c) e.push(ne(t.value), T(t) ? S : P(t, p.fill));
2141
+ for (let t of c) e.push(B(t.value), T(t) ? S : P(t, p.fill));
2142
2142
  return e.push(M(p.fill)), e;
2143
2143
  }
2144
2144
  return p.fill;
@@ -2168,7 +2168,7 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2168
2168
  if (o === "uniqueShp") {
2169
2169
  if (c.length === 0) return M(p.stroke.outlineColor);
2170
2170
  let e = ["match", ["to-string", ["get", s]]];
2171
- for (let t of c) e.push(ne(t.value), T(t) ? S : P(t, p.stroke.outlineColor));
2171
+ for (let t of c) e.push(B(t.value), T(t) ? S : P(t, p.stroke.outlineColor));
2172
2172
  return e.push(M(p.stroke.outlineColor)), e;
2173
2173
  }
2174
2174
  return p.stroke.outlineColor;
@@ -2198,7 +2198,7 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2198
2198
  if (o === "uniqueShp") {
2199
2199
  if (c.length === 0) return M(p.fill);
2200
2200
  let e = ["match", ["to-string", ["get", s]]];
2201
- for (let t of c) e.push(ne(t.value), T(t) ? S : P(t, p.fill));
2201
+ for (let t of c) e.push(B(t.value), T(t) ? S : P(t, p.fill));
2202
2202
  return e.push(M(p.fill)), e;
2203
2203
  }
2204
2204
  return p.fill;
@@ -2224,7 +2224,7 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2224
2224
  ] : E(t.fillOpacity), L = p?.strokeVisible !== !1, R = t.legendFilter || null, z = (e) => !R || !e ? e : {
2225
2225
  ...e,
2226
2226
  filter: R
2227
- }, V = w ? [
2227
+ }, ne = w ? [
2228
2228
  "case",
2229
2229
  [
2230
2230
  "==",
@@ -2253,7 +2253,7 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2253
2253
  "circle-color": F,
2254
2254
  "circle-radius": p.stroke.radius,
2255
2255
  "circle-opacity": ee,
2256
- "circle-stroke-color": L ? V : S,
2256
+ "circle-stroke-color": L ? ne : S,
2257
2257
  "circle-stroke-opacity": L ? ee : 0,
2258
2258
  "circle-stroke-width": L ? p.stroke.outlineWidth : 0
2259
2259
  }
@@ -2297,7 +2297,7 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2297
2297
  })] : []]
2298
2298
  };
2299
2299
  if (u.polygon) {
2300
- let r = L ? V : S;
2300
+ let r = L ? ne : S;
2301
2301
  return {
2302
2302
  ...y(),
2303
2303
  sources: { "mvt:source": {
@@ -2378,7 +2378,7 @@ var Qe = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", $e = {
2378
2378
  return;
2379
2379
  }
2380
2380
  ae();
2381
- let t = V();
2381
+ let t = ne();
2382
2382
  if (!t) {
2383
2383
  ae();
2384
2384
  return;
@@ -5399,19 +5399,30 @@ function vo(e) {
5399
5399
  vertexCount: _,
5400
5400
  indexCount: b,
5401
5401
  featureId: u,
5402
- geometryKind: d
5402
+ geometryKind: d,
5403
+ fidTrusted: p
5403
5404
  });
5404
5405
  }
5405
5406
  let s = (performance.now() - t).toFixed(1);
5406
5407
  return console.log(`[ShpZzts] 解析完成: ${n.length} 要素, ${s}ms`), n;
5407
5408
  }
5408
- var yo = class {
5409
+ async function yo(e, t, n) {
5410
+ let r = 0, i = Math.max(1, Math.min(t, e.length)), a = [];
5411
+ for (let t = 0; t < i; t++) a.push((async () => {
5412
+ for (; r < e.length;) {
5413
+ let t = e[r++];
5414
+ await n(t);
5415
+ }
5416
+ })());
5417
+ await Promise.all(a);
5418
+ }
5419
+ var bo = 512, xo = 2, So = 64, Co = class {
5409
5420
  constructor(e, t = {}) {
5410
- 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.pointSize = t.pointSize || 8, this.displayRange = po(t.displayRange);
5421
+ 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.layerDataUrl = t.layerDataUrl || "/v1/zzts/layer/3d/getVectorLayerData", this.opacity = this._normOpacity(t.opacity), this.batchSize = t.batchSize || 2e3, this.transitionDuration = t.transitionDuration || 50, this.fetchConcurrency = Number(t.fetchConcurrency) > 0 ? Number(t.fetchConcurrency) : 8, this.bulkTileThreshold = Number(t.bulkTileThreshold) > 0 ? Number(t.bulkTileThreshold) : 48, this.pointSize = t.pointSize || 8, this.displayRange = po(t.displayRange);
5411
5422
  let n = Number(t.pointSize);
5412
5423
  this.pointSize = Number.isFinite(n) && n > 0 ? n : 5, this._userColor = t.color || null, this.outline = ho(t.outline);
5413
5424
  let r = Number(t.outlineHeightOffset);
5414
- this.outlineHeightOffset = Number.isFinite(r) && r > 0 ? r : .8, this.dictCode = t.dictCode || "", this.serviceName = t.serviceName || "", this.enableServiceColor = t.enableServiceColor !== !1, this.modelColorUrl = t.modelColorUrl || "/v1/zzts/style/render/modelColors", this.modelColorCache = /* @__PURE__ */ new Map(), this.currentLod = -1, this.lodPrimitives = /* @__PURE__ */ new Map(), this.transitionAnimId = null, this.requestInProgress = !1, this.renderRequestToken = 0, 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;
5425
+ this.outlineHeightOffset = Number.isFinite(r) && r > 0 ? r : .8, this.dictCode = t.dictCode || "", this.serviceName = t.serviceName || "", this.enableServiceColor = t.enableServiceColor !== !1, this.modelColorUrl = t.modelColorUrl || "/v1/zzts/style/render/modelColors", this.modelColorCache = /* @__PURE__ */ new Map(), this.currentLod = -1, this.lodPrimitives = /* @__PURE__ */ new Map(), this.transitionAnimId = null, this.tileCache = /* @__PURE__ */ new Map(), this.bulkCache = /* @__PURE__ */ new Map(), this.activeAbort = null, this.renderRequestToken = 0, 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;
5415
5426
  }
5416
5427
  _normOpacity(e) {
5417
5428
  let t = Number(e);
@@ -5570,39 +5581,39 @@ var yo = class {
5570
5581
  };
5571
5582
  this.transitionAnimId = requestAnimationFrame(s);
5572
5583
  }
5573
- _renderBatched(e, t, n, r, i) {
5574
- let a = [], o = [], s = [];
5575
- for (let t of e) t.geometryKind === 2 && (!t.indices || t.indexCount === 0) ? o.push(t) : s.push(t);
5576
- if (o.length > 0) {
5577
- let e = new D.PointPrimitiveCollection(), r = [], s = [], c = [], l = [], u = this._normOpacity(n) * this.opacity;
5578
- for (let t of o) {
5579
- let n = this.globalInstanceId++, a = this._resolveFeatureColor(t, i);
5580
- c.push(n), l.push(a);
5581
- let o = new D.Color(a.red, a.green, a.blue, u);
5584
+ _renderBatched(e, t, n, r, i, a) {
5585
+ let o = a || [], s = [], c = [];
5586
+ for (let t of e) t.geometryKind === 2 && (!t.indices || t.indexCount === 0) ? s.push(t) : c.push(t);
5587
+ if (s.length > 0) {
5588
+ let e = new D.PointPrimitiveCollection(), r = [], a = [], c = [], l = [], u = this._normOpacity(n) * this.opacity;
5589
+ for (let t of s) {
5590
+ let n = this.globalInstanceId++, o = this._resolveFeatureColor(t, i);
5591
+ c.push(n), l.push(o);
5592
+ let s = new D.Color(o.red, o.green, o.blue, u);
5582
5593
  for (let i = 0; i < t.vertexCount; i++) r.push(e.add({
5583
5594
  position: D.Cartesian3.fromArray(t.positions, i * 3),
5584
5595
  pixelSize: this.pointSize,
5585
- color: o,
5596
+ color: s,
5586
5597
  id: n
5587
- })), s.push(a);
5598
+ })), a.push(o);
5588
5599
  }
5589
- this.viewer.scene.primitives.add(e), a.push({
5600
+ this.viewer.scene.primitives.add(e), o.push({
5590
5601
  primitive: e,
5591
5602
  instanceIds: c,
5592
5603
  instanceColors: l,
5593
5604
  pointPrimitives: r,
5594
- pointColors: s
5595
- }), console.log(`[ShpZzts] LOD ${t} 原生点渲染完成: ${o.length} 要素 / ${r.length} 点`);
5596
- }
5597
- let c = [];
5598
- for (let e = 0; e < s.length; e += this.batchSize) c.push(s.slice(e, e + this.batchSize));
5599
- let l = 0, u = (o) => {
5600
- if (o >= c.length) {
5601
- this.lodPrimitives.set(t, a), r && requestAnimationFrame(() => r());
5605
+ pointColors: a
5606
+ }), console.log(`[ShpZzts] LOD ${t} 原生点渲染完成: ${s.length} 要素 / ${r.length} 点`);
5607
+ }
5608
+ let l = [];
5609
+ for (let e = 0; e < c.length; e += this.batchSize) l.push(c.slice(e, e + this.batchSize));
5610
+ let u = 0, d = (a) => {
5611
+ if (a >= l.length) {
5612
+ this.lodPrimitives.set(t, o), r && requestAnimationFrame(() => r());
5602
5613
  return;
5603
5614
  }
5604
- let s = c[o], d = [], f = [];
5605
- for (let e of s) e.geometryKind === 2 && e.indexCount === 0 ? d.push(e) : f.push(e);
5615
+ let s = l[a], c = [], f = [];
5616
+ for (let e of s) e.geometryKind === 2 && e.indexCount === 0 ? c.push(e) : f.push(e);
5606
5617
  let p = 0, m = [], h = [], g = [];
5607
5618
  for (let e of f) {
5608
5619
  let t = this.globalInstanceId++;
@@ -5641,14 +5652,14 @@ var yo = class {
5641
5652
  compressVertices: !1,
5642
5653
  releaseGeometryInstances: !0
5643
5654
  });
5644
- this.viewer.scene.primitives.add(e), a.push({
5655
+ this.viewer.scene.primitives.add(e), o.push({
5645
5656
  primitive: e,
5646
5657
  instanceIds: m,
5647
5658
  instanceColors: h
5648
5659
  }), p++;
5649
5660
  }
5650
5661
  if (this.outline) {
5651
- let e = new D.PolylineCollection(), r = this._resolveOutlineColor(), i = this._normOpacity(n) * this.opacity, o = new D.Color(r.red, r.green, r.blue, i), s = [], c = new D.Cartesian3(), l = new D.Cartesian3();
5662
+ let e = new D.PolylineCollection(), r = this._resolveOutlineColor(), i = this._normOpacity(n) * this.opacity, a = new D.Color(r.red, r.green, r.blue, i), s = [], c = new D.Cartesian3(), l = new D.Cartesian3();
5652
5663
  for (let t of f) {
5653
5664
  if (t.geometryKind !== 0 || !t.indices || t.indexCount === 0) continue;
5654
5665
  let n = _o(t.indices, t.vertexCount);
@@ -5661,46 +5672,46 @@ var yo = class {
5661
5672
  s.push(e.add({
5662
5673
  positions: n,
5663
5674
  width: this.outline.width,
5664
- material: D.Material.fromType("Color", { color: o })
5675
+ material: D.Material.fromType("Color", { color: a })
5665
5676
  }));
5666
5677
  }
5667
5678
  }
5668
- s.length > 0 ? (this.viewer.scene.primitives.add(e), a.push({
5679
+ s.length > 0 ? (this.viewer.scene.primitives.add(e), o.push({
5669
5680
  primitive: e,
5670
5681
  polylines: s,
5671
5682
  baseOutlineColor: r
5672
5683
  }), p++, console.log(`[ShpZzts] LOD ${t} 边线渲染完成: ${s.length} 条`)) : e.destroy?.();
5673
5684
  }
5674
- if (d.length > 0) {
5675
- let e = new D.PointPrimitiveCollection(), t = [], r = [], o = this._normOpacity(n) * this.opacity;
5676
- for (let n of d) {
5685
+ if (c.length > 0) {
5686
+ let e = new D.PointPrimitiveCollection(), t = [], r = [], a = this._normOpacity(n) * this.opacity;
5687
+ for (let n of c) {
5677
5688
  if (!n.positions || n.positions.length < 3) continue;
5678
- let a = this._resolveFeatureColor(n, i);
5679
- r.push(a);
5689
+ let o = this._resolveFeatureColor(n, i);
5690
+ r.push(o);
5680
5691
  let s = e.add({
5681
5692
  position: new D.Cartesian3(n.positions[0], n.positions[1], n.positions[2]),
5682
- color: new D.Color(a.red, a.green, a.blue, o),
5693
+ color: new D.Color(o.red, o.green, o.blue, a),
5683
5694
  pixelSize: this.pointSize,
5684
5695
  disableDepthTestDistance: Infinity
5685
5696
  });
5686
5697
  t.push(s);
5687
5698
  }
5688
- t.length > 0 ? (this.viewer.scene.primitives.add(e), a.push({
5699
+ t.length > 0 ? (this.viewer.scene.primitives.add(e), o.push({
5689
5700
  primitive: e,
5690
5701
  pointPrimitives: t,
5691
5702
  pointBaseColors: r
5692
5703
  }), p++) : e.destroy?.();
5693
5704
  }
5694
5705
  if (p === 0) {
5695
- l++, l < c.length ? requestAnimationFrame(() => u(o + 1)) : (this.lodPrimitives.set(t, a), r && requestAnimationFrame(() => r()));
5706
+ u++, u < l.length ? requestAnimationFrame(() => d(a + 1)) : (this.lodPrimitives.set(t, o), r && requestAnimationFrame(() => r()));
5696
5707
  return;
5697
5708
  }
5698
- l++, l < c.length ? requestAnimationFrame(() => u(o + 1)) : (this.lodPrimitives.set(t, a), console.log(`[ShpZzts] LOD ${t} 渲染完成: ${e.length} 要素 / ${c.length} 批(点 ${d.length} 个)`), r && requestAnimationFrame(() => r()));
5709
+ u++, u < l.length ? requestAnimationFrame(() => d(a + 1)) : (this.lodPrimitives.set(t, o), console.log(`[ShpZzts] LOD ${t} 渲染完成: ${e.length} 要素 / ${l.length} 批(点 ${c.length} 个)`), r && requestAnimationFrame(() => r()));
5699
5710
  };
5700
- return u(0), a;
5711
+ return d(0), o;
5701
5712
  }
5702
- async _getVectorTileData(e, t) {
5703
- let n = await k.request({
5713
+ async _getVectorTileData(e, t, n) {
5714
+ let r = await k.request({
5704
5715
  method: "GET",
5705
5716
  url: this.tileUrl,
5706
5717
  headers: { Accept: "application/octet-stream" },
@@ -5710,81 +5721,158 @@ var yo = class {
5710
5721
  level: t
5711
5722
  },
5712
5723
  responseType: "arraybuffer",
5713
- timeout: 3e5
5714
- }), r = n?.data ?? n;
5715
- if (!r) throw Error("Response data is empty");
5724
+ timeout: 6e4,
5725
+ signal: n
5726
+ }), i = r?.data ?? r;
5727
+ if (!i) throw Error("Response data is empty");
5716
5728
  return {
5717
5729
  geosot: e,
5718
- data: r
5730
+ data: i
5719
5731
  };
5720
5732
  }
5733
+ async _fetchTileGeometries(e, t, n) {
5734
+ let r = `${t}|${e}`, i = this.tileCache.get(r);
5735
+ if (i) return this.tileCache.delete(r), this.tileCache.set(r, i), i;
5736
+ let { data: a } = await this._getVectorTileData(e, t, n), o = [];
5737
+ return a instanceof ArrayBuffer && a.byteLength > 8 && (o = vo(a) || []), this.tileCache.set(r, o), this.tileCache.size > bo && this.tileCache.delete(this.tileCache.keys().next().value), o;
5738
+ }
5739
+ async _getLayerGeometries(e, t) {
5740
+ let n = this.bulkCache.get(e);
5741
+ if (n) return this.bulkCache.delete(e), this.bulkCache.set(e, n), n;
5742
+ let r = await k.request({
5743
+ method: "GET",
5744
+ url: this.layerDataUrl,
5745
+ headers: { Accept: "application/octet-stream" },
5746
+ params: {
5747
+ layerId: this.id,
5748
+ level: e
5749
+ },
5750
+ responseType: "arraybuffer",
5751
+ timeout: 12e4,
5752
+ signal: t
5753
+ }), i = r?.data ?? r, a = i instanceof ArrayBuffer && i.byteLength > 8 && vo(i) || [];
5754
+ return a.length > 0 && (this.bulkCache.set(e, a), this.bulkCache.size > xo && this.bulkCache.delete(this.bulkCache.keys().next().value)), a;
5755
+ }
5721
5756
  async loadAndRender() {
5722
5757
  let e = this._getScreenBounds();
5723
5758
  if (!e) return;
5759
+ let t = ++this.renderRequestToken;
5760
+ if (this.activeAbort) try {
5761
+ this.activeAbort.abort();
5762
+ } catch {}
5763
+ let n = new AbortController();
5764
+ this.activeAbort = n;
5765
+ let r = () => t === this.renderRequestToken && !this.destroyed;
5724
5766
  if (this.displayRange && !e.requestBounds) {
5725
- this.renderRequestToken += 1, this._clearRenderedPrimitives(), console.log("[ShpZzts] 当前视窗与真实胶囊显示范围无交集,跳过瓦片请求");
5767
+ this._clearRenderedPrimitives(), console.log("[ShpZzts] 当前视窗与真实胶囊显示范围无交集,跳过瓦片请求");
5726
5768
  return;
5727
5769
  }
5728
- if (this.requestInProgress) {
5729
- console.log("[ShpZzts] 请求进行中,跳过");
5770
+ let i = Math.abs(e.region[3] - e.region[0]), a = Math.abs(e.region[4] - e.region[1]);
5771
+ if (i > 20 || a > 20) {
5772
+ console.warn(`[ShpZzts] 视窗范围过大,跳过请求 (lonSpan=${i.toFixed(2)}°, latSpan=${a.toFixed(2)}°, 限制=20°)`);
5730
5773
  return;
5731
5774
  }
5732
- let t = ++this.renderRequestToken, n = Math.abs(e.region[3] - e.region[0]), r = Math.abs(e.region[4] - e.region[1]);
5733
- if (n > 20 || r > 20) {
5734
- console.warn(`[ShpZzts] 视窗范围过大,跳过请求 (lonSpan=${n.toFixed(2)}°, latSpan=${r.toFixed(2)}°, 限制=20°)`);
5735
- return;
5736
- }
5737
- this.requestInProgress = !0;
5738
- let i = performance.now();
5775
+ let o = performance.now();
5739
5776
  try {
5740
- let n = await k.request({
5777
+ let t = await k.request({
5741
5778
  method: "GET",
5742
5779
  url: this.calTilesUrl,
5743
5780
  params: {
5744
5781
  region: e.region.join(","),
5745
5782
  height: e.height,
5746
5783
  width: e.width
5747
- }
5784
+ },
5785
+ signal: n.signal
5748
5786
  });
5749
- if (t !== this.renderRequestToken || this.destroyed) return;
5750
- let { lodLevel: r = -1, tiles: a = [] } = n?.data ?? n ?? {};
5751
- if (console.log(`[ShpZzts] LOD ${r} | 瓦片数: ${a.length}`), !a || a.length === 0) {
5787
+ if (!r()) return;
5788
+ let { lodLevel: i = -1, tiles: a = [] } = t?.data ?? t ?? {};
5789
+ if (console.log(`[ShpZzts] LOD ${i} | 瓦片数: ${a.length}`), !a || a.length === 0) {
5752
5790
  console.warn("[ShpZzts] 没有需要加载的瓦片"), this._clearRenderedPrimitives();
5753
5791
  return;
5754
5792
  }
5755
- let o = a.map((e) => this._getVectorTileData(e.geoSot, r));
5756
- console.log(`[ShpZzts] 开始并行加载 ${o.length} 个瓦片...`);
5757
- let s = await Promise.allSettled(o);
5758
- if (t !== this.renderRequestToken || this.destroyed) return;
5759
- let c = [];
5760
- for (let e = 0; e < s.length; e++) {
5761
- let t = s[e];
5762
- if (t.status === "fulfilled") {
5763
- let { geosot: e, data: n } = t.value;
5764
- if (n instanceof ArrayBuffer && n.byteLength > 0 && (console.log(`[ShpZzts] 瓦片 ${e} 数据长度: ${n.byteLength}`), n.byteLength > 8)) {
5765
- let e = vo(n);
5766
- e && e.length > 0 && (c = c.concat(e));
5793
+ let s = this.currentLod, c = s !== -1 && s !== i, l = [], u = /* @__PURE__ */ new Set(), d = (e) => {
5794
+ for (let t of e || []) {
5795
+ if (t.fidTrusted) {
5796
+ let e = String(t.featureId);
5797
+ if (u.has(e)) continue;
5798
+ u.add(e);
5767
5799
  }
5768
- } else console.error(`[ShpZzts] 瓦片 ${a[e]?.geoSot} 加载失败:`, t.reason);
5800
+ l.push(t);
5801
+ }
5802
+ }, f = !1;
5803
+ if (a.length >= this.bulkTileThreshold || i === 12 || i === 13) try {
5804
+ let e = await this._getLayerGeometries(i, n.signal);
5805
+ if (!r()) return;
5806
+ e.length > 0 && (d(e), f = !0, console.log(`[ShpZzts] LOD ${i} 整图层拉取完成: ${e.length} 要素`));
5807
+ } catch (e) {
5808
+ if (n.signal.aborted) return;
5809
+ console.warn("[ShpZzts] 整图层拉取失败,回退逐瓦片加载:", e?.message || e);
5810
+ }
5811
+ let p = !1;
5812
+ if (!f) {
5813
+ let e = [];
5814
+ for (let t of a) {
5815
+ let n = `${i}|${t.geoSot}`, r = this.tileCache.get(n);
5816
+ r ? (this.tileCache.delete(n), this.tileCache.set(n, r), d(r)) : e.push(t);
5817
+ }
5818
+ if (e.length === 0 && l.length === 0) {
5819
+ this._clearRenderedPrimitives(), console.log("[ShpZzts] 全部瓦片为空(缓存命中),清空渲染");
5820
+ return;
5821
+ }
5822
+ if (e.length > 0) {
5823
+ p = !0;
5824
+ let t = [], a = !1, o = 0, u = async () => {
5825
+ if (o >= l.length) return;
5826
+ let e = l.slice(o, o + So);
5827
+ o += e.length, a || (a = !0, this._destroyLodPrimitives(i), c && (console.log(`[ShpZzts] LOD 变化: ${s} → ${i}(渐进模式,直接切换)`), this._destroyLodPrimitives(s)));
5828
+ let n = null;
5829
+ if (this.isServiceColorEnabled()) {
5830
+ let t = [...new Set(e.map((e) => String(e.featureId ?? "").trim()).filter((e) => e))];
5831
+ if (n = await this.loadModelColorsByIds(t), !r()) return;
5832
+ }
5833
+ this._renderBatched(e, i, 1, null, n, t), this.currentLod = i, console.log(`[ShpZzts] LOD ${i} 渐进上屏: ${o}/${l.length}`);
5834
+ }, f = async (e) => {
5835
+ let t = await this._fetchTileGeometries(e.geoSot, i, n.signal);
5836
+ r() && (d(t), l.length - o >= So && await u());
5837
+ };
5838
+ if (console.log(`[ShpZzts] 开始并发加载 ${e.length} 个瓦片(并发 ${this.fetchConcurrency})...`), await yo(e, this.fetchConcurrency, async (e) => {
5839
+ if (r()) try {
5840
+ await f(e);
5841
+ } catch (t) {
5842
+ if (n.signal.aborted || !r()) return;
5843
+ console.warn(`[ShpZzts] 瓦片 ${e.geoSot} 加载失败,300ms 后重试一次:`, t?.message || t);
5844
+ try {
5845
+ if (await new Promise((e) => setTimeout(e, 300)), !r()) return;
5846
+ await f(e);
5847
+ } catch (t) {
5848
+ n.signal.aborted || console.error(`[ShpZzts] 瓦片 ${e.geoSot} 重试仍失败:`, t?.message || t);
5849
+ }
5850
+ }
5851
+ }), !r()) return;
5852
+ if (await u(), !a && l.length === 0) {
5853
+ console.warn("[ShpZzts] 逐瓦片加载完成但无几何体"), this._clearRenderedPrimitives();
5854
+ return;
5855
+ }
5856
+ }
5769
5857
  }
5770
- if (console.log(`[ShpZzts] 所有瓦片加载完成,总几何体数量: ${c.length}`), t !== this.renderRequestToken || this.destroyed) return;
5771
- let l = null;
5772
- if (c.length > 0 && this.isServiceColorEnabled()) {
5773
- let e = [...new Set(c.map((e) => String(e.featureId ?? "").trim()).filter((e) => e))];
5774
- l = await this.loadModelColorsByIds(e), console.log(`[ShpZzts] 服务配色命中: ${l.size}/${e.length}`);
5858
+ if (!p) {
5859
+ let e = null;
5860
+ if (l.length > 0 && this.isServiceColorEnabled()) {
5861
+ let t = [...new Set(l.map((e) => String(e.featureId ?? "").trim()).filter((e) => e))];
5862
+ if (e = await this.loadModelColorsByIds(t), !r()) return;
5863
+ console.log(`[ShpZzts] 服务配色命中: ${e.size}/${t.length}`);
5864
+ }
5865
+ l.length > 0 ? (c ? (console.log(`[ShpZzts-SILOD] LOD 变化: ${s} → ${i}`), this._destroyLodPrimitives(i), this._renderBatched(l, i, 0, () => {
5866
+ console.log(`[ShpZzts-SILOD] 新 LOD ${i} 分批渲染完成,启动交叉淡化`), this._crossFadeLod(s, i);
5867
+ }, e)) : (this._destroyLodPrimitives(i), this._renderBatched(l, i, 1, null, e)), this.currentLod = i) : this._clearRenderedPrimitives();
5775
5868
  }
5776
- if (c.length > 0) {
5777
- let e = this.currentLod;
5778
- this.currentLod !== -1 && this.currentLod !== r ? (console.log(`[ShpZzts-SILOD] LOD 变化: ${e} → ${r}`), this._destroyLodPrimitives(r), this._renderBatched(c, r, 0, () => {
5779
- console.log(`[ShpZzts-SILOD] 新 LOD ${r} 分批渲染完成,启动交叉淡化`), this._crossFadeLod(e, r);
5780
- }, l)) : (this._destroyLodPrimitives(r), this._renderBatched(c, r, 1, null, l)), this.currentLod = r;
5781
- } else this._clearRenderedPrimitives();
5782
- let u = (performance.now() - i).toFixed(0);
5783
- console.log(`[ShpZzts] 加载+渲染完成: ${c.length} 要素, ${u}ms`);
5869
+ let m = (performance.now() - o).toFixed(0);
5870
+ console.log(`[ShpZzts] 加载+渲染完成: ${l.length} 要素, ${m}ms`);
5784
5871
  } catch (e) {
5872
+ if (n.signal.aborted || e?.code === "ERR_CANCELED") return;
5785
5873
  console.error("[ShpZzts] 加载失败:", e);
5786
5874
  } finally {
5787
- this.requestInProgress = !1;
5875
+ this.activeAbort === n && (this.activeAbort = null);
5788
5876
  }
5789
5877
  }
5790
5878
  _onCameraMoveEnd() {
@@ -5809,7 +5897,13 @@ var yo = class {
5809
5897
  }, 500), console.log(`[ShpZzts] 图层 ${this.id} 初始化完成`));
5810
5898
  }
5811
5899
  remove() {
5812
- this.destroyed = !0, this.renderRequestToken += 1, this.transitionAnimId !== null && (cancelAnimationFrame(this.transitionAnimId), this.transitionAnimId = null), this.debounceTimer &&= (clearTimeout(this.debounceTimer), null), this._teardownMoveHandler(), this.modelColorCache.clear();
5900
+ if (this.destroyed = !0, this.renderRequestToken += 1, this.activeAbort) {
5901
+ try {
5902
+ this.activeAbort.abort();
5903
+ } catch {}
5904
+ this.activeAbort = null;
5905
+ }
5906
+ this.tileCache.clear(), this.bulkCache.clear(), this.transitionAnimId !== null && (cancelAnimationFrame(this.transitionAnimId), this.transitionAnimId = null), this.debounceTimer &&= (clearTimeout(this.debounceTimer), null), this._teardownMoveHandler(), this.modelColorCache.clear();
5813
5907
  for (let e of this.lodPrimitives.keys()) this._destroyLodPrimitives(e);
5814
5908
  console.log(`[ShpZzts] 图层 ${this.id} 已移除`);
5815
5909
  }
@@ -5855,15 +5949,15 @@ var yo = class {
5855
5949
  });
5856
5950
  }
5857
5951
  };
5858
- function bo(e, t) {
5952
+ function wo(e, t) {
5859
5953
  return !e && !t ? !0 : !e || !t ? !1 : e.west === t.west && e.south === t.south && e.east === t.east && e.north === t.north;
5860
5954
  }
5861
- function xo(e, t = {}) {
5955
+ function To(e, t = {}) {
5862
5956
  if (!e || e.destroyed) return !1;
5863
5957
  let n = t.layerId || t.id;
5864
- return !(!n || e.id !== n || t.calTilesUrl && t.calTilesUrl !== e.calTilesUrl || t.tileUrl && t.tileUrl !== e.tileUrl || t.dictCode !== void 0 && (t.dictCode || "") !== (e.dictCode || "") || t.serviceName !== void 0 && (t.serviceName || "") !== (e.serviceName || "") || t.enableServiceColor !== void 0 && !!t.enableServiceColor !== e.enableServiceColor || t.modelColorUrl && t.modelColorUrl !== e.modelColorUrl || t.color !== void 0 && (t.color || null) !== (e._userColor || null) || t.outline !== void 0 && !go(ho(t.outline), e.outline) || t.displayRange !== void 0 && !bo(e.displayRange, po(t.displayRange)));
5958
+ return !(!n || e.id !== n || t.calTilesUrl && t.calTilesUrl !== e.calTilesUrl || t.tileUrl && t.tileUrl !== e.tileUrl || t.layerDataUrl && t.layerDataUrl !== e.layerDataUrl || t.dictCode !== void 0 && (t.dictCode || "") !== (e.dictCode || "") || t.serviceName !== void 0 && (t.serviceName || "") !== (e.serviceName || "") || t.enableServiceColor !== void 0 && !!t.enableServiceColor !== e.enableServiceColor || t.modelColorUrl && t.modelColorUrl !== e.modelColorUrl || t.color !== void 0 && (t.color || null) !== (e._userColor || null) || t.outline !== void 0 && !go(ho(t.outline), e.outline) || t.displayRange !== void 0 && !wo(e.displayRange, po(t.displayRange)));
5865
5959
  }
5866
- var So = new class {
5960
+ var Eo = new class {
5867
5961
  constructor() {
5868
5962
  this.layers = /* @__PURE__ */ new Map();
5869
5963
  }
@@ -5871,7 +5965,7 @@ var So = new class {
5871
5965
  let n = t?.layerId || t?.id;
5872
5966
  if (!n) return console.error("[ShpZzts] 创建图层失败:缺少 layerId"), null;
5873
5967
  this.layers.has(n) && (console.warn(`[ShpZzts] 图层 ${n} 已存在,移除旧图层后重建`), this.removeLayer(n));
5874
- let r = new yo(e, t);
5968
+ let r = new Co(e, t);
5875
5969
  return await r.init(), this.layers.set(n, r), r;
5876
5970
  }
5877
5971
  removeLayer(e) {
@@ -5884,9 +5978,9 @@ var So = new class {
5884
5978
  removeAllLayers() {
5885
5979
  this.layers.forEach((e) => e.remove()), this.layers.clear();
5886
5980
  }
5887
- }(), Co = async (e, t) => So.createLayer(e, t), wo = (e) => {
5888
- So.removeLayer(e);
5889
- }, To = (e) => So.getLayer(e), Eo = {
5981
+ }(), Do = async (e, t) => Eo.createLayer(e, t), Oo = (e) => {
5982
+ Eo.removeLayer(e);
5983
+ }, ko = (e) => Eo.getLayer(e), Ao = {
5890
5984
  __name: "index",
5891
5985
  props: {
5892
5986
  config: {
@@ -5911,6 +6005,7 @@ var So = new class {
5911
6005
  layerId: "",
5912
6006
  calTilesUrl: "/v1/zzts/layer/shp/calTiles",
5913
6007
  tileUrl: "/v1/zzts/layer/3d/getVectorTile",
6008
+ layerDataUrl: "/v1/zzts/layer/3d/getVectorLayerData",
5914
6009
  displayRange: null,
5915
6010
  opacity: 1,
5916
6011
  batchSize: 2e3,
@@ -5924,6 +6019,7 @@ var So = new class {
5924
6019
  layerId: e.layerId,
5925
6020
  calTilesUrl: e.calTilesUrl,
5926
6021
  tileUrl: e.tileUrl,
6022
+ layerDataUrl: e.layerDataUrl,
5927
6023
  displayRange: e.displayRange,
5928
6024
  opacity: e.opacity,
5929
6025
  batchSize: e.batchSize,
@@ -5948,9 +6044,9 @@ var So = new class {
5948
6044
  return;
5949
6045
  }
5950
6046
  let t = s(e);
5951
- o && o !== e.layerId && wo(o);
5952
- let r = To(e.layerId);
5953
- if (r && xo(r, t)) {
6047
+ o && o !== e.layerId && Oo(o);
6048
+ let r = ko(e.layerId);
6049
+ if (r && To(r, t)) {
5954
6050
  r.updateOptions(t), o = e.layerId;
5955
6051
  return;
5956
6052
  }
@@ -5959,9 +6055,9 @@ var So = new class {
5959
6055
  calTilesUrl: t.calTilesUrl,
5960
6056
  tileUrl: t.tileUrl,
5961
6057
  opacity: t.opacity
5962
- }), await Co(n.value, t), o = e.layerId;
6058
+ }), await Do(n.value, t), o = e.layerId;
5963
6059
  }, u = () => {
5964
- wo(a.value.layerId);
6060
+ Oo(a.value.layerId);
5965
6061
  };
5966
6062
  return w(() => r.config, async () => {
5967
6063
  console.log("[zzLayerShpZzts] props.config changed =", JSON.parse(JSON.stringify(r.config || {}))), await l();
@@ -5973,7 +6069,7 @@ var So = new class {
5973
6069
  r.subStackIndex,
5974
6070
  r.groupKey
5975
6071
  ], () => {
5976
- let e = a.value, t = To(e.layerId);
6072
+ let e = a.value, t = ko(e.layerId);
5977
6073
  if (t && typeof t.updateOptions == "function") {
5978
6074
  t.updateOptions({
5979
6075
  stackIndex: r.stackIndex,
@@ -5986,16 +6082,16 @@ var So = new class {
5986
6082
  }), d(() => {
5987
6083
  console.log("[zzLayerShpZzts] 组件挂载");
5988
6084
  }), f(() => {
5989
- console.log("[zzLayerShpZzts] 组件卸载,开始清理资源..."), o ? wo(o) : u();
6085
+ console.log("[zzLayerShpZzts] 组件卸载,开始清理资源..."), o ? Oo(o) : u();
5990
6086
  }), (e, t) => null;
5991
6087
  }
5992
6088
  };
5993
6089
  //#endregion
5994
6090
  //#region src/zz-layer/zz-layer-zzts3d-point/pointTileUtils.js
5995
- function Do(e) {
6091
+ function jo(e) {
5996
6092
  return e instanceof ArrayBuffer ? e : ArrayBuffer.isView(e) ? e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength) : null;
5997
6093
  }
5998
- function Oo(e) {
6094
+ function Mo(e) {
5999
6095
  if (!e || e.byteLength === 0) return null;
6000
6096
  let t = new Uint8Array(e), n = t.find((e) => e > 32);
6001
6097
  if (n !== 123 && n !== 91) return null;
@@ -6005,41 +6101,41 @@ function Oo(e) {
6005
6101
  return null;
6006
6102
  }
6007
6103
  }
6008
- function ko(e, t = {}) {
6104
+ function No(e, t = {}) {
6009
6105
  return console.warn("[zzts3d-point] skip invalid tile data:", e, t), [];
6010
6106
  }
6011
- var Ao = [
6107
+ var Po = [
6012
6108
  13,
6013
6109
  14,
6014
6110
  15,
6015
6111
  16,
6016
6112
  18
6017
- ], jo = 16;
6018
- function Mo(e, t = jo) {
6113
+ ], Fo = 16;
6114
+ function Io(e, t = Fo) {
6019
6115
  let n = Number(e);
6020
- if (Number.isFinite(n) && n > 0) return Ao.find((e) => n <= e) || Ao[Ao.length - 1];
6116
+ if (Number.isFinite(n) && n > 0) return Po.find((e) => n <= e) || Po[Po.length - 1];
6021
6117
  let r = Number(t);
6022
- return Number.isFinite(r) && r > 0 ? Ao.find((e) => r <= e) || Ao[Ao.length - 1] : jo;
6118
+ return Number.isFinite(r) && r > 0 ? Po.find((e) => r <= e) || Po[Po.length - 1] : Fo;
6023
6119
  }
6024
- function No(e, t) {
6120
+ function Lo(e, t) {
6025
6121
  let n = (String(e ?? "").split("_")[0].match(/\d/g) || []).length;
6026
- return n > 0 ? Mo(n, t) : Mo(t);
6122
+ return n > 0 ? Io(n, t) : Io(t);
6027
6123
  }
6028
- function Po(e, t) {
6029
- let n = Do(e);
6030
- if (!n || n.byteLength < 4 || Oo(n)) return [];
6124
+ function Ro(e, t) {
6125
+ let n = jo(e);
6126
+ if (!n || n.byteLength < 4 || Mo(n)) return [];
6031
6127
  let r = [], i = new DataView(n), a = 0, o = i.getInt32(a, !0);
6032
- if (a += 4, o < 0 || o > 1e5) return ko("invalid entity count", {
6128
+ if (a += 4, o < 0 || o > 1e5) return No("invalid entity count", {
6033
6129
  entityCount: o,
6034
6130
  byteLength: n.byteLength
6035
6131
  });
6036
6132
  for (let e = 0; e < o; e++) {
6037
- if (a + 4 > n.byteLength) return ko("missing compressed chunk length", {
6133
+ if (a + 4 > n.byteLength) return No("missing compressed chunk length", {
6038
6134
  offset: a,
6039
6135
  byteLength: n.byteLength
6040
6136
  });
6041
6137
  let e = i.getInt32(a, !0);
6042
- if (a += 4, e <= 0 || a + e > n.byteLength) return ko("invalid compressed chunk length", {
6138
+ if (a += 4, e <= 0 || a + e > n.byteLength) return No("invalid compressed chunk length", {
6043
6139
  compressedLength: e,
6044
6140
  offset: a,
6045
6141
  byteLength: n.byteLength
@@ -6053,11 +6149,11 @@ function Po(e, t) {
6053
6149
  } catch {
6054
6150
  s = new DataView(o.buffer, o.byteOffset, o.byteLength);
6055
6151
  }
6056
- if (s.byteLength < 12) return ko("chunk too small", { byteLength: s.byteLength });
6152
+ if (s.byteLength < 12) return No("chunk too small", { byteLength: s.byteLength });
6057
6153
  let c = 0, l = s.getBigInt64(c, !0);
6058
6154
  c += 8;
6059
6155
  let u = s.getInt32(c, !0);
6060
- if (c += 4, u < 0 || u % 12 != 0 || c + u > s.byteLength) return ko("invalid positions byte length", {
6156
+ if (c += 4, u < 0 || u % 12 != 0 || c + u > s.byteLength) return No("invalid positions byte length", {
6061
6157
  positionsByteLength: u,
6062
6158
  innerOffset: c,
6063
6159
  byteLength: s.byteLength
@@ -6073,12 +6169,12 @@ function Po(e, t) {
6073
6169
  }
6074
6170
  return r;
6075
6171
  }
6076
- function Fo({ destroyed: e, currentVersion: t, requestVersion: n, cancelToken: r } = {}) {
6172
+ function zo({ destroyed: e, currentVersion: t, requestVersion: n, cancelToken: r } = {}) {
6077
6173
  return !e && t === n && !r?.token?.reason;
6078
6174
  }
6079
6175
  //#endregion
6080
6176
  //#region src/zz-layer/zz-layer-zzts3d-point/entityGrid.js
6081
- function Io(e) {
6177
+ function Bo(e) {
6082
6178
  if (!e) return null;
6083
6179
  let t = e;
6084
6180
  if (typeof e == "string") try {
@@ -6100,7 +6196,7 @@ function Io(e) {
6100
6196
  north: a
6101
6197
  };
6102
6198
  }
6103
- function Lo(e, t) {
6199
+ function Vo(e, t) {
6104
6200
  if (!e || !t) return null;
6105
6201
  let n = {
6106
6202
  west: Math.max(e.west, t.west),
@@ -6110,9 +6206,9 @@ function Lo(e, t) {
6110
6206
  };
6111
6207
  return n.west < n.east && n.south < n.north ? n : null;
6112
6208
  }
6113
- var Ro = class {
6209
+ var Ho = class {
6114
6210
  constructor(e, t = !1, n = null, r = "255,255,255", i = 5, a = 1, o = {}) {
6115
- 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.displayRange = Io(o.displayRange), 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();
6211
+ 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.displayRange = Bo(o.displayRange), 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();
6116
6212
  }
6117
6213
  getBaseStyle() {
6118
6214
  return {
@@ -6312,7 +6408,7 @@ var Ro = class {
6312
6408
  south: i[1],
6313
6409
  east: i[2],
6314
6410
  north: i[3]
6315
- }, o = this.displayRange ? Lo(a, this.displayRange) : a;
6411
+ }, o = this.displayRange ? Vo(a, this.displayRange) : a;
6316
6412
  if (!o) {
6317
6413
  this.clearAllTiles();
6318
6414
  return;
@@ -6351,11 +6447,11 @@ var Ro = class {
6351
6447
  r.forEach((e) => {
6352
6448
  if (this.isStatic && this.fixedLevel) e.geoSot = e.geoSot, e.level = t;
6353
6449
  else {
6354
- let r = No(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));
6450
+ let r = Lo(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));
6355
6451
  N.entityGridLevels.filter((e) => e.max >= i && e.min <= i), e.geoSot = e.geoSot, e.level = r;
6356
6452
  }
6357
6453
  });
6358
- let i = this.displayRange, a = r.filter((e) => i ? !!Lo({
6454
+ let i = this.displayRange, a = r.filter((e) => i ? !!Vo({
6359
6455
  west: Number(e?.xmin),
6360
6456
  south: Number(e?.ymin),
6361
6457
  east: Number(e?.xmax),
@@ -6386,7 +6482,7 @@ var Ro = class {
6386
6482
  this.fadeAnimations.set(t, { interval: i });
6387
6483
  }
6388
6484
  isActiveRequest(e, t) {
6389
- return Fo({
6485
+ return zo({
6390
6486
  destroyed: this.destroyed,
6391
6487
  currentVersion: this.requestVersion,
6392
6488
  requestVersion: e,
@@ -6544,7 +6640,7 @@ var Ro = class {
6544
6640
  this.handlers &&= (viewer.camera.changed.removeEventListener(this.handlers), null), this.clearAllTiles(), this.requestController &&= (this.requestController.abort(), null);
6545
6641
  }
6546
6642
  parseCompressedMeshData(e, t) {
6547
- return Po(e, t);
6643
+ return Ro(e, t);
6548
6644
  }
6549
6645
  showPoint(e, t, n, r) {
6550
6646
  viewer.entities.add({
@@ -6565,7 +6661,7 @@ var Ro = class {
6565
6661
  }
6566
6662
  });
6567
6663
  }
6568
- }, zo = new class {
6664
+ }, Uo = new class {
6569
6665
  constructor() {
6570
6666
  this.layers = /* @__PURE__ */ new Map();
6571
6667
  }
@@ -6575,9 +6671,9 @@ var Ro = class {
6575
6671
  if (this.layers.has(t)) {
6576
6672
  console.warn(`图层 ${t} 已存在`);
6577
6673
  let i = this.layers.get(t), a = Ga(i.renderSignature, e || {});
6578
- return n && (i.tileColor = n), i.dictCode = e?.dictCode || i.dictCode || "", i.serviceName = e?.serviceName || i.serviceName || "", e?.displayRange !== void 0 && (i.displayRange = Io(e.displayRange)), 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 = Wa(e || {}), i.modelColorCache.clear(), i.clearAllTiles(), i.getViewportInfo()), i;
6674
+ return n && (i.tileColor = n), i.dictCode = e?.dictCode || i.dictCode || "", i.serviceName = e?.serviceName || i.serviceName || "", e?.displayRange !== void 0 && (i.displayRange = Bo(e.displayRange)), 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 = Wa(e || {}), i.modelColorCache.clear(), i.clearAllTiles(), i.getViewportInfo()), i;
6579
6675
  }
6580
- let s = new Ro(t, i, r, n, a, o, e);
6676
+ let s = new Ho(t, i, r, n, a, o, e);
6581
6677
  s.renderSignature = Wa(e || {}), this.layers.set(t, s);
6582
6678
  try {
6583
6679
  return await s.init(), s.destroyed ? (this.layers.delete(t), null) : s;
@@ -6606,20 +6702,20 @@ var Ro = class {
6606
6702
  let t = this.layers.get(e);
6607
6703
  t && t.getViewportInfo();
6608
6704
  }
6609
- }(), Bo = async (e) => zo.createLayer(e, !1), Vo = (e) => {
6610
- zo.removeLayer(e);
6611
- }, Ho = (e) => zo.getLayer(e);
6705
+ }(), Wo = async (e) => Uo.createLayer(e, !1), Go = (e) => {
6706
+ Uo.removeLayer(e);
6707
+ }, Ko = (e) => Uo.getLayer(e);
6612
6708
  t(() => {
6613
- let e = zo.getLayerIds();
6709
+ let e = Uo.getLayerIds();
6614
6710
  if (e.length > 0) {
6615
- let t = zo.getLayer(e[0]);
6711
+ let t = Uo.getLayer(e[0]);
6616
6712
  return t ? t.getCurrentLevel() : 15;
6617
6713
  }
6618
6714
  return 15;
6619
6715
  });
6620
6716
  //#endregion
6621
6717
  //#region src/zz-layer/zz-layer-zzts3d-point/index.vue
6622
- var Uo = {
6718
+ var qo = {
6623
6719
  __name: "index",
6624
6720
  props: { config: {
6625
6721
  type: Object,
@@ -6685,8 +6781,8 @@ var Uo = {
6685
6781
  let S = async () => {
6686
6782
  let e = ++u, t = _.value;
6687
6783
  if (!t.layerId) return;
6688
- let n = x(t), i = Ho(t.layerId);
6689
- if (i && !Ga(i.renderSignature, n) ? s.value = i : s.value = await Bo(n), !(m || e !== u)) {
6784
+ let n = x(t), i = Ko(t.layerId);
6785
+ if (i && !Ga(i.renderSignature, n) ? s.value = i : s.value = await Wo(n), !(m || e !== u)) {
6690
6786
  if (l.value && _.value.highlightEnabled && s.value?.setHighlight && s.value.setHighlight(l.value, {
6691
6787
  highlightColor: _.value.highlightColor,
6692
6788
  highlightOpacity: _.value.highlightOpacity,
@@ -6726,7 +6822,7 @@ var Uo = {
6726
6822
  }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
6727
6823
  }
6728
6824
  }, C = () => {
6729
- b(), v(), s.value = null, Vo(_.value.layerId || i.config.layerId);
6825
+ b(), v(), s.value = null, Go(_.value.layerId || i.config.layerId);
6730
6826
  };
6731
6827
  return w(_, () => {
6732
6828
  S();
@@ -6737,7 +6833,7 @@ var Uo = {
6737
6833
  console.log("组件卸载,开始清理资源..."), m = !0, u++, d++, p?.abort(), p = null, C();
6738
6834
  }), (e, t) => null;
6739
6835
  }
6740
- }, Wo = {
6836
+ }, Jo = {
6741
6837
  __name: "queryPoint",
6742
6838
  props: {
6743
6839
  config: {
@@ -6920,17 +7016,17 @@ var Uo = {
6920
7016
  C(), x([]);
6921
7017
  }), (e, t) => null;
6922
7018
  }
6923
- }, Go = 30, Ko = 6378137, qo = 1 / 298.257223563, Jo = 2 * qo - qo * qo;
6924
- function Yo(e) {
7019
+ }, Yo = 30, Xo = 6378137, Zo = 1 / 298.257223563, Qo = 2 * Zo - Zo * Zo;
7020
+ function $o(e) {
6925
7021
  return e instanceof ArrayBuffer ? e : ArrayBuffer.isView(e) ? e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength) : null;
6926
7022
  }
6927
- function Xo(e, t, n) {
6928
- let r = Math.atan2(t, e), i = Math.sqrt(e * e + t * t), a = Math.atan2(n, i * (1 - Jo)), o = 0;
7023
+ function es(e, t, n) {
7024
+ let r = Math.atan2(t, e), i = Math.sqrt(e * e + t * t), a = Math.atan2(n, i * (1 - Qo)), o = 0;
6929
7025
  for (let e = 0; e < 10; e++) {
6930
- let e = Math.sin(a), t = Ko / Math.sqrt(1 - Jo * e * e);
7026
+ let e = Math.sin(a), t = Xo / Math.sqrt(1 - Qo * e * e);
6931
7027
  o = i / Math.cos(a) - t;
6932
7028
  let r = a;
6933
- if (a = Math.atan2(n, i * (1 - Jo * t / (t + o))), Math.abs(a - r) < 1e-12) break;
7029
+ if (a = Math.atan2(n, i * (1 - Qo * t / (t + o))), Math.abs(a - r) < 1e-12) break;
6934
7030
  }
6935
7031
  return [
6936
7032
  (r * 180 / Math.PI + 540) % 360 - 180,
@@ -6938,8 +7034,8 @@ function Xo(e, t, n) {
6938
7034
  o
6939
7035
  ];
6940
7036
  }
6941
- function Zo(e) {
6942
- let t = Yo(e);
7037
+ function ts(e) {
7038
+ let t = $o(e);
6943
7039
  if (!t || t.byteLength < 4) return null;
6944
7040
  let n = new DataView(t), r = 0, i = n.getInt32(r, !0);
6945
7041
  if (r += 4, i <= 0 || i > 1e4) return console.warn("[zzts3d-las] invalid blob count:", i), null;
@@ -6958,7 +7054,7 @@ function Zo(e) {
6958
7054
  }
6959
7055
  else f = d;
6960
7056
  let p = new DataView(f.buffer, f.byteOffset, 4).getInt32(0, !0);
6961
- p > 0 && p * Go + 4 <= f.byteLength && (a += p, o.push({
7057
+ p > 0 && p * Yo + 4 <= f.byteLength && (a += p, o.push({
6962
7058
  raw: f,
6963
7059
  pointCount: p
6964
7060
  }));
@@ -6984,7 +7080,7 @@ function Zo(e) {
6984
7080
  n += 2;
6985
7081
  let S = t.getUint8(n);
6986
7082
  n += 1, s[y * 3] = e, s[y * 3 + 1] = r, s[y * 3 + 2] = i, l[y * 3] = a, l[y * 3 + 1] = o, l[y * 3 + 2] = b, u[y] = x, d[y] = S;
6987
- let [C, w, T] = Xo(e, r, i);
7083
+ let [C, w, T] = es(e, r, i);
6988
7084
  c[y] = T, f = Math.min(f, C), p = Math.max(p, C), m = Math.min(m, w), h = Math.max(h, w), g = Math.min(g, T), _ = Math.max(_, T), (a !== 128 || o !== 128 || b !== 128) && (v = !0), y++;
6989
7085
  }
6990
7086
  }
@@ -7004,7 +7100,7 @@ function Zo(e) {
7004
7100
  maxH: _
7005
7101
  };
7006
7102
  }
7007
- function Qo() {
7103
+ function ns() {
7008
7104
  return {
7009
7105
  positions: new Float64Array(),
7010
7106
  heights: new Float32Array(),
@@ -7021,8 +7117,8 @@ function Qo() {
7021
7117
  maxH: 0
7022
7118
  };
7023
7119
  }
7024
- function $o(e) {
7025
- if (!e || e.length === 0) return Qo();
7120
+ function rs(e) {
7121
+ if (!e || e.length === 0) return ns();
7026
7122
  if (e.length === 1) return e[0];
7027
7123
  let t = e.reduce((e, t) => e + t.pointCount, 0), n = new Float64Array(t * 3), r = new Float32Array(t), i = new Uint8Array(t * 3), a = new Uint16Array(t), o = new Uint8Array(t), s = 0;
7028
7124
  for (let t of e) n.set(t.positions, s * 3), r.set(t.heights, s), i.set(t.rgb, s * 3), a.set(t.intensity, s), o.set(t.classification, s), s += t.pointCount;
@@ -7044,12 +7140,12 @@ function $o(e) {
7044
7140
  }
7045
7141
  //#endregion
7046
7142
  //#region src/zz-layer/zz-layer-zzts3d-las/entityGrid.js
7047
- var es = 3e5, ts = 4, ns = 3, rs = [
7143
+ var is = 3e5, as = 4, os = 3, ss = [
7048
7144
  74,
7049
7145
  144,
7050
7146
  217
7051
7147
  ];
7052
- function is(e) {
7148
+ function cs(e) {
7053
7149
  switch (e) {
7054
7150
  case 2: return [
7055
7151
  139,
@@ -7103,7 +7199,7 @@ function is(e) {
7103
7199
  ];
7104
7200
  }
7105
7201
  }
7106
- function as(e) {
7202
+ function ls(e) {
7107
7203
  let t = [
7108
7204
  [
7109
7205
  40,
@@ -7137,7 +7233,7 @@ function as(e) {
7137
7233
  Math.round(t[r][2] + (t[r + 1][2] - t[r][2]) * i)
7138
7234
  ];
7139
7235
  }
7140
- function os(e, t, n) {
7236
+ function us(e, t, n) {
7141
7237
  let r = e.pointCount, i = new Uint8Array(r * 4), a = Math.round(Math.min(1, Math.max(0, n)) * 255);
7142
7238
  if (t === "rgb" && e.hasRgb) for (let t = 0; t < r; t++) {
7143
7239
  let n = t * 3, r = t * 4;
@@ -7151,26 +7247,26 @@ function os(e, t, n) {
7151
7247
  }
7152
7248
  let o = Math.max(1, n - t);
7153
7249
  for (let n = 0; n < r; n++) {
7154
- let r = as((e.intensity[n] - t) / o), s = n * 4;
7250
+ let r = ls((e.intensity[n] - t) / o), s = n * 4;
7155
7251
  i[s] = r[0], i[s + 1] = r[1], i[s + 2] = r[2], i[s + 3] = a;
7156
7252
  }
7157
7253
  } else if (t === "classification") for (let t = 0; t < r; t++) {
7158
- let n = is(e.classification[t]), r = t * 4;
7254
+ let n = cs(e.classification[t]), r = t * 4;
7159
7255
  i[r] = n[0], i[r + 1] = n[1], i[r + 2] = n[2], i[r + 3] = a;
7160
7256
  }
7161
7257
  else if (t === "height") {
7162
7258
  let t = Math.max(.001, e.maxH - e.minH);
7163
7259
  for (let n = 0; n < r; n++) {
7164
- let r = as((e.heights[n] - e.minH) / t), o = n * 4;
7260
+ let r = ls((e.heights[n] - e.minH) / t), o = n * 4;
7165
7261
  i[o] = r[0], i[o + 1] = r[1], i[o + 2] = r[2], i[o + 3] = a;
7166
7262
  }
7167
7263
  } else for (let e = 0; e < r; e++) {
7168
7264
  let t = e * 4;
7169
- i[t] = rs[0], i[t + 1] = rs[1], i[t + 2] = rs[2], i[t + 3] = a;
7265
+ i[t] = ss[0], i[t + 1] = ss[1], i[t + 2] = ss[2], i[t + 3] = a;
7170
7266
  }
7171
7267
  return i;
7172
7268
  }
7173
- function ss(e) {
7269
+ function ds(e) {
7174
7270
  return `
7175
7271
  in float batchId;
7176
7272
  in vec3 position3DHigh;
@@ -7186,12 +7282,12 @@ function ss(e) {
7186
7282
  }
7187
7283
  `;
7188
7284
  }
7189
- var cs = "\n in vec4 v_color;\n void main() {\n vec2 coord = gl_PointCoord - vec2(0.5);\n if (dot(coord, coord) > 0.25) discard;\n out_FragColor = v_color;\n }\n";
7190
- function ls(e) {
7285
+ var fs = "\n in vec4 v_color;\n void main() {\n vec2 coord = gl_PointCoord - vec2(0.5);\n if (dot(coord, coord) > 0.25) discard;\n out_FragColor = v_color;\n }\n";
7286
+ function ps(e) {
7191
7287
  return new Cesium.Appearance({
7192
7288
  translucent: !0,
7193
- vertexShaderSource: ss(e),
7194
- fragmentShaderSource: cs,
7289
+ vertexShaderSource: ds(e),
7290
+ fragmentShaderSource: fs,
7195
7291
  renderState: {
7196
7292
  depthTest: { enabled: !0 },
7197
7293
  depthMask: !0,
@@ -7199,7 +7295,7 @@ function ls(e) {
7199
7295
  }
7200
7296
  });
7201
7297
  }
7202
- var us = class {
7298
+ var ms = class {
7203
7299
  constructor(e = {}) {
7204
7300
  this.id = e.layerId, this.pointSize = e.pointSize ?? 2, this.opacity = e.opacity ?? 1, this.colorMode = e.colorMode ?? "auto", this.fixedLevel = e.level ?? null, this.currentPrimitives = [], this.visibleTileKeys = /* @__PURE__ */ new Set(), this.loading = !1, this.pendingRefresh = !1, this.renderGeneration = 0, this.destroyed = !1, this.handlers = null, this.initTimer = null, this.parsedData = null, this.activeColorMode = "single", this.cancelSource = null, this.requestVersion = 0;
7205
7301
  }
@@ -7268,7 +7364,7 @@ var us = class {
7268
7364
  0
7269
7365
  ];
7270
7366
  }
7271
- async fetchTileWithRetry(e, t, n = ns) {
7367
+ async fetchTileWithRetry(e, t, n = os) {
7272
7368
  let r;
7273
7369
  for (let i = 1; i <= n; i++) try {
7274
7370
  return (await k.request({
@@ -7326,7 +7422,7 @@ var us = class {
7326
7422
  }
7327
7423
  this.visibleTileKeys = s;
7328
7424
  let c = Array(o.length), l = 0;
7329
- if (await Promise.all(Array.from({ length: Math.min(ts, o.length) }, async () => {
7425
+ if (await Promise.all(Array.from({ length: Math.min(as, o.length) }, async () => {
7330
7426
  for (; l < o.length;) {
7331
7427
  let e = l++, t = o[e], r = {
7332
7428
  layerId: this.id,
@@ -7357,14 +7453,14 @@ var us = class {
7357
7453
  let d = [];
7358
7454
  for (let e of c) {
7359
7455
  if (e.status !== "fulfilled" || !e.value?.byteLength) continue;
7360
- let t = Zo(e.value);
7456
+ let t = ts(e.value);
7361
7457
  t && t.pointCount > 0 && d.push(t);
7362
7458
  }
7363
7459
  if (d.length === 0) {
7364
7460
  console.warn("[zzts3d-las] 当前视口无有效点数据");
7365
7461
  return;
7366
7462
  }
7367
- let f = $o(d);
7463
+ let f = rs(d);
7368
7464
  this.parsedData = f, this.colorMode === "auto" ? this.activeColorMode = f.hasRgb ? "rgb" : f.intensity.some((e) => e > 0) ? "intensity" : "single" : this.activeColorMode = this.colorMode, this.renderPoints(f, this.activeColorMode);
7369
7465
  } catch (e) {
7370
7466
  !M.isCancel(e) && !this.destroyed && console.error("[zzts3d-las] 视口瓦片加载失败:", e);
@@ -7376,9 +7472,9 @@ var us = class {
7376
7472
  if (!viewer || e.pointCount === 0) return;
7377
7473
  let n = ++this.renderGeneration;
7378
7474
  this.removeCurrentPrimitives();
7379
- let r = os(e, t, this.opacity), i = e.pointCount, a = [];
7380
- for (let t = 0; t < i; t += es) {
7381
- let n = Math.min(i, t + es);
7475
+ let r = us(e, t, this.opacity), i = e.pointCount, a = [];
7476
+ for (let t = 0; t < i; t += is) {
7477
+ let n = Math.min(i, t + is);
7382
7478
  a.push({
7383
7479
  positions: e.positions.slice(t * 3, n * 3),
7384
7480
  colors: r.slice(t * 4, n * 4)
@@ -7404,7 +7500,7 @@ var us = class {
7404
7500
  boundingSphere: Cesium.BoundingSphere.fromVertices(e.positions)
7405
7501
  }), i = new Cesium.Primitive({
7406
7502
  geometryInstances: new Cesium.GeometryInstance({ geometry: r }),
7407
- appearance: ls(this.pointSize),
7503
+ appearance: ps(this.pointSize),
7408
7504
  asynchronous: !1,
7409
7505
  allowPicking: !1
7410
7506
  });
@@ -7412,7 +7508,7 @@ var us = class {
7412
7508
  };
7413
7509
  requestAnimationFrame(s);
7414
7510
  }
7415
- }, ds = new class {
7511
+ }, hs = new class {
7416
7512
  constructor() {
7417
7513
  this.layers = /* @__PURE__ */ new Map();
7418
7514
  }
@@ -7423,7 +7519,7 @@ var us = class {
7423
7519
  let n = this.layers.get(t);
7424
7520
  return n.pointSize = e?.pointSize ?? n.pointSize, n.opacity = e?.opacity ?? n.opacity, n.colorMode = e?.colorMode ?? n.colorMode, n;
7425
7521
  }
7426
- let n = new us(e);
7522
+ let n = new ms(e);
7427
7523
  this.layers.set(t, n);
7428
7524
  try {
7429
7525
  return await n.init(), n.destroyed ? (this.layers.delete(t), null) : n;
@@ -7438,7 +7534,7 @@ var us = class {
7438
7534
  getLayer(e) {
7439
7535
  return this.layers.get(e);
7440
7536
  }
7441
- }(), fs = (e) => ds.createLayer(e), ps = (e) => ds.removeLayer(e), ms = (e) => ds.getLayer(e), hs = {
7537
+ }(), gs = (e) => hs.createLayer(e), _s = (e) => hs.removeLayer(e), vs = (e) => hs.getLayer(e), ys = {
7442
7538
  __name: "index",
7443
7539
  props: { config: {
7444
7540
  type: Object,
@@ -7458,10 +7554,10 @@ var us = class {
7458
7554
  ++a;
7459
7555
  let e = i.value;
7460
7556
  if (!e.layerId) return;
7461
- let t = ms(e.layerId);
7462
- t ? (t.pointSize = e.pointSize, t.opacity = e.opacity, t.colorMode = e.colorMode) : await fs(e);
7557
+ let t = vs(e.layerId);
7558
+ t ? (t.pointSize = e.pointSize, t.opacity = e.opacity, t.colorMode = e.colorMode) : await gs(e);
7463
7559
  }, s = () => {
7464
- ps(n.config?.layerId || i.value.layerId);
7560
+ _s(n.config?.layerId || i.value.layerId);
7465
7561
  };
7466
7562
  return w(i, () => {
7467
7563
  o();
@@ -7472,7 +7568,7 @@ var us = class {
7472
7568
  a++, s();
7473
7569
  }), (e, t) => null;
7474
7570
  }
7475
- }, gs = "__zzts3dGridPickable", _s = {
7571
+ }, bs = "__zzts3dGridPickable", xs = {
7476
7572
  __name: "index",
7477
7573
  props: { config: {
7478
7574
  type: Object,
@@ -7572,7 +7668,7 @@ var us = class {
7572
7668
  b && y.remove(b), x && y.remove(x);
7573
7669
  } catch {}
7574
7670
  try {
7575
- b && delete b[gs], x && delete x[gs];
7671
+ b && delete b[bs], x && delete x[bs];
7576
7672
  } catch {}
7577
7673
  b = null, x = null;
7578
7674
  }
@@ -7591,7 +7687,7 @@ var us = class {
7591
7687
  return t.startsWith("grid_outline_") ? t.slice(13) : t;
7592
7688
  }
7593
7689
  function j() {
7594
- b && (b[gs] = !0), x && (x[gs] = !0);
7690
+ b && (b[bs] = !0), x && (x[bs] = !0);
7595
7691
  }
7596
7692
  function M(e, t) {
7597
7693
  return Cesium.ColorGeometryInstanceAttribute.toValue(C(e, t));
@@ -7634,7 +7730,7 @@ var us = class {
7634
7730
  if (!t?.length) return null;
7635
7731
  for (let e = 0; e < t.length; e++) {
7636
7732
  let n = t[e], r = n?.primitive;
7637
- if (r && (r[gs] === !0 || r === b || r === x)) return n;
7733
+ if (r && (r[bs] === !0 || r === b || r === x)) return n;
7638
7734
  }
7639
7735
  return null;
7640
7736
  }
@@ -7780,11 +7876,11 @@ var us = class {
7780
7876
  p++, m++, v.forEach((e) => e.abort()), v.clear(), _.clear(), h = "", L();
7781
7877
  }), (e, t) => null;
7782
7878
  }
7783
- }, vs = (e, t) => {
7879
+ }, Ss = (e, t) => {
7784
7880
  let n = e.__vccOpts || e;
7785
7881
  for (let [e, r] of t) n[e] = r;
7786
7882
  return n;
7787
- }, ys = "__zzts3dGridColorPickable", bs = /*#__PURE__*/ vs({
7883
+ }, Cs = "__zzts3dGridColorPickable", ws = /*#__PURE__*/ Ss({
7788
7884
  __name: "color",
7789
7885
  props: { config: {
7790
7886
  type: Object,
@@ -7885,7 +7981,7 @@ var us = class {
7885
7981
  D && E.remove(D), O && E.remove(O);
7886
7982
  } catch {}
7887
7983
  try {
7888
- D && delete D[ys], O && delete O[ys];
7984
+ D && delete D[Cs], O && delete O[Cs];
7889
7985
  } catch {}
7890
7986
  D = null, O = null;
7891
7987
  }
@@ -7915,15 +8011,15 @@ var us = class {
7915
8011
  return Number.isFinite(r) ? r : -1;
7916
8012
  }
7917
8013
  function z() {
7918
- D && (D[ys] = !0), O && (O[ys] = !0);
8014
+ D && (D[Cs] = !0), O && (O[Cs] = !0);
7919
8015
  }
7920
8016
  function te(e, t) {
7921
8017
  return Cesium.ColorGeometryInstanceAttribute.toValue(j(e, t));
7922
8018
  }
7923
- function ne(e) {
8019
+ function B(e) {
7924
8020
  return Cesium.ColorGeometryInstanceAttribute.toValue(e);
7925
8021
  }
7926
- function B(e) {
8022
+ function V(e) {
7927
8023
  if (e == null || e < 0) return;
7928
8024
  let t = y.value, n = (S ? C.get(S) : null)?.[e];
7929
8025
  if (!n) return;
@@ -7931,7 +8027,7 @@ var us = class {
7931
8027
  try {
7932
8028
  if (D?.ready) {
7933
8029
  let e = D.getGeometryInstanceAttributes(o);
7934
- e?.color && (e.color = ne(a));
8030
+ e?.color && (e.color = B(a));
7935
8031
  }
7936
8032
  if (O?.ready) {
7937
8033
  let e = O.getGeometryInstanceAttributes(s);
@@ -7939,7 +8035,7 @@ var us = class {
7939
8035
  }
7940
8036
  } catch {}
7941
8037
  }
7942
- function V(e) {
8038
+ function ne(e) {
7943
8039
  if (e == null || e < 0) return;
7944
8040
  let t = y.value, n = te(t.highlightColor, t.highlightOpacity ?? 1), r = `grid_fill_${e}`, i = `grid_outline_${e}`;
7945
8041
  try {
@@ -7955,7 +8051,7 @@ var us = class {
7955
8051
  }
7956
8052
  function H() {
7957
8053
  let e = m.value;
7958
- e != null && (B(e), m.value = null);
8054
+ e != null && (V(e), m.value = null);
7959
8055
  }
7960
8056
  function re(e) {
7961
8057
  if (!a.value?.scene?.drillPick) return null;
@@ -7963,7 +8059,7 @@ var us = class {
7963
8059
  if (!t?.length) return null;
7964
8060
  for (let e = 0; e < t.length; e++) {
7965
8061
  let n = t[e], r = n?.primitive;
7966
- if (r && (r[ys] === !0 || r === D || r === O)) return n;
8062
+ if (r && (r[Cs] === !0 || r === D || r === O)) return n;
7967
8063
  }
7968
8064
  return null;
7969
8065
  }
@@ -7992,7 +8088,7 @@ var us = class {
7992
8088
  H(), I(), s("point-click", {});
7993
8089
  return;
7994
8090
  }
7995
- H(), m.value = r, V(r);
8091
+ H(), m.value = r, ne(r);
7996
8092
  let [o, c, l, u, d, f, p] = a;
7997
8093
  L(e.position, d, p), s("point-click", {
7998
8094
  index: r,
@@ -8071,7 +8167,7 @@ var us = class {
8071
8167
  if (n !== x || !a.value || a.value.isDestroyed()) return;
8072
8168
  ae();
8073
8169
  let e = m.value;
8074
- e != null && V(e);
8170
+ e != null && ne(e);
8075
8171
  }, h = [];
8076
8172
  D?.readyPromise && h.push(D.readyPromise), O?.readyPromise && h.push(O.readyPromise), h.length ? Promise.all(h).then(p, p) : p();
8077
8173
  }
@@ -8118,7 +8214,7 @@ var us = class {
8118
8214
  }, { deep: !0 }), w(() => y.value.queryEnabled, () => {
8119
8215
  ae();
8120
8216
  }), w(() => [y.value.highlightColor, y.value.highlightOpacity], () => {
8121
- m.value != null && V(m.value);
8217
+ m.value != null && ne(m.value);
8122
8218
  }), d(() => {}), f(() => {
8123
8219
  b++, x++, T.forEach((e) => e.abort()), T.clear(), C.clear(), S = "", oe();
8124
8220
  }), (e, t) => _.visible ? (p(), i("div", {
@@ -8130,7 +8226,7 @@ var us = class {
8130
8226
  })
8131
8227
  }, null, 4)) : r("", !0);
8132
8228
  }
8133
- }, [["__scopeId", "data-v-719d18e0"]]), xs = {
8229
+ }, [["__scopeId", "data-v-719d18e0"]]), Ts = {
8134
8230
  __name: "query",
8135
8231
  props: {
8136
8232
  config: {
@@ -8363,7 +8459,7 @@ var us = class {
8363
8459
  u++, h.forEach((e) => e.abort()), h.clear(), p.clear(), m.clear(), d = "", D();
8364
8460
  }), (e, t) => null;
8365
8461
  }
8366
- }, Ss = {
8462
+ }, Es = {
8367
8463
  __name: "interpolation",
8368
8464
  props: { config: {
8369
8465
  type: Object,
@@ -8568,7 +8664,7 @@ var us = class {
8568
8664
  o++, u.forEach((e) => e.abort()), u.clear(), l.clear(), s = "", x();
8569
8665
  }), (e, t) => null;
8570
8666
  }
8571
- }, Cs = class {
8667
+ }, Ds = class {
8572
8668
  constructor(e, t = !1, n = null, r = "255,255,255", i = "", a = 1, o = "") {
8573
8669
  this.id = e, this.dictCode = o == null ? "" : String(o), 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.serviceType = i, this.opacity = a, this.fixedLevel = n, this.levels_add = window.levels_add_plus || 0, this.tileColor = r, this.tileSleepTime = window.tileSleepTime || 400;
8574
8670
  }
@@ -8946,7 +9042,7 @@ var us = class {
8946
9042
  }
8947
9043
  });
8948
9044
  }
8949
- }, ws = new class {
9045
+ }, Os = new class {
8950
9046
  constructor() {
8951
9047
  this.layers = /* @__PURE__ */ new Map();
8952
9048
  }
@@ -8962,7 +9058,7 @@ var us = class {
8962
9058
  }
8963
9059
  return i && (typeof e.clearAllTiles == "function" && e.clearAllTiles(), typeof e.getViewportInfo == "function" && e.getViewportInfo()), this.layers.get(t);
8964
9060
  }
8965
- let c = new Cs(t, i, r, n, a, o, s);
9061
+ let c = new Ds(t, i, r, n, a, o, s);
8966
9062
  return await c.init(), this.layers.set(t, c), c;
8967
9063
  }
8968
9064
  removeLayer(e) {
@@ -8986,20 +9082,20 @@ var us = class {
8986
9082
  let t = this.layers.get(e);
8987
9083
  t && t.getViewportInfo();
8988
9084
  }
8989
- }(), Ts = async (e) => ws.createLayer(e, !1), Es = (e) => {
8990
- ws.removeLayer(e);
9085
+ }(), ks = async (e) => Os.createLayer(e, !1), As = (e) => {
9086
+ Os.removeLayer(e);
8991
9087
  };
8992
9088
  t(() => {
8993
- let e = ws.getLayerIds();
9089
+ let e = Os.getLayerIds();
8994
9090
  if (e.length > 0) {
8995
- let t = ws.getLayer(e[0]);
9091
+ let t = Os.getLayer(e[0]);
8996
9092
  return t ? t.getCurrentLevel() : 15;
8997
9093
  }
8998
9094
  return 15;
8999
9095
  });
9000
9096
  //#endregion
9001
9097
  //#region src/zz-layer/zz-layer-zzts3dtype/index.vue
9002
- var Ds = {
9098
+ var js = {
9003
9099
  __name: "index",
9004
9100
  props: { config: {
9005
9101
  type: Object,
@@ -9030,7 +9126,7 @@ var Ds = {
9030
9126
  console.error("创建图层失败:缺少id参数", i.value);
9031
9127
  return;
9032
9128
  }
9033
- Ts({
9129
+ ks({
9034
9130
  id: e,
9035
9131
  layerId: i.value.layerId || "",
9036
9132
  dictCode: i.value.layerId || "",
@@ -9041,7 +9137,7 @@ var Ds = {
9041
9137
  opacity: i.value.opacity
9042
9138
  });
9043
9139
  }, s = () => {
9044
- Es(a());
9140
+ As(a());
9045
9141
  };
9046
9142
  return w(i, () => {
9047
9143
  o();
@@ -9051,7 +9147,7 @@ var Ds = {
9051
9147
  console.log("组件卸载,开始清理资源..."), s();
9052
9148
  }), (e, t) => null;
9053
9149
  }
9054
- }, Os = {
9150
+ }, Ms = {
9055
9151
  __name: "index",
9056
9152
  props: { config: {
9057
9153
  type: Object,
@@ -9089,7 +9185,7 @@ var Ds = {
9089
9185
  e && u();
9090
9186
  }), (e, t) => null;
9091
9187
  }
9092
- }, ks = {
9188
+ }, Ns = {
9093
9189
  excavations: [],
9094
9190
  globalStyle: {
9095
9191
  show: !0,
@@ -9116,38 +9212,38 @@ var Ds = {
9116
9212
  maxArea: 5e3 * 1e3 * 1e3,
9117
9213
  maxPerimeter: 5e3 * 1e3
9118
9214
  }
9119
- }, As = (e = {}) => ({
9120
- ...ks,
9215
+ }, Ps = (e = {}) => ({
9216
+ ...Ns,
9121
9217
  ...e,
9122
9218
  globalStyle: {
9123
- ...ks.globalStyle,
9219
+ ...Ns.globalStyle,
9124
9220
  ...e.globalStyle
9125
9221
  },
9126
9222
  limits: {
9127
- ...ks.limits,
9223
+ ...Ns.limits,
9128
9224
  ...e.limits
9129
9225
  },
9130
9226
  excavations: e.excavations || []
9131
- }), js = (e, t, n = 1) => {
9227
+ }), Fs = (e, t, n = 1) => {
9132
9228
  try {
9133
9229
  return D.Color.fromCssColorString(e).withAlpha(n);
9134
9230
  } catch {
9135
9231
  return D.Color.fromCssColorString(t).withAlpha(n);
9136
9232
  }
9137
- }, Ms = (e, t, n, r, i) => e ? D.Material.fromType("Image", {
9233
+ }, Is = (e, t, n, r, i) => e ? D.Material.fromType("Image", {
9138
9234
  image: e,
9139
9235
  color: D.Color.WHITE.withAlpha(n),
9140
9236
  repeat: i || new D.Cartesian2(1, 1)
9141
- }) : D.Material.fromType("Color", { color: js(t, r, n) }), Ns = (e) => {
9237
+ }) : D.Material.fromType("Color", { color: Fs(t, r, n) }), Ls = (e) => {
9142
9238
  if (e.length < 2) return 0;
9143
9239
  let t = 0;
9144
9240
  for (let n = 0; n < e.length - 1; n += 1) t += D.Cartesian3.distance(e[n], e[n + 1]);
9145
9241
  return t;
9146
- }, Ps = (e, t) => {
9242
+ }, Rs = (e, t) => {
9147
9243
  if (!e) return;
9148
- let n = Ns(t), r = Math.max(Math.ceil(n / 100), 1);
9244
+ let n = Ls(t), r = Math.max(Math.ceil(n / 100), 1);
9149
9245
  return new D.Cartesian2(r, 1);
9150
- }, Fs = (e, t, n, r = !1) => {
9246
+ }, zs = (e, t, n, r = !1) => {
9151
9247
  let i = r ? {
9152
9248
  perPositionHeight: !1,
9153
9249
  heightReference: D.HeightReference.CLAMP_TO_GROUND
@@ -9167,7 +9263,7 @@ var Ds = {
9167
9263
  clampToGround: r
9168
9264
  }
9169
9265
  });
9170
- }, Is = (e, t, n = !1) => {
9266
+ }, Bs = (e, t, n = !1) => {
9171
9267
  let r = n ? {
9172
9268
  perPositionHeight: !1,
9173
9269
  heightReference: D.HeightReference.CLAMP_TO_GROUND
@@ -9187,19 +9283,19 @@ var Ds = {
9187
9283
  clampToGround: n
9188
9284
  }
9189
9285
  });
9190
- }, Ls = async (e = 260) => {
9286
+ }, Vs = async (e = 260) => {
9191
9287
  await new Promise((t) => window.setTimeout(t, e));
9192
- }, Rs = (e, t = e.height || 0) => D.Cartesian3.fromDegrees(e.lng, e.lat, t), zs = (e) => D.Cartesian3.fromDegrees(e.lng, e.lat), Bs = (e, t) => D.Math.equalsEpsilon(e.lng, t.lng, D.Math.EPSILON12) && D.Math.equalsEpsilon(e.lat, t.lat, D.Math.EPSILON12), Vs = (e) => {
9288
+ }, Hs = (e, t = e.height || 0) => D.Cartesian3.fromDegrees(e.lng, e.lat, t), Us = (e) => D.Cartesian3.fromDegrees(e.lng, e.lat), Ws = (e, t) => D.Math.equalsEpsilon(e.lng, t.lng, D.Math.EPSILON12) && D.Math.equalsEpsilon(e.lat, t.lat, D.Math.EPSILON12), Gs = (e) => {
9193
9289
  let t = e.reduce((e, t) => {
9194
9290
  let n = e.at(-1);
9195
- return (!n || !Bs(n, t)) && e.push(t), e;
9291
+ return (!n || !Ws(n, t)) && e.push(t), e;
9196
9292
  }, []);
9197
- return t.length > 1 && Bs(t[0], t[t.length - 1]) && t.pop(), t;
9198
- }, Hs = (e) => e <= 50 ? 5 : e <= 200 ? 10 : e <= 1e3 ? 20 : 50, Us = (e) => {
9199
- let t = Hs(e);
9293
+ return t.length > 1 && Ws(t[0], t[t.length - 1]) && t.pop(), t;
9294
+ }, Ks = (e) => e <= 50 ? 5 : e <= 200 ? 10 : e <= 1e3 ? 20 : 50, qs = (e) => {
9295
+ let t = Ks(e);
9200
9296
  return Math.min(Math.max(Math.ceil(e / t), 1), 800);
9201
- }, Ws = (e) => e.map((t, n) => {
9202
- 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 = Us(o.surfaceDistance), c = [t];
9297
+ }, Js = (e) => e.map((t, n) => {
9298
+ 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 = qs(o.surfaceDistance), c = [t];
9203
9299
  for (let e = 1; e < s; e += 1) {
9204
9300
  let n = e / s, i = o.interpolateUsingFraction(n);
9205
9301
  c.push({
@@ -9209,10 +9305,10 @@ var Ds = {
9209
9305
  });
9210
9306
  }
9211
9307
  return c.push(r), { points: c };
9212
- }), Gs = (e) => e.flatMap((t, n) => {
9308
+ }), Ys = (e) => e.flatMap((t, n) => {
9213
9309
  let r = n === 0 ? t.points : t.points.slice(1);
9214
- return n === e.length - 1 && r.length > 0 && Bs(r[r.length - 1], e[0].points[0]) ? r.slice(0, -1) : r;
9215
- }), Ks = (e) => {
9310
+ return n === e.length - 1 && r.length > 0 && Ws(r[r.length - 1], e[0].points[0]) ? r.slice(0, -1) : r;
9311
+ }), Xs = (e) => {
9216
9312
  if (e.length < 2) return 0;
9217
9313
  let t = 0;
9218
9314
  for (let n = 0; n < e.length; n += 1) {
@@ -9220,10 +9316,10 @@ var Ds = {
9220
9316
  t += s.surfaceDistance;
9221
9317
  }
9222
9318
  return t;
9223
- }, qs = (e) => {
9319
+ }, Zs = (e) => {
9224
9320
  if (e.length < 3) return 0;
9225
9321
  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) => {
9226
- let i = Js(e.lng, t);
9322
+ let i = Qs(e.lng, t);
9227
9323
  return {
9228
9324
  x: D.Math.toRadians(i) * r * Math.cos(n),
9229
9325
  y: D.Math.toRadians(e.lat) * r
@@ -9234,20 +9330,20 @@ var Ds = {
9234
9330
  a += t.x * n.y - n.x * t.y;
9235
9331
  }
9236
9332
  return Math.abs(a) / 2;
9237
- }, Js = (e, t) => {
9333
+ }, Qs = (e, t) => {
9238
9334
  let n = e;
9239
9335
  for (; n - t > 180;) n -= 360;
9240
9336
  for (; n - t < -180;) n += 360;
9241
9337
  return n;
9242
- }, Ys = (e) => e >= 1e3 ? `${(e / 1e3).toFixed(2)}公里` : `${Math.round(e)}米`, Xs = (e) => e >= 1e3 * 1e3 ? `${(e / 1e3 / 1e3).toFixed(2)}平方公里` : `${Math.round(e)}平方米`, Zs = (e, t) => {
9243
- let n = qs(e);
9244
- if (t.maxArea > 0 && n > t.maxArea) return `绘制区域过大,面积约 ${Xs(n)},已超过 ${Xs(t.maxArea)},请缩小范围或分块开挖`;
9245
- let r = Ks(e);
9246
- return t.maxPerimeter > 0 && r > t.maxPerimeter ? `绘制区域过大,周长约 ${Ys(r)},已超过 ${Ys(t.maxPerimeter)},请缩小范围或分块开挖` : "";
9247
- }, Qs = (e, t) => {
9338
+ }, $s = (e) => e >= 1e3 ? `${(e / 1e3).toFixed(2)}公里` : `${Math.round(e)}米`, ec = (e) => e >= 1e3 * 1e3 ? `${(e / 1e3 / 1e3).toFixed(2)}平方公里` : `${Math.round(e)}平方米`, tc = (e, t) => {
9339
+ let n = Zs(e);
9340
+ if (t.maxArea > 0 && n > t.maxArea) return `绘制区域过大,面积约 ${ec(n)},已超过 ${ec(t.maxArea)},请缩小范围或分块开挖`;
9341
+ let r = Xs(e);
9342
+ return t.maxPerimeter > 0 && r > t.maxPerimeter ? `绘制区域过大,周长约 ${$s(r)},已超过 ${$s(t.maxPerimeter)},请缩小范围或分块开挖` : "";
9343
+ }, nc = (e, t) => {
9248
9344
  let n = t[0], r = 0;
9249
9345
  return e.map((i, a) => {
9250
- let o = a === e.length - 1 && i.points.length > 0 && e[0].points.length > 0 && Bs(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);
9346
+ let o = a === e.length - 1 && i.points.length > 0 && e[0].points.length > 0 && Ws(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);
9251
9347
  if (r += s, a === 0) return o ? [...c, n] : c;
9252
9348
  let l = t[r - s - 1];
9253
9349
  return o ? [
@@ -9256,10 +9352,10 @@ var Ds = {
9256
9352
  n
9257
9353
  ] : [l, ...c];
9258
9354
  });
9259
- }, $s = (e, t) => {
9355
+ }, rc = (e, t) => {
9260
9356
  let n = Math.min(...e);
9261
9357
  return e.map(() => n - t);
9262
- }, ec = (e, t, n) => ({
9358
+ }, ic = (e, t, n) => ({
9263
9359
  id: e.id || n(),
9264
9360
  positions: e.positions || [],
9265
9361
  height: e.height ?? t.height,
@@ -9276,12 +9372,12 @@ var Ds = {
9276
9372
  showSide: e.showSide ?? t.showSide,
9277
9373
  showBottom: e.showBottom ?? t.showBottom,
9278
9374
  showEdge: e.showEdge ?? t.showEdge
9279
- }), tc = (e, t) => {
9375
+ }), ac = (e, t) => {
9280
9376
  e.clippingPolygons = t;
9281
- }, nc = (e) => new D.ClippingPolygon({ positions: e.map((e) => zs(e)) }), rc = (e) => new D.ClippingPolygonCollection({
9282
- polygons: e.filter((e) => e.length >= 3).map(nc),
9377
+ }, oc = (e) => new D.ClippingPolygon({ positions: e.map((e) => Us(e)) }), sc = (e) => new D.ClippingPolygonCollection({
9378
+ polygons: e.filter((e) => e.length >= 3).map(oc),
9283
9379
  inverse: !1
9284
- }), ic = (e, t, n, r, i) => {
9380
+ }), cc = (e, t, n, r, i) => {
9285
9381
  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) => {
9286
9382
  let i = e(), a = t(), o = r.map((e) => D.Cartographic.fromDegrees(e.lng, e.lat));
9287
9383
  if (i && a.sampleTerrain && !(i.terrainProvider instanceof D.EllipsoidTerrainProvider)) try {
@@ -9293,7 +9389,7 @@ var Ds = {
9293
9389
  let n = o[t], r = i?.scene.globe.getHeight(n);
9294
9390
  return e.height ?? r ?? 0;
9295
9391
  });
9296
- }, m = (e) => ec(e, t().globalStyle, f), h = (e) => {
9392
+ }, m = (e) => ic(e, t().globalStyle, f), h = (e) => {
9297
9393
  let n = t();
9298
9394
  return JSON.stringify({
9299
9395
  item: e,
@@ -9307,9 +9403,9 @@ var Ds = {
9307
9403
  e.height ?? null
9308
9404
  ])), n = s.get(t);
9309
9405
  if (n) return n;
9310
- let r = Ws(e), i = {
9406
+ let r = Js(e), i = {
9311
9407
  renderBoundarySegments: r,
9312
- renderBoundaryPositions: Gs(r),
9408
+ renderBoundaryPositions: Ys(r),
9313
9409
  clipBoundaryPositions: e,
9314
9410
  bottomBoundaryPositions: e
9315
9411
  };
@@ -9322,13 +9418,13 @@ var Ds = {
9322
9418
  y();
9323
9419
  return;
9324
9420
  }
9325
- l ||= (c = n.scene.globe.clippingPolygons, !0), tc(n.scene.globe, rc(i)), n.scene.requestRender();
9421
+ l ||= (c = n.scene.globe.clippingPolygons, !0), ac(n.scene.globe, sc(i)), n.scene.requestRender();
9326
9422
  }, v = () => {
9327
9423
  let n = e(), r = t();
9328
9424
  n && (d ||= (u = n.scene.globe.depthTestAgainstTerrain, !0), n.scene.globe.depthTestAgainstTerrain = r.depthTestAgainstTerrain, n.scene.requestRender());
9329
9425
  }, y = () => {
9330
9426
  let t = e();
9331
- t && (l &&= (tc(t.scene.globe, c || void 0), c = null, !1), t.scene.requestRender());
9427
+ t && (l &&= (ac(t.scene.globe, c || void 0), c = null, !1), t.scene.requestRender());
9332
9428
  }, b = () => {
9333
9429
  let t = e();
9334
9430
  !t || !d || (t.scene.globe.depthTestAgainstTerrain = u, d = !1, t.scene.requestRender());
@@ -9338,10 +9434,10 @@ var Ds = {
9338
9434
  }, S = async (r) => {
9339
9435
  let a = e();
9340
9436
  if (!a) return null;
9341
- let o = m(r), s = Vs(o.positions);
9437
+ let o = m(r), s = Gs(o.positions);
9342
9438
  if (!s || s.length < 3) return n("excavation-error", /* @__PURE__ */ Error("地形开挖至少需要 3 个多边形点位")), null;
9343
9439
  let c = (e) => {
9344
- let r = Is(a, s.map((e) => Rs(e, e.height || 0)), t().depthTestAgainstTerrain);
9440
+ let r = Bs(a, s.map((e) => Hs(e, e.height || 0)), t().depthTestAgainstTerrain);
9345
9441
  return r.show = o.show, a.scene.requestRender(), n("excavation-error", Error(e)), P.warning(e), {
9346
9442
  item: {
9347
9443
  ...o,
@@ -9351,14 +9447,14 @@ var Ds = {
9351
9447
  primitives: [],
9352
9448
  terrainClipEnabled: !1
9353
9449
  };
9354
- }, l = Zs(s, t().limits);
9450
+ }, l = tc(s, t().limits);
9355
9451
  if (l) return c(l);
9356
- let { renderBoundarySegments: u, renderBoundaryPositions: d, bottomBoundaryPositions: f } = g(s), h = Fs(a, o.id, s.map((e) => Rs(e, e.height || 0)), t().depthTestAgainstTerrain);
9452
+ let { renderBoundarySegments: u, renderBoundaryPositions: d, bottomBoundaryPositions: f } = g(s), h = zs(a, o.id, s.map((e) => Hs(e, e.height || 0)), t().depthTestAgainstTerrain);
9357
9453
  a.scene.requestRender();
9358
9454
  let _ = [], v = [];
9359
9455
  try {
9360
- await Promise.all([Ls(), i?.() || Promise.resolve()]);
9361
- let e = await p(d), t = $s(e, o.height), n = Math.min(...e) - o.height, r = f.map((e) => Rs(e, n)), s = d.map((t, n) => Rs(t, e[n])), c = Qs(u, e), l = Qs(u, t), m = D.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, h = {
9456
+ await Promise.all([Vs(), i?.() || Promise.resolve()]);
9457
+ let e = await p(d), t = rc(e, o.height), n = Math.min(...e) - o.height, r = f.map((e) => Hs(e, n)), s = d.map((t, n) => Hs(t, e[n])), c = nc(u, e), l = nc(u, t), m = D.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, h = {
9362
9458
  depthTest: { enabled: !0 },
9363
9459
  depthMask: !0
9364
9460
  };
@@ -9374,7 +9470,7 @@ var Ds = {
9374
9470
  })
9375
9471
  }),
9376
9472
  appearance: new D.MaterialAppearance({
9377
- material: Ms(o.bottomTexture, o.bottomColor, o.bottomOpacity, ks.globalStyle.bottomColor),
9473
+ material: Is(o.bottomTexture, o.bottomColor, o.bottomOpacity, Ns.globalStyle.bottomColor),
9378
9474
  materialSupport: D.MaterialAppearance.MaterialSupport.TEXTURED,
9379
9475
  faceForward: !0,
9380
9476
  renderState: h
@@ -9384,7 +9480,7 @@ var Ds = {
9384
9480
  v.push(e);
9385
9481
  }
9386
9482
  if (o.showSide) for (let e = 0; e < u.length; e += 1) {
9387
- let t = u[e].points.map((e) => Rs(e)), n = l[e], r = c[e], i = Ps(o.sideTexture, t), s = a.scene.primitives.add(new D.Primitive({
9483
+ let t = u[e].points.map((e) => Hs(e)), n = l[e], r = c[e], i = Rs(o.sideTexture, t), s = a.scene.primitives.add(new D.Primitive({
9388
9484
  show: !1,
9389
9485
  geometryInstances: new D.GeometryInstance({
9390
9486
  id: `${o.id}-wall-${e}`,
@@ -9396,7 +9492,7 @@ var Ds = {
9396
9492
  })
9397
9493
  }),
9398
9494
  appearance: new D.MaterialAppearance({
9399
- material: Ms(o.sideTexture, o.sideColor, o.sideOpacity, ks.globalStyle.bottomColor, i),
9495
+ material: Is(o.sideTexture, o.sideColor, o.sideOpacity, Ns.globalStyle.bottomColor, i),
9400
9496
  materialSupport: D.MaterialAppearance.MaterialSupport.TEXTURED,
9401
9497
  faceForward: !0,
9402
9498
  renderState: h
@@ -9412,7 +9508,7 @@ var Ds = {
9412
9508
  polyline: {
9413
9509
  positions: e,
9414
9510
  width: o.edgeWidth,
9415
- material: js(o.edgeColor, ks.globalStyle.bottomColor, o.edgeOpacity),
9511
+ material: Fs(o.edgeColor, Ns.globalStyle.bottomColor, o.edgeOpacity),
9416
9512
  clampToGround: !1
9417
9513
  }
9418
9514
  });
@@ -9481,7 +9577,7 @@ var Ds = {
9481
9577
  for (let t of i.excavations) {
9482
9578
  let n = m(t), r = {
9483
9579
  ...n,
9484
- positions: Vs(n.positions)
9580
+ positions: Gs(n.positions)
9485
9581
  }, i = h(r), o = r.id;
9486
9582
  s.add(o);
9487
9583
  let c = a.get(o);
@@ -9528,7 +9624,7 @@ var Ds = {
9528
9624
  restoreDepthTestAgainstTerrain: b,
9529
9625
  getMethods: A
9530
9626
  };
9531
- }, ac = /* @__PURE__ */ s({
9627
+ }, lc = /* @__PURE__ */ s({
9532
9628
  __name: "index",
9533
9629
  props: { config: {} },
9534
9630
  emits: [
@@ -9539,7 +9635,7 @@ var Ds = {
9539
9635
  "excavation-error"
9540
9636
  ],
9541
9637
  setup(e, { expose: n, emit: r }) {
9542
- let i = c("cesiumViewer"), a = r, o = e, s = t(() => As(o.config)), l = () => i?.value, u = () => {
9638
+ let i = c("cesiumViewer"), a = r, o = e, s = t(() => Ps(o.config)), l = () => i?.value, u = () => {
9543
9639
  let e = l();
9544
9640
  return e ? !(e.terrainProvider instanceof D.EllipsoidTerrainProvider) : !1;
9545
9641
  }, d = t(() => JSON.stringify({
@@ -9557,7 +9653,7 @@ var Ds = {
9557
9653
  });
9558
9654
  }, b = () => {
9559
9655
  !v() || _.size === 0 || (_.forEach((e) => e()), _.clear());
9560
- }, x = ic(l, () => s.value, p, () => m, y);
9656
+ }, x = cc(l, () => s.value, p, () => m, y);
9561
9657
  m = x.getMethods();
9562
9658
  let S = async (e) => {
9563
9659
  l() && await x.syncExcavations(e);
@@ -9585,7 +9681,7 @@ var Ds = {
9585
9681
  _.clear(), h?.(), h = null, x.clearExcavations(), x.restoreDepthTestAgainstTerrain();
9586
9682
  }), n(m), (e, t) => null;
9587
9683
  }
9588
- }), oc = {
9684
+ }), uc = {
9589
9685
  __name: "index",
9590
9686
  props: {
9591
9687
  config: {
@@ -9653,7 +9749,7 @@ var Ds = {
9653
9749
  p();
9654
9750
  }), (e, t) => null;
9655
9751
  }
9656
- }, sc = {
9752
+ }, dc = {
9657
9753
  __name: "index",
9658
9754
  props: { config: {
9659
9755
  type: Object,
@@ -9717,7 +9813,7 @@ var Ds = {
9717
9813
  u();
9718
9814
  }), (e, t) => null;
9719
9815
  }
9720
- }, cc = {
9816
+ }, fc = {
9721
9817
  __name: "index",
9722
9818
  props: { config: {
9723
9819
  type: Object,
@@ -9906,7 +10002,7 @@ var Ds = {
9906
10002
  b();
9907
10003
  }), (e, t) => null;
9908
10004
  }
9909
- }, lc = {
10005
+ }, pc = {
9910
10006
  __name: "index",
9911
10007
  props: { config: {
9912
10008
  type: Object,
@@ -10093,7 +10189,7 @@ var Ds = {
10093
10189
  b();
10094
10190
  }), (e, t) => null;
10095
10191
  }
10096
- }, uc = {
10192
+ }, mc = {
10097
10193
  __name: "index",
10098
10194
  props: { config: {
10099
10195
  type: Object,
@@ -10293,16 +10389,16 @@ var Ds = {
10293
10389
  b();
10294
10390
  }), (e, t) => null;
10295
10391
  }
10296
- }, dc = { class: "legend-panel__header" }, fc = { class: "legend-panel__title" }, pc = { class: "legend-panel__body" }, mc = {
10392
+ }, hc = { class: "legend-panel__header" }, gc = { class: "legend-panel__title" }, _c = { class: "legend-panel__body" }, vc = {
10297
10393
  key: 0,
10298
10394
  class: "legend-panel__multiband"
10299
- }, hc = { class: "legend-panel__multiband-labels" }, gc = { class: "legend-panel__multiband-label legend-panel__multiband-label--top" }, _c = { class: "legend-panel__multiband-label legend-panel__multiband-label--bottom" }, vc = {
10395
+ }, yc = { class: "legend-panel__multiband-labels" }, bc = { class: "legend-panel__multiband-label legend-panel__multiband-label--top" }, xc = { class: "legend-panel__multiband-label legend-panel__multiband-label--bottom" }, Sc = {
10300
10396
  key: 1,
10301
10397
  class: "legend-panel__list"
10302
- }, yc = {
10398
+ }, Cc = {
10303
10399
  key: 0,
10304
10400
  class: "legend-panel__symbol legend-panel__symbol--line"
10305
- }, bc = { class: "legend-panel__label" }, xc = /* @__PURE__ */ s({
10401
+ }, wc = { class: "legend-panel__label" }, Tc = /* @__PURE__ */ s({
10306
10402
  __name: "index",
10307
10403
  props: {
10308
10404
  visible: { type: Boolean },
@@ -10362,7 +10458,7 @@ var Ds = {
10362
10458
  strokeVisible: o
10363
10459
  };
10364
10460
  }, te = (e) => {
10365
- let t = e.color || B(e.r, e.g, e.b) || "#409EFF", { outlineColor: n, strokeType: r, outlineWidth: i } = z(e, "line"), a = t || n, o = Math.max(2, i);
10461
+ let t = e.color || V(e.r, e.g, e.b) || "#409EFF", { outlineColor: n, strokeType: r, outlineWidth: i } = z(e, "line"), a = t || n, o = Math.max(2, i);
10366
10462
  return r === "dashed" ? {
10367
10463
  width: "22px",
10368
10464
  height: `${o}px`,
@@ -10372,14 +10468,14 @@ var Ds = {
10372
10468
  height: `${o}px`,
10373
10469
  backgroundColor: a
10374
10470
  };
10375
- }, ne = (e) => {
10376
- let t = P(e), n = e.color || B(e.r, e.g, e.b) || "#cccccc", { outlineColor: r, strokeType: i, outlineWidth: a, strokeVisible: o } = z(e, t);
10471
+ }, B = (e) => {
10472
+ let t = P(e), n = e.color || V(e.r, e.g, e.b) || "#cccccc", { outlineColor: r, strokeType: i, outlineWidth: a, strokeVisible: o } = z(e, t);
10377
10473
  return {
10378
10474
  backgroundColor: n,
10379
10475
  border: o ? `${Math.max(2, a)}px ${i === "dashed" ? "dashed" : "solid"} ${r}` : "none",
10380
10476
  boxSizing: "border-box"
10381
10477
  };
10382
- }, B = (e, t, n) => {
10478
+ }, V = (e, t, n) => {
10383
10479
  let r = (e) => Math.max(0, Math.min(255, Number(e) || 0)).toString(16).padStart(2, "0");
10384
10480
  return e == null && t == null && n == null ? "" : `#${r(e)}${r(t)}${r(n)}`;
10385
10481
  };
@@ -10388,7 +10484,7 @@ var Ds = {
10388
10484
  return s.visible ? (p(), i("div", {
10389
10485
  key: 0,
10390
10486
  class: l(["legend-panel", g.value])
10391
- }, [a("div", dc, [a("span", fc, x(v.value), 1), o(f, {
10487
+ }, [a("div", hc, [a("span", gc, x(v.value), 1), o(f, {
10392
10488
  text: "",
10393
10489
  size: "small",
10394
10490
  class: "legend-panel__toggle",
@@ -10399,22 +10495,22 @@ var Ds = {
10399
10495
  _: 1
10400
10496
  })]),
10401
10497
  _: 1
10402
- })]), a("div", pc, [c[1] ||= a("div", { class: "legend-panel__section-title" }, "图例", -1), S.value && w.value ? (p(), i("div", mc, [a("div", {
10498
+ })]), a("div", _c, [c[1] ||= a("div", { class: "legend-panel__section-title" }, "图例", -1), S.value && w.value ? (p(), i("div", vc, [a("div", {
10403
10499
  class: "legend-panel__multiband-bar",
10404
10500
  style: u(M.value)
10405
- }, null, 4), a("div", hc, [a("div", gc, x(w.value.MultibandValueNameTop), 1), a("div", _c, x(w.value.MultibandValueNameBot), 1)])])) : D.value.length ? (p(), i("div", vc, [(p(!0), i(e, null, _(D.value, (e, t) => (p(), i("div", {
10501
+ }, null, 4), a("div", yc, [a("div", bc, x(w.value.MultibandValueNameTop), 1), a("div", xc, x(w.value.MultibandValueNameBot), 1)])])) : D.value.length ? (p(), i("div", Sc, [(p(!0), i(e, null, _(D.value, (e, t) => (p(), i("div", {
10406
10502
  key: L(e, t),
10407
10503
  class: l(["legend-panel__item", { "is-item-hidden": O.value && A(e) }])
10408
10504
  }, [
10409
- P(e) === "line" ? (p(), i("div", yc, [a("span", {
10505
+ P(e) === "line" ? (p(), i("div", Cc, [a("span", {
10410
10506
  class: "legend-panel__line-bar",
10411
10507
  style: u(te(e))
10412
10508
  }, null, 4)])) : (p(), i("div", {
10413
10509
  key: 1,
10414
10510
  class: l(["legend-panel__symbol", N(e)]),
10415
- style: u(ne(e))
10511
+ style: u(B(e))
10416
10512
  }, null, 6)),
10417
- a("div", bc, x(e.valueName || "-"), 1),
10513
+ a("div", wc, x(e.valueName || "-"), 1),
10418
10514
  O.value ? (p(), n(m, {
10419
10515
  key: 2,
10420
10516
  content: A(e) ? "显示" : "隐藏",
@@ -10437,8 +10533,8 @@ var Ds = {
10437
10533
  }))])], 2)) : r("", !0);
10438
10534
  };
10439
10535
  }
10440
- }), Sc = (e) => {
10441
- e.component("zzViewer", ve), e.component("zz-viewer", ve), e.component("zzLayerWmts", Me), e.component("zz-layer-wmts", Me), e.component("zzLayerXyz", Ne), e.component("zz-layer-xyz", Ne), e.component("zzLayerWms", Pe), e.component("zz-layer-wms", Pe), e.component("zzLayerZzts", Ie), e.component("zz-layer-zzts", Ie), e.component("zzLayerZzts3d", $a), e.component("zz-layer-zzts3d", $a), e.component("zzLayerZzts3dv2", fo), e.component("zz-layer-zzts3dv2", fo), e.component("zzLayerShpZzts", Eo), e.component("zz-layer-shp-zzts", Eo), e.component("zzLayerZzts3dPoint", Uo), e.component("zz-layer-zzts3d-point", Uo), e.component("zzLayerZzts3dPointQuery", Wo), e.component("zz-layer-zzts3d-point-query", Wo), e.component("zzLayerZzts3dLas", hs), e.component("zz-layer-zzts3d-las", hs), e.component("zzLayerZzts3dGrid", _s), e.component("zz-layer-zzts3d-grid", _s), e.component("zzLayerZzts3dGridColor", bs), e.component("zz-layer-zzts3d-grid-color", bs), e.component("zzLayerZzts3dGridQuery", xs), e.component("zz-layer-zzts3d-grid-query", xs), e.component("zzLayerZzts3dGridInterpolation", Ss), e.component("zz-layer-zzts3d-grid-interpolation", Ss), e.component("zzLayerZzts3dtwintype", Ds), e.component("zz-layer-zzts3dtwintype", Ds), e.component("zzLayerGeojson", Xe), e.component("zz-layer-geojson", Xe), e.component("zzLayerMvt", $e), e.component("zz-layer-mvt", $e), e.component("zzTerrain", Os), e.component("zz-terrain", Os), e.component("zzTerrainExcavation", ac), e.component("zz-terrain-excavation", ac), e.component("zz3dtiles", oc), e.component("zz-3dtiles", oc), e.component("zzGltf", sc), e.component("zz-gltf", sc), e.component("zzEntityPoint", cc), e.component("zz-entity-point", cc), e.component("zzEntityPolyline", lc), e.component("zz-entity-polyline", lc), e.component("zzEntityPolygon", uc), e.component("zz-entity-polygon", uc), e.component("zzLegend", xc), e.component("zz-legend", xc);
10536
+ }), Ec = (e) => {
10537
+ e.component("zzViewer", ve), e.component("zz-viewer", ve), e.component("zzLayerWmts", Me), e.component("zz-layer-wmts", Me), e.component("zzLayerXyz", Ne), e.component("zz-layer-xyz", Ne), e.component("zzLayerWms", Pe), e.component("zz-layer-wms", Pe), e.component("zzLayerZzts", Ie), e.component("zz-layer-zzts", Ie), e.component("zzLayerZzts3d", $a), e.component("zz-layer-zzts3d", $a), e.component("zzLayerZzts3dv2", fo), e.component("zz-layer-zzts3dv2", fo), e.component("zzLayerShpZzts", Ao), e.component("zz-layer-shp-zzts", Ao), e.component("zzLayerZzts3dPoint", qo), e.component("zz-layer-zzts3d-point", qo), e.component("zzLayerZzts3dPointQuery", Jo), e.component("zz-layer-zzts3d-point-query", Jo), e.component("zzLayerZzts3dLas", ys), e.component("zz-layer-zzts3d-las", ys), e.component("zzLayerZzts3dGrid", xs), e.component("zz-layer-zzts3d-grid", xs), e.component("zzLayerZzts3dGridColor", ws), e.component("zz-layer-zzts3d-grid-color", ws), e.component("zzLayerZzts3dGridQuery", Ts), e.component("zz-layer-zzts3d-grid-query", Ts), e.component("zzLayerZzts3dGridInterpolation", Es), e.component("zz-layer-zzts3d-grid-interpolation", Es), e.component("zzLayerZzts3dtwintype", js), e.component("zz-layer-zzts3dtwintype", js), e.component("zzLayerGeojson", Xe), e.component("zz-layer-geojson", Xe), e.component("zzLayerMvt", $e), e.component("zz-layer-mvt", $e), e.component("zzTerrain", Ms), e.component("zz-terrain", Ms), e.component("zzTerrainExcavation", lc), e.component("zz-terrain-excavation", lc), e.component("zz3dtiles", uc), e.component("zz-3dtiles", uc), e.component("zzGltf", dc), e.component("zz-gltf", dc), e.component("zzEntityPoint", fc), e.component("zz-entity-point", fc), e.component("zzEntityPolyline", pc), e.component("zz-entity-polyline", pc), e.component("zzEntityPolygon", mc), e.component("zz-entity-polygon", mc), e.component("zzLegend", Tc), e.component("zz-legend", Tc);
10442
10538
  };
10443
10539
  //#endregion
10444
- export { L as LAYER_TYPE_BAND, he as addImageryLayerWithStackIndex, ge as addPrimitiveWithStackIndex, fe as applyImageryStackIndex, me as applyPrimitiveStackIndex, Sc as default, ie as moveImageryLayerToIndex, pe as moveImageryLayersToStackIndex, oe as movePrimitiveToIndex, ue as scheduleImageryLayerStackSync, de as schedulePrimitiveStackSync, se as syncImageryLayerStack, U as syncPrimitiveStack, H as tagImageryLayerStackMeta, re as tagPrimitiveStackMeta, oc as zz3dtiles, cc as zzEntityPoint, uc as zzEntityPolygon, lc as zzEntityPolyline, sc as zzGltf, Xe as zzLayerGeojson, $e as zzLayerMvt, Eo as zzLayerShpZzts, Pe as zzLayerWms, Me as zzLayerWmts, Ne as zzLayerXyz, Ie as zzLayerZzts, xc as zzLegendPanel, Os as zzTerrain, ac as zzTerrainExcavation, ve as zzViewer };
10540
+ export { L as LAYER_TYPE_BAND, he as addImageryLayerWithStackIndex, ge as addPrimitiveWithStackIndex, fe as applyImageryStackIndex, me as applyPrimitiveStackIndex, Ec as default, ie as moveImageryLayerToIndex, pe as moveImageryLayersToStackIndex, oe as movePrimitiveToIndex, ue as scheduleImageryLayerStackSync, de as schedulePrimitiveStackSync, se as syncImageryLayerStack, U as syncPrimitiveStack, H as tagImageryLayerStackMeta, re as tagPrimitiveStackMeta, uc as zz3dtiles, fc as zzEntityPoint, mc as zzEntityPolygon, pc as zzEntityPolyline, dc as zzGltf, Xe as zzLayerGeojson, $e as zzLayerMvt, Ao as zzLayerShpZzts, Pe as zzLayerWms, Me as zzLayerWmts, Ne as zzLayerXyz, Ie as zzLayerZzts, Tc as zzLegendPanel, Ms as zzTerrain, lc as zzTerrainExcavation, ve as zzViewer };