Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions src/components/Tracker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<!-- fullscreen button -->
<b-badge v-if="showFullScreen && showFSIcon" v-b-tooltip.hover :title="FullscreenDesc" role="button"
variant="primary" class="mr-1"
@click="toggleFullscreen(!fullscreen)">
@click="toggleFullscreen(!fullscreen); resetAdvMode()">
<BIconFullscreen v-if="!fullscreen"></BIconFullscreen>
<BIconFullscreenExit v-if="fullscreen"></BIconFullscreenExit>
{{ fullscreen ? "Exit" : "Enter" }} Full-Screen Mode
Expand Down Expand Up @@ -82,8 +82,8 @@

<!-- Announcement Bar -->
<Announcement v-if="fullscreen"></Announcement>

</div>
<Modal v-if="fullscreen" class="modal"></Modal>
</fullscreen>
</div>
</template>
Expand All @@ -98,6 +98,7 @@ import VueFullscreen from 'vue-fullscreen'
import mixin from '../mixins/mixins.js'
import Schedule from "./Schedule";
import Fullscrn_qrcode from "./Fullscrn_qrcode";
import Modal from "../components/Modal";

Vue.use(VueFullscreen);

Expand All @@ -113,7 +114,8 @@ export default {
BIconFullscreen,
BIconFullscreenExit,
BIconVinyl,
Schedule
Schedule,
Modal
},
mixins: [mixin],
data() {
Expand All @@ -135,6 +137,7 @@ export default {
{ name: 'User Bus', icon: '🚍', color: 'mediumseagreen' },
// { name: 'System Bus', icon: '...', color: 'red' },
{ name: 'Placeholder Bus', icon: '🚌', color: 'red' },
// add more bus types as needed
],
currentBuses: [], // active buses
trailColors: ["orange", "green", "purple", "maroon", "yellow", "pink", "cyan", "gray", "brown", "darkmagenta", "plum", "steelblue", "seashell", "lavender",] // colors of markers
Expand Down Expand Up @@ -162,6 +165,7 @@ export default {
});
},
mounted() {

// initialize map object
let vm = this;
mapkit.init({
Expand Down Expand Up @@ -198,8 +202,25 @@ export default {
if (f > -1) {
this.fullscreenDelay = 200; // delay to show icons for firefox users, since firefox has fullscreen animation by default
}
this.bindDoubleClickEvent();
},
methods: {
redirectToWebsite(location) {
location.replaceAll(' ', '+')
window.open("https://www.google.com/maps/search/" + encodeURIComponent(location), "_blank"); // Redirect to the desired website
},
bindDoubleClickEvent() {
const mapElement = document.getElementById("map");
mapElement.addEventListener("dblclick", (event) => {
if (event.target.classList.contains("annotation-stop")) {
this.redirectToWebsite(event.target.title);
}
});
},
resetAdvMode() {
// Reset Advanced Mode
this.$store.commit('setAdvMode', false);
},
centerMap() {
const center = new mapkit.Coordinate(42.73029109316892, -73.67655873298646);
const span = new mapkit.CoordinateSpan(0.016, 0.032);
Expand Down Expand Up @@ -448,7 +469,8 @@ export default {

renderBuses() {
// manually update type of buses
}
},

},
watch: {
isDarkMode(val) {
Expand Down Expand Up @@ -484,11 +506,14 @@ export default {
this.renderStops();
this.updateBuses();
}
}
},
};
</script>

<style>
.modal {
z-index: 9999;
}
.annotation-stop {
width: 12px;
height: 12px;
Expand All @@ -497,7 +522,9 @@ export default {
background-color: white;
opacity: 0.8;
}

.annotation-stop:hover {
cursor: pointer;
}
.annotation-popover-light {
background-color: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(5px);
Expand Down