From 64685aa1d1eb42a9585e7aa802fdfe8adcb5a6bb Mon Sep 17 00:00:00 2001 From: portree_kid Date: Sat, 4 Jul 2020 22:37:32 +0200 Subject: [PATCH] https://github.com/Portree-Kid/flightgear-airports/issues/28 --- src/renderer/loaders/ParkingSpot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/loaders/ParkingSpot.js b/src/renderer/loaders/ParkingSpot.js index 2559520..a1a4455 100644 --- a/src/renderer/loaders/ParkingSpot.js +++ b/src/renderer/loaders/ParkingSpot.js @@ -171,13 +171,14 @@ L.ParkingSpot = L.Circle.extend({ var leftIntermediate = turf.destination(leftFront, halfRadiusKM, backwards, options); var rightIntermediate = turf.destination(rightFront, halfRadiusKM, backwards, options); - if(this.box === undefined ) { + if(this.box === undefined && this.editor !== undefined) { var latlngs = [leftBack, rightBack, rightMiddle, rightIntermediate, rightFront, leftFront, leftIntermediate, leftMiddle].map(l => this.turfToLatLng(l)); this.box = L.polygon(latlngs); this.box.addTo(this.editor.editLayer); this.box.on('click', function (event) { console.debug("Click Parking : " + event.target); if (Number(store.default.state.Editable.index) >= 0 && + this.featureLookup !== undefined && this.featureLookup[store.default.state.Editable.index]!==undefined) { this.featureLookup[store.default.state.Editable.index].forEach(element => { if(element.deselect !== undefined) {