@teeechina/teee-map 0.0.30 → 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 +59 -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
|
@@ -40914,6 +40914,7 @@ var qt = class {
|
|
|
40914
40914
|
circuitFeatures = [];
|
|
40915
40915
|
signalFeatures = [];
|
|
40916
40916
|
sgfhqyFeatures = [];
|
|
40917
|
+
lableFeatures = [];
|
|
40917
40918
|
pathInfoRecords = [];
|
|
40918
40919
|
destLocoFeatures = [];
|
|
40919
40920
|
onPathSelected;
|
|
@@ -40994,7 +40995,7 @@ var qt = class {
|
|
|
40994
40995
|
subState2: "",
|
|
40995
40996
|
subState3: ""
|
|
40996
40997
|
};
|
|
40997
|
-
(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);
|
|
40998
40999
|
}
|
|
40999
41000
|
}
|
|
41000
41001
|
changeFeatureState(e, t) {
|
|
@@ -42571,6 +42572,63 @@ var Gn = class {
|
|
|
42571
42572
|
n.push(e + "&" + r + "&" + i);
|
|
42572
42573
|
}), n.length > 0 && this.onSendSignal?.(n);
|
|
42573
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
|
+
}
|
|
42574
42632
|
};
|
|
42575
42633
|
//#endregion
|
|
42576
42634
|
//#region src/teee-map/utils/graphTool.ts
|