Add station modal logic and station data for part of route 0210
This commit is contained in:
@@ -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.`);
|
||||
|
||||
Reference in New Issue
Block a user