From 3772717291c5382164c824a580710451f3583d6d Mon Sep 17 00:00:00 2001 From: portree_kid Date: Wed, 12 Feb 2020 20:49:22 +0100 Subject: [PATCH] Zoom out --- src/renderer/components/EditLayer.vue | 7 +++++++ src/renderer/components/FlightgearMap.vue | 2 ++ src/renderer/components/PavementLayer.vue | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/src/renderer/components/EditLayer.vue b/src/renderer/components/EditLayer.vue index 23cb652..300aaff 100644 --- a/src/renderer/components/EditLayer.vue +++ b/src/renderer/components/EditLayer.vue @@ -365,6 +365,13 @@ }) writeGroundnetXML(this.$store.state.Settings.settings.airportsDirectory, this.icao, xml) }, + setVisible(visible) { + if (visible) { + this.groundnetLayerGroup.addTo(this.$parent.mapObject) + } else { + this.groundnetLayerGroup.removeFrom(this.$parent.mapObject) + } + } }, computed: { edit: function () { diff --git a/src/renderer/components/FlightgearMap.vue b/src/renderer/components/FlightgearMap.vue index f366309..cc6cdad 100644 --- a/src/renderer/components/FlightgearMap.vue +++ b/src/renderer/components/FlightgearMap.vue @@ -65,6 +65,7 @@ this.$refs.pavementLayer.load(airportsToLoad[0]) this.editingAirport = airportsToLoad[0] } + this.$refs.editLayer.setVisible(this.zoom >= 12) this.$refs.airportLayer.setVisible(this.zoom < 12) // console.log(this.groundnet) @@ -131,6 +132,7 @@ if (bounds !== this.$store.state.Settings.bounds) { this.$store.dispatch('setBounds', bounds) this.$refs.airportLayer.setVisible(this.zoom < 12) + this.$refs.pavementLayer.setVisible(this.zoom < 12) } } }, diff --git a/src/renderer/components/PavementLayer.vue b/src/renderer/components/PavementLayer.vue index be300da..49a15b4 100644 --- a/src/renderer/components/PavementLayer.vue +++ b/src/renderer/components/PavementLayer.vue @@ -63,6 +63,15 @@ if (this.$parent._isMounted) { this.deferredMountedTo(this.$parent.mapObject) } + }, + setVisible (visible) { + if (this.layerGroup !== undefined) { + if (visible) { + this.layerGroup.addTo(this.$parent.mapObject) + } else { + this.layerGroup.removeFrom(this.$parent.mapObject) + } + } } }, computed: {