From aa73aeb1a4c2082234f3cfb8716075889a07c0a8 Mon Sep 17 00:00:00 2001 From: portree_kid Date: Mon, 30 Dec 2019 23:27:29 +0100 Subject: [PATCH] Reactive Zoom --- src/renderer/components/FlightgearMap.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/FlightgearMap.vue b/src/renderer/components/FlightgearMap.vue index bbde3b7..6adb712 100644 --- a/src/renderer/components/FlightgearMap.vue +++ b/src/renderer/components/FlightgearMap.vue @@ -47,8 +47,6 @@ }, data () { return { - zoom: this.$store.state.Settings.zoom, - center: this.$store.state.Settings.center, url: 'http://{s}.tile.osm.org/{z}/{x}/{y}.png', attribution: '© OpenStreetMap contributors', marker: L.latLng(47.413220, -1.219482), @@ -61,19 +59,22 @@ this.$store.commit('SET_EDIT_AIRPORT', item) }, zoomUpdated (zoom) { - this.zoom = zoom - this.$store.commit('ZOOM', this.zoom) + this.$store.commit('ZOOM', zoom) }, centerUpdated (center) { - this.center = center - this.$store.commit('CENTER', this.center) + this.$store.commit('CENTER', center) }, boundsUpdated (bounds) { this.bounds = bounds } }, computed: { - + zoom: function () { + return this.$store.state.Settings.zoom + }, + center: function () { + return this.$store.state.Settings.center + } } }