Fewer MUTATIONS of CENTER & BOUNDS

This commit is contained in:
portree_kid 2020-01-07 15:24:30 +01:00
parent d520d982b5
commit 7f3bdc8de8

View File

@ -101,15 +101,21 @@
this.$store.commit('SET_EDIT_AIRPORT', item.properties) this.$store.commit('SET_EDIT_AIRPORT', item.properties)
}, },
zoomUpdated (zoom) { zoomUpdated (zoom) {
if (zoom !== this.$store.state.Settings.zoom) {
this.$store.dispatch('setZoom', zoom) this.$store.dispatch('setZoom', zoom)
console.log(this.$refs.airportLayer.setVisible(zoom < 12)) this.$refs.airportLayer.setVisible(zoom < 12)
}
}, },
centerUpdated (center) { centerUpdated (center) {
if (center !== this.$store.state.Settings.center) {
this.$store.dispatch('setCenter', center) this.$store.dispatch('setCenter', center)
}
}, },
boundsUpdated (bounds) { boundsUpdated (bounds) {
if (bounds !== this.$store.state.Settings.bounds) {
this.$store.dispatch('setBounds', bounds) this.$store.dispatch('setBounds', bounds)
} }
}
}, },
computed: { computed: {
zoom: function () { zoom: function () {