From c01ff0bdbf63e2c13a9447e04e32d825f7cfccb4 Mon Sep 17 00:00:00 2001 From: Raimund Renkert Date: Fri, 4 Mar 2022 16:15:15 +0100 Subject: [PATCH] Layers for POI in web client and list of players. --- cmd/mtwebmapper/client/src/App.vue | 60 +++++- .../client/src/components/MapView.vue | 195 +++++++++++++++++- cmd/mtwebmapper/client/src/store/index.js | 27 ++- 3 files changed, 274 insertions(+), 8 deletions(-) diff --git a/cmd/mtwebmapper/client/src/App.vue b/cmd/mtwebmapper/client/src/App.vue index 67b716f..a83eb56 100644 --- a/cmd/mtwebmapper/client/src/App.vue +++ b/cmd/mtwebmapper/client/src/App.vue @@ -15,6 +15,56 @@ Players + + + + + + + Buildings + + + + + + + + Points of Interest + + + + + + + + Travelnet + + + + + + + + Other + + + + + + Players + + + + + + + + fa-crosshairs + + @@ -120,11 +170,19 @@ export default { mounted() { fetch("players").then(response => response.json().then((data) => { this.$store.commit("setPlayers", data); - })) + })); + fetch("poi").then(response => response.json().then((data) => { + this.$store.commit("setPointFeatures", data); + })); }, methods: { refreshContent() { this.$store.dispatch("manualUpdate"); + }, + goToPlayer(player) { + console.log(player); + const coords = [player.geometry.coordinates[1], player.geometry.coordinates[0]]; + this.$store.commit("setMapCenter", coords) } } } diff --git a/cmd/mtwebmapper/client/src/components/MapView.vue b/cmd/mtwebmapper/client/src/components/MapView.vue index 418a366..1bf270a 100644 --- a/cmd/mtwebmapper/client/src/components/MapView.vue +++ b/cmd/mtwebmapper/client/src/components/MapView.vue @@ -1,7 +1,27 @@