From 3669921773e3d386730b81deb41672e135ccc273 Mon Sep 17 00:00:00 2001 From: Katharina Will Date: Sat, 1 Jun 2019 14:09:01 +0200 Subject: [PATCH] Markers are now shown in different colors according to cacheaccesdefinition --- .../frontend/src/pages/Cache.vue | 2 +- .../frontend/src/pages/Overview.vue | 31 +++++++------------ .../frontend/src/statics/map-marker_amber.svg | 1 + .../frontend/src/statics/map-marker_blue.svg | 18 ----------- .../frontend/src/statics/map-marker_green.svg | 19 +----------- .../frontend/src/statics/map-marker_grey.svg | 20 +----------- .../src/statics/map-marker_primary.svg | 1 + .../src/statics/map-marker_yellow.svg | 18 ----------- 8 files changed, 17 insertions(+), 93 deletions(-) create mode 100644 labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_amber.svg delete mode 100644 labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_blue.svg create mode 100644 labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_primary.svg delete mode 100644 labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_yellow.svg diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue index e3784e1..7c77c89 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue @@ -252,7 +252,7 @@ }, validateRankingPoints: function () { var re = new RegExp('^[0-9]+$'); - var rps = String.valueOf(this.computedCache.rankingPoints); + var rps = String(this.computedCache.rankingPoints); return re.test(rps); }, validateEverything(){ diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Overview.vue b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Overview.vue index ef17a80..a5e36d1 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Overview.vue +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Overview.vue @@ -111,17 +111,17 @@ -
+
+ data-projection="EPSG:4326" :style="{ height: mapHeight+'px' }"> - + @@ -168,14 +168,15 @@ Vue.use(VueLayers); tab: 'list', caches: [], stations: [], - pois: [], features: [], render: false, + renderMarker: false, zoom: 15, center: [ 9.208858198755664, 49.14785422283188], rotation: 0, geolocPosition: undefined, mapHeight: 0, + mapmarker: "", } }, mounted: function () { @@ -242,6 +243,9 @@ Vue.use(VueLayers); return this.goToReward(cache.id); } }, + getMarkerURL(cache) { + return `./statics/map-marker_${this.getColorClass(cache)}.svg` + }, getCacheAccesDefinition(cache) { // console.log("getCacheAccessDefinition") // console.log(cache.hasOwnProperty('cacheAccesDefinition') ? cache.cacheAccesDefinition : -1) @@ -255,18 +259,6 @@ Vue.use(VueLayers); .then((response) => { this.caches = response.data; //this.fetchMyCaches(); - for (let cache in this.caches) { - - this.stations[cache] = (this.caches[cache].stationen[0]); - const poiItem = { - Name: this.caches[cache].name, - Latitude: this.stations[cache].lattitude, - Longitude: this.stations[cache].longitude - }; - this.pois.push(poiItem); - console.log(poiItem.Name + " " + poiItem.Latitude + " " + poiItem.Longitude); - } - resolve(true); }).catch((error) => { let msg; @@ -309,7 +301,8 @@ Vue.use(VueLayers); }) } console.log(this.caches); - console.log("data processed.") + console.log("data processed."); + }).finally(() => resolve(true)) } else { resolve(true); diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_amber.svg b/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_amber.svg new file mode 100644 index 0000000..edd9e39 --- /dev/null +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_amber.svg @@ -0,0 +1 @@ + diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_blue.svg b/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_blue.svg deleted file mode 100644 index 1332e2a..0000000 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_blue.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_green.svg b/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_green.svg index 303fba5..ff9e53b 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_green.svg +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_green.svg @@ -1,18 +1 @@ - - - - - - - - - + diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_grey.svg b/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_grey.svg index c8c75bf..f090f9a 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_grey.svg +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_grey.svg @@ -1,19 +1 @@ - - - - - - - - - + diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_primary.svg b/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_primary.svg new file mode 100644 index 0000000..1762d7a --- /dev/null +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_primary.svg @@ -0,0 +1 @@ + diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_yellow.svg b/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_yellow.svg deleted file mode 100644 index ed06075..0000000 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/statics/map-marker_yellow.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - -