From 41376bb130a2596c63d8e528a3e0073a3f04e2e1 Mon Sep 17 00:00:00 2001 From: portree_kid Date: Thu, 19 Nov 2020 22:29:50 +0100 Subject: [PATCH] #61 Layercontrol fixed --- src/renderer/components/FlightgearMap.vue | 8 ++++++++ src/renderer/loaders/groundnet_writer.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/FlightgearMap.vue b/src/renderer/components/FlightgearMap.vue index 96e9fde..a723f00 100644 --- a/src/renderer/components/FlightgearMap.vue +++ b/src/renderer/components/FlightgearMap.vue @@ -208,12 +208,20 @@ You should have received a copy of the GNU General Public License along with FG if (this.$refs.pavementLayer.getLayer() === e.layer) { // debugger var l = this.layersControl._layers.filter(l => l.name === 'APT Layer') + if (l.length > 0 && l[0].layer !== this.$refs.pavementLayer.getLayer()) { + this.layersControl.removeLayer(l[0].layer) + this.layersControl.addOverlay(this.$refs.pavementLayer.getLayer(), 'APT Layer') + } if (l.length === 0) { this.layersControl.addOverlay(this.$refs.pavementLayer.getLayer(), 'APT Layer') } } if (this.$refs.thresholdLayer.getLayer() === e.layer) { l = this.layersControl._layers.filter(l => l.name === 'Threshold Layer') + if (l.length > 0 && l[0].layer !== this.$refs.thresholdLayer.getLayer()) { + this.layersControl.removeLayer(l[0].layer) + this.layersControl.addOverlay(this.$refs.thresholdLayer.getLayer(), 'Threshold Layer') + } if (l.length === 0) { this.layersControl.addOverlay(this.$refs.thresholdLayer.getLayer(), 'Threshold Layer') } diff --git a/src/renderer/loaders/groundnet_writer.js b/src/renderer/loaders/groundnet_writer.js index a908f8e..155dbaf 100644 --- a/src/renderer/loaders/groundnet_writer.js +++ b/src/renderer/loaders/groundnet_writer.js @@ -206,7 +206,7 @@ var mapParkings = function (o) { console.debug(o.options.attributes.airlineCodes); parking['@airlineCodes'] = o.options.attributes.airlineCodes; } - if(o.options.attributes.number && o.options.attributes.number.trim() !== '') { + if(o.options.attributes.number !== undefined && o.options.attributes.number.trim() !== '') { console.debug(o.options.attributes.number); parking['@number'] = o.options.attributes.number; }