Merge pull request #35 from 0hAodha/notrunning
add black icons for not running trains
This commit is contained in:
@ -19,8 +19,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>
|
||||||
@ -118,6 +119,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);
|
||||||
|
Reference in New Issue
Block a user