From dc480ad25d2ab890cfeaf2cf599c423977b706c9 Mon Sep 17 00:00:00 2001 From: portree_kid Date: Thu, 6 Aug 2020 20:59:30 +0200 Subject: [PATCH] Box not displayed on new Parking --- src/renderer/components/EditLayer.vue | 5 ++++- src/renderer/loaders/ParkingSpot.js | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/EditLayer.vue b/src/renderer/components/EditLayer.vue index b57ad19..e1d41f9 100644 --- a/src/renderer/components/EditLayer.vue +++ b/src/renderer/components/EditLayer.vue @@ -847,9 +847,12 @@ You should have received a copy of the GNU General Public License along with FG circle.glueindex = circle.id circle.addTo(this.groundnetLayerGroup) circle.featureLookup = this.featureLookup + circle.addListeners() circle.enableEdit() circle.extensions() - circle.addListeners() + circle.updateVertexFromDirection(); + circle.updateWheelPos(); + circle.updateBox(); if (Number(this.$store.state.Editable.index) >= 0 && this.featureLookup[this.$store.state.Editable.index]!==undefined) { this.featureLookup[this.$store.state.Editable.index].forEach(element => { diff --git a/src/renderer/loaders/ParkingSpot.js b/src/renderer/loaders/ParkingSpot.js index de6ead9..5470b27 100644 --- a/src/renderer/loaders/ParkingSpot.js +++ b/src/renderer/loaders/ParkingSpot.js @@ -189,11 +189,14 @@ L.ParkingSpot = L.Circle.extend({ }); } event.target._parkingSpot.select(); - }); - + }); + if(this.editor && this.editor.editLayer) { + this.box.addTo(this.editor.editLayer); + } } if(this.box!==undefined) { var latlngs = [leftBack, rightBack, rightMiddle, rightIntermediate, rightFront, leftFront, leftIntermediate, leftMiddle].map(l => this.turfToLatLng(l)); + console.debug(latlngs); this.box.setLatLngs(latlngs); } } @@ -216,10 +219,10 @@ L.ParkingSpot = L.Circle.extend({ if(this.direction) { this.direction.setStyle(style); this.frontWheel.setStyle(style); - } + } this.updateWheelPos(); this.updateBox(); - if(this.box) { + if(this.box) { this.box.setStyle(style); } },