From d9eed59de7ff9e6de025a136dee4122cbac5eb5d Mon Sep 17 00:00:00 2001 From: portree_kid Date: Mon, 8 Jun 2020 22:54:01 +0200 Subject: [PATCH] Node edit --- src/renderer/components/EditLayer.vue | 3 ++- src/renderer/components/NodeEdit.vue | 26 +++++++++++++------ .../loaders/TaxiwaySegmentExtender.js | 2 +- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/renderer/components/EditLayer.vue b/src/renderer/components/EditLayer.vue index 258f3e6..055d4e1 100644 --- a/src/renderer/components/EditLayer.vue +++ b/src/renderer/components/EditLayer.vue @@ -694,8 +694,9 @@ if(element.__vertex && Number(element.glueindex) === Number(nIndex)){ if (this.$store.state.Editable.data.node.coords) { console.log('Cords : ' + this.$store.state.Editable.data.node.coords); - this.setPointCoords(this.$store.state.Editable.index, this.$store.state.Editable.data.node.coords) + var position = new Coordinates(this.$store.state.Editable.data.node.coords); + latlng = {lat: position.latitude, lng: position.longitude }; } } }); diff --git a/src/renderer/components/NodeEdit.vue b/src/renderer/components/NodeEdit.vue index a57f44b..df6be58 100644 --- a/src/renderer/components/NodeEdit.vue +++ b/src/renderer/components/NodeEdit.vue @@ -6,7 +6,9 @@ Coordinates : - + @@ -14,7 +16,8 @@ Is on runway : - + @@ -22,12 +25,13 @@ Holdpoint Type : - + @@ -47,6 +51,11 @@ } }, */ + data () { + return { + coordFocussed: false, runwayFocussed: false, holdFocussed: false + } + }, computed: { editing: { get: function () { @@ -54,7 +63,7 @@ } }, options: function () { - return [{value: 'none', label: 'none'}, {value: 'PushBack', label: 'PushBack'}, {value: 'normal', label: 'normal'}, {value: 'CAT II/III', label: 'CAT II/III'}] + return [{value: 'none', label: 'none', disabled: false }, {value: 'PushBack', label: 'PushBack'}, {value: 'normal', label: 'normal'}, {value: 'CAT II/III', label: 'CAT II/III'}] }, node: function () { return this.$store.state.Editable.type === 'node' || this.$store.state.Editable.type === 'runway' @@ -69,10 +78,9 @@ }, // setter set: function (newValue) { - if (newValue==='unknown') { - + if (this.coordFocussed) { + this.$store.commit('SET_EDIT_NODE_COORDS', newValue) } - this.$store.commit('SET_EDIT_NODE_COORDS', newValue) } }, isOnRunway: { @@ -82,7 +90,9 @@ }, // setter set: function (newValue) { - this.$store.commit('SET_EDIT_ISONRUNWAY', newValue ? 1 : 0) + if(!this.runwayFocussed) { + this.$store.commit('SET_EDIT_ISONRUNWAY', newValue ? 1 : 0) + } } }, holdPointType: { diff --git a/src/renderer/loaders/TaxiwaySegmentExtender.js b/src/renderer/loaders/TaxiwaySegmentExtender.js index cb4603a..236b058 100644 --- a/src/renderer/loaders/TaxiwaySegmentExtender.js +++ b/src/renderer/loaders/TaxiwaySegmentExtender.js @@ -21,7 +21,7 @@ exports.extendTaxiSegment = function (taxiwaySegment) { taxiwaySegment.__proto__.updateMiddle = function () { this._latlngs.forEach(element => { - if (element.__vertex.middleMarker) { + if (element.__vertex && element.__vertex.middleMarker) { element.__vertex.middleMarker.updateLatLng(); } });