Started implementation of map view in Overview

This commit is contained in:
Katharina Will 2019-05-08 20:14:37 +02:00
parent 7512c2e49e
commit 2e315c6125

View File

@ -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) => {