Merge pull request #11 from 0hAodha/conor

Add map icons
This commit is contained in:
2023-02-10 09:19:30 +00:00
committed by GitHub

View File

@ -1,12 +1,16 @@
<template> <template>
<button @click="getLiveTrainData">Show</button> <button @click="getLiveTrainData">Show</button>
<button @click="postLiveTrainData">Populate Database</button> <button @click="postLiveTrainData">Populate Database</button>
<!--Sidebar, fades out on click of X button--> <!--Sidebar, fades out on click of X button-->
<transition id="sidebar" name="slideLeft"> <transition id="sidebar" name="slideLeft">
<div v-if="this.display" id= "sidebarDiv"> <div v-if="this.display" id= "sidebarDiv">
<div id = "sidebarHeader"><img id = "headerImage" src="https://cdn.discordapp.com/attachments/1017419092447207436/1063092138029625394/pixil-frame-0.png"> <div v-on:click="this.display = false" id="xButton">X</div></div>
<div id = "sidebarHeader">
<img id = "headerImage" src="https://cdn.discordapp.com/attachments/1017419092447207436/1063092138029625394/pixil-frame-0.png">
<div v-on:click="this.display = false" id="xButton">X</div>
</div>
<div id= "sidebarDiv"> <div id= "sidebarDiv">
<h2>Train Code: {{ selectedDataMap["TrainCode"] }}</h2> <h2>Train Code: {{ selectedDataMap["TrainCode"] }}</h2>
<p>Date: {{ selectedDataMap["TrainDate"] }}</p> <p>Date: {{ selectedDataMap["TrainDate"] }}</p>
@ -18,21 +22,21 @@
</div> </div>
</div> </div>
</transition> </transition>
<ol-map :loadTilesWhileAnimating="true" :loadTilesWhileInteracting="true" style="height: 1000px"> <ol-map :loadTilesWhileAnimating="true" :loadTilesWhileInteracting="true" style="height: 1000px">
<ol-view ref="view" :center="center" :rotation="rotation" :zoom="zoom" :projection="projection" /> <ol-view ref="view" :center="center" :rotation="rotation" :zoom="zoom" :projection="projection" />
<ol-tile-layer> <ol-tile-layer>
<ol-source-osm /> <ol-source-osm />
</ol-tile-layer> </ol-tile-layer>
<template v-for="coordinate, i in coordinates"> <template v-for="coordinate, i in coordinates" :position="inline-block">
<ol-overlay :position="coordinate"> <ol-overlay :position="coordinate">
<template v-slot="slotProps"> <div class="overlay-content" @click="getSelectedTrain(i)">
<div class="overlay-content" @click="getSelectedTrain(i)">{{ i }}</div> <img src="https://cdn.discordapp.com/attachments/1017419092447207436/1063092138029625394/pixil-frame-0.png" class="trainMapIcon">
</template> </div>
</ol-overlay> </ol-overlay>
</template> </template>
</ol-map> </ol-map>
</template> </template>
@ -118,10 +122,12 @@ export default {
<style scoped> <style scoped>
.overlay-content { .overlay-content {
background: #efefef; width: 1%;
box-shadow: 0 5px 10px rgb(2 2 2 / 20%); }
padding: 10px 20px;
font-size: 16px; .trainMapIcon {
height: 5.5vh;
width: 3.5vw;
} }
.slideLeft-enter-active, .slideLeft-leave-active { .slideLeft-enter-active, .slideLeft-leave-active {
@ -146,7 +152,6 @@ background-position: 0% 50%;
} }
} }
#sidebar{ #sidebar{
position: absolute; position: absolute;
height: 85%; height: 85%;
@ -194,6 +199,7 @@ right:10px;
#xButton:hover{ #xButton:hover{
color:red; color:red;
} }
#sidebarFooter{ #sidebarFooter{
position: relative; position: relative;
bottom:0%; bottom:0%;
@ -207,8 +213,8 @@ position: relative;
height:80%; height:80%;
width:100%; width:100%;
overflow: hidden; overflow: hidden;
} }
#sidebarContent{ #sidebarContent{
position: relative; position: relative;
size: 6px; size: 6px;
@ -217,10 +223,6 @@ overflow-wrap: break-word;
font-family: Georgia, 'Times New Roman', Times, serif ; font-family: Georgia, 'Times New Roman', Times, serif ;
} }
body{
background-color: #b7deff;
}
#mapDiv{ #mapDiv{
background-color: black; background-color: black;
position: absolute; position: absolute;
@ -238,7 +240,6 @@ height: 100%;
width: 100%; width: 100%;
top: 0%; top: 0%;
z-index: 0; z-index: 0;
} }
#buttonDiv{ #buttonDiv{