add black icons for not running trains

This commit is contained in:
Andrew
2023-03-08 11:22:54 +00:00
parent de3b8add5e
commit 94bcc79e51

View File

@ -31,8 +31,9 @@
<!-- overlay offset is the size of the image so that it is centered--> <!-- overlay offset is the size of the image so that it is centered-->
<ol-overlay :position="coordinate" :positioning="center-center" :offset="[-14,-16]"> <ol-overlay :position="coordinate" :positioning="center-center" :offset="[-14,-16]">
<div class="overlay-content" @click="getSelectedTrain(i)"> <div class="overlay-content" @click="getSelectedTrain(i)">
<img v-if="isTrainLate(i)" src="../assets/red-train-solid.png" class="trainMapIcon" alt="Train Icon"> <img v-if="isTrainRunning(i) && isTrainLate(i)" src="../assets/red-train-solid.png" class="trainMapIcon" alt="Late Train Icon">
<img v-else src="../assets/green-train-solid.png" class="trainMapIcon" alt="Train Icon"> <img v-else-if="isTrainRunning(i) && !isTrainLate(i)" src="../assets/green-train-solid.png" class="trainMapIcon" alt="On-Time Train Icon">
<img v-else src="../assets/train-solid.svg" class="trainMapIcon" alt="Not Running Train Icon">
</div> </div>
</ol-overlay> </ol-overlay>
</template> </template>
@ -129,6 +130,16 @@ export default {
return false; return false;
}, },
// method to determine whether or not a selected train is running
isTrainRunning(i) {
if (this.allDataMap[i]["TrainStatus"][0] == "R") {
return true;
}
else {
return false;
}
},
// method to fetch live train data from the database // method to fetch live train data from the database
getLiveTrainData() { getLiveTrainData() {
const functions = getFunctions(app); const functions = getFunctions(app);