From 739eb20f65c3d0e529c0e4bf32a055d961163a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 12 Jan 2023 16:54:06 +0100 Subject: [PATCH] Fix map coordinates of users and groups --- webapp/pages/map.vue | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/webapp/pages/map.vue b/webapp/pages/map.vue index 4085ed545..e617ab64f 100644 --- a/webapp/pages/map.vue +++ b/webapp/pages/map.vue @@ -193,13 +193,15 @@ export default { console.log('markers.isUsersAdded !!! user index: ', index) if (user.id !== this.currentUser.id && user.location) { console.log('markers.isUsersAdded !!! user index if: ', index) - this.markers.array.push(new mapboxgl.Marker({ - coordinates: this.getCoordinates(user.location), - scale: 0.75, - color: 'blue', - })) + this.markers.array.push( + new mapboxgl.Marker({ + // Wolle: coordinates: this.getCoordinates(user.location), + scale: 0.75, + color: 'blue', + }), + ) this.markers.array[this.markers.array.length - 1] - .setLngLat(this.currentUserCoordinates) + .setLngLat(this.getCoordinates(user.location)) .addTo(this.map) } }) @@ -210,14 +212,21 @@ export default { this.groups.forEach((group, index) => { console.log('markers.isGroupsAdded !!! group index: ', index) if (group.location) { - console.log('markers.isGroupsAdded !!! group index if: ', index) - this.markers.array.push(new mapboxgl.Marker({ - coordinates: this.getCoordinates(group.location), - scale: 0.75, - color: 'green', - })) + console.log( + 'markers.isGroupsAdded !!! group index if: ', + index, + ' location: ', + this.getCoordinates(group.location), + ) + this.markers.array.push( + new mapboxgl.Marker({ + // Wolle: coordinates: this.getCoordinates(group.location), + scale: 0.75, + color: 'green', + }), + ) this.markers.array[this.markers.array.length - 1] - .setLngLat(this.currentUserCoordinates) + .setLngLat(this.getCoordinates(group.location)) .addTo(this.map) } })