@teeechina/teee-map 0.0.29 → 0.0.31
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/teee-map.mjs +83 -1
- package/dist/teee-map.umd.js +1 -1
- package/index.d.ts +3 -4
- package/package.json +1 -1
package/dist/teee-map.mjs
CHANGED
|
@@ -38860,11 +38860,35 @@ var E = T, D = async () => {
|
|
|
38860
38860
|
id: `${e}_track`,
|
|
38861
38861
|
type: "line",
|
|
38862
38862
|
source: e,
|
|
38863
|
+
filter: [
|
|
38864
|
+
"any",
|
|
38865
|
+
[
|
|
38866
|
+
"==",
|
|
38867
|
+
["get", "isSurveying"],
|
|
38868
|
+
1
|
|
38869
|
+
],
|
|
38870
|
+
["!", ["has", "isSurveying"]]
|
|
38871
|
+
],
|
|
38863
38872
|
layout: { "line-join": "round" },
|
|
38864
38873
|
paint: {
|
|
38865
38874
|
"line-color": "#85A0D9",
|
|
38866
38875
|
"line-width": 2
|
|
38867
38876
|
}
|
|
38877
|
+
}, {
|
|
38878
|
+
id: `${e}_track_noSurveying`,
|
|
38879
|
+
type: "line",
|
|
38880
|
+
source: e,
|
|
38881
|
+
filter: [
|
|
38882
|
+
"==",
|
|
38883
|
+
["get", "isSurveying"],
|
|
38884
|
+
0
|
|
38885
|
+
],
|
|
38886
|
+
layout: { "line-join": "round" },
|
|
38887
|
+
paint: {
|
|
38888
|
+
"line-color": "#ccc",
|
|
38889
|
+
"line-width": 2,
|
|
38890
|
+
"line-dasharray": [2, 2]
|
|
38891
|
+
}
|
|
38868
38892
|
}], Ht = /* @__PURE__ */ function(e) {
|
|
38869
38893
|
return e[e.RedCircuit = 1] = "RedCircuit", e[e.WhiteCircuit = 2] = "WhiteCircuit", e[e.EqualRedCircuit = 3] = "EqualRedCircuit", e[e.GreyCircuit = 4] = "GreyCircuit", e[e.GreenCircuit = 5] = "GreenCircuit", e;
|
|
38870
38894
|
}({}), Ut = {
|
|
@@ -40890,6 +40914,7 @@ var qt = class {
|
|
|
40890
40914
|
circuitFeatures = [];
|
|
40891
40915
|
signalFeatures = [];
|
|
40892
40916
|
sgfhqyFeatures = [];
|
|
40917
|
+
lableFeatures = [];
|
|
40893
40918
|
pathInfoRecords = [];
|
|
40894
40919
|
destLocoFeatures = [];
|
|
40895
40920
|
onPathSelected;
|
|
@@ -40970,7 +40995,7 @@ var qt = class {
|
|
|
40970
40995
|
subState2: "",
|
|
40971
40996
|
subState3: ""
|
|
40972
40997
|
};
|
|
40973
|
-
(e.properties.name == "XI接车" || e.properties.name == "XK接车" || e.properties.name == "XE接车" || e.properties.name == "SF接车" || e.properties.name == "SI接车") && (t.state = 2), (e.properties.name == "XH发车" || e.properties.name == "SE发车" || e.properties.name == "SH发车" || e.properties.name == "XJ发车") && (t.state = 1), this.teeeMap.updateFeatureState(e.properties.code, t);
|
|
40998
|
+
(e.properties.name == "XI接车" || e.properties.name == "XK接车" || e.properties.name == "XE接车" || e.properties.name == "SF接车" || e.properties.name == "SI接车") && (t.state = "2"), (e.properties.name == "XH发车" || e.properties.name == "SE发车" || e.properties.name == "SH发车" || e.properties.name == "XJ发车") && (t.state = "1"), this.teeeMap.updateFeatureState(e.properties.code, t);
|
|
40974
40999
|
}
|
|
40975
41000
|
}
|
|
40976
41001
|
changeFeatureState(e, t) {
|
|
@@ -42547,6 +42572,63 @@ var Gn = class {
|
|
|
42547
42572
|
n.push(e + "&" + r + "&" + i);
|
|
42548
42573
|
}), n.length > 0 && this.onSendSignal?.(n);
|
|
42549
42574
|
}
|
|
42575
|
+
collectState() {
|
|
42576
|
+
let e = Math.floor(Date.now() / 1e3), t = /* @__PURE__ */ new Map(), n = [], r = {
|
|
42577
|
+
unset: "0",
|
|
42578
|
+
red: "1",
|
|
42579
|
+
green: "2",
|
|
42580
|
+
white: "3",
|
|
42581
|
+
blue: "4"
|
|
42582
|
+
};
|
|
42583
|
+
for (let [e, n] of Object.entries(this.layers)) {
|
|
42584
|
+
for (let e of this.queryFeatures(n.signal.replace("geojson_station_", ""))) {
|
|
42585
|
+
let n = String(e.properties?.name ?? ""), i = String(e.properties?.code ?? ""), a = String(e.properties?.stcode ?? i.substring(0, 9));
|
|
42586
|
+
if (!n || !i || !a) continue;
|
|
42587
|
+
let o = this.filterCodes.length && !this.filterCodes.includes(i) ? "unset" : String(this.getFeatureState(i)?.state ?? "");
|
|
42588
|
+
if (!o) continue;
|
|
42589
|
+
let s = r[o] ?? o, c = t.get(a);
|
|
42590
|
+
t.set(a, c ? c + n + ":" + s + ";" : n + ":" + s + ";");
|
|
42591
|
+
}
|
|
42592
|
+
t.forEach((e, n) => t.set(n, (e.endsWith(";") ? e.slice(0, -1) : e) + "&"));
|
|
42593
|
+
let e = this.queryFeatures(n.switch_loc.replace("geojson_station_", ""));
|
|
42594
|
+
for (let r of this.queryFeatures(n.switch.replace("geojson_station_", ""))) {
|
|
42595
|
+
let n = String(r.properties?.name ?? ""), i = String(r.properties?.code ?? ""), a = String(r.properties?.stcode ?? i.substring(0, 9));
|
|
42596
|
+
if (!n || !i || !a) continue;
|
|
42597
|
+
let o = e.find((e) => String(e.properties?.s_code ?? "") === i && String(e.properties?.location ?? "") === "1") ?? e.find((e) => String(e.properties?.s_code ?? "") === i);
|
|
42598
|
+
if (!o) continue;
|
|
42599
|
+
let s = this.filterCodes.length && !this.filterCodes.includes(i) ? "0" : String(this.getFeatureState(String(o.properties?.code ?? ""))?.state ?? "");
|
|
42600
|
+
if (!s) continue;
|
|
42601
|
+
let c = Number(s), l = t.get(a);
|
|
42602
|
+
l === void 0 ? l = "&" + (c === 5 || c === 6 ? n + ":" + (c === 5 ? 2 : 3) + ";" + n + "-F:" + s + ";" : n + ":" + s + ";") : l += c === 5 || c === 6 ? n + ":" + (c === 5 ? 2 : 3) + ";" + n + "-F:" + s + ";" : n + ":" + s + ";", t.set(a, l);
|
|
42603
|
+
}
|
|
42604
|
+
t.forEach((e, n) => t.set(n, (e.endsWith(";") ? e.slice(0, -1) : e) + "&"));
|
|
42605
|
+
let i = /* @__PURE__ */ new Map();
|
|
42606
|
+
for (let e of this.queryFeatures(n.track_circuit.replace("geojson_station_", ""))) {
|
|
42607
|
+
let t = String(e.properties?.name ?? ""), n = String(e.properties?.code ?? ""), r = String(e.properties?.stcode ?? n.substring(0, 9));
|
|
42608
|
+
if (!t || !n || !r) continue;
|
|
42609
|
+
let a = this.filterCodes.length && !this.filterCodes.includes(n) ? "0" : String(this.getFeatureState(n)?.state ?? "");
|
|
42610
|
+
if (!a) continue;
|
|
42611
|
+
let o = r + "_" + t;
|
|
42612
|
+
i.get(o) ? (a === "1" || a === "2") && i.set(o, {
|
|
42613
|
+
name: t,
|
|
42614
|
+
stcode: r,
|
|
42615
|
+
state: a
|
|
42616
|
+
}) : i.set(o, {
|
|
42617
|
+
name: t,
|
|
42618
|
+
stcode: r,
|
|
42619
|
+
state: a
|
|
42620
|
+
});
|
|
42621
|
+
}
|
|
42622
|
+
i.forEach((e) => {
|
|
42623
|
+
let n = t.get(e.stcode);
|
|
42624
|
+
t.set(e.stcode, n ? n + e.name + ":" + e.state + ";" : "& &" + e.name + ":" + e.state + ";");
|
|
42625
|
+
});
|
|
42626
|
+
}
|
|
42627
|
+
return t.forEach((t, r) => {
|
|
42628
|
+
let i = t.endsWith(";") ? t.slice(0, -1) : t;
|
|
42629
|
+
n.push(e + "&" + r + "&ZK01&" + i);
|
|
42630
|
+
}), n;
|
|
42631
|
+
}
|
|
42550
42632
|
};
|
|
42551
42633
|
//#endregion
|
|
42552
42634
|
//#region src/teee-map/utils/graphTool.ts
|