Started implementation of map view in Overview
This commit is contained in:
parent
7512c2e49e
commit
2e315c6125
@ -91,6 +91,8 @@
|
|||||||
return {
|
return {
|
||||||
tab: 'list',
|
tab: 'list',
|
||||||
caches: [],
|
caches: [],
|
||||||
|
stations: [],
|
||||||
|
pois: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
@ -114,8 +116,19 @@
|
|||||||
fetchAllCaches() {
|
fetchAllCaches() {
|
||||||
this.$axios.get('/api/allCaches')
|
this.$axios.get('/api/allCaches')
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log("Caches: " + this.caches);
|
|
||||||
this.caches = response.data;
|
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) => {
|
}).catch((error) => {
|
||||||
let message;
|
let message;
|
||||||
let header = "Fehler: ";
|
let header = "Fehler: ";
|
||||||
@ -144,9 +157,23 @@
|
|||||||
},
|
},
|
||||||
editCache() {
|
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) {
|
deleteCache(id) {
|
||||||
console.log('delete cache: ' + id);
|
console.log('delete cache: ' + id);
|
||||||
this.$axios.get('/api/deleteCache', {params: {cacheID: id}})
|
axios.get('/api/deleteCache', {params: {cacheID: id}})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.fetchAllCaches()
|
this.fetchAllCaches()
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user