From 5626c52537c63b502ed7b9d41f37576c498366d4 Mon Sep 17 00:00:00 2001 From: Katharina Will Date: Thu, 6 Jun 2019 12:53:42 +0200 Subject: [PATCH] CacheStart map shows marker for startstation again --- .../frontend/src/pages/CacheStart.vue | 2 +- .../frontend/src/pages/StationView.vue | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/CacheStart.vue b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/CacheStart.vue index 951b7af..973eed8 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/CacheStart.vue +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/CacheStart.vue @@ -9,7 +9,7 @@ - + diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/StationView.vue b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/StationView.vue index 487d6bd..951c055 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/StationView.vue +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/StationView.vue @@ -57,7 +57,7 @@ Vue.use(VueLayers); stationen: [], }, station: {}, - markercolor: "red", + markercolor: "grey", cameraActive: false, result: null, zoom: 15, @@ -121,8 +121,15 @@ Vue.use(VueLayers); }, getMarkerURL(station) { - console.log(station); - return `./statics/map-marker_${this.markercolor}.svg` + return `./statics/map-marker_${this.setMarkercolor(station)}.svg` + }, + setMarkercolor(station){ + if(this.station === cache.stationen.find(station => station.id === Number(this.$route.params.id))) { + this.markercolor = "red"; + } else if (this.station) { + this.markercolor = "grey"; + } + return this.markercolor }, updateResult(event) {