@skzz/components-gis 0.1.0 → 0.1.2
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
|
@@ -14,30 +14,31 @@ var R = {
|
|
|
14
14
|
wfs: 0,
|
|
15
15
|
mvt: 100,
|
|
16
16
|
zzts3d: 0,
|
|
17
|
+
zzts3dv2: 0,
|
|
17
18
|
tiles3d: 100
|
|
18
19
|
};
|
|
19
20
|
function z(e) {
|
|
20
21
|
let t = e;
|
|
21
22
|
return !!(t._customId || t._zzAppLayer);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function B(e) {
|
|
24
25
|
let t = e;
|
|
25
26
|
return z(t) && t._zzStackIndex !== void 0 && t._zzStackIndex >= 0;
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function ee(e) {
|
|
28
29
|
let t = e;
|
|
29
30
|
return !!t._zzAppPrimitive && t._zzStackIndex !== void 0 && t._zzStackIndex >= 0;
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function V(e, t, n, r, i, a, o, s) {
|
|
32
33
|
return e === t ? n === r ? i === a ? o - s : i.localeCompare(a) : n - r : e - t;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
35
|
+
function te(e, t) {
|
|
36
|
+
return V(e._zzStackIndex ?? 0, t._zzStackIndex ?? 0, e._zzSubStackIndex ?? 0, t._zzSubStackIndex ?? 0, e._zzGroupKey ?? "", t._zzGroupKey ?? "", e._zzTileOrder ?? 0, t._zzTileOrder ?? 0);
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
38
|
+
function ne(e, t) {
|
|
39
|
+
return V(e._zzStackIndex ?? 0, t._zzStackIndex ?? 0, e._zzSubStackIndex ?? 0, t._zzSubStackIndex ?? 0, e._zzGroupKey ?? "", t._zzGroupKey ?? "", e._zzTileOrder ?? 0, t._zzTileOrder ?? 0);
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function re(e, t) {
|
|
41
42
|
let n = e;
|
|
42
43
|
n._zzAppLayer = !0, n._zzLayerType = t.layerType, n._zzGroupKey = t.groupKey, n._zzStackIndex = t.stackIndex, n._zzSubStackIndex = t.subStackIndex ?? 0, n._zzTypeBandBase = t.typeBandBase ?? 0, n._zzTileOrder = t.tileOrder ?? 0;
|
|
43
44
|
}
|
|
@@ -80,14 +81,14 @@ function ce(e) {
|
|
|
80
81
|
let t = e.imageryLayers, n = [], r = [];
|
|
81
82
|
for (let e = 0; e < t.length; e++) {
|
|
82
83
|
let i = t.get(e);
|
|
83
|
-
if (
|
|
84
|
+
if (B(i)) {
|
|
84
85
|
r.push(i);
|
|
85
86
|
continue;
|
|
86
87
|
}
|
|
87
88
|
n.push(i);
|
|
88
89
|
}
|
|
89
90
|
if (r.length === 0) return;
|
|
90
|
-
let i = [...r].sort(
|
|
91
|
+
let i = [...r].sort(te), a = [...n, ...i];
|
|
91
92
|
for (let t = a.length - 1; t >= 0; t--) ae(e, a[t], t);
|
|
92
93
|
}
|
|
93
94
|
function le(e) {
|
|
@@ -95,14 +96,14 @@ function le(e) {
|
|
|
95
96
|
let t = e.scene.primitives, n = [], r = [];
|
|
96
97
|
for (let e = 0; e < t.length; e++) {
|
|
97
98
|
let i = t.get(e);
|
|
98
|
-
if (
|
|
99
|
+
if (ee(i)) {
|
|
99
100
|
r.push(i);
|
|
100
101
|
continue;
|
|
101
102
|
}
|
|
102
103
|
n.push(i);
|
|
103
104
|
}
|
|
104
105
|
if (r.length === 0) return;
|
|
105
|
-
let i = [...r].sort(
|
|
106
|
+
let i = [...r].sort(ne), a = [...n, ...i];
|
|
106
107
|
for (let t = a.length - 1; t >= 0; t--) se(e, a[t], t);
|
|
107
108
|
}
|
|
108
109
|
var ue = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new WeakMap();
|
|
@@ -121,7 +122,7 @@ function pe(e, t = 48) {
|
|
|
121
122
|
}, t));
|
|
122
123
|
}
|
|
123
124
|
function me(e, t, n, r = {}) {
|
|
124
|
-
!e || !t || n < 0 || (
|
|
125
|
+
!e || !t || n < 0 || (re(t, {
|
|
125
126
|
layerType: r.layerType || "imagery",
|
|
126
127
|
groupKey: r.groupKey || t._customId || t._zzGroupKey || String(n),
|
|
127
128
|
stackIndex: n,
|
|
@@ -132,7 +133,7 @@ function me(e, t, n, r = {}) {
|
|
|
132
133
|
}
|
|
133
134
|
function he(e, t, n, r = "", i = {}) {
|
|
134
135
|
!e || !Array.isArray(t) || t.length === 0 || n < 0 || (t.forEach((e, t) => {
|
|
135
|
-
|
|
136
|
+
re(e, {
|
|
136
137
|
layerType: i.layerType || "zzts",
|
|
137
138
|
groupKey: r || e._zzGroupKey || String(n),
|
|
138
139
|
stackIndex: n,
|
|
@@ -158,7 +159,7 @@ function _e(e, t, n, r = 0, i = {}) {
|
|
|
158
159
|
e._zzAppLayer = !0;
|
|
159
160
|
return;
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
+
re(t, {
|
|
162
163
|
layerType: i.layerType || "imagery",
|
|
163
164
|
groupKey: i.groupKey || t._customId || String(n),
|
|
164
165
|
stackIndex: n,
|
|
@@ -842,12 +843,12 @@ var Pe = {
|
|
|
842
843
|
throw e;
|
|
843
844
|
});
|
|
844
845
|
if (m.delete(s), !c || l || i !== h) return;
|
|
845
|
-
let u =
|
|
846
|
+
let u = B(c.elements), d = [...o];
|
|
846
847
|
if (u.length === 0) {
|
|
847
848
|
f(d, t);
|
|
848
849
|
return;
|
|
849
850
|
}
|
|
850
|
-
for (let e of u)
|
|
851
|
+
for (let e of u) te(e.id, e, 0, i);
|
|
851
852
|
console.log("newTiles", u), console.log("grouplayer", o), setTimeout(() => {
|
|
852
853
|
l || i !== h || (f(d, t), le());
|
|
853
854
|
}, 500);
|
|
@@ -879,34 +880,34 @@ var Pe = {
|
|
|
879
880
|
e.ymin,
|
|
880
881
|
e.xmax,
|
|
881
882
|
e.ymax
|
|
882
|
-
].map((e) => Number(e).toFixed(8)).join(",") : "",
|
|
883
|
+
].map((e) => Number(e).toFixed(8)).join(",") : "", B = (e) => {
|
|
883
884
|
if (!Array.isArray(e)) return [];
|
|
884
885
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = O();
|
|
885
886
|
return e.filter((e) => {
|
|
886
887
|
let i = e?.id ? String(e.id) : "", a = z(e?.extent);
|
|
887
888
|
return !i || !a || r && !j(M(e.extent), r) || t.has(i) || n.has(a) ? !1 : (t.add(i), n.add(a), !0);
|
|
888
889
|
});
|
|
889
|
-
},
|
|
890
|
+
}, ee = (e, t) => {
|
|
890
891
|
if (!e || !t) return !1;
|
|
891
892
|
let n = t?.id ? String(t.id) : "", r = z(t?.extent);
|
|
892
893
|
return !!(n && e._zzTileId === n || r && e._zzTileExtentKey === r);
|
|
893
|
-
},
|
|
894
|
+
}, V = (e) => {
|
|
894
895
|
let t = n.value?.imageryLayers;
|
|
895
896
|
if (t) {
|
|
896
897
|
for (let n = t.length - 1; n >= 0; n--) {
|
|
897
898
|
let r = t.get(n);
|
|
898
|
-
L(r) &&
|
|
899
|
+
L(r) && ee(r, e) && t.remove(r, !0);
|
|
899
900
|
}
|
|
900
|
-
o = o.filter((t) => !
|
|
901
|
+
o = o.filter((t) => !ee(t, e));
|
|
901
902
|
}
|
|
902
|
-
},
|
|
903
|
+
}, te = async (e, t, r = 0, i = h) => {
|
|
903
904
|
if (r === 3 || l || i !== h) return;
|
|
904
905
|
let a = new Image();
|
|
905
906
|
u.add(a);
|
|
906
907
|
let s = t.extent;
|
|
907
908
|
a.crossOrigin = "anonymous", a.onload = () => {
|
|
908
909
|
if (u.delete(a), l || i !== h) return;
|
|
909
|
-
|
|
910
|
+
V(t);
|
|
910
911
|
let e = D.Rectangle.fromDegrees(s.xmin, s.ymin, s.xmax, s.ymax), r = A(), c = t.url;
|
|
911
912
|
if (r) try {
|
|
912
913
|
c = Me(a, r, e, new D.GeographicProjection()).toDataURL("image/png");
|
|
@@ -936,11 +937,11 @@ var Pe = {
|
|
|
936
937
|
}, a.onerror = () => {
|
|
937
938
|
u.delete(a);
|
|
938
939
|
let n = setTimeout(() => {
|
|
939
|
-
p.delete(n), !l && i === h &&
|
|
940
|
+
p.delete(n), !l && i === h && te(e, t, r + 1, i);
|
|
940
941
|
}, 500);
|
|
941
942
|
p.add(n);
|
|
942
943
|
}, a.src = t.url;
|
|
943
|
-
},
|
|
944
|
+
}, ne = () => {
|
|
944
945
|
try {
|
|
945
946
|
l = !0, h++, s &&= (clearTimeout(s), null);
|
|
946
947
|
try {
|
|
@@ -976,7 +977,7 @@ var Pe = {
|
|
|
976
977
|
let r = e[t];
|
|
977
978
|
L(r) && n.value.imageryLayers.remove(r);
|
|
978
979
|
}
|
|
979
|
-
},
|
|
980
|
+
}, re = () => {
|
|
980
981
|
try {
|
|
981
982
|
let e = C.value;
|
|
982
983
|
if (!e) {
|
|
@@ -1054,9 +1055,9 @@ var Pe = {
|
|
|
1054
1055
|
});
|
|
1055
1056
|
};
|
|
1056
1057
|
return w(S, (e, t) => {
|
|
1057
|
-
!e || e === t || (
|
|
1058
|
+
!e || e === t || (ne(), l = !1, P());
|
|
1058
1059
|
}), w(C, () => {
|
|
1059
|
-
o.length > 0 &&
|
|
1060
|
+
o.length > 0 && re();
|
|
1060
1061
|
}, { deep: !0 }), w(() => [
|
|
1061
1062
|
_.stackIndex,
|
|
1062
1063
|
_.subStackIndex,
|
|
@@ -1068,7 +1069,7 @@ var Pe = {
|
|
|
1068
1069
|
}), d(() => {
|
|
1069
1070
|
console.log("组件挂载,开始初始化..."), P();
|
|
1070
1071
|
}), f(() => {
|
|
1071
|
-
console.log("组件卸载,开始清理资源..."), p.forEach((e) => clearTimeout(e)), p.clear(), m.forEach((e) => e.abort()), m.clear(),
|
|
1072
|
+
console.log("组件卸载,开始清理资源..."), p.forEach((e) => clearTimeout(e)), p.clear(), m.forEach((e) => e.abort()), m.clear(), ne();
|
|
1072
1073
|
}), (e, t) => null;
|
|
1073
1074
|
}
|
|
1074
1075
|
}, ze = {
|
|
@@ -1293,7 +1294,7 @@ var Pe = {
|
|
|
1293
1294
|
}
|
|
1294
1295
|
async function L() {
|
|
1295
1296
|
try {
|
|
1296
|
-
|
|
1297
|
+
Ne();
|
|
1297
1298
|
let e;
|
|
1298
1299
|
if (typeof o.value == "string") {
|
|
1299
1300
|
let t = await k.request({
|
|
@@ -1305,7 +1306,7 @@ var Pe = {
|
|
|
1305
1306
|
} else e = o.value;
|
|
1306
1307
|
if (!e || !e.type) throw Error("无效的GeoJSON数据");
|
|
1307
1308
|
let t = { clampToGround: p.value };
|
|
1308
|
-
C = await D.GeoJsonDataSource.load(e, t), C.name = s.value, z(), await r.value.dataSources.add(C), C.show = u.value, R(), m.value && await
|
|
1309
|
+
C = await D.GeoJsonDataSource.load(e, t), C.name = s.value, z(), await r.value.dataSources.add(C), C.show = u.value, R(), m.value && await Fe(_.value), a("loaded", {
|
|
1309
1310
|
dataSource: C,
|
|
1310
1311
|
entities: T.value,
|
|
1311
1312
|
name: s.value,
|
|
@@ -1326,33 +1327,33 @@ var Pe = {
|
|
|
1326
1327
|
let e = C.entities.values;
|
|
1327
1328
|
for (let t = 0; t < e.length; t++) {
|
|
1328
1329
|
let n = e[t];
|
|
1329
|
-
|
|
1330
|
+
B(n);
|
|
1330
1331
|
}
|
|
1331
1332
|
}
|
|
1332
|
-
function
|
|
1333
|
-
let t =
|
|
1334
|
-
|
|
1333
|
+
function B(e) {
|
|
1334
|
+
let t = Me(e);
|
|
1335
|
+
ee(e, t), e.polygon ? Ee(e, t) : e.polyline ? De(e, t) : (e.point || e.billboard) && Oe(e, t);
|
|
1335
1336
|
}
|
|
1336
|
-
function
|
|
1337
|
+
function ee(e, t) {
|
|
1337
1338
|
let n = x.value || [];
|
|
1338
1339
|
if (!Array.isArray(n) || n.length === 0) {
|
|
1339
1340
|
e.show = !0;
|
|
1340
1341
|
return;
|
|
1341
1342
|
}
|
|
1342
|
-
let r =
|
|
1343
|
+
let r = he();
|
|
1343
1344
|
if (!r?.fieldName || !ae(r)) {
|
|
1344
1345
|
e.show = !0;
|
|
1345
1346
|
return;
|
|
1346
1347
|
}
|
|
1347
|
-
e.show = !
|
|
1348
|
+
e.show = !V(t, r);
|
|
1348
1349
|
}
|
|
1349
|
-
function
|
|
1350
|
+
function V(e, t) {
|
|
1350
1351
|
let n = new Set((x.value || []).map(String));
|
|
1351
1352
|
if (!n.size) return !1;
|
|
1352
1353
|
let r = t.type, i = t.fieldName, a = E(e, i), o = n.has("__default__");
|
|
1353
1354
|
if (r === "uniqueShp" || r === "unique") {
|
|
1354
|
-
let e =
|
|
1355
|
-
return n.has(e) || n.has(String(a ?? "")) ? !0 : !(t.colorListArray || []).some((t) =>
|
|
1355
|
+
let e = ce(a);
|
|
1356
|
+
return n.has(e) || n.has(String(a ?? "")) ? !0 : !(t.colorListArray || []).some((t) => ce(t?.value) === e) && o;
|
|
1356
1357
|
}
|
|
1357
1358
|
if (r === "gradedColor" || r === "classified" || r === "classBreaks") {
|
|
1358
1359
|
let e = Number.parseFloat(a);
|
|
@@ -1366,15 +1367,15 @@ var Pe = {
|
|
|
1366
1367
|
}
|
|
1367
1368
|
return !1;
|
|
1368
1369
|
}
|
|
1369
|
-
function
|
|
1370
|
+
function te(e) {
|
|
1370
1371
|
if (e?.a === void 0 || e?.a === null) return 1;
|
|
1371
1372
|
let t = Number(e.a);
|
|
1372
1373
|
return Number.isNaN(t) ? 1 : t <= 100 ? Math.max(0, Math.min(1, t / 100)) : Math.max(0, Math.min(1, t / 255));
|
|
1373
1374
|
}
|
|
1374
|
-
function
|
|
1375
|
+
function ne(e, t) {
|
|
1375
1376
|
if (!e) return t;
|
|
1376
1377
|
if (e.color) {
|
|
1377
|
-
let t =
|
|
1378
|
+
let t = te(e);
|
|
1378
1379
|
if (t >= 1) return e.color;
|
|
1379
1380
|
try {
|
|
1380
1381
|
let n = D.Color.fromCssColorString(e.color);
|
|
@@ -1384,22 +1385,25 @@ var Pe = {
|
|
|
1384
1385
|
}
|
|
1385
1386
|
}
|
|
1386
1387
|
if (e.r !== void 0 && e.g !== void 0 && e.b !== void 0) {
|
|
1387
|
-
let t =
|
|
1388
|
+
let t = te(e);
|
|
1388
1389
|
return `rgba(${e.r}, ${e.g}, ${e.b}, ${t})`;
|
|
1389
1390
|
}
|
|
1390
1391
|
return t;
|
|
1391
1392
|
}
|
|
1392
|
-
function
|
|
1393
|
+
function re(e) {
|
|
1393
1394
|
return !Array.isArray(e) || e.length === 0 ? "" : e.some((e) => e && (e.valueMin !== void 0 || e.valueMax !== void 0)) ? "gradedColor" : e.some((e) => e && e.value !== void 0) ? "uniqueShp" : "";
|
|
1394
1395
|
}
|
|
1395
1396
|
function ie(e = {}) {
|
|
1396
1397
|
let t = e.type || e.styleType || "";
|
|
1397
|
-
return t === "classBreaks" || t === "classified" ? "gradedColor" : t === "unique" ? "uniqueShp" : t === "gradedColor" || t === "uniqueShp" ? t :
|
|
1398
|
+
return t === "classBreaks" || t === "classified" ? "gradedColor" : t === "unique" ? "uniqueShp" : t === "gradedColor" || t === "uniqueShp" ? t : re(e.colorListArray);
|
|
1398
1399
|
}
|
|
1399
1400
|
function ae(e) {
|
|
1400
1401
|
return !!(e.fieldName && e.colorListArray.length > 0 && e.type);
|
|
1401
1402
|
}
|
|
1402
1403
|
function oe(e) {
|
|
1404
|
+
return e.strictClassifiedStyle === !0 && ae(e) && ["uniqueShp", "gradedColor"].includes(e.type);
|
|
1405
|
+
}
|
|
1406
|
+
function se(e) {
|
|
1403
1407
|
let t = e.stroke || {};
|
|
1404
1408
|
return {
|
|
1405
1409
|
outlineColor: t.outlineColor || e.outlineColor || "#409EFF",
|
|
@@ -1412,17 +1416,17 @@ var Pe = {
|
|
|
1412
1416
|
visible: t.visible !== !1
|
|
1413
1417
|
};
|
|
1414
1418
|
}
|
|
1415
|
-
function
|
|
1419
|
+
function ce(e) {
|
|
1416
1420
|
if (e == null) return "";
|
|
1417
1421
|
let t = String(e).trim(), n = Number(t);
|
|
1418
1422
|
return !Number.isNaN(n) && t !== "" ? String(n) : t;
|
|
1419
1423
|
}
|
|
1420
|
-
function
|
|
1424
|
+
function le(e, t) {
|
|
1421
1425
|
if (!Array.isArray(e)) return null;
|
|
1422
|
-
let n =
|
|
1423
|
-
return e.find((e) =>
|
|
1426
|
+
let n = ce(t);
|
|
1427
|
+
return e.find((e) => ce(e.value) === n) || null;
|
|
1424
1428
|
}
|
|
1425
|
-
function
|
|
1429
|
+
function ue(e, t) {
|
|
1426
1430
|
if (!Array.isArray(e) || e.length === 0) return null;
|
|
1427
1431
|
let n = [...e].filter((e) => e && e.valueMin !== void 0 && e.valueMax !== void 0).sort((e, t) => Number(e.valueMin) - Number(t.valueMin));
|
|
1428
1432
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -1431,24 +1435,24 @@ var Pe = {
|
|
|
1431
1435
|
}
|
|
1432
1436
|
return null;
|
|
1433
1437
|
}
|
|
1434
|
-
function
|
|
1438
|
+
function de(e = {}) {
|
|
1435
1439
|
let t = e.colorList || {};
|
|
1436
1440
|
return t.point || t.line || t.polygon, t;
|
|
1437
1441
|
}
|
|
1438
|
-
function
|
|
1439
|
-
let n =
|
|
1442
|
+
function fe(e, t) {
|
|
1443
|
+
let n = de(t)?.polygon;
|
|
1440
1444
|
return n?.fill || n?.color || e?.fill || e?.color || "rgba(255, 255, 0, 0.3)";
|
|
1441
1445
|
}
|
|
1442
|
-
function
|
|
1443
|
-
let n =
|
|
1446
|
+
function pe(e, t) {
|
|
1447
|
+
let n = de(t)?.point;
|
|
1444
1448
|
return n?.fill || n?.color || e?.fill || e?.color || "#FF0000";
|
|
1445
1449
|
}
|
|
1446
|
-
function
|
|
1447
|
-
let n =
|
|
1450
|
+
function me(e, t) {
|
|
1451
|
+
let n = de(t)?.line?.stroke;
|
|
1448
1452
|
return n?.outlineColor || n?.color || e?.stroke?.outlineColor || e?.stroke?.color || e?.color || "#409EFF";
|
|
1449
1453
|
}
|
|
1450
|
-
function
|
|
1451
|
-
let e = y.value || {}, t = e.fieldName || "", n = Array.isArray(e.colorListArray) ? e.colorListArray : [], r =
|
|
1454
|
+
function he() {
|
|
1455
|
+
let e = y.value || {}, t = e.fieldName || "", n = Array.isArray(e.colorListArray) ? e.colorListArray : [], r = de(e);
|
|
1452
1456
|
return {
|
|
1453
1457
|
type: ie({
|
|
1454
1458
|
...e,
|
|
@@ -1461,41 +1465,43 @@ var Pe = {
|
|
|
1461
1465
|
point: F(l.value).point,
|
|
1462
1466
|
line: F(l.value).line,
|
|
1463
1467
|
polygon: F(l.value).polygon
|
|
1464
|
-
}
|
|
1468
|
+
},
|
|
1469
|
+
strictClassifiedStyle: e.strictClassifiedStyle === !0
|
|
1465
1470
|
};
|
|
1466
1471
|
}
|
|
1467
|
-
function
|
|
1472
|
+
function ge(e, t) {
|
|
1468
1473
|
let n = t.colorList?.point;
|
|
1469
1474
|
return Number(n?.stroke?.radius ?? n?.radius ?? e.radius ?? 8);
|
|
1470
1475
|
}
|
|
1471
|
-
function
|
|
1476
|
+
function _e(e, t) {
|
|
1472
1477
|
let n = E(e, t.fieldName);
|
|
1473
1478
|
if (n == null || n === "") return null;
|
|
1474
1479
|
if (t.type === "gradedColor") {
|
|
1475
1480
|
let e = parseFloat(n);
|
|
1476
|
-
return Number.isNaN(e) ? null :
|
|
1481
|
+
return Number.isNaN(e) ? null : ue(t.colorListArray, e);
|
|
1477
1482
|
}
|
|
1478
|
-
return
|
|
1483
|
+
return le(t.colorListArray, n);
|
|
1479
1484
|
}
|
|
1480
|
-
function
|
|
1485
|
+
function ve(e, t, n) {
|
|
1486
|
+
if (oe(n)) return ne(e, "rgba(0,0,0,0)");
|
|
1481
1487
|
let r = F(l.value);
|
|
1482
|
-
return t === "polygon" ?
|
|
1488
|
+
return t === "polygon" ? ne(e, fe(r.polygon, n)) : t === "line" ? ne(e, me(r.line, n)) : t === "point" ? ne(e, pe(r.point, n)) : ne(e, "#409EFF");
|
|
1483
1489
|
}
|
|
1484
|
-
function
|
|
1490
|
+
function ye(e) {
|
|
1485
1491
|
let t = e.polygon?.hierarchy?.getValue?.(D.JulianDate.now());
|
|
1486
1492
|
if (!t?.positions?.length) return;
|
|
1487
1493
|
let n = t.positions, r = new D.Cartesian3(0, 0, 0);
|
|
1488
1494
|
for (let e = 0; e < n.length; e++) D.Cartesian3.add(r, n[e], r);
|
|
1489
1495
|
return D.Cartesian3.multiplyByScalar(r, 1 / n.length, new D.Cartesian3());
|
|
1490
1496
|
}
|
|
1491
|
-
function
|
|
1497
|
+
function be(e) {
|
|
1492
1498
|
let t = e.polyline;
|
|
1493
1499
|
if (!t?.positions) return null;
|
|
1494
1500
|
let n = t.positions;
|
|
1495
1501
|
return typeof n.getValue == "function" ? n.getValue(D.JulianDate.now()) : n;
|
|
1496
1502
|
}
|
|
1497
|
-
function
|
|
1498
|
-
let t =
|
|
1503
|
+
function xe(e) {
|
|
1504
|
+
let t = be(e);
|
|
1499
1505
|
if (!Array.isArray(t) || t.length === 0) return;
|
|
1500
1506
|
if (t.length === 1) return D.Cartesian3.clone(t[0]);
|
|
1501
1507
|
let n = 0;
|
|
@@ -1512,7 +1518,7 @@ var Pe = {
|
|
|
1512
1518
|
}
|
|
1513
1519
|
return D.Cartesian3.clone(t[t.length - 1]);
|
|
1514
1520
|
}
|
|
1515
|
-
function
|
|
1521
|
+
function Se(e, t, n, r = {}) {
|
|
1516
1522
|
if (!t) return;
|
|
1517
1523
|
let i = r.position;
|
|
1518
1524
|
if (!i) return;
|
|
@@ -1520,7 +1526,7 @@ var Pe = {
|
|
|
1520
1526
|
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;
|
|
1521
1527
|
e.label.show = new D.ConstantProperty(!0), e.label.text = new D.ConstantProperty(t), e.label.font = new D.ConstantProperty(M(a, n.fontFamily)), e.label.fillColor = new D.ConstantProperty(N(o)), e.label.outlineColor = new D.ConstantProperty(N(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);
|
|
1522
1528
|
}
|
|
1523
|
-
function
|
|
1529
|
+
function Ce(e, t, n) {
|
|
1524
1530
|
let r = n?.fieldName, i = O(E(t, r), n);
|
|
1525
1531
|
if (!r || !i) return;
|
|
1526
1532
|
if (!e.position && e.point) {
|
|
@@ -1534,19 +1540,19 @@ var Pe = {
|
|
|
1534
1540
|
let s = Number(e.point?.pixelSize?.getValue?.(D.JulianDate.now()) ?? F(l.value).point.radius ?? 8), c = Number(e.point?.outlineWidth?.getValue?.(D.JulianDate.now()) ?? 0), u = n.pixelOffsetY ?? -(s + c + a * .55 + 8);
|
|
1535
1541
|
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);
|
|
1536
1542
|
}
|
|
1537
|
-
function
|
|
1543
|
+
function we(e, t, n) {
|
|
1538
1544
|
let r = n?.fieldName;
|
|
1539
|
-
!r || !e.polygon ||
|
|
1545
|
+
!r || !e.polygon || Se(e, O(E(t, r), n), n, { position: ye(e) });
|
|
1540
1546
|
}
|
|
1541
|
-
function
|
|
1547
|
+
function Te(e, t, n) {
|
|
1542
1548
|
let r = n?.fieldName;
|
|
1543
|
-
!r || !e.polyline ||
|
|
1549
|
+
!r || !e.polyline || Se(e, O(E(t, r), n), n, { position: xe(e) });
|
|
1544
1550
|
}
|
|
1545
|
-
function
|
|
1546
|
-
let n = F(l.value).polygon, r =
|
|
1547
|
-
e.polygon.material = new D.ColorMaterialProperty(N(
|
|
1551
|
+
function Ee(e, t) {
|
|
1552
|
+
let n = F(l.value).polygon, r = se(n), i = n.strokeVisible !== !1 && r.outlineWidth > 0, a = he(), o = ae(a) ? _e(t, a) : null, s = !oe(a) || !!o, c = ve(o, "polygon", a), u = Number(v.value ?? 0), d = Number.isFinite(u) && u > 0 && p.value;
|
|
1553
|
+
e.polygon.material = new D.ColorMaterialProperty(N(c)), d ? e.polygon.zIndex = new D.ConstantProperty(u) : e.polygon.zIndex = void 0, e.polygon.outline = i && s, e.polygon.outlineColor = new D.ConstantProperty(i && s ? N(r.outlineColor) : D.Color.TRANSPARENT), e.polygon.outlineWidth = new D.ConstantProperty(i && s ? r.outlineWidth : 0), e.polyline = {
|
|
1548
1554
|
positions: e.polygon.hierarchy._value.positions,
|
|
1549
|
-
show: i,
|
|
1555
|
+
show: i && s,
|
|
1550
1556
|
width: r.outlineWidth,
|
|
1551
1557
|
material: I({
|
|
1552
1558
|
type: r.type,
|
|
@@ -1556,38 +1562,38 @@ var Pe = {
|
|
|
1556
1562
|
borderColor: r.borderColor,
|
|
1557
1563
|
borderWidth: r.borderWidth
|
|
1558
1564
|
})
|
|
1559
|
-
},
|
|
1565
|
+
}, d && (e.polyline.clampToGround = !0, e.polyline.zIndex = u), b.value?.fieldName && we(e, t, b.value);
|
|
1560
1566
|
}
|
|
1561
|
-
function
|
|
1562
|
-
let n = F(l.value).line, r =
|
|
1563
|
-
e.polyline.width = new D.ConstantProperty(n.stroke.outlineWidth), e.polyline.material = I({
|
|
1567
|
+
function De(e, t) {
|
|
1568
|
+
let n = F(l.value).line, r = he(), i = ae(r) ? _e(t, r) : null, a = !oe(r) || !!i, o = ve(i, "line", r);
|
|
1569
|
+
e.polyline.width = new D.ConstantProperty(a ? n.stroke.outlineWidth : 0), e.polyline.material = I({
|
|
1564
1570
|
type: n.stroke.type,
|
|
1565
|
-
color:
|
|
1571
|
+
color: o,
|
|
1566
1572
|
dashLength: n.stroke.dashLength,
|
|
1567
1573
|
gapLength: n.stroke.gapLength,
|
|
1568
1574
|
borderColor: n.stroke.borderColor,
|
|
1569
1575
|
borderWidth: n.stroke.borderWidth
|
|
1570
|
-
}), b.value?.fieldName &&
|
|
1576
|
+
}), b.value?.fieldName && Te(e, t, b.value);
|
|
1571
1577
|
}
|
|
1572
|
-
function
|
|
1573
|
-
let n = F(l.value).point, r =
|
|
1574
|
-
e.billboard && (e.billboard.show = new D.ConstantProperty(!1)), e.point && (e.point.show = new D.ConstantProperty(!1)), n.showIcon && n.iconStyle.url ?
|
|
1578
|
+
function Oe(e, t) {
|
|
1579
|
+
let n = F(l.value).point, r = he(), i = ae(r) ? _e(t, r) : null, a = !oe(r) || !!i, o = ve(i, "point", r), s = ge(n, r);
|
|
1580
|
+
e.billboard && (e.billboard.show = new D.ConstantProperty(!1)), e.point && (e.point.show = new D.ConstantProperty(!1)), n.showIcon && n.iconStyle.url ? Ae(e, n.iconStyle) : ke(e, {
|
|
1575
1581
|
...n,
|
|
1576
|
-
radius:
|
|
1577
|
-
color:
|
|
1582
|
+
radius: s,
|
|
1583
|
+
color: o,
|
|
1578
1584
|
borderColor: n.borderColor,
|
|
1579
|
-
borderWidth: n.borderWidth
|
|
1580
|
-
}), n.showLabel && n.labelStyle &&
|
|
1585
|
+
borderWidth: a ? n.borderWidth : 0
|
|
1586
|
+
}), n.showLabel && n.labelStyle && je(e, t, n.labelStyle), b.value?.fieldName && Ce(e, t, b.value);
|
|
1581
1587
|
}
|
|
1582
|
-
function
|
|
1588
|
+
function ke(e, t) {
|
|
1583
1589
|
e.point ||= new D.PointGraphics();
|
|
1584
1590
|
let n = t.strokeVisible !== !1 && Number(t.borderWidth) > 0;
|
|
1585
1591
|
e.point.show = new D.ConstantProperty(!0), e.point.pixelSize = new D.ConstantProperty(t.radius), e.point.color = new D.ConstantProperty(N(t.color || t.fill)), e.point.outlineColor = new D.ConstantProperty(n ? N(t.borderColor) : D.Color.TRANSPARENT), e.point.outlineWidth = new D.ConstantProperty(n ? t.borderWidth : 0);
|
|
1586
1592
|
}
|
|
1587
|
-
function
|
|
1593
|
+
function Ae(e, t) {
|
|
1588
1594
|
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;
|
|
1589
1595
|
}
|
|
1590
|
-
function
|
|
1596
|
+
function je(e, t, n) {
|
|
1591
1597
|
e.label ||= new D.LabelGraphics();
|
|
1592
1598
|
let r = "";
|
|
1593
1599
|
if (n.field) {
|
|
@@ -1598,7 +1604,7 @@ var Pe = {
|
|
|
1598
1604
|
let i = parseInt(String(n.fontSize || "12"), 10) || 12;
|
|
1599
1605
|
e.label.font = new D.ConstantProperty(M(i, n.fontFamily)), e.label.fillColor = new D.ConstantProperty(N(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);
|
|
1600
1606
|
}
|
|
1601
|
-
function
|
|
1607
|
+
function Me(e) {
|
|
1602
1608
|
if (!e?.properties) return {};
|
|
1603
1609
|
let t = D.JulianDate.now(), n = e.properties, r = {}, i = n.propertyIds && [...n.propertyIds] || n.propertyNames && [...n.propertyNames] || [];
|
|
1604
1610
|
for (let e = 0; e < i.length; e++) {
|
|
@@ -1611,17 +1617,17 @@ var Pe = {
|
|
|
1611
1617
|
}
|
|
1612
1618
|
return r;
|
|
1613
1619
|
}
|
|
1614
|
-
function
|
|
1620
|
+
function Ne() {
|
|
1615
1621
|
try {
|
|
1616
1622
|
C && r.value && (r.value.dataSources.remove(C), C = null, T.value = []);
|
|
1617
1623
|
} catch (e) {
|
|
1618
1624
|
console.warn("移除图层时发生错误:", e);
|
|
1619
1625
|
}
|
|
1620
1626
|
}
|
|
1621
|
-
function
|
|
1627
|
+
function Pe(e) {
|
|
1622
1628
|
C && (C.show = e);
|
|
1623
1629
|
}
|
|
1624
|
-
async function
|
|
1630
|
+
async function Fe(e = 2) {
|
|
1625
1631
|
if (C && r.value) try {
|
|
1626
1632
|
return await r.value.flyTo(C, {
|
|
1627
1633
|
duration: e,
|
|
@@ -1639,7 +1645,7 @@ var Pe = {
|
|
|
1639
1645
|
return w(o, (e) => {
|
|
1640
1646
|
e && L();
|
|
1641
1647
|
}, { deep: !0 }), w(u, (e) => {
|
|
1642
|
-
|
|
1648
|
+
Pe(e);
|
|
1643
1649
|
}), w(l, () => {
|
|
1644
1650
|
C && z();
|
|
1645
1651
|
}, { deep: !0 }), w(y, () => {
|
|
@@ -1655,14 +1661,14 @@ var Pe = {
|
|
|
1655
1661
|
}), w(r, (e) => {
|
|
1656
1662
|
o.value && e && L();
|
|
1657
1663
|
}), f(() => {
|
|
1658
|
-
|
|
1664
|
+
Ne();
|
|
1659
1665
|
}), t({
|
|
1660
1666
|
getDataSource: () => C,
|
|
1661
1667
|
getEntities: () => [...T.value],
|
|
1662
|
-
flyTo:
|
|
1663
|
-
removeLayer:
|
|
1668
|
+
flyTo: Fe,
|
|
1669
|
+
removeLayer: Ne,
|
|
1664
1670
|
reload: L,
|
|
1665
|
-
setVisibility:
|
|
1671
|
+
setVisibility: Pe
|
|
1666
1672
|
}), (e, t) => null;
|
|
1667
1673
|
}
|
|
1668
1674
|
}, Be = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", Ve = {
|
|
@@ -1860,20 +1866,20 @@ var Pe = {
|
|
|
1860
1866
|
name: "MVT Layer"
|
|
1861
1867
|
};
|
|
1862
1868
|
return g && _ && (e.glyphs = _), e;
|
|
1863
|
-
}, E = new Set((Array.isArray(t.hiddenValues) ? t.hiddenValues : []).map(String)), A = "rgba(0,0,0,0)", j = (e) => {
|
|
1869
|
+
}, E = new Set((Array.isArray(t.hiddenValues) ? t.hiddenValues : []).map(String)), A = "rgba(0,0,0,0)", j = a.strictClassifiedStyle === !0 && ["uniqueShp", "gradedColor"].includes(o), M = (e) => {
|
|
1864
1870
|
let t = O(e?.value);
|
|
1865
1871
|
return E.has(t) || E.has(String(e?.value ?? ""));
|
|
1866
|
-
},
|
|
1872
|
+
}, N = (e) => {
|
|
1867
1873
|
let t = `${e?.valueMin}..${e?.valueMax}`, n = `${Number(e?.valueMin)}..${Number(e?.valueMax)}`;
|
|
1868
1874
|
return E.has(t) || E.has(n);
|
|
1869
|
-
},
|
|
1875
|
+
}, P = (e) => E.has("__default__") ? A : e, F = (e) => j ? A : P(e), I = (e, t) => e.color || (j ? A : t), L = (() => {
|
|
1870
1876
|
if (!u.point && !u.line && !u.polygon) return "#1968df";
|
|
1871
1877
|
if (u.point) {
|
|
1872
1878
|
if (o === "gradedColor") {
|
|
1873
|
-
if (c.length === 0) return
|
|
1879
|
+
if (c.length === 0) return F(p.fill);
|
|
1874
1880
|
let e = [...c].filter((e) => e && e.valueMin !== void 0 && e.valueMax !== void 0).sort((e, t) => Number(e.valueMin) - Number(t.valueMin)), t = ["case"];
|
|
1875
1881
|
for (let n of e) {
|
|
1876
|
-
let e = Number(n.valueMin), r = Number(n.valueMax), i =
|
|
1882
|
+
let e = Number(n.valueMin), r = Number(n.valueMax), i = N(n) ? A : I(n, p.fill);
|
|
1877
1883
|
t.push([
|
|
1878
1884
|
"all",
|
|
1879
1885
|
[
|
|
@@ -1888,22 +1894,22 @@ var Pe = {
|
|
|
1888
1894
|
]
|
|
1889
1895
|
], i);
|
|
1890
1896
|
}
|
|
1891
|
-
return t.push(
|
|
1897
|
+
return t.push(F(p.fill)), t;
|
|
1892
1898
|
}
|
|
1893
1899
|
if (o === "uniqueShp") {
|
|
1894
|
-
if (c.length === 0) return
|
|
1900
|
+
if (c.length === 0) return F(p.fill);
|
|
1895
1901
|
let e = ["match", ["to-string", ["get", s]]];
|
|
1896
|
-
for (let t of c) e.push(O(t.value),
|
|
1897
|
-
return e.push(
|
|
1902
|
+
for (let t of c) e.push(O(t.value), M(t) ? A : I(t, p.fill));
|
|
1903
|
+
return e.push(F(p.fill)), e;
|
|
1898
1904
|
}
|
|
1899
1905
|
return p.fill;
|
|
1900
1906
|
}
|
|
1901
1907
|
if (u.line) {
|
|
1902
1908
|
if (o === "gradedColor") {
|
|
1903
|
-
if (c.length === 0) return
|
|
1909
|
+
if (c.length === 0) return F(p.stroke.outlineColor);
|
|
1904
1910
|
let e = [...c].filter((e) => e && e.valueMin !== void 0 && e.valueMax !== void 0).sort((e, t) => Number(e.valueMin) - Number(t.valueMin)), t = ["case"];
|
|
1905
1911
|
for (let n of e) {
|
|
1906
|
-
let e = Number(n.valueMin), r = Number(n.valueMax), i =
|
|
1912
|
+
let e = Number(n.valueMin), r = Number(n.valueMax), i = N(n) ? A : I(n, p.stroke.outlineColor);
|
|
1907
1913
|
t.push([
|
|
1908
1914
|
"all",
|
|
1909
1915
|
[
|
|
@@ -1918,22 +1924,22 @@ var Pe = {
|
|
|
1918
1924
|
]
|
|
1919
1925
|
], i);
|
|
1920
1926
|
}
|
|
1921
|
-
return t.push(
|
|
1927
|
+
return t.push(F(p.stroke.outlineColor)), t;
|
|
1922
1928
|
}
|
|
1923
1929
|
if (o === "uniqueShp") {
|
|
1924
|
-
if (c.length === 0) return
|
|
1930
|
+
if (c.length === 0) return F(p.stroke.outlineColor);
|
|
1925
1931
|
let e = ["match", ["to-string", ["get", s]]];
|
|
1926
|
-
for (let t of c) e.push(O(t.value),
|
|
1927
|
-
return e.push(
|
|
1932
|
+
for (let t of c) e.push(O(t.value), M(t) ? A : I(t, p.stroke.outlineColor));
|
|
1933
|
+
return e.push(F(p.stroke.outlineColor)), e;
|
|
1928
1934
|
}
|
|
1929
1935
|
return p.stroke.outlineColor;
|
|
1930
1936
|
}
|
|
1931
1937
|
if (u.polygon) {
|
|
1932
1938
|
if (o === "gradedColor") {
|
|
1933
|
-
if (c.length === 0) return
|
|
1939
|
+
if (c.length === 0) return F(p.fill);
|
|
1934
1940
|
let e = [...c].filter((e) => e && e.valueMin !== void 0 && e.valueMax !== void 0).sort((e, t) => Number(e.valueMin) - Number(t.valueMin)), t = ["case"];
|
|
1935
1941
|
for (let n of e) {
|
|
1936
|
-
let e = Number(n.valueMin), r = Number(n.valueMax), i =
|
|
1942
|
+
let e = Number(n.valueMin), r = Number(n.valueMax), i = N(n) ? A : I(n, p.fill);
|
|
1937
1943
|
t.push([
|
|
1938
1944
|
"all",
|
|
1939
1945
|
[
|
|
@@ -1948,20 +1954,47 @@ var Pe = {
|
|
|
1948
1954
|
]
|
|
1949
1955
|
], i);
|
|
1950
1956
|
}
|
|
1951
|
-
return t.push(
|
|
1957
|
+
return t.push(F(p.fill)), t;
|
|
1952
1958
|
}
|
|
1953
1959
|
if (o === "uniqueShp") {
|
|
1954
|
-
if (c.length === 0) return
|
|
1960
|
+
if (c.length === 0) return F(p.fill);
|
|
1955
1961
|
let e = ["match", ["to-string", ["get", s]]];
|
|
1956
|
-
for (let t of c) e.push(O(t.value),
|
|
1957
|
-
return e.push(
|
|
1962
|
+
for (let t of c) e.push(O(t.value), M(t) ? A : I(t, p.fill));
|
|
1963
|
+
return e.push(F(p.fill)), e;
|
|
1958
1964
|
}
|
|
1959
1965
|
return p.fill;
|
|
1960
1966
|
}
|
|
1961
|
-
})(),
|
|
1967
|
+
})(), R = j ? [
|
|
1968
|
+
"case",
|
|
1969
|
+
[
|
|
1970
|
+
"==",
|
|
1971
|
+
L,
|
|
1972
|
+
A
|
|
1973
|
+
],
|
|
1974
|
+
0,
|
|
1975
|
+
f
|
|
1976
|
+
] : f, z = j ? [
|
|
1977
|
+
"case",
|
|
1978
|
+
[
|
|
1979
|
+
"==",
|
|
1980
|
+
L,
|
|
1981
|
+
A
|
|
1982
|
+
],
|
|
1983
|
+
0,
|
|
1984
|
+
b(t.fillOpacity)
|
|
1985
|
+
] : b(t.fillOpacity), B = p?.strokeVisible !== !1, ee = t.legendFilter || null, V = (e) => !ee || !e ? e : {
|
|
1962
1986
|
...e,
|
|
1963
|
-
filter:
|
|
1964
|
-
},
|
|
1987
|
+
filter: ee
|
|
1988
|
+
}, te = j ? [
|
|
1989
|
+
"case",
|
|
1990
|
+
[
|
|
1991
|
+
"==",
|
|
1992
|
+
L,
|
|
1993
|
+
A
|
|
1994
|
+
],
|
|
1995
|
+
A,
|
|
1996
|
+
p.stroke.outlineColor
|
|
1997
|
+
] : p.stroke.outlineColor;
|
|
1965
1998
|
if (u.point) return console.log("进入pointpointpoint"), {
|
|
1966
1999
|
...T(),
|
|
1967
2000
|
sources: { [r.source]: {
|
|
@@ -1970,21 +2003,21 @@ var Pe = {
|
|
|
1970
2003
|
minzoom: Number(t.minzoom ?? 1),
|
|
1971
2004
|
maxzoom: Number(t.maxzoom ?? 14)
|
|
1972
2005
|
} },
|
|
1973
|
-
layers: [
|
|
2006
|
+
layers: [V({
|
|
1974
2007
|
id: r.circle,
|
|
1975
2008
|
type: "circle",
|
|
1976
2009
|
source: r.source,
|
|
1977
2010
|
"source-layer": n,
|
|
1978
2011
|
layout: { visibility: t.visibility || "visible" },
|
|
1979
2012
|
paint: {
|
|
1980
|
-
"circle-color":
|
|
2013
|
+
"circle-color": L,
|
|
1981
2014
|
"circle-radius": p.stroke.radius,
|
|
1982
|
-
"circle-opacity":
|
|
1983
|
-
"circle-stroke-color":
|
|
1984
|
-
"circle-stroke-opacity":
|
|
1985
|
-
"circle-stroke-width":
|
|
2015
|
+
"circle-opacity": R,
|
|
2016
|
+
"circle-stroke-color": B ? te : A,
|
|
2017
|
+
"circle-stroke-opacity": B ? R : 0,
|
|
2018
|
+
"circle-stroke-width": B ? p.stroke.outlineWidth : 0
|
|
1986
2019
|
}
|
|
1987
|
-
}), ...g ? [
|
|
2020
|
+
}), ...g ? [V({
|
|
1988
2021
|
id: r.label,
|
|
1989
2022
|
type: "symbol",
|
|
1990
2023
|
source: r.source,
|
|
@@ -2001,19 +2034,19 @@ var Pe = {
|
|
|
2001
2034
|
minzoom: Number(t.minzoom ?? 1),
|
|
2002
2035
|
maxzoom: Number(t.maxzoom ?? 14)
|
|
2003
2036
|
} },
|
|
2004
|
-
layers: [
|
|
2037
|
+
layers: [V({
|
|
2005
2038
|
id: "mvt-line",
|
|
2006
2039
|
type: "line",
|
|
2007
2040
|
source: "mvt:source",
|
|
2008
2041
|
"source-layer": n,
|
|
2009
2042
|
layout: { visibility: t.visibility },
|
|
2010
2043
|
paint: {
|
|
2011
|
-
"line-color":
|
|
2012
|
-
"line-opacity":
|
|
2044
|
+
"line-color": L,
|
|
2045
|
+
"line-opacity": R,
|
|
2013
2046
|
"line-width": p.stroke.outlineWidth ?? t.lineWidth,
|
|
2014
2047
|
"line-dasharray": p.stroke.type === "dashed" ? [2, 2] : [1, 0]
|
|
2015
2048
|
}
|
|
2016
|
-
}), ...g ? [
|
|
2049
|
+
}), ...g ? [V({
|
|
2017
2050
|
id: r.label,
|
|
2018
2051
|
type: "symbol",
|
|
2019
2052
|
source: "mvt:source",
|
|
@@ -2023,7 +2056,7 @@ var Pe = {
|
|
|
2023
2056
|
})] : []]
|
|
2024
2057
|
};
|
|
2025
2058
|
if (u.polygon) {
|
|
2026
|
-
let e =
|
|
2059
|
+
let e = B ? te : A;
|
|
2027
2060
|
return {
|
|
2028
2061
|
...T(),
|
|
2029
2062
|
sources: { "mvt:source": {
|
|
@@ -2033,19 +2066,19 @@ var Pe = {
|
|
|
2033
2066
|
maxzoom: Number(t.maxzoom ?? 14)
|
|
2034
2067
|
} },
|
|
2035
2068
|
layers: [
|
|
2036
|
-
|
|
2069
|
+
V({
|
|
2037
2070
|
id: "mvt-fill",
|
|
2038
2071
|
type: "fill",
|
|
2039
2072
|
source: "mvt:source",
|
|
2040
2073
|
"source-layer": n,
|
|
2041
2074
|
layout: { visibility: t.visibility },
|
|
2042
2075
|
paint: {
|
|
2043
|
-
"fill-color":
|
|
2044
|
-
"fill-opacity":
|
|
2076
|
+
"fill-color": L,
|
|
2077
|
+
"fill-opacity": z,
|
|
2045
2078
|
"fill-outline-color": e
|
|
2046
2079
|
}
|
|
2047
2080
|
}),
|
|
2048
|
-
|
|
2081
|
+
V({
|
|
2049
2082
|
id: "mvt-line",
|
|
2050
2083
|
type: "line",
|
|
2051
2084
|
source: "mvt:source",
|
|
@@ -2053,12 +2086,12 @@ var Pe = {
|
|
|
2053
2086
|
layout: { visibility: t.visibility },
|
|
2054
2087
|
paint: {
|
|
2055
2088
|
"line-color": e,
|
|
2056
|
-
"line-opacity":
|
|
2057
|
-
"line-width":
|
|
2089
|
+
"line-opacity": B ? R : 0,
|
|
2090
|
+
"line-width": B ? p.stroke.outlineWidth ?? t.lineWidth : 0,
|
|
2058
2091
|
"line-dasharray": p.stroke.type === "dashed" ? [2, 2] : [1, 0]
|
|
2059
2092
|
}
|
|
2060
2093
|
}),
|
|
2061
|
-
...g ? [
|
|
2094
|
+
...g ? [V({
|
|
2062
2095
|
id: "mvt-label",
|
|
2063
2096
|
type: "symbol",
|
|
2064
2097
|
source: "mvt:source",
|
|
@@ -4551,10 +4584,413 @@ var za = {
|
|
|
4551
4584
|
a ? La(a) : l();
|
|
4552
4585
|
}), (e, t) => null;
|
|
4553
4586
|
}
|
|
4587
|
+
}, Ba = "/v1/zzts/layer/3d/getTwinTileGridManifest";
|
|
4588
|
+
function Va(e) {
|
|
4589
|
+
if (!e) return null;
|
|
4590
|
+
let t = Number(e.longitudeWest ?? e.west), n = Number(e.latitudeSouth ?? e.south), r = Number(e.longitudeEast ?? e.east), i = Number(e.latitudeNorth ?? e.north);
|
|
4591
|
+
return ![
|
|
4592
|
+
t,
|
|
4593
|
+
n,
|
|
4594
|
+
r,
|
|
4595
|
+
i
|
|
4596
|
+
].every(Number.isFinite) || t < -180 || r > 180 || n < -90 || i > 90 || t >= r || n >= i ? null : {
|
|
4597
|
+
west: t,
|
|
4598
|
+
south: n,
|
|
4599
|
+
east: r,
|
|
4600
|
+
north: i
|
|
4601
|
+
};
|
|
4602
|
+
}
|
|
4603
|
+
function Ha(e, t) {
|
|
4604
|
+
if (!e || !t) return null;
|
|
4605
|
+
let n = {
|
|
4606
|
+
west: Math.max(e.west, t.west),
|
|
4607
|
+
south: Math.max(e.south, t.south),
|
|
4608
|
+
east: Math.min(e.east, t.east),
|
|
4609
|
+
north: Math.min(e.north, t.north)
|
|
4610
|
+
};
|
|
4611
|
+
return n.west < n.east && n.south < n.north ? n : null;
|
|
4612
|
+
}
|
|
4613
|
+
function Ua(e, t) {
|
|
4614
|
+
let n = String(e || "255,255,255").split(",").map((e) => Number(e.trim())), [r, i, a] = n.length === 3 && n.every(Number.isFinite) ? n : [
|
|
4615
|
+
255,
|
|
4616
|
+
255,
|
|
4617
|
+
255
|
|
4618
|
+
];
|
|
4619
|
+
return new Cesium.Color(r / 255, i / 255, a / 255, t);
|
|
4620
|
+
}
|
|
4621
|
+
function Wa(e, t) {
|
|
4622
|
+
let n = e instanceof Uint8Array && e[0] === 31 && e[1] === 139 ? Da.ungzip(e) : new Uint8Array(e);
|
|
4623
|
+
if (n.length < 16) throw Error("TW2 分片过短");
|
|
4624
|
+
let r = new DataView(n.buffer, n.byteOffset, n.byteLength);
|
|
4625
|
+
if (r.getUint32(0, !0) !== 3299156) throw Error("TW2 magic 不匹配");
|
|
4626
|
+
let i = r.getUint32(12, !0), a = t <= 3 ? 1 / 100 : 1, o = [], s = 16;
|
|
4627
|
+
for (let e = 0; e < i; e++) {
|
|
4628
|
+
let e = r.getBigUint64(s, !0), t = r.getUint32(s + 8, !0), i = r.getUint32(s + 12, !0);
|
|
4629
|
+
s += 16;
|
|
4630
|
+
let c = new Int32Array(n.buffer, n.byteOffset + s, t), l = new Float64Array(t);
|
|
4631
|
+
for (let e = 0; e < t; e++) l[e] = c[e] * a;
|
|
4632
|
+
s += t * 4;
|
|
4633
|
+
let u = new Uint32Array(n.buffer, n.byteOffset + s, i);
|
|
4634
|
+
s += i * 4, o.push({
|
|
4635
|
+
id: e,
|
|
4636
|
+
positions: l,
|
|
4637
|
+
indices: u
|
|
4638
|
+
});
|
|
4639
|
+
}
|
|
4640
|
+
return o;
|
|
4641
|
+
}
|
|
4642
|
+
function Ga(e, t, n, r, i) {
|
|
4643
|
+
let a = 0, o = 0;
|
|
4644
|
+
for (let t of e) a += t.positions.length, o += t.indices.length;
|
|
4645
|
+
let s = new Float64Array(a), c = new Uint32Array(o), l = 0, u = 0;
|
|
4646
|
+
for (let t of e) {
|
|
4647
|
+
let e = l / 3;
|
|
4648
|
+
s.set(t.positions, l);
|
|
4649
|
+
for (let n = 0; n < t.indices.length; n++) c[u + n] = t.indices[n] + e;
|
|
4650
|
+
l += t.positions.length, u += t.indices.length;
|
|
4651
|
+
}
|
|
4652
|
+
let d = i < 1;
|
|
4653
|
+
return new Cesium.Primitive({
|
|
4654
|
+
geometryInstances: [new Cesium.GeometryInstance({
|
|
4655
|
+
id: `tw2_${t}_S${n}`,
|
|
4656
|
+
geometry: new Cesium.Geometry({
|
|
4657
|
+
attributes: { position: new Cesium.GeometryAttribute({
|
|
4658
|
+
componentDatatype: Cesium.ComponentDatatype.DOUBLE,
|
|
4659
|
+
componentsPerAttribute: 3,
|
|
4660
|
+
values: s
|
|
4661
|
+
}) },
|
|
4662
|
+
indices: c,
|
|
4663
|
+
primitiveType: Cesium.PrimitiveType.TRIANGLES,
|
|
4664
|
+
boundingSphere: Cesium.BoundingSphere.fromVertices(s)
|
|
4665
|
+
}),
|
|
4666
|
+
attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(d ? r.withAlpha(i) : r) }
|
|
4667
|
+
})],
|
|
4668
|
+
appearance: new Cesium.PerInstanceColorAppearance({
|
|
4669
|
+
flat: !0,
|
|
4670
|
+
translucent: d,
|
|
4671
|
+
vertexFormat: Cesium.VertexFormat.POSITION_ONLY
|
|
4672
|
+
}),
|
|
4673
|
+
asynchronous: !1,
|
|
4674
|
+
compressVertices: !1
|
|
4675
|
+
});
|
|
4676
|
+
}
|
|
4677
|
+
var Ka = class {
|
|
4678
|
+
constructor(e, t = !1, n = null, r = "255,255,255", i = 1, a = {}) {
|
|
4679
|
+
this.id = e, this.dataLayerId = a.dataLayerId || e, this.isStatic = t, this.fixedLevel = n, this.currentNewLevel = g(n || 15), this.color = r, this.opacity = i ?? 1, this.layerOpacity = a.layerOpacity ?? 1, this.displayRange = Va(a.displayRange), this.lodCalculationRange = Va(a.lodCalculationRange), this.stackIndex = a.stackIndex, this.subStackIndex = a.subStackIndex ?? 0, this.groupKey = a.groupKey || String(e), this.levels_add = window.levels_add_plus || 0, this.destroyed = !1, this.handlers = null, this.requestController = null, this.requestVersion = 0, this.loadedTiles = /* @__PURE__ */ new Map(), this.emptyTiles = /* @__PURE__ */ new Set();
|
|
4680
|
+
}
|
|
4681
|
+
async init() {
|
|
4682
|
+
this.initHandler();
|
|
4683
|
+
}
|
|
4684
|
+
initHandler() {
|
|
4685
|
+
if (this.getViewportInfo(), this.handlers) try {
|
|
4686
|
+
viewer.camera.changed.removeEventListener(this.handlers);
|
|
4687
|
+
} catch (e) {
|
|
4688
|
+
console.warn("移除旧的事件监听器失败:", e);
|
|
4689
|
+
}
|
|
4690
|
+
let e = null, t = () => {
|
|
4691
|
+
clearTimeout(e), e = setTimeout(() => this.getViewportInfo(), 250);
|
|
4692
|
+
};
|
|
4693
|
+
viewer.camera.changed.addEventListener(t), this.handlers = t;
|
|
4694
|
+
}
|
|
4695
|
+
getViewportInfo() {
|
|
4696
|
+
if (this.destroyed) return;
|
|
4697
|
+
this.requestController && this.requestController.abort(), this.requestController = new AbortController();
|
|
4698
|
+
let e = N.getFrustumGroundIntersectionPoints(viewer), t = N.getCenter(viewer), n = N.getCameraView(viewer);
|
|
4699
|
+
if (n.pitch > -18 || !e || e.length < 4) return;
|
|
4700
|
+
let r;
|
|
4701
|
+
if (this.isStatic && this.fixedLevel) r = this.fixedLevel + this.levels_add;
|
|
4702
|
+
else {
|
|
4703
|
+
let e = Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(t.x, t.y, 0), Cesium.Cartesian3.fromDegrees(n.x, n.y, n.z)), i = N.entityGridLevels.filter((t) => t.max >= e && t.min <= e);
|
|
4704
|
+
if (!i[0]) return;
|
|
4705
|
+
r = i[0].level + this.levels_add;
|
|
4706
|
+
}
|
|
4707
|
+
this.currentNewLevel.value = r;
|
|
4708
|
+
let i = Ge(Ue([
|
|
4709
|
+
[e[0].x, e[0].y],
|
|
4710
|
+
[e[1].x, e[1].y],
|
|
4711
|
+
[e[2].x, e[2].y],
|
|
4712
|
+
[e[3].x, e[3].y]
|
|
4713
|
+
])), a = {
|
|
4714
|
+
west: i[0],
|
|
4715
|
+
south: i[1],
|
|
4716
|
+
east: i[2],
|
|
4717
|
+
north: i[3]
|
|
4718
|
+
}, o = this.displayRange ? Ha(a, this.displayRange) : a;
|
|
4719
|
+
if (!o) {
|
|
4720
|
+
this.clearAllTiles();
|
|
4721
|
+
return;
|
|
4722
|
+
}
|
|
4723
|
+
let s = this.lodCalculationRange || o;
|
|
4724
|
+
this.getEntityData([
|
|
4725
|
+
s.west,
|
|
4726
|
+
s.south,
|
|
4727
|
+
s.east,
|
|
4728
|
+
s.north
|
|
4729
|
+
], r, this.requestController.signal);
|
|
4730
|
+
}
|
|
4731
|
+
async getEntityData(e, t, n) {
|
|
4732
|
+
let r = viewer.scene.canvas, i = r.clientWidth, a = r.clientHeight, o = Number(e[2]) - Number(e[0]), s = Number(e[3]) - Number(e[1]);
|
|
4733
|
+
if (!(o > 20 || s > 20)) try {
|
|
4734
|
+
let t = await k.request({
|
|
4735
|
+
method: "GET",
|
|
4736
|
+
url: `/v1/zzts/layer/3d/calTiles?region=${e[0]},${e[1]},0,${e[2]},${e[3]},10&width=${i}&height=${a}`,
|
|
4737
|
+
timeout: 6e4,
|
|
4738
|
+
signal: n
|
|
4739
|
+
});
|
|
4740
|
+
!n.aborted && !this.destroyed && this.renderTiles(t.tiles || [], t.lodLevel);
|
|
4741
|
+
} catch (e) {
|
|
4742
|
+
e?.name !== "AbortError" && console.error(`图层 ${this.id} 获取格网数据出错:`, e);
|
|
4743
|
+
}
|
|
4744
|
+
}
|
|
4745
|
+
renderTiles(e, t) {
|
|
4746
|
+
if (this.destroyed) return;
|
|
4747
|
+
let n = ++this.requestVersion, r = new Set(e.map((e) => e.geoSot));
|
|
4748
|
+
for (let e of [...this.loadedTiles.keys()]) r.has(e) || this.removeTile(e);
|
|
4749
|
+
for (let e of [...this.emptyTiles]) r.has(e) || this.emptyTiles.delete(e);
|
|
4750
|
+
e.filter((e) => !this.loadedTiles.has(e.geoSot) && !this.emptyTiles.has(e.geoSot)).forEach((e) => this.loadTile(e, t, n, this.requestController?.signal));
|
|
4751
|
+
}
|
|
4752
|
+
async loadTile(e, t, n, r) {
|
|
4753
|
+
let i = () => !this.destroyed && n === this.requestVersion && !r?.aborted;
|
|
4754
|
+
try {
|
|
4755
|
+
let n = await k.request({
|
|
4756
|
+
method: "GET",
|
|
4757
|
+
url: `${Ba}?layerId=${encodeURIComponent(this.dataLayerId)}&geosot=${encodeURIComponent(e.geoSot)}&level=${t}`,
|
|
4758
|
+
timeout: 6e4,
|
|
4759
|
+
signal: r
|
|
4760
|
+
});
|
|
4761
|
+
if (!i()) return;
|
|
4762
|
+
if (!n || n.protocol === "EMPTY" || !n.shards?.length) {
|
|
4763
|
+
this.emptyTiles.add(e.geoSot);
|
|
4764
|
+
return;
|
|
4765
|
+
}
|
|
4766
|
+
let a = await Promise.all(n.shards.map((t) => k.request({
|
|
4767
|
+
method: "GET",
|
|
4768
|
+
url: t.url,
|
|
4769
|
+
headers: { Accept: "application/octet-stream" },
|
|
4770
|
+
responseType: "arraybuffer",
|
|
4771
|
+
timeout: 6e4,
|
|
4772
|
+
signal: r
|
|
4773
|
+
}).then((r) => this.addShardToMap(e, t, r.data, n.lod))));
|
|
4774
|
+
if (!i()) {
|
|
4775
|
+
a.filter(Boolean).forEach((e) => viewer.scene.primitives.remove(e));
|
|
4776
|
+
return;
|
|
4777
|
+
}
|
|
4778
|
+
} catch (t) {
|
|
4779
|
+
t?.name !== "AbortError" && console.error(`图层 ${this.id} 加载瓦片失败:`, e.geoSot, t);
|
|
4780
|
+
}
|
|
4781
|
+
}
|
|
4782
|
+
addShardToMap(e, t, n, r) {
|
|
4783
|
+
let i = Wa(n, r), a = Ua(this.color, 1), o = Ga(i, e.geoSot, t.index, a, this.opacity);
|
|
4784
|
+
o.layerId = this.id, o.geoSot = e.geoSot, ve(viewer, o, this.stackIndex, 0, {
|
|
4785
|
+
layerType: "zzts3dv2",
|
|
4786
|
+
groupKey: this.groupKey,
|
|
4787
|
+
subStackIndex: this.subStackIndex,
|
|
4788
|
+
tileOrder: this.loadedTiles.size
|
|
4789
|
+
});
|
|
4790
|
+
let s = this.loadedTiles.get(e.geoSot);
|
|
4791
|
+
return s || (s = [], this.loadedTiles.set(e.geoSot, s)), s.push({
|
|
4792
|
+
primitive: o,
|
|
4793
|
+
shardIndex: t.index
|
|
4794
|
+
}), o;
|
|
4795
|
+
}
|
|
4796
|
+
removeTile(e) {
|
|
4797
|
+
let t = this.loadedTiles.get(e);
|
|
4798
|
+
if (t) {
|
|
4799
|
+
for (let { primitive: e } of t) try {
|
|
4800
|
+
viewer.scene.primitives.remove(e);
|
|
4801
|
+
} catch (e) {
|
|
4802
|
+
console.warn("移除分片图元失败:", e);
|
|
4803
|
+
}
|
|
4804
|
+
this.loadedTiles.delete(e);
|
|
4805
|
+
}
|
|
4806
|
+
}
|
|
4807
|
+
removeTilesOnly() {
|
|
4808
|
+
this.clearAllTiles();
|
|
4809
|
+
}
|
|
4810
|
+
clearAllTiles() {
|
|
4811
|
+
for (let e of [...this.loadedTiles.keys()]) this.removeTile(e);
|
|
4812
|
+
this.emptyTiles.clear();
|
|
4813
|
+
}
|
|
4814
|
+
updateOptions(e = {}) {
|
|
4815
|
+
let t = e.color !== void 0 && e.color !== this.color, n = e.opacity !== void 0 && Number(e.opacity) !== this.opacity, r = t || n || e.level !== void 0 && e.level !== this.fixedLevel || e.isStatic !== void 0 && e.isStatic !== this.isStatic;
|
|
4816
|
+
if (e.dataLayerId !== void 0 && (this.dataLayerId = e.dataLayerId || this.id), e.color !== void 0 && (this.color = e.color), e.opacity !== void 0 && (this.opacity = Number(e.opacity)), e.displayRange !== void 0 && (this.displayRange = Va(e.displayRange)), e.lodCalculationRange !== void 0 && (this.lodCalculationRange = Va(e.lodCalculationRange)), e.stackIndex !== void 0 && (this.stackIndex = e.stackIndex), e.subStackIndex !== void 0 && (this.subStackIndex = e.subStackIndex ?? 0), e.groupKey !== void 0 && (this.groupKey = e.groupKey || String(this.id)), !r && e.stackIndex !== void 0) for (let e of this.loadedTiles.values()) for (let { primitive: t } of e) ge(viewer, t, this.stackIndex, 0, {
|
|
4817
|
+
layerType: "zzts3dv2",
|
|
4818
|
+
groupKey: this.groupKey,
|
|
4819
|
+
subStackIndex: this.subStackIndex
|
|
4820
|
+
});
|
|
4821
|
+
r && (this.clearAllTiles(), this.getViewportInfo());
|
|
4822
|
+
}
|
|
4823
|
+
getCurrentLevel() {
|
|
4824
|
+
return this.currentNewLevel.value;
|
|
4825
|
+
}
|
|
4826
|
+
remove() {
|
|
4827
|
+
if (this.destroyed = !0, this.handlers) {
|
|
4828
|
+
try {
|
|
4829
|
+
viewer.camera.changed.removeEventListener(this.handlers);
|
|
4830
|
+
} catch (e) {
|
|
4831
|
+
console.warn("移除事件监听器失败:", e);
|
|
4832
|
+
}
|
|
4833
|
+
this.handlers = null;
|
|
4834
|
+
}
|
|
4835
|
+
this.clearAllTiles(), this.requestController &&= (this.requestController.abort(), null);
|
|
4836
|
+
}
|
|
4837
|
+
}, qa = new class {
|
|
4838
|
+
constructor() {
|
|
4839
|
+
this.layers = /* @__PURE__ */ new Map();
|
|
4840
|
+
}
|
|
4841
|
+
async createLayer(e) {
|
|
4842
|
+
let t = typeof e == "string" ? e : e?.layerId || e?.id;
|
|
4843
|
+
if (!t) return console.error("创建图层失败:缺少id参数"), null;
|
|
4844
|
+
if (this.layers.has(t)) {
|
|
4845
|
+
console.warn(`图层 ${t} 已存在,更新图层配置`);
|
|
4846
|
+
let n = this.layers.get(t);
|
|
4847
|
+
if (n.initPromise && await n.initPromise, n.destroyed) return this.layers.delete(t), this.createLayer(e);
|
|
4848
|
+
if (this.layers.get(t) !== n) return this.createLayer(e);
|
|
4849
|
+
let r = ja(n.renderSignature, e || {});
|
|
4850
|
+
return typeof n.updateOptions == "function" && (r ? n.updateOptions(e || {}) : n.updateOptions({
|
|
4851
|
+
stackIndex: e?.stackIndex,
|
|
4852
|
+
subStackIndex: e?.subStackIndex,
|
|
4853
|
+
groupKey: e?.groupKey
|
|
4854
|
+
})), r && (n.renderSignature = Aa(e || {})), n;
|
|
4855
|
+
}
|
|
4856
|
+
let n = new Ka(t, e?.isStatic, e?.level ?? null, e?.color ?? "255,255,255", e?.opacity ?? 1, e || {});
|
|
4857
|
+
n.renderSignature = Aa(e || {}), n.initPromise = n.init(), this.layers.set(t, n);
|
|
4858
|
+
try {
|
|
4859
|
+
if (await n.initPromise, n.destroyed) return this.layers.get(t) === n && this.layers.delete(t), null;
|
|
4860
|
+
} catch (e) {
|
|
4861
|
+
return console.error(`图层 ${t} 初始化失败:`, e), this.layers.delete(t), n.remove(), null;
|
|
4862
|
+
}
|
|
4863
|
+
return n;
|
|
4864
|
+
}
|
|
4865
|
+
removeLayer(e) {
|
|
4866
|
+
let t = this.layers.get(e);
|
|
4867
|
+
t && (t.remove(), this.layers.delete(e));
|
|
4868
|
+
}
|
|
4869
|
+
removeAllLayers() {
|
|
4870
|
+
this.layers.forEach((e) => e.remove()), this.layers.clear();
|
|
4871
|
+
}
|
|
4872
|
+
getLayer(e) {
|
|
4873
|
+
return this.layers.get(e);
|
|
4874
|
+
}
|
|
4875
|
+
getLayerIds() {
|
|
4876
|
+
return Array.from(this.layers.keys());
|
|
4877
|
+
}
|
|
4878
|
+
removeTilesByLayerId(e) {
|
|
4879
|
+
let t = this.layers.get(e);
|
|
4880
|
+
t && t.removeTilesOnly();
|
|
4881
|
+
}
|
|
4882
|
+
refreshLayer(e) {
|
|
4883
|
+
let t = this.layers.get(e);
|
|
4884
|
+
t && t.getViewportInfo();
|
|
4885
|
+
}
|
|
4886
|
+
}(), Ja = async (e) => qa.createLayer(e), Ya = (e) => qa.removeLayer(e), Xa = (e) => qa.getLayer(e);
|
|
4887
|
+
t(() => {
|
|
4888
|
+
let e = qa.getLayerIds();
|
|
4889
|
+
if (e.length > 0) {
|
|
4890
|
+
let t = qa.getLayer(e[0]);
|
|
4891
|
+
return t ? t.getCurrentLevel() : 15;
|
|
4892
|
+
}
|
|
4893
|
+
return 15;
|
|
4894
|
+
});
|
|
4895
|
+
//#endregion
|
|
4896
|
+
//#region src/zz-layer/zz-layer-zzts3dv2/index.vue
|
|
4897
|
+
var Za = {
|
|
4898
|
+
__name: "index",
|
|
4899
|
+
props: {
|
|
4900
|
+
config: {
|
|
4901
|
+
type: Object,
|
|
4902
|
+
default: () => ({})
|
|
4903
|
+
},
|
|
4904
|
+
stackIndex: {
|
|
4905
|
+
type: Number,
|
|
4906
|
+
default: -1
|
|
4907
|
+
},
|
|
4908
|
+
subStackIndex: {
|
|
4909
|
+
type: Number,
|
|
4910
|
+
default: 0
|
|
4911
|
+
},
|
|
4912
|
+
groupKey: {
|
|
4913
|
+
type: String,
|
|
4914
|
+
default: ""
|
|
4915
|
+
}
|
|
4916
|
+
},
|
|
4917
|
+
setup(e) {
|
|
4918
|
+
c("cesiumViewer");
|
|
4919
|
+
let n = e, r = {
|
|
4920
|
+
layerId: "",
|
|
4921
|
+
dataLayerId: "",
|
|
4922
|
+
color: "255,255,255",
|
|
4923
|
+
isStatic: !1,
|
|
4924
|
+
level: null,
|
|
4925
|
+
opacity: 1,
|
|
4926
|
+
layerOpacity: 1,
|
|
4927
|
+
dictCode: "",
|
|
4928
|
+
displayRange: null,
|
|
4929
|
+
lodCalculationRange: null
|
|
4930
|
+
}, i = t(() => ({
|
|
4931
|
+
...r,
|
|
4932
|
+
...n.config
|
|
4933
|
+
})), a = "";
|
|
4934
|
+
function o(e) {
|
|
4935
|
+
let t = e.level ? !0 : e.isStatic;
|
|
4936
|
+
return {
|
|
4937
|
+
layerId: e.layerId,
|
|
4938
|
+
dataLayerId: e.dataLayerId || e.layerId,
|
|
4939
|
+
color: e.color,
|
|
4940
|
+
isStatic: t,
|
|
4941
|
+
level: e.level,
|
|
4942
|
+
opacity: e.opacity,
|
|
4943
|
+
layerOpacity: e.layerOpacity,
|
|
4944
|
+
displayRange: e.displayRange,
|
|
4945
|
+
lodCalculationRange: e.lodCalculationRange,
|
|
4946
|
+
stackIndex: n.stackIndex,
|
|
4947
|
+
subStackIndex: n.subStackIndex,
|
|
4948
|
+
groupKey: n.groupKey || e.layerId
|
|
4949
|
+
};
|
|
4950
|
+
}
|
|
4951
|
+
let s = async () => {
|
|
4952
|
+
let e = i.value;
|
|
4953
|
+
if (!e.layerId) {
|
|
4954
|
+
console.warn("[zzLayerZzts3dv2] 缺少 layerId,跳过初始化", e);
|
|
4955
|
+
return;
|
|
4956
|
+
}
|
|
4957
|
+
let t = o(e), n = Xa(e.layerId);
|
|
4958
|
+
if (n && !ja(n.renderSignature, t)) {
|
|
4959
|
+
typeof n.updateOptions == "function" && n.updateOptions(t), a = e.layerId;
|
|
4960
|
+
return;
|
|
4961
|
+
}
|
|
4962
|
+
await Ja(t), a = e.layerId;
|
|
4963
|
+
}, l = () => {
|
|
4964
|
+
Ya(i.value.layerId);
|
|
4965
|
+
};
|
|
4966
|
+
return w(() => n.config, async () => {
|
|
4967
|
+
await s();
|
|
4968
|
+
}, {
|
|
4969
|
+
deep: !0,
|
|
4970
|
+
immediate: !0
|
|
4971
|
+
}), w(() => [
|
|
4972
|
+
n.stackIndex,
|
|
4973
|
+
n.subStackIndex,
|
|
4974
|
+
n.groupKey
|
|
4975
|
+
], () => {
|
|
4976
|
+
let e = i.value, t = Xa(e.layerId);
|
|
4977
|
+
if (t && typeof t.updateOptions == "function") {
|
|
4978
|
+
t.updateOptions({
|
|
4979
|
+
stackIndex: n.stackIndex,
|
|
4980
|
+
subStackIndex: n.subStackIndex,
|
|
4981
|
+
groupKey: n.groupKey || e.layerId
|
|
4982
|
+
});
|
|
4983
|
+
return;
|
|
4984
|
+
}
|
|
4985
|
+
s();
|
|
4986
|
+
}), f(() => {
|
|
4987
|
+
a ? Ya(a) : l();
|
|
4988
|
+
}), (e, t) => null;
|
|
4989
|
+
}
|
|
4554
4990
|
};
|
|
4555
4991
|
//#endregion
|
|
4556
4992
|
//#region src/zz-layer/zz-layer-shp-zzts/shpZztsRenderer.js
|
|
4557
|
-
function
|
|
4993
|
+
function Qa(e) {
|
|
4558
4994
|
if (!e) return null;
|
|
4559
4995
|
let t = Number(e.longitudeWest ?? e.west), n = Number(e.latitudeSouth ?? e.south), r = Number(e.longitudeEast ?? e.east), i = Number(e.latitudeNorth ?? e.north);
|
|
4560
4996
|
return ![
|
|
@@ -4569,7 +5005,7 @@ function Ba(e) {
|
|
|
4569
5005
|
north: i
|
|
4570
5006
|
};
|
|
4571
5007
|
}
|
|
4572
|
-
function
|
|
5008
|
+
function $a(e, t) {
|
|
4573
5009
|
if (!e || !t) return null;
|
|
4574
5010
|
let n = {
|
|
4575
5011
|
west: Math.max(e.west, t.west),
|
|
@@ -4579,78 +5015,90 @@ function Va(e, t) {
|
|
|
4579
5015
|
};
|
|
4580
5016
|
return n.west < n.east && n.south < n.north ? n : null;
|
|
4581
5017
|
}
|
|
4582
|
-
function
|
|
4583
|
-
let t = performance.now(), n = [], r = new DataView(e), i = r.getInt32(0, !0);
|
|
4584
|
-
if (
|
|
4585
|
-
console.log(`[ShpZzts] 瓦片数量: ${
|
|
4586
|
-
let
|
|
4587
|
-
for (let t = 0; t <
|
|
4588
|
-
let
|
|
4589
|
-
if (
|
|
4590
|
-
console.error(`[ShpZzts] dataLen 异常: ${
|
|
5018
|
+
function eo(e) {
|
|
5019
|
+
let t = performance.now(), n = [], r = new DataView(e), i = new TextDecoder(), a = r.getInt32(0, !0);
|
|
5020
|
+
if (a <= 0 || a > 1e5) return console.warn(`[ShpZzts] tileCount 异常: ${a},跳过解析`), n;
|
|
5021
|
+
console.log(`[ShpZzts] 瓦片数量: ${a}`);
|
|
5022
|
+
let o = 4;
|
|
5023
|
+
for (let t = 0; t < a; t++) {
|
|
5024
|
+
let a = r.getInt32(o, !0);
|
|
5025
|
+
if (o += 4, a <= 0 || a > 100 * 1024 * 1024) {
|
|
5026
|
+
console.error(`[ShpZzts] dataLen 异常: ${a},跳过瓦片 ${t}`), o += Math.max(0, a);
|
|
4591
5027
|
continue;
|
|
4592
5028
|
}
|
|
4593
|
-
let
|
|
4594
|
-
|
|
4595
|
-
let
|
|
4596
|
-
if (
|
|
4597
|
-
let e = s.
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
5029
|
+
let s = new Uint8Array(e, o, a), c = new DataView(s.buffer, s.byteOffset, s.byteLength);
|
|
5030
|
+
o += a;
|
|
5031
|
+
let l = 0, u = String(t), d = 0, f = c.getInt32(0, !0), p = !1;
|
|
5032
|
+
if (f > 0 && f <= 256 && a >= 4 + f + 8) {
|
|
5033
|
+
let e = f, t = s.slice(4, 4 + e), n = i.decode(t), r = 4 + e, o = !1;
|
|
5034
|
+
if (a >= r + 1 + 8) {
|
|
5035
|
+
let e = r + 1, t = c.getInt32(e, !0);
|
|
5036
|
+
if (t >= 24 && t % 24 == 0 && t <= a - e - 4) {
|
|
5037
|
+
let i = e + 4, s = c.getInt32(i, !0);
|
|
5038
|
+
r + 1 + 8 + t + s === a && s >= 0 && s % 4 == 0 && (u = n, d = c.getUint8(r), l = e, p = !0, o = !0);
|
|
5039
|
+
}
|
|
5040
|
+
}
|
|
5041
|
+
if (!o) {
|
|
5042
|
+
let t = r, i = c.getInt32(t, !0);
|
|
5043
|
+
if (i >= 24 && i % 24 == 0 && i <= a - t - 4) {
|
|
5044
|
+
let r = t + 4, o = c.getInt32(r, !0);
|
|
5045
|
+
4 + e + 8 + i + o === a && o >= 0 && o % 4 == 0 && (u = n, l = t, p = !0);
|
|
5046
|
+
}
|
|
4605
5047
|
}
|
|
4606
|
-
l = 4 + u;
|
|
4607
5048
|
}
|
|
4608
|
-
|
|
5049
|
+
p || (l = 0);
|
|
5050
|
+
let m = c.getInt32(l, !0);
|
|
4609
5051
|
l += 4;
|
|
4610
|
-
let
|
|
4611
|
-
if (l += 4,
|
|
4612
|
-
console.error(`[ShpZzts]
|
|
5052
|
+
let h = c.getInt32(l, !0);
|
|
5053
|
+
if (l += 4, m <= 0 || m % 24 != 0) {
|
|
5054
|
+
console.error(`[ShpZzts] positionsByteLen 非法: ${m},跳过瓦片 ${t}`);
|
|
5055
|
+
continue;
|
|
5056
|
+
}
|
|
5057
|
+
if (h < 0 || h % 4 != 0) {
|
|
5058
|
+
console.error(`[ShpZzts] indicesByteLen 非法: ${h},跳过瓦片 ${t}`);
|
|
4613
5059
|
continue;
|
|
4614
5060
|
}
|
|
4615
|
-
let
|
|
4616
|
-
if (h >
|
|
4617
|
-
console.error(`[ShpZzts]
|
|
5061
|
+
let g = s.byteLength - l;
|
|
5062
|
+
if (m + h > g) {
|
|
5063
|
+
console.error(`[ShpZzts] 数据长度溢出: pos=${m} + idx=${h} > remaining=${g},跳过瓦片 ${t}`);
|
|
4618
5064
|
continue;
|
|
4619
5065
|
}
|
|
4620
|
-
|
|
4621
|
-
|
|
5066
|
+
let _ = m / 8 / 3, v = s.slice(l, l + m), y = new Float64Array(v.buffer, v.byteOffset, _ * 3);
|
|
5067
|
+
l += m;
|
|
5068
|
+
let b = h / 4;
|
|
5069
|
+
if (b > 1e8) {
|
|
5070
|
+
console.error(`[ShpZzts] indexCount 异常巨大: ${b},跳过瓦片 ${t}`);
|
|
4622
5071
|
continue;
|
|
4623
5072
|
}
|
|
4624
|
-
let
|
|
4625
|
-
l +=
|
|
4626
|
-
let
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
for (let e = 0; e < _.length && !b; e++) isFinite(_[e]) || (b = !0);
|
|
4630
|
-
if (b) {
|
|
5073
|
+
let x = s.slice(l, l + h), S = new Uint32Array(x.buffer, x.byteOffset, b);
|
|
5074
|
+
l += h;
|
|
5075
|
+
let C = !1;
|
|
5076
|
+
for (let e = 0; e < y.length && !C; e++) isFinite(y[e]) || (C = !0);
|
|
5077
|
+
if (C) {
|
|
4631
5078
|
console.error(`[ShpZzts] NaN/Inf 坐标 tile=${t},跳过`);
|
|
4632
5079
|
continue;
|
|
4633
5080
|
}
|
|
4634
|
-
let
|
|
4635
|
-
for (let e = 0; e <
|
|
4636
|
-
if (
|
|
4637
|
-
console.error(`[ShpZzts] 索引越界 tile=${t} maxIdx=${
|
|
5081
|
+
let w = 0;
|
|
5082
|
+
for (let e = 0; e < S.length; e++) S[e] > w && (w = S[e]);
|
|
5083
|
+
if (w >= _) {
|
|
5084
|
+
console.error(`[ShpZzts] 索引越界 tile=${t} maxIdx=${w} vertexCount=${_},跳过`);
|
|
4638
5085
|
continue;
|
|
4639
5086
|
}
|
|
4640
5087
|
n.push({
|
|
4641
|
-
positions:
|
|
4642
|
-
indices:
|
|
4643
|
-
vertexCount:
|
|
4644
|
-
indexCount:
|
|
4645
|
-
featureId:
|
|
5088
|
+
positions: y,
|
|
5089
|
+
indices: S,
|
|
5090
|
+
vertexCount: _,
|
|
5091
|
+
indexCount: b,
|
|
5092
|
+
featureId: u,
|
|
5093
|
+
geometryKind: d
|
|
4646
5094
|
});
|
|
4647
5095
|
}
|
|
4648
|
-
let
|
|
4649
|
-
return console.log(`[ShpZzts] 解析完成: ${n.length} 要素, ${
|
|
5096
|
+
let s = (performance.now() - t).toFixed(1);
|
|
5097
|
+
return console.log(`[ShpZzts] 解析完成: ${n.length} 要素, ${s}ms`), n;
|
|
4650
5098
|
}
|
|
4651
|
-
var
|
|
5099
|
+
var to = class {
|
|
4652
5100
|
constructor(e, t = {}) {
|
|
4653
|
-
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.displayRange =
|
|
5101
|
+
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 = Qa(t.displayRange), this._userColor = t.color || null, 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;
|
|
4654
5102
|
}
|
|
4655
5103
|
_normOpacity(e) {
|
|
4656
5104
|
let t = Number(e);
|
|
@@ -4718,7 +5166,7 @@ var Ua = class {
|
|
|
4718
5166
|
south: D.Math.toDegrees(t.south),
|
|
4719
5167
|
east: D.Math.toDegrees(t.east),
|
|
4720
5168
|
north: D.Math.toDegrees(t.north)
|
|
4721
|
-
}, r = this.displayRange ?
|
|
5169
|
+
}, r = this.displayRange ? $a(n, this.displayRange) : n;
|
|
4722
5170
|
return {
|
|
4723
5171
|
requestBounds: r,
|
|
4724
5172
|
region: [
|
|
@@ -4736,12 +5184,21 @@ var Ua = class {
|
|
|
4736
5184
|
_updatePrimitiveAlpha(e, t) {
|
|
4737
5185
|
if (!e) return;
|
|
4738
5186
|
let n = this._normOpacity(t);
|
|
4739
|
-
for (let t of e) if (!(!t.primitive || t.primitive.isDestroyed?.()))
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
5187
|
+
for (let t of e) if (!(!t.primitive || t.primitive.isDestroyed?.())) {
|
|
5188
|
+
if (t.pointPrimitives) {
|
|
5189
|
+
for (let e = 0; e < t.pointPrimitives.length; e++) {
|
|
5190
|
+
let r = t.pointColors[e], i = t.pointPrimitives[e];
|
|
5191
|
+
r && i && (i.color = new D.Color(r.red, r.green, r.blue, n));
|
|
5192
|
+
}
|
|
5193
|
+
continue;
|
|
5194
|
+
}
|
|
5195
|
+
for (let e = 0; e < t.instanceIds.length; e++) {
|
|
5196
|
+
let r = t.instanceColors[e], i = new D.Color(r.red, r.green, r.blue, n);
|
|
5197
|
+
try {
|
|
5198
|
+
let n = t.primitive.getGeometryInstanceAttributes(t.instanceIds[e]);
|
|
5199
|
+
n?.color && (n.color = D.ColorGeometryInstanceAttribute.toValue(i));
|
|
5200
|
+
} catch {}
|
|
5201
|
+
}
|
|
4745
5202
|
}
|
|
4746
5203
|
}
|
|
4747
5204
|
_applyLayerOpacity() {
|
|
@@ -4782,12 +5239,38 @@ var Ua = class {
|
|
|
4782
5239
|
this.transitionAnimId = requestAnimationFrame(s);
|
|
4783
5240
|
}
|
|
4784
5241
|
_renderBatched(e, t, n, r, i) {
|
|
4785
|
-
let a = [], o = [];
|
|
4786
|
-
for (let t
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
let
|
|
4790
|
-
|
|
5242
|
+
let a = [], o = [], s = [];
|
|
5243
|
+
for (let t of e) t.geometryKind === 2 && (!t.indices || t.indexCount === 0) ? o.push(t) : s.push(t);
|
|
5244
|
+
if (o.length > 0) {
|
|
5245
|
+
let e = new D.PointPrimitiveCollection(), r = [], s = [], c = [], l = [], u = this._normOpacity(n) * this.opacity;
|
|
5246
|
+
for (let t of o) {
|
|
5247
|
+
let n = this.globalInstanceId++, a = this._resolveFeatureColor(t, i);
|
|
5248
|
+
c.push(n), l.push(a);
|
|
5249
|
+
let o = new D.Color(a.red, a.green, a.blue, u);
|
|
5250
|
+
for (let i = 0; i < t.vertexCount; i++) r.push(e.add({
|
|
5251
|
+
position: D.Cartesian3.fromArray(t.positions, i * 3),
|
|
5252
|
+
pixelSize: this.pointSize,
|
|
5253
|
+
color: o,
|
|
5254
|
+
id: n
|
|
5255
|
+
})), s.push(a);
|
|
5256
|
+
}
|
|
5257
|
+
this.viewer.scene.primitives.add(e), a.push({
|
|
5258
|
+
primitive: e,
|
|
5259
|
+
instanceIds: c,
|
|
5260
|
+
instanceColors: l,
|
|
5261
|
+
pointPrimitives: r,
|
|
5262
|
+
pointColors: s
|
|
5263
|
+
}), console.log(`[ShpZzts] LOD ${t} 原生点渲染完成: ${o.length} 要素 / ${r.length} 点`);
|
|
5264
|
+
}
|
|
5265
|
+
let c = [];
|
|
5266
|
+
for (let e = 0; e < s.length; e += this.batchSize) c.push(s.slice(e, e + this.batchSize));
|
|
5267
|
+
let l = 0, u = (o) => {
|
|
5268
|
+
if (o >= c.length) {
|
|
5269
|
+
this.lodPrimitives.set(t, a), r && requestAnimationFrame(() => r());
|
|
5270
|
+
return;
|
|
5271
|
+
}
|
|
5272
|
+
let s = c[o], d = [], f = [], p = [];
|
|
5273
|
+
for (let e of s) {
|
|
4791
5274
|
let t = this.globalInstanceId++;
|
|
4792
5275
|
d.push(t);
|
|
4793
5276
|
let r = this._resolveFeatureColor(e, i);
|
|
@@ -4814,7 +5297,7 @@ var Ua = class {
|
|
|
4814
5297
|
}
|
|
4815
5298
|
}
|
|
4816
5299
|
if (p.length === 0) {
|
|
4817
|
-
|
|
5300
|
+
l++, l < c.length ? requestAnimationFrame(() => u(o + 1)) : (this.lodPrimitives.set(t, a), r && requestAnimationFrame(() => r()));
|
|
4818
5301
|
return;
|
|
4819
5302
|
}
|
|
4820
5303
|
let m = new D.Primitive({
|
|
@@ -4831,9 +5314,9 @@ var Ua = class {
|
|
|
4831
5314
|
primitive: m,
|
|
4832
5315
|
instanceIds: d,
|
|
4833
5316
|
instanceColors: f
|
|
4834
|
-
}),
|
|
5317
|
+
}), l++, l < c.length ? requestAnimationFrame(() => u(o + 1)) : (this.lodPrimitives.set(t, a), console.log(`[ShpZzts] LOD ${t} 渲染完成: ${e.length} 要素 / ${c.length} 批`), r && requestAnimationFrame(() => r()));
|
|
4835
5318
|
};
|
|
4836
|
-
return
|
|
5319
|
+
return u(0), a;
|
|
4837
5320
|
}
|
|
4838
5321
|
async _getVectorTileData(e, t) {
|
|
4839
5322
|
let n = await k.request({
|
|
@@ -4898,7 +5381,7 @@ var Ua = class {
|
|
|
4898
5381
|
if (t.status === "fulfilled") {
|
|
4899
5382
|
let { geosot: e, data: n } = t.value;
|
|
4900
5383
|
if (n instanceof ArrayBuffer && n.byteLength > 0 && (console.log(`[ShpZzts] 瓦片 ${e} 数据长度: ${n.byteLength}`), n.byteLength > 100)) {
|
|
4901
|
-
let e =
|
|
5384
|
+
let e = eo(n);
|
|
4902
5385
|
e && e.length > 0 && (c = c.concat(e));
|
|
4903
5386
|
}
|
|
4904
5387
|
} else console.error(`[ShpZzts] 瓦片 ${a[e]?.geoSot} 加载失败:`, t.reason);
|
|
@@ -4955,7 +5438,7 @@ var Ua = class {
|
|
|
4955
5438
|
let n = this._normOpacity(e.opacity);
|
|
4956
5439
|
n !== this.opacity && (this.opacity = n, t = !0);
|
|
4957
5440
|
}
|
|
4958
|
-
e.stackIndex !== void 0 && (this.stackIndex = e.stackIndex), e.subStackIndex !== void 0 && (this.subStackIndex = e.subStackIndex), e.groupKey !== void 0 && (this.groupKey = e.groupKey), e.color !== void 0 && (this._userColor = e.color || null), e.displayRange !== void 0 && (this.displayRange =
|
|
5441
|
+
e.stackIndex !== void 0 && (this.stackIndex = e.stackIndex), e.subStackIndex !== void 0 && (this.subStackIndex = e.subStackIndex), e.groupKey !== void 0 && (this.groupKey = e.groupKey), e.color !== void 0 && (this._userColor = e.color || null), e.displayRange !== void 0 && (this.displayRange = Qa(e.displayRange));
|
|
4959
5442
|
let n = !1;
|
|
4960
5443
|
e.dictCode !== void 0 && e.dictCode !== this.dictCode && (this.dictCode = e.dictCode || "", n = !0), e.serviceName !== void 0 && e.serviceName !== this.serviceName && (this.serviceName = e.serviceName || "", n = !0), e.enableServiceColor !== void 0 && !!e.enableServiceColor !== this.enableServiceColor && (this.enableServiceColor = !!e.enableServiceColor, n = !0), e.modelColorUrl !== void 0 && e.modelColorUrl !== this.modelColorUrl && (this.modelColorUrl = e.modelColorUrl || "/v1/zzts/style/render/modelColors", n = !0), n && this.modelColorCache.clear(), t && this._applyLayerOpacity(), console.log(`[ShpZzts] 图层 ${this.id} 配置已更新`, {
|
|
4961
5444
|
opacity: this.opacity,
|
|
@@ -4963,15 +5446,15 @@ var Ua = class {
|
|
|
4963
5446
|
});
|
|
4964
5447
|
}
|
|
4965
5448
|
};
|
|
4966
|
-
function
|
|
5449
|
+
function no(e, t) {
|
|
4967
5450
|
return !e && !t ? !0 : !e || !t ? !1 : e.west === t.west && e.south === t.south && e.east === t.east && e.north === t.north;
|
|
4968
5451
|
}
|
|
4969
|
-
function
|
|
5452
|
+
function ro(e, t = {}) {
|
|
4970
5453
|
if (!e || e.destroyed) return !1;
|
|
4971
5454
|
let n = t.layerId || t.id;
|
|
4972
|
-
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.displayRange !== void 0 && !
|
|
5455
|
+
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.displayRange !== void 0 && !no(e.displayRange, Qa(t.displayRange)));
|
|
4973
5456
|
}
|
|
4974
|
-
var
|
|
5457
|
+
var io = new class {
|
|
4975
5458
|
constructor() {
|
|
4976
5459
|
this.layers = /* @__PURE__ */ new Map();
|
|
4977
5460
|
}
|
|
@@ -4979,7 +5462,7 @@ var Ka = new class {
|
|
|
4979
5462
|
let n = t?.layerId || t?.id;
|
|
4980
5463
|
if (!n) return console.error("[ShpZzts] 创建图层失败:缺少 layerId"), null;
|
|
4981
5464
|
this.layers.has(n) && (console.warn(`[ShpZzts] 图层 ${n} 已存在,移除旧图层后重建`), this.removeLayer(n));
|
|
4982
|
-
let r = new
|
|
5465
|
+
let r = new to(e, t);
|
|
4983
5466
|
return await r.init(), this.layers.set(n, r), r;
|
|
4984
5467
|
}
|
|
4985
5468
|
removeLayer(e) {
|
|
@@ -4992,9 +5475,9 @@ var Ka = new class {
|
|
|
4992
5475
|
removeAllLayers() {
|
|
4993
5476
|
this.layers.forEach((e) => e.remove()), this.layers.clear();
|
|
4994
5477
|
}
|
|
4995
|
-
}(),
|
|
4996
|
-
|
|
4997
|
-
},
|
|
5478
|
+
}(), ao = async (e, t) => io.createLayer(e, t), oo = (e) => {
|
|
5479
|
+
io.removeLayer(e);
|
|
5480
|
+
}, so = (e) => io.getLayer(e), co = {
|
|
4998
5481
|
__name: "index",
|
|
4999
5482
|
props: {
|
|
5000
5483
|
config: {
|
|
@@ -5053,9 +5536,9 @@ var Ka = new class {
|
|
|
5053
5536
|
return;
|
|
5054
5537
|
}
|
|
5055
5538
|
let t = s(e);
|
|
5056
|
-
o && o !== e.layerId &&
|
|
5057
|
-
let r =
|
|
5058
|
-
if (r &&
|
|
5539
|
+
o && o !== e.layerId && oo(o);
|
|
5540
|
+
let r = so(e.layerId);
|
|
5541
|
+
if (r && ro(r, t)) {
|
|
5059
5542
|
r.updateOptions(t), o = e.layerId;
|
|
5060
5543
|
return;
|
|
5061
5544
|
}
|
|
@@ -5064,9 +5547,9 @@ var Ka = new class {
|
|
|
5064
5547
|
calTilesUrl: t.calTilesUrl,
|
|
5065
5548
|
tileUrl: t.tileUrl,
|
|
5066
5549
|
opacity: t.opacity
|
|
5067
|
-
}), await
|
|
5550
|
+
}), await ao(n.value, t), o = e.layerId;
|
|
5068
5551
|
}, u = () => {
|
|
5069
|
-
|
|
5552
|
+
oo(a.value.layerId);
|
|
5070
5553
|
};
|
|
5071
5554
|
return w(() => r.config, async () => {
|
|
5072
5555
|
console.log("[zzLayerShpZzts] props.config changed =", JSON.parse(JSON.stringify(r.config || {}))), await l();
|
|
@@ -5078,7 +5561,7 @@ var Ka = new class {
|
|
|
5078
5561
|
r.subStackIndex,
|
|
5079
5562
|
r.groupKey
|
|
5080
5563
|
], () => {
|
|
5081
|
-
let e = a.value, t =
|
|
5564
|
+
let e = a.value, t = so(e.layerId);
|
|
5082
5565
|
if (t && typeof t.updateOptions == "function") {
|
|
5083
5566
|
t.updateOptions({
|
|
5084
5567
|
stackIndex: r.stackIndex,
|
|
@@ -5091,16 +5574,16 @@ var Ka = new class {
|
|
|
5091
5574
|
}), d(() => {
|
|
5092
5575
|
console.log("[zzLayerShpZzts] 组件挂载");
|
|
5093
5576
|
}), f(() => {
|
|
5094
|
-
console.log("[zzLayerShpZzts] 组件卸载,开始清理资源..."), o ?
|
|
5577
|
+
console.log("[zzLayerShpZzts] 组件卸载,开始清理资源..."), o ? oo(o) : u();
|
|
5095
5578
|
}), (e, t) => null;
|
|
5096
5579
|
}
|
|
5097
5580
|
};
|
|
5098
5581
|
//#endregion
|
|
5099
5582
|
//#region src/zz-layer/zz-layer-zzts3d-point/pointTileUtils.js
|
|
5100
|
-
function
|
|
5583
|
+
function lo(e) {
|
|
5101
5584
|
return e instanceof ArrayBuffer ? e : ArrayBuffer.isView(e) ? e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength) : null;
|
|
5102
5585
|
}
|
|
5103
|
-
function
|
|
5586
|
+
function uo(e) {
|
|
5104
5587
|
if (!e || e.byteLength === 0) return null;
|
|
5105
5588
|
let t = new Uint8Array(e), n = t.find((e) => e > 32);
|
|
5106
5589
|
if (n !== 123 && n !== 91) return null;
|
|
@@ -5110,41 +5593,41 @@ function Qa(e) {
|
|
|
5110
5593
|
return null;
|
|
5111
5594
|
}
|
|
5112
5595
|
}
|
|
5113
|
-
function
|
|
5596
|
+
function fo(e, t = {}) {
|
|
5114
5597
|
return console.warn("[zzts3d-point] skip invalid tile data:", e, t), [];
|
|
5115
5598
|
}
|
|
5116
|
-
var
|
|
5599
|
+
var po = [
|
|
5117
5600
|
13,
|
|
5118
5601
|
14,
|
|
5119
5602
|
15,
|
|
5120
5603
|
16,
|
|
5121
5604
|
18
|
|
5122
|
-
],
|
|
5123
|
-
function
|
|
5605
|
+
], mo = 16;
|
|
5606
|
+
function ho(e, t = mo) {
|
|
5124
5607
|
let n = Number(e);
|
|
5125
|
-
if (Number.isFinite(n) && n > 0) return
|
|
5608
|
+
if (Number.isFinite(n) && n > 0) return po.find((e) => n <= e) || po[po.length - 1];
|
|
5126
5609
|
let r = Number(t);
|
|
5127
|
-
return Number.isFinite(r) && r > 0 ?
|
|
5610
|
+
return Number.isFinite(r) && r > 0 ? po.find((e) => r <= e) || po[po.length - 1] : mo;
|
|
5128
5611
|
}
|
|
5129
|
-
function
|
|
5612
|
+
function go(e, t) {
|
|
5130
5613
|
let n = (String(e ?? "").split("_")[0].match(/\d/g) || []).length;
|
|
5131
|
-
return n > 0 ?
|
|
5614
|
+
return n > 0 ? ho(n, t) : ho(t);
|
|
5132
5615
|
}
|
|
5133
|
-
function
|
|
5134
|
-
let n =
|
|
5135
|
-
if (!n || n.byteLength < 4 ||
|
|
5616
|
+
function _o(e, t) {
|
|
5617
|
+
let n = lo(e);
|
|
5618
|
+
if (!n || n.byteLength < 4 || uo(n)) return [];
|
|
5136
5619
|
let r = [], i = new DataView(n), a = 0, o = i.getInt32(a, !0);
|
|
5137
|
-
if (a += 4, o < 0 || o > 1e5) return
|
|
5620
|
+
if (a += 4, o < 0 || o > 1e5) return fo("invalid entity count", {
|
|
5138
5621
|
entityCount: o,
|
|
5139
5622
|
byteLength: n.byteLength
|
|
5140
5623
|
});
|
|
5141
5624
|
for (let e = 0; e < o; e++) {
|
|
5142
|
-
if (a + 4 > n.byteLength) return
|
|
5625
|
+
if (a + 4 > n.byteLength) return fo("missing compressed chunk length", {
|
|
5143
5626
|
offset: a,
|
|
5144
5627
|
byteLength: n.byteLength
|
|
5145
5628
|
});
|
|
5146
5629
|
let e = i.getInt32(a, !0);
|
|
5147
|
-
if (a += 4, e <= 0 || a + e > n.byteLength) return
|
|
5630
|
+
if (a += 4, e <= 0 || a + e > n.byteLength) return fo("invalid compressed chunk length", {
|
|
5148
5631
|
compressedLength: e,
|
|
5149
5632
|
offset: a,
|
|
5150
5633
|
byteLength: n.byteLength
|
|
@@ -5158,11 +5641,11 @@ function io(e, t) {
|
|
|
5158
5641
|
} catch {
|
|
5159
5642
|
s = new DataView(o.buffer, o.byteOffset, o.byteLength);
|
|
5160
5643
|
}
|
|
5161
|
-
if (s.byteLength < 12) return
|
|
5644
|
+
if (s.byteLength < 12) return fo("chunk too small", { byteLength: s.byteLength });
|
|
5162
5645
|
let c = 0, l = s.getBigInt64(c, !0);
|
|
5163
5646
|
c += 8;
|
|
5164
5647
|
let u = s.getInt32(c, !0);
|
|
5165
|
-
if (c += 4, u < 0 || u % 12 != 0 || c + u > s.byteLength) return
|
|
5648
|
+
if (c += 4, u < 0 || u % 12 != 0 || c + u > s.byteLength) return fo("invalid positions byte length", {
|
|
5166
5649
|
positionsByteLength: u,
|
|
5167
5650
|
innerOffset: c,
|
|
5168
5651
|
byteLength: s.byteLength
|
|
@@ -5178,12 +5661,12 @@ function io(e, t) {
|
|
|
5178
5661
|
}
|
|
5179
5662
|
return r;
|
|
5180
5663
|
}
|
|
5181
|
-
function
|
|
5664
|
+
function vo({ destroyed: e, currentVersion: t, requestVersion: n, cancelToken: r } = {}) {
|
|
5182
5665
|
return !e && t === n && !r?.token?.reason;
|
|
5183
5666
|
}
|
|
5184
5667
|
//#endregion
|
|
5185
5668
|
//#region src/zz-layer/zz-layer-zzts3d-point/entityGrid.js
|
|
5186
|
-
function
|
|
5669
|
+
function yo(e) {
|
|
5187
5670
|
if (!e) return null;
|
|
5188
5671
|
let t = e;
|
|
5189
5672
|
if (typeof e == "string") try {
|
|
@@ -5205,7 +5688,7 @@ function oo(e) {
|
|
|
5205
5688
|
north: a
|
|
5206
5689
|
};
|
|
5207
5690
|
}
|
|
5208
|
-
function
|
|
5691
|
+
function bo(e, t) {
|
|
5209
5692
|
if (!e || !t) return null;
|
|
5210
5693
|
let n = {
|
|
5211
5694
|
west: Math.max(e.west, t.west),
|
|
@@ -5215,9 +5698,9 @@ function so(e, t) {
|
|
|
5215
5698
|
};
|
|
5216
5699
|
return n.west < n.east && n.south < n.north ? n : null;
|
|
5217
5700
|
}
|
|
5218
|
-
var
|
|
5701
|
+
var xo = class {
|
|
5219
5702
|
constructor(e, t = !1, n = null, r = "255,255,255", i = 5, a = 1, o = {}) {
|
|
5220
|
-
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 =
|
|
5703
|
+
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 = yo(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();
|
|
5221
5704
|
}
|
|
5222
5705
|
getBaseStyle() {
|
|
5223
5706
|
return {
|
|
@@ -5417,7 +5900,7 @@ var co = class {
|
|
|
5417
5900
|
south: i[1],
|
|
5418
5901
|
east: i[2],
|
|
5419
5902
|
north: i[3]
|
|
5420
|
-
}, o = this.displayRange ?
|
|
5903
|
+
}, o = this.displayRange ? bo(a, this.displayRange) : a;
|
|
5421
5904
|
if (!o) {
|
|
5422
5905
|
this.clearAllTiles();
|
|
5423
5906
|
return;
|
|
@@ -5456,11 +5939,11 @@ var co = class {
|
|
|
5456
5939
|
r.forEach((e) => {
|
|
5457
5940
|
if (this.isStatic && this.fixedLevel) e.geoSot = e.geoSot, e.level = t;
|
|
5458
5941
|
else {
|
|
5459
|
-
let r =
|
|
5942
|
+
let r = go(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));
|
|
5460
5943
|
N.entityGridLevels.filter((e) => e.max >= i && e.min <= i), e.geoSot = e.geoSot, e.level = r;
|
|
5461
5944
|
}
|
|
5462
5945
|
});
|
|
5463
|
-
let i = this.displayRange, a = r.filter((e) => i ? !!
|
|
5946
|
+
let i = this.displayRange, a = r.filter((e) => i ? !!bo({
|
|
5464
5947
|
west: Number(e?.xmin),
|
|
5465
5948
|
south: Number(e?.ymin),
|
|
5466
5949
|
east: Number(e?.xmax),
|
|
@@ -5491,7 +5974,7 @@ var co = class {
|
|
|
5491
5974
|
this.fadeAnimations.set(t, { interval: i });
|
|
5492
5975
|
}
|
|
5493
5976
|
isActiveRequest(e, t) {
|
|
5494
|
-
return
|
|
5977
|
+
return vo({
|
|
5495
5978
|
destroyed: this.destroyed,
|
|
5496
5979
|
currentVersion: this.requestVersion,
|
|
5497
5980
|
requestVersion: e,
|
|
@@ -5649,7 +6132,7 @@ var co = class {
|
|
|
5649
6132
|
this.handlers &&= (viewer.camera.changed.removeEventListener(this.handlers), null), this.clearAllTiles(), this.requestController &&= (this.requestController.abort(), null);
|
|
5650
6133
|
}
|
|
5651
6134
|
parseCompressedMeshData(e, t) {
|
|
5652
|
-
return
|
|
6135
|
+
return _o(e, t);
|
|
5653
6136
|
}
|
|
5654
6137
|
showPoint(e, t, n, r) {
|
|
5655
6138
|
viewer.entities.add({
|
|
@@ -5670,7 +6153,7 @@ var co = class {
|
|
|
5670
6153
|
}
|
|
5671
6154
|
});
|
|
5672
6155
|
}
|
|
5673
|
-
},
|
|
6156
|
+
}, So = new class {
|
|
5674
6157
|
constructor() {
|
|
5675
6158
|
this.layers = /* @__PURE__ */ new Map();
|
|
5676
6159
|
}
|
|
@@ -5680,9 +6163,9 @@ var co = class {
|
|
|
5680
6163
|
if (this.layers.has(t)) {
|
|
5681
6164
|
console.warn(`图层 ${t} 已存在`);
|
|
5682
6165
|
let i = this.layers.get(t), a = ja(i.renderSignature, e || {});
|
|
5683
|
-
return n && (i.tileColor = n), i.dictCode = e?.dictCode || i.dictCode || "", i.serviceName = e?.serviceName || i.serviceName || "", e?.displayRange !== void 0 && (i.displayRange =
|
|
6166
|
+
return n && (i.tileColor = n), i.dictCode = e?.dictCode || i.dictCode || "", i.serviceName = e?.serviceName || i.serviceName || "", e?.displayRange !== void 0 && (i.displayRange = yo(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 = Aa(e || {}), i.modelColorCache.clear(), i.clearAllTiles(), i.getViewportInfo()), i;
|
|
5684
6167
|
}
|
|
5685
|
-
let s = new
|
|
6168
|
+
let s = new xo(t, i, r, n, a, o, e);
|
|
5686
6169
|
s.renderSignature = Aa(e || {}), this.layers.set(t, s);
|
|
5687
6170
|
try {
|
|
5688
6171
|
return await s.init(), s.destroyed ? (this.layers.delete(t), null) : s;
|
|
@@ -5711,20 +6194,20 @@ var co = class {
|
|
|
5711
6194
|
let t = this.layers.get(e);
|
|
5712
6195
|
t && t.getViewportInfo();
|
|
5713
6196
|
}
|
|
5714
|
-
}(),
|
|
5715
|
-
|
|
5716
|
-
},
|
|
6197
|
+
}(), Co = async (e) => So.createLayer(e, !1), wo = (e) => {
|
|
6198
|
+
So.removeLayer(e);
|
|
6199
|
+
}, To = (e) => So.getLayer(e);
|
|
5717
6200
|
t(() => {
|
|
5718
|
-
let e =
|
|
6201
|
+
let e = So.getLayerIds();
|
|
5719
6202
|
if (e.length > 0) {
|
|
5720
|
-
let t =
|
|
6203
|
+
let t = So.getLayer(e[0]);
|
|
5721
6204
|
return t ? t.getCurrentLevel() : 15;
|
|
5722
6205
|
}
|
|
5723
6206
|
return 15;
|
|
5724
6207
|
});
|
|
5725
6208
|
//#endregion
|
|
5726
6209
|
//#region src/zz-layer/zz-layer-zzts3d-point/index.vue
|
|
5727
|
-
var
|
|
6210
|
+
var Eo = {
|
|
5728
6211
|
__name: "index",
|
|
5729
6212
|
props: { config: {
|
|
5730
6213
|
type: Object,
|
|
@@ -5790,8 +6273,8 @@ var mo = {
|
|
|
5790
6273
|
let S = async () => {
|
|
5791
6274
|
let e = ++u, t = _.value;
|
|
5792
6275
|
if (!t.layerId) return;
|
|
5793
|
-
let n = x(t), i =
|
|
5794
|
-
if (i && !ja(i.renderSignature, n) ? s.value = i : s.value = await
|
|
6276
|
+
let n = x(t), i = To(t.layerId);
|
|
6277
|
+
if (i && !ja(i.renderSignature, n) ? s.value = i : s.value = await Co(n), !(m || e !== u)) {
|
|
5795
6278
|
if (l.value && _.value.highlightEnabled && s.value?.setHighlight && s.value.setHighlight(l.value, {
|
|
5796
6279
|
highlightColor: _.value.highlightColor,
|
|
5797
6280
|
highlightOpacity: _.value.highlightOpacity,
|
|
@@ -5831,7 +6314,7 @@ var mo = {
|
|
|
5831
6314
|
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
5832
6315
|
}
|
|
5833
6316
|
}, C = () => {
|
|
5834
|
-
b(), v(), s.value = null,
|
|
6317
|
+
b(), v(), s.value = null, wo(_.value.layerId || i.config.layerId);
|
|
5835
6318
|
};
|
|
5836
6319
|
return w(_, () => {
|
|
5837
6320
|
S();
|
|
@@ -5842,7 +6325,7 @@ var mo = {
|
|
|
5842
6325
|
console.log("组件卸载,开始清理资源..."), m = !0, u++, d++, p?.abort(), p = null, C();
|
|
5843
6326
|
}), (e, t) => null;
|
|
5844
6327
|
}
|
|
5845
|
-
},
|
|
6328
|
+
}, Do = {
|
|
5846
6329
|
__name: "queryPoint",
|
|
5847
6330
|
props: {
|
|
5848
6331
|
config: {
|
|
@@ -6025,17 +6508,17 @@ var mo = {
|
|
|
6025
6508
|
C(), x([]);
|
|
6026
6509
|
}), (e, t) => null;
|
|
6027
6510
|
}
|
|
6028
|
-
},
|
|
6029
|
-
function
|
|
6511
|
+
}, Oo = 30, ko = 6378137, Ao = 1 / 298.257223563, jo = 2 * Ao - Ao * Ao;
|
|
6512
|
+
function Mo(e) {
|
|
6030
6513
|
return e instanceof ArrayBuffer ? e : ArrayBuffer.isView(e) ? e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength) : null;
|
|
6031
6514
|
}
|
|
6032
|
-
function
|
|
6033
|
-
let r = Math.atan2(t, e), i = Math.sqrt(e * e + t * t), a = Math.atan2(n, i * (1 -
|
|
6515
|
+
function No(e, t, n) {
|
|
6516
|
+
let r = Math.atan2(t, e), i = Math.sqrt(e * e + t * t), a = Math.atan2(n, i * (1 - jo)), o = 0;
|
|
6034
6517
|
for (let e = 0; e < 10; e++) {
|
|
6035
|
-
let e = Math.sin(a), t =
|
|
6518
|
+
let e = Math.sin(a), t = ko / Math.sqrt(1 - jo * e * e);
|
|
6036
6519
|
o = i / Math.cos(a) - t;
|
|
6037
6520
|
let r = a;
|
|
6038
|
-
if (a = Math.atan2(n, i * (1 -
|
|
6521
|
+
if (a = Math.atan2(n, i * (1 - jo * t / (t + o))), Math.abs(a - r) < 1e-12) break;
|
|
6039
6522
|
}
|
|
6040
6523
|
return [
|
|
6041
6524
|
(r * 180 / Math.PI + 540) % 360 - 180,
|
|
@@ -6043,8 +6526,8 @@ function xo(e, t, n) {
|
|
|
6043
6526
|
o
|
|
6044
6527
|
];
|
|
6045
6528
|
}
|
|
6046
|
-
function
|
|
6047
|
-
let t =
|
|
6529
|
+
function Po(e) {
|
|
6530
|
+
let t = Mo(e);
|
|
6048
6531
|
if (!t || t.byteLength < 4) return null;
|
|
6049
6532
|
let n = new DataView(t), r = 0, i = n.getInt32(r, !0);
|
|
6050
6533
|
if (r += 4, i <= 0 || i > 1e4) return console.warn("[zzts3d-las] invalid blob count:", i), null;
|
|
@@ -6063,7 +6546,7 @@ function So(e) {
|
|
|
6063
6546
|
}
|
|
6064
6547
|
else f = d;
|
|
6065
6548
|
let p = new DataView(f.buffer, f.byteOffset, 4).getInt32(0, !0);
|
|
6066
|
-
p > 0 && p *
|
|
6549
|
+
p > 0 && p * Oo + 4 <= f.byteLength && (a += p, o.push({
|
|
6067
6550
|
raw: f,
|
|
6068
6551
|
pointCount: p
|
|
6069
6552
|
}));
|
|
@@ -6089,7 +6572,7 @@ function So(e) {
|
|
|
6089
6572
|
n += 2;
|
|
6090
6573
|
let S = t.getUint8(n);
|
|
6091
6574
|
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;
|
|
6092
|
-
let [C, w, T] =
|
|
6575
|
+
let [C, w, T] = No(e, r, i);
|
|
6093
6576
|
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++;
|
|
6094
6577
|
}
|
|
6095
6578
|
}
|
|
@@ -6109,7 +6592,7 @@ function So(e) {
|
|
|
6109
6592
|
maxH: _
|
|
6110
6593
|
};
|
|
6111
6594
|
}
|
|
6112
|
-
function
|
|
6595
|
+
function Fo() {
|
|
6113
6596
|
return {
|
|
6114
6597
|
positions: new Float64Array(),
|
|
6115
6598
|
heights: new Float32Array(),
|
|
@@ -6126,8 +6609,8 @@ function Co() {
|
|
|
6126
6609
|
maxH: 0
|
|
6127
6610
|
};
|
|
6128
6611
|
}
|
|
6129
|
-
function
|
|
6130
|
-
if (!e || e.length === 0) return
|
|
6612
|
+
function Io(e) {
|
|
6613
|
+
if (!e || e.length === 0) return Fo();
|
|
6131
6614
|
if (e.length === 1) return e[0];
|
|
6132
6615
|
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;
|
|
6133
6616
|
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;
|
|
@@ -6149,12 +6632,12 @@ function wo(e) {
|
|
|
6149
6632
|
}
|
|
6150
6633
|
//#endregion
|
|
6151
6634
|
//#region src/zz-layer/zz-layer-zzts3d-las/entityGrid.js
|
|
6152
|
-
var
|
|
6635
|
+
var Lo = 3e5, Ro = 4, zo = 3, Bo = [
|
|
6153
6636
|
74,
|
|
6154
6637
|
144,
|
|
6155
6638
|
217
|
|
6156
6639
|
];
|
|
6157
|
-
function
|
|
6640
|
+
function Vo(e) {
|
|
6158
6641
|
switch (e) {
|
|
6159
6642
|
case 2: return [
|
|
6160
6643
|
139,
|
|
@@ -6208,7 +6691,7 @@ function ko(e) {
|
|
|
6208
6691
|
];
|
|
6209
6692
|
}
|
|
6210
6693
|
}
|
|
6211
|
-
function
|
|
6694
|
+
function Ho(e) {
|
|
6212
6695
|
let t = [
|
|
6213
6696
|
[
|
|
6214
6697
|
40,
|
|
@@ -6242,7 +6725,7 @@ function Ao(e) {
|
|
|
6242
6725
|
Math.round(t[r][2] + (t[r + 1][2] - t[r][2]) * i)
|
|
6243
6726
|
];
|
|
6244
6727
|
}
|
|
6245
|
-
function
|
|
6728
|
+
function Uo(e, t, n) {
|
|
6246
6729
|
let r = e.pointCount, i = new Uint8Array(r * 4), a = Math.round(Math.min(1, Math.max(0, n)) * 255);
|
|
6247
6730
|
if (t === "rgb" && e.hasRgb) for (let t = 0; t < r; t++) {
|
|
6248
6731
|
let n = t * 3, r = t * 4;
|
|
@@ -6256,26 +6739,26 @@ function jo(e, t, n) {
|
|
|
6256
6739
|
}
|
|
6257
6740
|
let o = Math.max(1, n - t);
|
|
6258
6741
|
for (let n = 0; n < r; n++) {
|
|
6259
|
-
let r =
|
|
6742
|
+
let r = Ho((e.intensity[n] - t) / o), s = n * 4;
|
|
6260
6743
|
i[s] = r[0], i[s + 1] = r[1], i[s + 2] = r[2], i[s + 3] = a;
|
|
6261
6744
|
}
|
|
6262
6745
|
} else if (t === "classification") for (let t = 0; t < r; t++) {
|
|
6263
|
-
let n =
|
|
6746
|
+
let n = Vo(e.classification[t]), r = t * 4;
|
|
6264
6747
|
i[r] = n[0], i[r + 1] = n[1], i[r + 2] = n[2], i[r + 3] = a;
|
|
6265
6748
|
}
|
|
6266
6749
|
else if (t === "height") {
|
|
6267
6750
|
let t = Math.max(.001, e.maxH - e.minH);
|
|
6268
6751
|
for (let n = 0; n < r; n++) {
|
|
6269
|
-
let r =
|
|
6752
|
+
let r = Ho((e.heights[n] - e.minH) / t), o = n * 4;
|
|
6270
6753
|
i[o] = r[0], i[o + 1] = r[1], i[o + 2] = r[2], i[o + 3] = a;
|
|
6271
6754
|
}
|
|
6272
6755
|
} else for (let e = 0; e < r; e++) {
|
|
6273
6756
|
let t = e * 4;
|
|
6274
|
-
i[t] =
|
|
6757
|
+
i[t] = Bo[0], i[t + 1] = Bo[1], i[t + 2] = Bo[2], i[t + 3] = a;
|
|
6275
6758
|
}
|
|
6276
6759
|
return i;
|
|
6277
6760
|
}
|
|
6278
|
-
function
|
|
6761
|
+
function Wo(e) {
|
|
6279
6762
|
return `
|
|
6280
6763
|
in float batchId;
|
|
6281
6764
|
in vec3 position3DHigh;
|
|
@@ -6291,12 +6774,12 @@ function Mo(e) {
|
|
|
6291
6774
|
}
|
|
6292
6775
|
`;
|
|
6293
6776
|
}
|
|
6294
|
-
var
|
|
6295
|
-
function
|
|
6777
|
+
var Go = "\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";
|
|
6778
|
+
function Ko(e) {
|
|
6296
6779
|
return new Cesium.Appearance({
|
|
6297
6780
|
translucent: !0,
|
|
6298
|
-
vertexShaderSource:
|
|
6299
|
-
fragmentShaderSource:
|
|
6781
|
+
vertexShaderSource: Wo(e),
|
|
6782
|
+
fragmentShaderSource: Go,
|
|
6300
6783
|
renderState: {
|
|
6301
6784
|
depthTest: { enabled: !0 },
|
|
6302
6785
|
depthMask: !0,
|
|
@@ -6304,7 +6787,7 @@ function Po(e) {
|
|
|
6304
6787
|
}
|
|
6305
6788
|
});
|
|
6306
6789
|
}
|
|
6307
|
-
var
|
|
6790
|
+
var qo = class {
|
|
6308
6791
|
constructor(e = {}) {
|
|
6309
6792
|
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;
|
|
6310
6793
|
}
|
|
@@ -6373,7 +6856,7 @@ var Fo = class {
|
|
|
6373
6856
|
0
|
|
6374
6857
|
];
|
|
6375
6858
|
}
|
|
6376
|
-
async fetchTileWithRetry(e, t, n =
|
|
6859
|
+
async fetchTileWithRetry(e, t, n = zo) {
|
|
6377
6860
|
let r;
|
|
6378
6861
|
for (let i = 1; i <= n; i++) try {
|
|
6379
6862
|
return (await k.request({
|
|
@@ -6431,7 +6914,7 @@ var Fo = class {
|
|
|
6431
6914
|
}
|
|
6432
6915
|
this.visibleTileKeys = s;
|
|
6433
6916
|
let c = Array(o.length), l = 0;
|
|
6434
|
-
if (await Promise.all(Array.from({ length: Math.min(
|
|
6917
|
+
if (await Promise.all(Array.from({ length: Math.min(Ro, o.length) }, async () => {
|
|
6435
6918
|
for (; l < o.length;) {
|
|
6436
6919
|
let e = l++, t = o[e], r = {
|
|
6437
6920
|
layerId: this.id,
|
|
@@ -6462,14 +6945,14 @@ var Fo = class {
|
|
|
6462
6945
|
let d = [];
|
|
6463
6946
|
for (let e of c) {
|
|
6464
6947
|
if (e.status !== "fulfilled" || !e.value?.byteLength) continue;
|
|
6465
|
-
let t =
|
|
6948
|
+
let t = Po(e.value);
|
|
6466
6949
|
t && t.pointCount > 0 && d.push(t);
|
|
6467
6950
|
}
|
|
6468
6951
|
if (d.length === 0) {
|
|
6469
6952
|
console.warn("[zzts3d-las] 当前视口无有效点数据");
|
|
6470
6953
|
return;
|
|
6471
6954
|
}
|
|
6472
|
-
let f =
|
|
6955
|
+
let f = Io(d);
|
|
6473
6956
|
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);
|
|
6474
6957
|
} catch (e) {
|
|
6475
6958
|
!M.isCancel(e) && !this.destroyed && console.error("[zzts3d-las] 视口瓦片加载失败:", e);
|
|
@@ -6481,9 +6964,9 @@ var Fo = class {
|
|
|
6481
6964
|
if (!viewer || e.pointCount === 0) return;
|
|
6482
6965
|
let n = ++this.renderGeneration;
|
|
6483
6966
|
this.removeCurrentPrimitives();
|
|
6484
|
-
let r =
|
|
6485
|
-
for (let t = 0; t < i; t +=
|
|
6486
|
-
let n = Math.min(i, t +
|
|
6967
|
+
let r = Uo(e, t, this.opacity), i = e.pointCount, a = [];
|
|
6968
|
+
for (let t = 0; t < i; t += Lo) {
|
|
6969
|
+
let n = Math.min(i, t + Lo);
|
|
6487
6970
|
a.push({
|
|
6488
6971
|
positions: e.positions.slice(t * 3, n * 3),
|
|
6489
6972
|
colors: r.slice(t * 4, n * 4)
|
|
@@ -6509,7 +6992,7 @@ var Fo = class {
|
|
|
6509
6992
|
boundingSphere: Cesium.BoundingSphere.fromVertices(e.positions)
|
|
6510
6993
|
}), i = new Cesium.Primitive({
|
|
6511
6994
|
geometryInstances: new Cesium.GeometryInstance({ geometry: r }),
|
|
6512
|
-
appearance:
|
|
6995
|
+
appearance: Ko(this.pointSize),
|
|
6513
6996
|
asynchronous: !1,
|
|
6514
6997
|
allowPicking: !1
|
|
6515
6998
|
});
|
|
@@ -6517,7 +7000,7 @@ var Fo = class {
|
|
|
6517
7000
|
};
|
|
6518
7001
|
requestAnimationFrame(s);
|
|
6519
7002
|
}
|
|
6520
|
-
},
|
|
7003
|
+
}, Jo = new class {
|
|
6521
7004
|
constructor() {
|
|
6522
7005
|
this.layers = /* @__PURE__ */ new Map();
|
|
6523
7006
|
}
|
|
@@ -6528,7 +7011,7 @@ var Fo = class {
|
|
|
6528
7011
|
let n = this.layers.get(t);
|
|
6529
7012
|
return n.pointSize = e?.pointSize ?? n.pointSize, n.opacity = e?.opacity ?? n.opacity, n.colorMode = e?.colorMode ?? n.colorMode, n;
|
|
6530
7013
|
}
|
|
6531
|
-
let n = new
|
|
7014
|
+
let n = new qo(e);
|
|
6532
7015
|
this.layers.set(t, n);
|
|
6533
7016
|
try {
|
|
6534
7017
|
return await n.init(), n.destroyed ? (this.layers.delete(t), null) : n;
|
|
@@ -6543,7 +7026,7 @@ var Fo = class {
|
|
|
6543
7026
|
getLayer(e) {
|
|
6544
7027
|
return this.layers.get(e);
|
|
6545
7028
|
}
|
|
6546
|
-
}(),
|
|
7029
|
+
}(), Yo = (e) => Jo.createLayer(e), Xo = (e) => Jo.removeLayer(e), Zo = (e) => Jo.getLayer(e), Qo = {
|
|
6547
7030
|
__name: "index",
|
|
6548
7031
|
props: { config: {
|
|
6549
7032
|
type: Object,
|
|
@@ -6563,10 +7046,10 @@ var Fo = class {
|
|
|
6563
7046
|
++a;
|
|
6564
7047
|
let e = i.value;
|
|
6565
7048
|
if (!e.layerId) return;
|
|
6566
|
-
let t =
|
|
6567
|
-
t ? (t.pointSize = e.pointSize, t.opacity = e.opacity, t.colorMode = e.colorMode) : await
|
|
7049
|
+
let t = Zo(e.layerId);
|
|
7050
|
+
t ? (t.pointSize = e.pointSize, t.opacity = e.opacity, t.colorMode = e.colorMode) : await Yo(e);
|
|
6568
7051
|
}, s = () => {
|
|
6569
|
-
|
|
7052
|
+
Xo(n.config?.layerId || i.value.layerId);
|
|
6570
7053
|
};
|
|
6571
7054
|
return w(i, () => {
|
|
6572
7055
|
o();
|
|
@@ -6577,7 +7060,7 @@ var Fo = class {
|
|
|
6577
7060
|
a++, s();
|
|
6578
7061
|
}), (e, t) => null;
|
|
6579
7062
|
}
|
|
6580
|
-
},
|
|
7063
|
+
}, $o = "__zzts3dGridPickable", es = {
|
|
6581
7064
|
__name: "index",
|
|
6582
7065
|
props: { config: {
|
|
6583
7066
|
type: Object,
|
|
@@ -6677,7 +7160,7 @@ var Fo = class {
|
|
|
6677
7160
|
b && y.remove(b), x && y.remove(x);
|
|
6678
7161
|
} catch {}
|
|
6679
7162
|
try {
|
|
6680
|
-
b && delete b[
|
|
7163
|
+
b && delete b[$o], x && delete x[$o];
|
|
6681
7164
|
} catch {}
|
|
6682
7165
|
b = null, x = null;
|
|
6683
7166
|
}
|
|
@@ -6696,7 +7179,7 @@ var Fo = class {
|
|
|
6696
7179
|
return t.startsWith("grid_outline_") ? t.slice(13) : t;
|
|
6697
7180
|
}
|
|
6698
7181
|
function j() {
|
|
6699
|
-
b && (b[
|
|
7182
|
+
b && (b[$o] = !0), x && (x[$o] = !0);
|
|
6700
7183
|
}
|
|
6701
7184
|
function M(e, t) {
|
|
6702
7185
|
return Cesium.ColorGeometryInstanceAttribute.toValue(C(e, t));
|
|
@@ -6739,7 +7222,7 @@ var Fo = class {
|
|
|
6739
7222
|
if (!t?.length) return null;
|
|
6740
7223
|
for (let e = 0; e < t.length; e++) {
|
|
6741
7224
|
let n = t[e], r = n?.primitive;
|
|
6742
|
-
if (r && (r[
|
|
7225
|
+
if (r && (r[$o] === !0 || r === b || r === x)) return n;
|
|
6743
7226
|
}
|
|
6744
7227
|
return null;
|
|
6745
7228
|
}
|
|
@@ -6788,9 +7271,9 @@ var Fo = class {
|
|
|
6788
7271
|
y = null;
|
|
6789
7272
|
}
|
|
6790
7273
|
function z(e) {
|
|
6791
|
-
h && _.has(h) &&
|
|
7274
|
+
h && _.has(h) && B(_.get(h), e);
|
|
6792
7275
|
}
|
|
6793
|
-
function
|
|
7276
|
+
function B(e, t) {
|
|
6794
7277
|
let n = ++m, i = E();
|
|
6795
7278
|
if (!i) return;
|
|
6796
7279
|
D();
|
|
@@ -6841,7 +7324,7 @@ var Fo = class {
|
|
|
6841
7324
|
}, p = [];
|
|
6842
7325
|
b?.readyPromise && p.push(b.readyPromise), x?.readyPromise && p.push(x.readyPromise), p.length ? Promise.all(p).then(f, f) : f();
|
|
6843
7326
|
}
|
|
6844
|
-
async function
|
|
7327
|
+
async function ee() {
|
|
6845
7328
|
if (!r.value) return;
|
|
6846
7329
|
let e = l.value || {}, t = e.modelId;
|
|
6847
7330
|
if (!t) {
|
|
@@ -6870,10 +7353,10 @@ var Fo = class {
|
|
|
6870
7353
|
if (!a || !a.byteLength) return;
|
|
6871
7354
|
i = T(a), _.set(t, i);
|
|
6872
7355
|
}
|
|
6873
|
-
n === p && (h = t,
|
|
7356
|
+
n === p && (h = t, B(i, e));
|
|
6874
7357
|
}
|
|
6875
7358
|
return w(() => l.value.modelId, () => {
|
|
6876
|
-
|
|
7359
|
+
ee();
|
|
6877
7360
|
}, { immediate: !0 }), w(() => [l.value.fill, l.value.line], () => {
|
|
6878
7361
|
let e = l.value || {};
|
|
6879
7362
|
e?.modelId && z(e);
|
|
@@ -6885,11 +7368,11 @@ var Fo = class {
|
|
|
6885
7368
|
p++, m++, v.forEach((e) => e.abort()), v.clear(), _.clear(), h = "", R();
|
|
6886
7369
|
}), (e, t) => null;
|
|
6887
7370
|
}
|
|
6888
|
-
},
|
|
7371
|
+
}, ts = (e, t) => {
|
|
6889
7372
|
let n = e.__vccOpts || e;
|
|
6890
7373
|
for (let [e, r] of t) n[e] = r;
|
|
6891
7374
|
return n;
|
|
6892
|
-
},
|
|
7375
|
+
}, ns = "__zzts3dGridColorPickable", rs = /*#__PURE__*/ ts({
|
|
6893
7376
|
__name: "color",
|
|
6894
7377
|
props: { config: {
|
|
6895
7378
|
type: Object,
|
|
@@ -6990,7 +7473,7 @@ var Fo = class {
|
|
|
6990
7473
|
D && E.remove(D), O && E.remove(O);
|
|
6991
7474
|
} catch {}
|
|
6992
7475
|
try {
|
|
6993
|
-
D && delete D[
|
|
7476
|
+
D && delete D[ns], O && delete O[ns];
|
|
6994
7477
|
} catch {}
|
|
6995
7478
|
D = null, O = null;
|
|
6996
7479
|
}
|
|
@@ -7019,16 +7502,16 @@ var Fo = class {
|
|
|
7019
7502
|
let r = Number.parseInt(n, 10);
|
|
7020
7503
|
return Number.isFinite(r) ? r : -1;
|
|
7021
7504
|
}
|
|
7022
|
-
function
|
|
7023
|
-
D && (D[
|
|
7505
|
+
function B() {
|
|
7506
|
+
D && (D[ns] = !0), O && (O[ns] = !0);
|
|
7024
7507
|
}
|
|
7025
|
-
function
|
|
7508
|
+
function ee(e, t) {
|
|
7026
7509
|
return Cesium.ColorGeometryInstanceAttribute.toValue(j(e, t));
|
|
7027
7510
|
}
|
|
7028
|
-
function
|
|
7511
|
+
function V(e) {
|
|
7029
7512
|
return Cesium.ColorGeometryInstanceAttribute.toValue(e);
|
|
7030
7513
|
}
|
|
7031
|
-
function
|
|
7514
|
+
function te(e) {
|
|
7032
7515
|
if (e == null || e < 0) return;
|
|
7033
7516
|
let t = y.value, n = (S ? C.get(S) : null)?.[e];
|
|
7034
7517
|
if (!n) return;
|
|
@@ -7036,17 +7519,17 @@ var Fo = class {
|
|
|
7036
7519
|
try {
|
|
7037
7520
|
if (D?.ready) {
|
|
7038
7521
|
let e = D.getGeometryInstanceAttributes(o);
|
|
7039
|
-
e?.color && (e.color =
|
|
7522
|
+
e?.color && (e.color = V(a));
|
|
7040
7523
|
}
|
|
7041
7524
|
if (O?.ready) {
|
|
7042
7525
|
let e = O.getGeometryInstanceAttributes(s);
|
|
7043
|
-
e?.color && t.line?.show !== !1 && (e.color =
|
|
7526
|
+
e?.color && t.line?.show !== !1 && (e.color = ee(t.line?.color, t.line?.opacity));
|
|
7044
7527
|
}
|
|
7045
7528
|
} catch {}
|
|
7046
7529
|
}
|
|
7047
|
-
function
|
|
7530
|
+
function ne(e) {
|
|
7048
7531
|
if (e == null || e < 0) return;
|
|
7049
|
-
let t = y.value, n =
|
|
7532
|
+
let t = y.value, n = ee(t.highlightColor, t.highlightOpacity ?? 1), r = `grid_fill_${e}`, i = `grid_outline_${e}`;
|
|
7050
7533
|
try {
|
|
7051
7534
|
if (D?.ready) {
|
|
7052
7535
|
let e = D.getGeometryInstanceAttributes(r);
|
|
@@ -7058,9 +7541,9 @@ var Fo = class {
|
|
|
7058
7541
|
}
|
|
7059
7542
|
} catch {}
|
|
7060
7543
|
}
|
|
7061
|
-
function
|
|
7544
|
+
function re() {
|
|
7062
7545
|
let e = m.value;
|
|
7063
|
-
e != null && (
|
|
7546
|
+
e != null && (te(e), m.value = null);
|
|
7064
7547
|
}
|
|
7065
7548
|
function ie(e) {
|
|
7066
7549
|
if (!a.value?.scene?.drillPick) return null;
|
|
@@ -7068,7 +7551,7 @@ var Fo = class {
|
|
|
7068
7551
|
if (!t?.length) return null;
|
|
7069
7552
|
for (let e = 0; e < t.length; e++) {
|
|
7070
7553
|
let n = t[e], r = n?.primitive;
|
|
7071
|
-
if (r && (r[
|
|
7554
|
+
if (r && (r[ns] === !0 || r === D || r === O)) return n;
|
|
7072
7555
|
}
|
|
7073
7556
|
return null;
|
|
7074
7557
|
}
|
|
@@ -7078,26 +7561,26 @@ var Fo = class {
|
|
|
7078
7561
|
function oe() {
|
|
7079
7562
|
if (I(), a.value) {
|
|
7080
7563
|
if (!y.value.queryEnabled) {
|
|
7081
|
-
|
|
7564
|
+
re(), L();
|
|
7082
7565
|
return;
|
|
7083
7566
|
}
|
|
7084
|
-
!D && !O || (
|
|
7567
|
+
!D && !O || (B(), l.value = new Cesium.ScreenSpaceEventHandler(a.value.scene.canvas), l.value.setInputAction((e) => {
|
|
7085
7568
|
try {
|
|
7086
7569
|
let t = y.value, n = ie(e);
|
|
7087
7570
|
if (!n) {
|
|
7088
|
-
|
|
7571
|
+
re(), L(), s("point-click", {});
|
|
7089
7572
|
return;
|
|
7090
7573
|
}
|
|
7091
7574
|
let r = z(n.id), i = ae(), a = r >= 0 ? i?.[r] : null;
|
|
7092
7575
|
if (!a) {
|
|
7093
|
-
|
|
7576
|
+
re(), L(), s("point-click", {});
|
|
7094
7577
|
return;
|
|
7095
7578
|
}
|
|
7096
7579
|
if (m.value === r && t.highlightToggle) {
|
|
7097
|
-
|
|
7580
|
+
re(), L(), s("point-click", {});
|
|
7098
7581
|
return;
|
|
7099
7582
|
}
|
|
7100
|
-
|
|
7583
|
+
re(), m.value = r, ne(r);
|
|
7101
7584
|
let [o, c, l, u, d, f, p] = a;
|
|
7102
7585
|
R(e.position, d, p), s("point-click", {
|
|
7103
7586
|
index: r,
|
|
@@ -7176,7 +7659,7 @@ var Fo = class {
|
|
|
7176
7659
|
if (n !== x || !a.value || a.value.isDestroyed()) return;
|
|
7177
7660
|
oe();
|
|
7178
7661
|
let e = m.value;
|
|
7179
|
-
e != null &&
|
|
7662
|
+
e != null && ne(e);
|
|
7180
7663
|
}, h = [];
|
|
7181
7664
|
D?.readyPromise && h.push(D.readyPromise), O?.readyPromise && h.push(O.readyPromise), h.length ? Promise.all(h).then(p, p) : p();
|
|
7182
7665
|
}
|
|
@@ -7223,7 +7706,7 @@ var Fo = class {
|
|
|
7223
7706
|
}, { deep: !0 }), w(() => y.value.queryEnabled, () => {
|
|
7224
7707
|
oe();
|
|
7225
7708
|
}), w(() => [y.value.highlightColor, y.value.highlightOpacity], () => {
|
|
7226
|
-
m.value != null &&
|
|
7709
|
+
m.value != null && ne(m.value);
|
|
7227
7710
|
}), d(() => {}), f(() => {
|
|
7228
7711
|
b++, x++, T.forEach((e) => e.abort()), T.clear(), C.clear(), S = "", se();
|
|
7229
7712
|
}), (e, t) => _.visible ? (p(), i("div", {
|
|
@@ -7235,7 +7718,7 @@ var Fo = class {
|
|
|
7235
7718
|
})
|
|
7236
7719
|
}, null, 4)) : r("", !0);
|
|
7237
7720
|
}
|
|
7238
|
-
}, [["__scopeId", "data-v-719d18e0"]]),
|
|
7721
|
+
}, [["__scopeId", "data-v-719d18e0"]]), is = {
|
|
7239
7722
|
__name: "query",
|
|
7240
7723
|
props: {
|
|
7241
7724
|
config: {
|
|
@@ -7468,7 +7951,7 @@ var Fo = class {
|
|
|
7468
7951
|
u++, h.forEach((e) => e.abort()), h.clear(), p.clear(), m.clear(), d = "", D();
|
|
7469
7952
|
}), (e, t) => null;
|
|
7470
7953
|
}
|
|
7471
|
-
},
|
|
7954
|
+
}, as = {
|
|
7472
7955
|
__name: "interpolation",
|
|
7473
7956
|
props: { config: {
|
|
7474
7957
|
type: Object,
|
|
@@ -7673,7 +8156,7 @@ var Fo = class {
|
|
|
7673
8156
|
o++, u.forEach((e) => e.abort()), u.clear(), l.clear(), s = "", x();
|
|
7674
8157
|
}), (e, t) => null;
|
|
7675
8158
|
}
|
|
7676
|
-
},
|
|
8159
|
+
}, os = class {
|
|
7677
8160
|
constructor(e, t = !1, n = null, r = "255,255,255", i = "", a = 1, o = "") {
|
|
7678
8161
|
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;
|
|
7679
8162
|
}
|
|
@@ -8051,7 +8534,7 @@ var Fo = class {
|
|
|
8051
8534
|
}
|
|
8052
8535
|
});
|
|
8053
8536
|
}
|
|
8054
|
-
},
|
|
8537
|
+
}, ss = new class {
|
|
8055
8538
|
constructor() {
|
|
8056
8539
|
this.layers = /* @__PURE__ */ new Map();
|
|
8057
8540
|
}
|
|
@@ -8067,7 +8550,7 @@ var Fo = class {
|
|
|
8067
8550
|
}
|
|
8068
8551
|
return i && (typeof e.clearAllTiles == "function" && e.clearAllTiles(), typeof e.getViewportInfo == "function" && e.getViewportInfo()), this.layers.get(t);
|
|
8069
8552
|
}
|
|
8070
|
-
let c = new
|
|
8553
|
+
let c = new os(t, i, r, n, a, o, s);
|
|
8071
8554
|
return await c.init(), this.layers.set(t, c), c;
|
|
8072
8555
|
}
|
|
8073
8556
|
removeLayer(e) {
|
|
@@ -8091,20 +8574,20 @@ var Fo = class {
|
|
|
8091
8574
|
let t = this.layers.get(e);
|
|
8092
8575
|
t && t.getViewportInfo();
|
|
8093
8576
|
}
|
|
8094
|
-
}(),
|
|
8095
|
-
|
|
8577
|
+
}(), cs = async (e) => ss.createLayer(e, !1), ls = (e) => {
|
|
8578
|
+
ss.removeLayer(e);
|
|
8096
8579
|
};
|
|
8097
8580
|
t(() => {
|
|
8098
|
-
let e =
|
|
8581
|
+
let e = ss.getLayerIds();
|
|
8099
8582
|
if (e.length > 0) {
|
|
8100
|
-
let t =
|
|
8583
|
+
let t = ss.getLayer(e[0]);
|
|
8101
8584
|
return t ? t.getCurrentLevel() : 15;
|
|
8102
8585
|
}
|
|
8103
8586
|
return 15;
|
|
8104
8587
|
});
|
|
8105
8588
|
//#endregion
|
|
8106
8589
|
//#region src/zz-layer/zz-layer-zzts3dtype/index.vue
|
|
8107
|
-
var
|
|
8590
|
+
var us = {
|
|
8108
8591
|
__name: "index",
|
|
8109
8592
|
props: { config: {
|
|
8110
8593
|
type: Object,
|
|
@@ -8135,7 +8618,7 @@ var Qo = {
|
|
|
8135
8618
|
console.error("创建图层失败:缺少id参数", i.value);
|
|
8136
8619
|
return;
|
|
8137
8620
|
}
|
|
8138
|
-
|
|
8621
|
+
cs({
|
|
8139
8622
|
id: e,
|
|
8140
8623
|
layerId: i.value.layerId || "",
|
|
8141
8624
|
dictCode: i.value.layerId || "",
|
|
@@ -8146,7 +8629,7 @@ var Qo = {
|
|
|
8146
8629
|
opacity: i.value.opacity
|
|
8147
8630
|
});
|
|
8148
8631
|
}, s = () => {
|
|
8149
|
-
|
|
8632
|
+
ls(a());
|
|
8150
8633
|
};
|
|
8151
8634
|
return w(i, () => {
|
|
8152
8635
|
o();
|
|
@@ -8156,7 +8639,7 @@ var Qo = {
|
|
|
8156
8639
|
console.log("组件卸载,开始清理资源..."), s();
|
|
8157
8640
|
}), (e, t) => null;
|
|
8158
8641
|
}
|
|
8159
|
-
},
|
|
8642
|
+
}, ds = {
|
|
8160
8643
|
__name: "index",
|
|
8161
8644
|
props: { config: {
|
|
8162
8645
|
type: Object,
|
|
@@ -8194,7 +8677,7 @@ var Qo = {
|
|
|
8194
8677
|
e && u();
|
|
8195
8678
|
}), (e, t) => null;
|
|
8196
8679
|
}
|
|
8197
|
-
},
|
|
8680
|
+
}, fs = {
|
|
8198
8681
|
excavations: [],
|
|
8199
8682
|
globalStyle: {
|
|
8200
8683
|
show: !0,
|
|
@@ -8221,38 +8704,38 @@ var Qo = {
|
|
|
8221
8704
|
maxArea: 5e3 * 1e3 * 1e3,
|
|
8222
8705
|
maxPerimeter: 5e3 * 1e3
|
|
8223
8706
|
}
|
|
8224
|
-
},
|
|
8225
|
-
...
|
|
8707
|
+
}, ps = (e = {}) => ({
|
|
8708
|
+
...fs,
|
|
8226
8709
|
...e,
|
|
8227
8710
|
globalStyle: {
|
|
8228
|
-
...
|
|
8711
|
+
...fs.globalStyle,
|
|
8229
8712
|
...e.globalStyle
|
|
8230
8713
|
},
|
|
8231
8714
|
limits: {
|
|
8232
|
-
...
|
|
8715
|
+
...fs.limits,
|
|
8233
8716
|
...e.limits
|
|
8234
8717
|
},
|
|
8235
8718
|
excavations: e.excavations || []
|
|
8236
|
-
}),
|
|
8719
|
+
}), ms = (e, t, n = 1) => {
|
|
8237
8720
|
try {
|
|
8238
8721
|
return D.Color.fromCssColorString(e).withAlpha(n);
|
|
8239
8722
|
} catch {
|
|
8240
8723
|
return D.Color.fromCssColorString(t).withAlpha(n);
|
|
8241
8724
|
}
|
|
8242
|
-
},
|
|
8725
|
+
}, hs = (e, t, n, r, i) => e ? D.Material.fromType("Image", {
|
|
8243
8726
|
image: e,
|
|
8244
8727
|
color: D.Color.WHITE.withAlpha(n),
|
|
8245
8728
|
repeat: i || new D.Cartesian2(1, 1)
|
|
8246
|
-
}) : D.Material.fromType("Color", { color:
|
|
8729
|
+
}) : D.Material.fromType("Color", { color: ms(t, r, n) }), gs = (e) => {
|
|
8247
8730
|
if (e.length < 2) return 0;
|
|
8248
8731
|
let t = 0;
|
|
8249
8732
|
for (let n = 0; n < e.length - 1; n += 1) t += D.Cartesian3.distance(e[n], e[n + 1]);
|
|
8250
8733
|
return t;
|
|
8251
|
-
},
|
|
8734
|
+
}, _s = (e, t) => {
|
|
8252
8735
|
if (!e) return;
|
|
8253
|
-
let n =
|
|
8736
|
+
let n = gs(t), r = Math.max(Math.ceil(n / 100), 1);
|
|
8254
8737
|
return new D.Cartesian2(r, 1);
|
|
8255
|
-
},
|
|
8738
|
+
}, vs = (e, t, n, r = !1) => {
|
|
8256
8739
|
let i = r ? {
|
|
8257
8740
|
perPositionHeight: !1,
|
|
8258
8741
|
heightReference: D.HeightReference.CLAMP_TO_GROUND
|
|
@@ -8272,7 +8755,7 @@ var Qo = {
|
|
|
8272
8755
|
clampToGround: r
|
|
8273
8756
|
}
|
|
8274
8757
|
});
|
|
8275
|
-
},
|
|
8758
|
+
}, ys = (e, t, n = !1) => {
|
|
8276
8759
|
let r = n ? {
|
|
8277
8760
|
perPositionHeight: !1,
|
|
8278
8761
|
heightReference: D.HeightReference.CLAMP_TO_GROUND
|
|
@@ -8292,19 +8775,19 @@ var Qo = {
|
|
|
8292
8775
|
clampToGround: n
|
|
8293
8776
|
}
|
|
8294
8777
|
});
|
|
8295
|
-
},
|
|
8778
|
+
}, bs = async (e = 260) => {
|
|
8296
8779
|
await new Promise((t) => window.setTimeout(t, e));
|
|
8297
|
-
},
|
|
8780
|
+
}, xs = (e, t = e.height || 0) => D.Cartesian3.fromDegrees(e.lng, e.lat, t), Ss = (e) => D.Cartesian3.fromDegrees(e.lng, e.lat), Cs = (e, t) => D.Math.equalsEpsilon(e.lng, t.lng, D.Math.EPSILON12) && D.Math.equalsEpsilon(e.lat, t.lat, D.Math.EPSILON12), ws = (e) => {
|
|
8298
8781
|
let t = e.reduce((e, t) => {
|
|
8299
8782
|
let n = e.at(-1);
|
|
8300
|
-
return (!n || !
|
|
8783
|
+
return (!n || !Cs(n, t)) && e.push(t), e;
|
|
8301
8784
|
}, []);
|
|
8302
|
-
return t.length > 1 &&
|
|
8303
|
-
},
|
|
8304
|
-
let t =
|
|
8785
|
+
return t.length > 1 && Cs(t[0], t[t.length - 1]) && t.pop(), t;
|
|
8786
|
+
}, Ts = (e) => e <= 50 ? 5 : e <= 200 ? 10 : e <= 1e3 ? 20 : 50, Es = (e) => {
|
|
8787
|
+
let t = Ts(e);
|
|
8305
8788
|
return Math.min(Math.max(Math.ceil(e / t), 1), 800);
|
|
8306
|
-
},
|
|
8307
|
-
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 =
|
|
8789
|
+
}, Ds = (e) => e.map((t, n) => {
|
|
8790
|
+
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 = Es(o.surfaceDistance), c = [t];
|
|
8308
8791
|
for (let e = 1; e < s; e += 1) {
|
|
8309
8792
|
let n = e / s, i = o.interpolateUsingFraction(n);
|
|
8310
8793
|
c.push({
|
|
@@ -8314,10 +8797,10 @@ var Qo = {
|
|
|
8314
8797
|
});
|
|
8315
8798
|
}
|
|
8316
8799
|
return c.push(r), { points: c };
|
|
8317
|
-
}),
|
|
8800
|
+
}), Os = (e) => e.flatMap((t, n) => {
|
|
8318
8801
|
let r = n === 0 ? t.points : t.points.slice(1);
|
|
8319
|
-
return n === e.length - 1 && r.length > 0 &&
|
|
8320
|
-
}),
|
|
8802
|
+
return n === e.length - 1 && r.length > 0 && Cs(r[r.length - 1], e[0].points[0]) ? r.slice(0, -1) : r;
|
|
8803
|
+
}), ks = (e) => {
|
|
8321
8804
|
if (e.length < 2) return 0;
|
|
8322
8805
|
let t = 0;
|
|
8323
8806
|
for (let n = 0; n < e.length; n += 1) {
|
|
@@ -8325,10 +8808,10 @@ var Qo = {
|
|
|
8325
8808
|
t += s.surfaceDistance;
|
|
8326
8809
|
}
|
|
8327
8810
|
return t;
|
|
8328
|
-
},
|
|
8811
|
+
}, As = (e) => {
|
|
8329
8812
|
if (e.length < 3) return 0;
|
|
8330
8813
|
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) => {
|
|
8331
|
-
let i =
|
|
8814
|
+
let i = js(e.lng, t);
|
|
8332
8815
|
return {
|
|
8333
8816
|
x: D.Math.toRadians(i) * r * Math.cos(n),
|
|
8334
8817
|
y: D.Math.toRadians(e.lat) * r
|
|
@@ -8339,20 +8822,20 @@ var Qo = {
|
|
|
8339
8822
|
a += t.x * n.y - n.x * t.y;
|
|
8340
8823
|
}
|
|
8341
8824
|
return Math.abs(a) / 2;
|
|
8342
|
-
},
|
|
8825
|
+
}, js = (e, t) => {
|
|
8343
8826
|
let n = e;
|
|
8344
8827
|
for (; n - t > 180;) n -= 360;
|
|
8345
8828
|
for (; n - t < -180;) n += 360;
|
|
8346
8829
|
return n;
|
|
8347
|
-
},
|
|
8348
|
-
let n =
|
|
8349
|
-
if (t.maxArea > 0 && n > t.maxArea) return `绘制区域过大,面积约 ${
|
|
8350
|
-
let r =
|
|
8351
|
-
return t.maxPerimeter > 0 && r > t.maxPerimeter ? `绘制区域过大,周长约 ${
|
|
8352
|
-
},
|
|
8830
|
+
}, Ms = (e) => e >= 1e3 ? `${(e / 1e3).toFixed(2)}公里` : `${Math.round(e)}米`, Ns = (e) => e >= 1e3 * 1e3 ? `${(e / 1e3 / 1e3).toFixed(2)}平方公里` : `${Math.round(e)}平方米`, Ps = (e, t) => {
|
|
8831
|
+
let n = As(e);
|
|
8832
|
+
if (t.maxArea > 0 && n > t.maxArea) return `绘制区域过大,面积约 ${Ns(n)},已超过 ${Ns(t.maxArea)},请缩小范围或分块开挖`;
|
|
8833
|
+
let r = ks(e);
|
|
8834
|
+
return t.maxPerimeter > 0 && r > t.maxPerimeter ? `绘制区域过大,周长约 ${Ms(r)},已超过 ${Ms(t.maxPerimeter)},请缩小范围或分块开挖` : "";
|
|
8835
|
+
}, Fs = (e, t) => {
|
|
8353
8836
|
let n = t[0], r = 0;
|
|
8354
8837
|
return e.map((i, a) => {
|
|
8355
|
-
let o = a === e.length - 1 && i.points.length > 0 && e[0].points.length > 0 &&
|
|
8838
|
+
let o = a === e.length - 1 && i.points.length > 0 && e[0].points.length > 0 && Cs(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);
|
|
8356
8839
|
if (r += s, a === 0) return o ? [...c, n] : c;
|
|
8357
8840
|
let l = t[r - s - 1];
|
|
8358
8841
|
return o ? [
|
|
@@ -8361,10 +8844,10 @@ var Qo = {
|
|
|
8361
8844
|
n
|
|
8362
8845
|
] : [l, ...c];
|
|
8363
8846
|
});
|
|
8364
|
-
},
|
|
8847
|
+
}, Is = (e, t) => {
|
|
8365
8848
|
let n = Math.min(...e);
|
|
8366
8849
|
return e.map(() => n - t);
|
|
8367
|
-
},
|
|
8850
|
+
}, Ls = (e, t, n) => ({
|
|
8368
8851
|
id: e.id || n(),
|
|
8369
8852
|
positions: e.positions || [],
|
|
8370
8853
|
height: e.height ?? t.height,
|
|
@@ -8381,12 +8864,12 @@ var Qo = {
|
|
|
8381
8864
|
showSide: e.showSide ?? t.showSide,
|
|
8382
8865
|
showBottom: e.showBottom ?? t.showBottom,
|
|
8383
8866
|
showEdge: e.showEdge ?? t.showEdge
|
|
8384
|
-
}),
|
|
8867
|
+
}), Rs = (e, t) => {
|
|
8385
8868
|
e.clippingPolygons = t;
|
|
8386
|
-
},
|
|
8387
|
-
polygons: e.filter((e) => e.length >= 3).map(
|
|
8869
|
+
}, zs = (e) => new D.ClippingPolygon({ positions: e.map((e) => Ss(e)) }), Bs = (e) => new D.ClippingPolygonCollection({
|
|
8870
|
+
polygons: e.filter((e) => e.length >= 3).map(zs),
|
|
8388
8871
|
inverse: !1
|
|
8389
|
-
}),
|
|
8872
|
+
}), Vs = (e, t, n, r, i) => {
|
|
8390
8873
|
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) => {
|
|
8391
8874
|
let i = e(), a = t(), o = r.map((e) => D.Cartographic.fromDegrees(e.lng, e.lat));
|
|
8392
8875
|
if (i && a.sampleTerrain && !(i.terrainProvider instanceof D.EllipsoidTerrainProvider)) try {
|
|
@@ -8398,7 +8881,7 @@ var Qo = {
|
|
|
8398
8881
|
let n = o[t], r = i?.scene.globe.getHeight(n);
|
|
8399
8882
|
return e.height ?? r ?? 0;
|
|
8400
8883
|
});
|
|
8401
|
-
}, m = (e) =>
|
|
8884
|
+
}, m = (e) => Ls(e, t().globalStyle, f), h = (e) => {
|
|
8402
8885
|
let n = t();
|
|
8403
8886
|
return JSON.stringify({
|
|
8404
8887
|
item: e,
|
|
@@ -8412,9 +8895,9 @@ var Qo = {
|
|
|
8412
8895
|
e.height ?? null
|
|
8413
8896
|
])), n = s.get(t);
|
|
8414
8897
|
if (n) return n;
|
|
8415
|
-
let r =
|
|
8898
|
+
let r = Ds(e), i = {
|
|
8416
8899
|
renderBoundarySegments: r,
|
|
8417
|
-
renderBoundaryPositions:
|
|
8900
|
+
renderBoundaryPositions: Os(r),
|
|
8418
8901
|
clipBoundaryPositions: e,
|
|
8419
8902
|
bottomBoundaryPositions: e
|
|
8420
8903
|
};
|
|
@@ -8427,13 +8910,13 @@ var Qo = {
|
|
|
8427
8910
|
y();
|
|
8428
8911
|
return;
|
|
8429
8912
|
}
|
|
8430
|
-
l ||= (c = n.scene.globe.clippingPolygons, !0),
|
|
8913
|
+
l ||= (c = n.scene.globe.clippingPolygons, !0), Rs(n.scene.globe, Bs(i)), n.scene.requestRender();
|
|
8431
8914
|
}, v = () => {
|
|
8432
8915
|
let n = e(), r = t();
|
|
8433
8916
|
n && (d ||= (u = n.scene.globe.depthTestAgainstTerrain, !0), n.scene.globe.depthTestAgainstTerrain = r.depthTestAgainstTerrain, n.scene.requestRender());
|
|
8434
8917
|
}, y = () => {
|
|
8435
8918
|
let t = e();
|
|
8436
|
-
t && (l &&= (
|
|
8919
|
+
t && (l &&= (Rs(t.scene.globe, c || void 0), c = null, !1), t.scene.requestRender());
|
|
8437
8920
|
}, b = () => {
|
|
8438
8921
|
let t = e();
|
|
8439
8922
|
!t || !d || (t.scene.globe.depthTestAgainstTerrain = u, d = !1, t.scene.requestRender());
|
|
@@ -8443,10 +8926,10 @@ var Qo = {
|
|
|
8443
8926
|
}, S = async (r) => {
|
|
8444
8927
|
let a = e();
|
|
8445
8928
|
if (!a) return null;
|
|
8446
|
-
let o = m(r), s =
|
|
8929
|
+
let o = m(r), s = ws(o.positions);
|
|
8447
8930
|
if (!s || s.length < 3) return n("excavation-error", /* @__PURE__ */ Error("地形开挖至少需要 3 个多边形点位")), null;
|
|
8448
8931
|
let c = (e) => {
|
|
8449
|
-
let r =
|
|
8932
|
+
let r = ys(a, s.map((e) => xs(e, e.height || 0)), t().depthTestAgainstTerrain);
|
|
8450
8933
|
return r.show = o.show, a.scene.requestRender(), n("excavation-error", Error(e)), P.warning(e), {
|
|
8451
8934
|
item: {
|
|
8452
8935
|
...o,
|
|
@@ -8456,14 +8939,14 @@ var Qo = {
|
|
|
8456
8939
|
primitives: [],
|
|
8457
8940
|
terrainClipEnabled: !1
|
|
8458
8941
|
};
|
|
8459
|
-
}, l =
|
|
8942
|
+
}, l = Ps(s, t().limits);
|
|
8460
8943
|
if (l) return c(l);
|
|
8461
|
-
let { renderBoundarySegments: u, renderBoundaryPositions: d, bottomBoundaryPositions: f } = g(s), h =
|
|
8944
|
+
let { renderBoundarySegments: u, renderBoundaryPositions: d, bottomBoundaryPositions: f } = g(s), h = vs(a, o.id, s.map((e) => xs(e, e.height || 0)), t().depthTestAgainstTerrain);
|
|
8462
8945
|
a.scene.requestRender();
|
|
8463
8946
|
let _ = [], v = [];
|
|
8464
8947
|
try {
|
|
8465
|
-
await Promise.all([
|
|
8466
|
-
let e = await p(d), t =
|
|
8948
|
+
await Promise.all([bs(), i?.() || Promise.resolve()]);
|
|
8949
|
+
let e = await p(d), t = Is(e, o.height), n = Math.min(...e) - o.height, r = f.map((e) => xs(e, n)), s = d.map((t, n) => xs(t, e[n])), c = Fs(u, e), l = Fs(u, t), m = D.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, h = {
|
|
8467
8950
|
depthTest: { enabled: !0 },
|
|
8468
8951
|
depthMask: !0
|
|
8469
8952
|
};
|
|
@@ -8479,7 +8962,7 @@ var Qo = {
|
|
|
8479
8962
|
})
|
|
8480
8963
|
}),
|
|
8481
8964
|
appearance: new D.MaterialAppearance({
|
|
8482
|
-
material:
|
|
8965
|
+
material: hs(o.bottomTexture, o.bottomColor, o.bottomOpacity, fs.globalStyle.bottomColor),
|
|
8483
8966
|
materialSupport: D.MaterialAppearance.MaterialSupport.TEXTURED,
|
|
8484
8967
|
faceForward: !0,
|
|
8485
8968
|
renderState: h
|
|
@@ -8489,7 +8972,7 @@ var Qo = {
|
|
|
8489
8972
|
v.push(e);
|
|
8490
8973
|
}
|
|
8491
8974
|
if (o.showSide) for (let e = 0; e < u.length; e += 1) {
|
|
8492
|
-
let t = u[e].points.map((e) =>
|
|
8975
|
+
let t = u[e].points.map((e) => xs(e)), n = l[e], r = c[e], i = _s(o.sideTexture, t), s = a.scene.primitives.add(new D.Primitive({
|
|
8493
8976
|
show: !1,
|
|
8494
8977
|
geometryInstances: new D.GeometryInstance({
|
|
8495
8978
|
id: `${o.id}-wall-${e}`,
|
|
@@ -8501,7 +8984,7 @@ var Qo = {
|
|
|
8501
8984
|
})
|
|
8502
8985
|
}),
|
|
8503
8986
|
appearance: new D.MaterialAppearance({
|
|
8504
|
-
material:
|
|
8987
|
+
material: hs(o.sideTexture, o.sideColor, o.sideOpacity, fs.globalStyle.bottomColor, i),
|
|
8505
8988
|
materialSupport: D.MaterialAppearance.MaterialSupport.TEXTURED,
|
|
8506
8989
|
faceForward: !0,
|
|
8507
8990
|
renderState: h
|
|
@@ -8517,7 +9000,7 @@ var Qo = {
|
|
|
8517
9000
|
polyline: {
|
|
8518
9001
|
positions: e,
|
|
8519
9002
|
width: o.edgeWidth,
|
|
8520
|
-
material:
|
|
9003
|
+
material: ms(o.edgeColor, fs.globalStyle.bottomColor, o.edgeOpacity),
|
|
8521
9004
|
clampToGround: !1
|
|
8522
9005
|
}
|
|
8523
9006
|
});
|
|
@@ -8586,7 +9069,7 @@ var Qo = {
|
|
|
8586
9069
|
for (let t of i.excavations) {
|
|
8587
9070
|
let n = m(t), r = {
|
|
8588
9071
|
...n,
|
|
8589
|
-
positions:
|
|
9072
|
+
positions: ws(n.positions)
|
|
8590
9073
|
}, i = h(r), o = r.id;
|
|
8591
9074
|
s.add(o);
|
|
8592
9075
|
let c = a.get(o);
|
|
@@ -8633,7 +9116,7 @@ var Qo = {
|
|
|
8633
9116
|
restoreDepthTestAgainstTerrain: b,
|
|
8634
9117
|
getMethods: A
|
|
8635
9118
|
};
|
|
8636
|
-
},
|
|
9119
|
+
}, Hs = /* @__PURE__ */ s({
|
|
8637
9120
|
__name: "index",
|
|
8638
9121
|
props: { config: {} },
|
|
8639
9122
|
emits: [
|
|
@@ -8644,7 +9127,7 @@ var Qo = {
|
|
|
8644
9127
|
"excavation-error"
|
|
8645
9128
|
],
|
|
8646
9129
|
setup(e, { expose: n, emit: r }) {
|
|
8647
|
-
let i = c("cesiumViewer"), a = r, o = e, s = t(() =>
|
|
9130
|
+
let i = c("cesiumViewer"), a = r, o = e, s = t(() => ps(o.config)), l = () => i?.value, u = () => {
|
|
8648
9131
|
let e = l();
|
|
8649
9132
|
return e ? !(e.terrainProvider instanceof D.EllipsoidTerrainProvider) : !1;
|
|
8650
9133
|
}, d = t(() => JSON.stringify({
|
|
@@ -8662,7 +9145,7 @@ var Qo = {
|
|
|
8662
9145
|
});
|
|
8663
9146
|
}, b = () => {
|
|
8664
9147
|
!v() || _.size === 0 || (_.forEach((e) => e()), _.clear());
|
|
8665
|
-
}, x =
|
|
9148
|
+
}, x = Vs(l, () => s.value, p, () => m, y);
|
|
8666
9149
|
m = x.getMethods();
|
|
8667
9150
|
let S = async (e) => {
|
|
8668
9151
|
l() && await x.syncExcavations(e);
|
|
@@ -8690,7 +9173,7 @@ var Qo = {
|
|
|
8690
9173
|
_.clear(), h?.(), h = null, x.clearExcavations(), x.restoreDepthTestAgainstTerrain();
|
|
8691
9174
|
}), n(m), (e, t) => null;
|
|
8692
9175
|
}
|
|
8693
|
-
}),
|
|
9176
|
+
}), Us = {
|
|
8694
9177
|
__name: "index",
|
|
8695
9178
|
props: {
|
|
8696
9179
|
config: {
|
|
@@ -8749,7 +9232,7 @@ var Qo = {
|
|
|
8749
9232
|
u();
|
|
8750
9233
|
}), (e, t) => null;
|
|
8751
9234
|
}
|
|
8752
|
-
},
|
|
9235
|
+
}, Ws = {
|
|
8753
9236
|
__name: "index",
|
|
8754
9237
|
props: { config: {
|
|
8755
9238
|
type: Object,
|
|
@@ -8813,7 +9296,7 @@ var Qo = {
|
|
|
8813
9296
|
u();
|
|
8814
9297
|
}), (e, t) => null;
|
|
8815
9298
|
}
|
|
8816
|
-
},
|
|
9299
|
+
}, Gs = {
|
|
8817
9300
|
__name: "index",
|
|
8818
9301
|
props: { config: {
|
|
8819
9302
|
type: Object,
|
|
@@ -9002,7 +9485,7 @@ var Qo = {
|
|
|
9002
9485
|
b();
|
|
9003
9486
|
}), (e, t) => null;
|
|
9004
9487
|
}
|
|
9005
|
-
},
|
|
9488
|
+
}, Ks = {
|
|
9006
9489
|
__name: "index",
|
|
9007
9490
|
props: { config: {
|
|
9008
9491
|
type: Object,
|
|
@@ -9189,7 +9672,7 @@ var Qo = {
|
|
|
9189
9672
|
b();
|
|
9190
9673
|
}), (e, t) => null;
|
|
9191
9674
|
}
|
|
9192
|
-
},
|
|
9675
|
+
}, qs = {
|
|
9193
9676
|
__name: "index",
|
|
9194
9677
|
props: { config: {
|
|
9195
9678
|
type: Object,
|
|
@@ -9389,16 +9872,16 @@ var Qo = {
|
|
|
9389
9872
|
b();
|
|
9390
9873
|
}), (e, t) => null;
|
|
9391
9874
|
}
|
|
9392
|
-
},
|
|
9875
|
+
}, Js = { class: "legend-panel__header" }, Ys = { class: "legend-panel__title" }, Xs = { class: "legend-panel__body" }, Zs = {
|
|
9393
9876
|
key: 0,
|
|
9394
9877
|
class: "legend-panel__multiband"
|
|
9395
|
-
},
|
|
9878
|
+
}, Qs = { class: "legend-panel__multiband-labels" }, $s = { class: "legend-panel__multiband-label legend-panel__multiband-label--top" }, ec = { class: "legend-panel__multiband-label legend-panel__multiband-label--bottom" }, tc = {
|
|
9396
9879
|
key: 1,
|
|
9397
9880
|
class: "legend-panel__list"
|
|
9398
|
-
},
|
|
9881
|
+
}, nc = {
|
|
9399
9882
|
key: 0,
|
|
9400
9883
|
class: "legend-panel__symbol legend-panel__symbol--line"
|
|
9401
|
-
},
|
|
9884
|
+
}, rc = { class: "legend-panel__label" }, ic = /* @__PURE__ */ s({
|
|
9402
9885
|
__name: "index",
|
|
9403
9886
|
props: {
|
|
9404
9887
|
visible: { type: Boolean },
|
|
@@ -9449,7 +9932,7 @@ var Qo = {
|
|
|
9449
9932
|
let N = (e) => P(e) === "point" ? "legend-panel__symbol--point" : "legend-panel__symbol--polygon", P = (e) => {
|
|
9450
9933
|
let t = e.type || b.value;
|
|
9451
9934
|
return t === "point" ? "point" : t === "line" ? "line" : "polygon";
|
|
9452
|
-
}, R = (e, t) => `${e.value ?? e.label ?? e.valueName ?? t}`, z = (e) => e === "point" ? "point" : e === "line" ? "line" : "polygon",
|
|
9935
|
+
}, R = (e, t) => `${e.value ?? e.label ?? e.valueName ?? t}`, z = (e) => e === "point" ? "point" : e === "line" ? "line" : "polygon", B = (e, t) => {
|
|
9453
9936
|
let n = z(t || P(e)), r = h.value?.colorList?.[n]?.stroke || {}, i = e.outlineColor || r.outlineColor || r.color || "#409EFF", a = e.strokeType || r.type || "solid", o = e.strokeVisible ?? r.visible !== !1;
|
|
9454
9937
|
return {
|
|
9455
9938
|
outlineColor: i,
|
|
@@ -9457,8 +9940,8 @@ var Qo = {
|
|
|
9457
9940
|
outlineWidth: o ? Math.max(1, Number(e.outlineWidth ?? r.outlineWidth) || 2) : 0,
|
|
9458
9941
|
strokeVisible: o
|
|
9459
9942
|
};
|
|
9460
|
-
},
|
|
9461
|
-
let t = e.color ||
|
|
9943
|
+
}, ee = (e) => {
|
|
9944
|
+
let t = e.color || te(e.r, e.g, e.b) || "#409EFF", { outlineColor: n, strokeType: r, outlineWidth: i } = B(e, "line"), a = t || n, o = Math.max(2, i);
|
|
9462
9945
|
return r === "dashed" ? {
|
|
9463
9946
|
width: "22px",
|
|
9464
9947
|
height: `${o}px`,
|
|
@@ -9468,14 +9951,14 @@ var Qo = {
|
|
|
9468
9951
|
height: `${o}px`,
|
|
9469
9952
|
backgroundColor: a
|
|
9470
9953
|
};
|
|
9471
|
-
},
|
|
9472
|
-
let t = P(e), n = e.color ||
|
|
9954
|
+
}, V = (e) => {
|
|
9955
|
+
let t = P(e), n = e.color || te(e.r, e.g, e.b) || "#cccccc", { outlineColor: r, strokeType: i, outlineWidth: a, strokeVisible: o } = B(e, t);
|
|
9473
9956
|
return {
|
|
9474
9957
|
backgroundColor: n,
|
|
9475
9958
|
border: o ? `${Math.max(2, a)}px ${i === "dashed" ? "dashed" : "solid"} ${r}` : "none",
|
|
9476
9959
|
boxSizing: "border-box"
|
|
9477
9960
|
};
|
|
9478
|
-
},
|
|
9961
|
+
}, te = (e, t, n) => {
|
|
9479
9962
|
let r = (e) => Math.max(0, Math.min(255, Number(e) || 0)).toString(16).padStart(2, "0");
|
|
9480
9963
|
return e == null && t == null && n == null ? "" : `#${r(e)}${r(t)}${r(n)}`;
|
|
9481
9964
|
};
|
|
@@ -9484,7 +9967,7 @@ var Qo = {
|
|
|
9484
9967
|
return s.visible ? (p(), i("div", {
|
|
9485
9968
|
key: 0,
|
|
9486
9969
|
class: l(["legend-panel", g.value])
|
|
9487
|
-
}, [a("div",
|
|
9970
|
+
}, [a("div", Js, [a("span", Ys, x(v.value), 1), o(f, {
|
|
9488
9971
|
text: "",
|
|
9489
9972
|
size: "small",
|
|
9490
9973
|
class: "legend-panel__toggle",
|
|
@@ -9495,22 +9978,22 @@ var Qo = {
|
|
|
9495
9978
|
_: 1
|
|
9496
9979
|
})]),
|
|
9497
9980
|
_: 1
|
|
9498
|
-
})]), a("div",
|
|
9981
|
+
})]), a("div", Xs, [c[1] ||= a("div", { class: "legend-panel__section-title" }, "图例", -1), S.value && w.value ? (p(), i("div", Zs, [a("div", {
|
|
9499
9982
|
class: "legend-panel__multiband-bar",
|
|
9500
9983
|
style: u(M.value)
|
|
9501
|
-
}, null, 4), a("div",
|
|
9984
|
+
}, null, 4), a("div", Qs, [a("div", $s, x(w.value.MultibandValueNameTop), 1), a("div", ec, x(w.value.MultibandValueNameBot), 1)])])) : D.value.length ? (p(), i("div", tc, [(p(!0), i(e, null, _(D.value, (e, t) => (p(), i("div", {
|
|
9502
9985
|
key: R(e, t),
|
|
9503
9986
|
class: l(["legend-panel__item", { "is-item-hidden": O.value && A(e) }])
|
|
9504
9987
|
}, [
|
|
9505
|
-
P(e) === "line" ? (p(), i("div",
|
|
9988
|
+
P(e) === "line" ? (p(), i("div", nc, [a("span", {
|
|
9506
9989
|
class: "legend-panel__line-bar",
|
|
9507
|
-
style: u(
|
|
9990
|
+
style: u(ee(e))
|
|
9508
9991
|
}, null, 4)])) : (p(), i("div", {
|
|
9509
9992
|
key: 1,
|
|
9510
9993
|
class: l(["legend-panel__symbol", N(e)]),
|
|
9511
|
-
style: u(
|
|
9994
|
+
style: u(V(e))
|
|
9512
9995
|
}, null, 6)),
|
|
9513
|
-
a("div",
|
|
9996
|
+
a("div", rc, x(e.valueName || "-"), 1),
|
|
9514
9997
|
O.value ? (p(), n(m, {
|
|
9515
9998
|
key: 2,
|
|
9516
9999
|
content: A(e) ? "显示" : "隐藏",
|
|
@@ -9533,8 +10016,8 @@ var Qo = {
|
|
|
9533
10016
|
}))])], 2)) : r("", !0);
|
|
9534
10017
|
};
|
|
9535
10018
|
}
|
|
9536
|
-
}),
|
|
9537
|
-
e.component("zzViewer", be), e.component("zz-viewer", be), e.component("zzLayerWmts", Pe), e.component("zz-layer-wmts", Pe), e.component("zzLayerXyz", Fe), e.component("zz-layer-xyz", Fe), e.component("zzLayerWms", Ie), e.component("zz-layer-wms", Ie), e.component("zzLayerZzts", Re), e.component("zz-layer-zzts", Re), e.component("zzLayerZzts3d", za), e.component("zz-layer-zzts3d", za), e.component("zzLayerShpZzts",
|
|
10019
|
+
}), ac = (e) => {
|
|
10020
|
+
e.component("zzViewer", be), e.component("zz-viewer", be), e.component("zzLayerWmts", Pe), e.component("zz-layer-wmts", Pe), e.component("zzLayerXyz", Fe), e.component("zz-layer-xyz", Fe), e.component("zzLayerWms", Ie), e.component("zz-layer-wms", Ie), e.component("zzLayerZzts", Re), e.component("zz-layer-zzts", Re), e.component("zzLayerZzts3d", za), e.component("zz-layer-zzts3d", za), e.component("zzLayerZzts3dv2", Za), e.component("zz-layer-zzts3dv2", Za), e.component("zzLayerShpZzts", co), e.component("zz-layer-shp-zzts", co), e.component("zzLayerZzts3dPoint", Eo), e.component("zz-layer-zzts3d-point", Eo), e.component("zzLayerZzts3dPointQuery", Do), e.component("zz-layer-zzts3d-point-query", Do), e.component("zzLayerZzts3dLas", Qo), e.component("zz-layer-zzts3d-las", Qo), e.component("zzLayerZzts3dGrid", es), e.component("zz-layer-zzts3d-grid", es), e.component("zzLayerZzts3dGridColor", rs), e.component("zz-layer-zzts3d-grid-color", rs), e.component("zzLayerZzts3dGridQuery", is), e.component("zz-layer-zzts3d-grid-query", is), e.component("zzLayerZzts3dGridInterpolation", as), e.component("zz-layer-zzts3d-grid-interpolation", as), e.component("zzLayerZzts3dtwintype", us), e.component("zz-layer-zzts3dtwintype", us), e.component("zzLayerGeojson", ze), e.component("zz-layer-geojson", ze), e.component("zzLayerMvt", Ve), e.component("zz-layer-mvt", Ve), e.component("zzTerrain", ds), e.component("zz-terrain", ds), e.component("zzTerrainExcavation", Hs), e.component("zz-terrain-excavation", Hs), e.component("zz3dtiles", Us), e.component("zz-3dtiles", Us), e.component("zzGltf", Ws), e.component("zz-gltf", Ws), e.component("zzEntityPoint", Gs), e.component("zz-entity-point", Gs), e.component("zzEntityPolyline", Ks), e.component("zz-entity-polyline", Ks), e.component("zzEntityPolygon", qs), e.component("zz-entity-polygon", qs), e.component("zzLegend", ic), e.component("zz-legend", ic);
|
|
9538
10021
|
};
|
|
9539
10022
|
//#endregion
|
|
9540
|
-
export { R as LAYER_TYPE_BAND, _e as addImageryLayerWithStackIndex, ve as addPrimitiveWithStackIndex, me as applyImageryStackIndex, ge as applyPrimitiveStackIndex,
|
|
10023
|
+
export { R as LAYER_TYPE_BAND, _e as addImageryLayerWithStackIndex, ve as addPrimitiveWithStackIndex, me as applyImageryStackIndex, ge as applyPrimitiveStackIndex, ac as default, ae as moveImageryLayerToIndex, he as moveImageryLayersToStackIndex, se as movePrimitiveToIndex, fe as scheduleImageryLayerStackSync, pe as schedulePrimitiveStackSync, ce as syncImageryLayerStack, le as syncPrimitiveStack, re as tagImageryLayerStackMeta, ie as tagPrimitiveStackMeta, Us as zz3dtiles, Gs as zzEntityPoint, qs as zzEntityPolygon, Ks as zzEntityPolyline, Ws as zzGltf, ze as zzLayerGeojson, Ve as zzLayerMvt, co as zzLayerShpZzts, Ie as zzLayerWms, Pe as zzLayerWmts, Fe as zzLayerXyz, Re as zzLayerZzts, ic as zzLegendPanel, ds as zzTerrain, Hs as zzTerrainExcavation, be as zzViewer };
|