Add station modal logic and station data for part of route 0210

This commit is contained in:
2026-03-12 00:54:42 +00:00
parent 06861f4037
commit 0fc2c0177b
33 changed files with 2394 additions and 2045 deletions

View File

@@ -21,7 +21,7 @@ fs.readdirSync(stationInputDir).forEach((file) => {
const content = yaml.load(fs.readFileSync(fullPath, 'utf8'));
if (content.crs) {
stationList.push(content.crs)
stationList.push(content.crs);
}
const fileName = file.replace('.yaml', '.json');
@@ -40,11 +40,10 @@ fs.readdirSync(inputDir).forEach((file) => {
const contentSet = new Set();
// Use this loop to add a 'link' to each station if its CRS exists in 'stationList'
if (Array.isArray(content.routeDetail)) {
content.routeDetail.forEach((item) => {
if ((item.type === 'station') && (item.crs)) {
if (item.type === 'station' && item.crs) {
// Edit the item if item.crs exists in 'stationList' - maybe a `linkable: true`?
if (stationList.includes(item.crs)) {
item.stationInfo = true;
@@ -83,7 +82,6 @@ fs.readdirSync(inputDir).forEach((file) => {
}
});
fs.writeFileSync(indexFile, JSON.stringify(mapList));
console.log(`Generated ${mapList.length} map files and index.`);