From b06b1b6a03affaa8691d28333bf581a38cc7f4b2 Mon Sep 17 00:00:00 2001 From: portree_kid Date: Wed, 13 May 2020 11:01:28 +0200 Subject: [PATCH] Upload check --- src/renderer/components/EditBar.vue | 1 + src/renderer/components/EditLayer.vue | 27 ++++++- src/renderer/components/Upload.vue | 105 +++++++++++++++++++++++++- 3 files changed, 129 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/EditBar.vue b/src/renderer/components/EditBar.vue index 22ff45f..e1cf3f2 100644 --- a/src/renderer/components/EditBar.vue +++ b/src/renderer/components/EditBar.vue @@ -72,6 +72,7 @@ methods: { upload() { this.uploadVisible = true + this.$refs.upload.check() }, zoomout() { this.$parent.$parent.zoomUpdated(9) diff --git a/src/renderer/components/EditLayer.vue b/src/renderer/components/EditLayer.vue index 17f2cce..72252e0 100644 --- a/src/renderer/components/EditLayer.vue +++ b/src/renderer/components/EditLayer.vue @@ -239,9 +239,9 @@ }); }, show (index) { - if(this.featureLookup[index]===undefined) { + if(this.featureLookup===undefined || this.featureLookup[index]===undefined) { console.error("Lookup " + index + " failed "); - return; + this.buildLookup() } this.featureLookup[index].forEach((element, i) => { if (element instanceof L.Polyline) { @@ -281,6 +281,29 @@ } }); }, + buildLookup () { + this.featureLookup = {}; + this.groundnetLayerGroup.eachLayer((layer) => { + if (layer instanceof L.Polyline) { + // console.log(layer._latlngs) + layer._latlngs.forEach(latlng => { + if (latlng.attributes.index) { + if( this.featureLookup[latlng.attributes.index] == undefined) { + this.featureLookup[latlng.attributes.index] = []; + } + this.featureLookup[latlng.attributes.index].push(layer); + } + }) + } else if (layer instanceof L.RunwayNode || layer instanceof L.ParkingSpot || layer instanceof L.HoldNode) { + if( this.featureLookup[layer.glueindex] == undefined) { + this.featureLookup[layer.glueindex] = []; + } + this.featureLookup[layer.glueindex].push(layer); + } else { + console.warn(layer) + } + }) + }, getPointCoords (index) { if(this.featureLookup[index]===undefined) { console.error("Lookup " + index + " failed "); diff --git a/src/renderer/components/Upload.vue b/src/renderer/components/Upload.vue index 49dc553..5e79267 100644 --- a/src/renderer/components/Upload.vue +++ b/src/renderer/components/Upload.vue @@ -1,11 +1,13 @@ @@ -13,6 +15,7 @@