From 2d94425de59bdefdc9629732443b340ba01b0d73 Mon Sep 17 00:00:00 2001 From: Keith Paterson Date: Thu, 7 Jan 2021 21:42:12 +0100 Subject: [PATCH] #110 --- src/renderer/components/ThresholdLayer.vue | 3 +++ src/renderer/loaders/Threshold.js | 2 +- src/renderer/loaders/Tower.js | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/ThresholdLayer.vue b/src/renderer/components/ThresholdLayer.vue index dfabab7..6de117b 100644 --- a/src/renderer/components/ThresholdLayer.vue +++ b/src/renderer/components/ThresholdLayer.vue @@ -50,6 +50,9 @@ load (icao) { this.$parent.mapObject.createPane('threshold-pane') this.$parent.mapObject.getPane('threshold-pane').style.zIndex = 550 + if (this.layerGroup) { + this.layerGroup.removeFrom(this.$parent.mapObject) + } // Callback for add this.layerGroup = readThresholdXML(this.$store.state.Settings.settings.airportsDirectory, icao, this.read) if (!this.layerGroup) { diff --git a/src/renderer/loaders/Threshold.js b/src/renderer/loaders/Threshold.js index 8299107..218db3a 100644 --- a/src/renderer/loaders/Threshold.js +++ b/src/renderer/loaders/Threshold.js @@ -37,7 +37,7 @@ L.Threshold = L.Marker.extend({ console.debug(`Lat Lng Threshold ${this.getLatLng()}`); if(map !== null) { var metersPP = this.metersPerPixel(map.getCenter().lat, map.getZoom()); - console.debug('Old Meters per pixel ' + this.metersPP); + console.debug('Old Meters per pixel ' + this._metersPP); console.debug('New Meters per pixel ' + metersPP); if(this._metersPP != metersPP) { var pixelSize = (this.iconSize/2) / metersPP; diff --git a/src/renderer/loaders/Tower.js b/src/renderer/loaders/Tower.js index 81dce99..be60398 100644 --- a/src/renderer/loaders/Tower.js +++ b/src/renderer/loaders/Tower.js @@ -30,19 +30,19 @@ L.TowerMarker = L.Marker.extend({ return svg2[0]; }, updateIcon : function(map) { - console.debug(`Lat Lng Threshold ${this.getLatLng()}`); + console.debug(`Lat Lng Tower ${this.getLatLng()}`); if(map !== null) { var metersPP = this.metersPerPixel(map.getCenter().lat, map.getZoom()); - console.debug('Old Meters per pixel ' + this.metersPP); + console.debug('Old Meters per pixel ' + this._metersPP); console.debug('New Meters per pixel ' + metersPP); if(this._metersPP != metersPP) { - var pixelSize = (this.iconSize/2) / metersPP; + var pixelSize = this.iconSize / metersPP; var scale = pixelSize/this.iconSize; var offset = 0;//-(this.iconSize/2); this.setIcon(L.divIcon({ iconSize: 64, className: 'threshold-marker-icon', - html: `
${this.svg}
`, + html: `
${this.svg}
`, })); this.update(this.getLatLng());