diff --git a/frontend/src/pages/Overview.vue b/frontend/src/pages/Overview.vue index 22575e3..3df177f 100644 --- a/frontend/src/pages/Overview.vue +++ b/frontend/src/pages/Overview.vue @@ -91,6 +91,8 @@ return { tab: 'list', caches: [], + stations: [], + pois: [] } }, mounted: function () { @@ -114,8 +116,19 @@ fetchAllCaches() { this.$axios.get('/api/allCaches') .then((response) => { - console.log("Caches: " + this.caches); this.caches = response.data; + for(let cache in this.caches) { + + this.stations[cache]=(this.caches[cache].stationen[0]); + const poiItem = { + Name: this.caches[cache].name, + CategoryID: 3, + Latitude: this.stations[cache].lattitude, + Longitude: this.stations[cache].longitude + }; + this.pois.push(poiItem); + } + this.initMap(); }).catch((error) => { let message; let header = "Fehler: "; @@ -144,9 +157,23 @@ }, editCache() { }, + initMap(){ + console.log("Signalwort: " + this.pois); + // this.$axios.post('http://seserver.se.hs-heilbronn.de:3000/api/map', { + // body: this.pois + // }).then((response)=>{ + // console.log(response) + // }) + // }, + this.$axios.get('http://www.se.hs-heilbronn.de:3000/api/map/lon=9&lat=49', { + body: this.pois + }).then((response)=>{ + console.log(response) + }) + }, deleteCache(id) { console.log('delete cache: ' + id); - this.$axios.get('/api/deleteCache', {params: {cacheID: id}}) + axios.get('/api/deleteCache', {params: {cacheID: id}}) .then((response) => { this.fetchAllCaches() }).catch((error) => {