diff --git a/src/renderer/components/EditLayer.vue b/src/renderer/components/EditLayer.vue index 8f7c026..c845d84 100644 --- a/src/renderer/components/EditLayer.vue +++ b/src/renderer/components/EditLayer.vue @@ -41,11 +41,7 @@ You should have received a copy of the GNU General Public License along with FG props: [], created () { - console.log(LMap) - console.log(LMarker) - console.log(L) - console.log(LEdit) - console.log(L2) + [LMap, LMarker, L, LEdit, L2] console.log('Created Editlayer') // console.log(LSymbol) }, @@ -125,9 +121,12 @@ You should have received a copy of the GNU General Public License along with FG this.icao = icao this.groundnetLayerGroup = readGroundnetXML(this.$store.state.Settings.settings.airportsDirectory, icao, force) if (this.groundnetLayerGroup === undefined) { - console.error('ICAO not loaded ' + icao) + console.warn('Groundnet for ICAO not loaded ' + icao) return } + if (this.groundnetLayerGroup.getLayers().length === 0) { + console.warn('Groundnet for ICAO not loaded ' + icao) + } this.groundnetLayerGroup.eachLayer(l => { if (l instanceof L.TaxiwaySegment) { l.addListeners() diff --git a/src/renderer/components/ThresholdLayer.vue b/src/renderer/components/ThresholdLayer.vue index a6f75e7..4f8c779 100644 --- a/src/renderer/components/ThresholdLayer.vue +++ b/src/renderer/components/ThresholdLayer.vue @@ -31,6 +31,10 @@ load (icao) { // Callback for add this.layerGroup = readThresholdXML(this.$store.state.Settings.settings.airportsDirectory, icao, this.read) + if (!this.layerGroup) { + console.warn('Threshold for ICAO not loaded ' + icao) + return + } this.layerGroup.addTo(this.$parent.mapObject) this.visible = true this.icao = icao diff --git a/src/renderer/loaders/groundnet_writer.js b/src/renderer/loaders/groundnet_writer.js index 5fa6463..3d5e686 100644 --- a/src/renderer/loaders/groundnet_writer.js +++ b/src/renderer/loaders/groundnet_writer.js @@ -60,6 +60,11 @@ function walkPushbackRoute (index, walkedNodes, pushBackNodes) { exports.writeGroundnetXML = function (fDir, icao, featureList) { try { + try { fs.mkdirSync(path.join(fDir), { recursive: true })} catch (err) { } + try { fs.mkdirSync(path.join(fDir, icao[0]),{ recursive: true })} catch (err) { } + try { fs.mkdirSync(path.join(fDir, icao[0], icao[1]), { recursive: true })} catch (err) { } + try { fs.mkdirSync(path.join(fDir, icao[0], icao[1], icao[2]), { recursive: true })} catch (err) { } + var f = path.join(fDir, icao[0], icao[1], icao[2], icao + '.groundnet.new.xml'); var fBak = path.join(fDir, icao[0], icao[1], icao[2], icao + '.groundnet.bak.xml'); diff --git a/src/renderer/utils/scan.js b/src/renderer/utils/scan.js index dd951e0..303bfc0 100644 --- a/src/renderer/utils/scan.js +++ b/src/renderer/utils/scan.js @@ -186,6 +186,9 @@ function scanTrafficIntoDB(p, features) { function traverseDir(dir) { var result = []; + if(!fs.existsSync(dir)) { + return result; + } fs.readdirSync(dir).forEach(file => { let fullPath = path.join(dir, file); if (fs.lstatSync(fullPath).isDirectory()) {