Box not displayed on new Parking

This commit is contained in:
portree_kid 2020-08-06 20:59:30 +02:00
parent 7c8cc0e705
commit dc480ad25d
2 changed files with 11 additions and 5 deletions

View File

@ -847,9 +847,12 @@ You should have received a copy of the GNU General Public License along with FG
circle.glueindex = circle.id circle.glueindex = circle.id
circle.addTo(this.groundnetLayerGroup) circle.addTo(this.groundnetLayerGroup)
circle.featureLookup = this.featureLookup circle.featureLookup = this.featureLookup
circle.addListeners()
circle.enableEdit() circle.enableEdit()
circle.extensions() circle.extensions()
circle.addListeners() circle.updateVertexFromDirection();
circle.updateWheelPos();
circle.updateBox();
if (Number(this.$store.state.Editable.index) >= 0 && if (Number(this.$store.state.Editable.index) >= 0 &&
this.featureLookup[this.$store.state.Editable.index]!==undefined) { this.featureLookup[this.$store.state.Editable.index]!==undefined) {
this.featureLookup[this.$store.state.Editable.index].forEach(element => { this.featureLookup[this.$store.state.Editable.index].forEach(element => {

View File

@ -190,10 +190,13 @@ L.ParkingSpot = L.Circle.extend({
} }
event.target._parkingSpot.select(); event.target._parkingSpot.select();
}); });
if(this.editor && this.editor.editLayer) {
this.box.addTo(this.editor.editLayer);
}
} }
if(this.box!==undefined) { if(this.box!==undefined) {
var latlngs = [leftBack, rightBack, rightMiddle, rightIntermediate, rightFront, leftFront, leftIntermediate, leftMiddle].map(l => this.turfToLatLng(l)); var latlngs = [leftBack, rightBack, rightMiddle, rightIntermediate, rightFront, leftFront, leftIntermediate, leftMiddle].map(l => this.turfToLatLng(l));
console.debug(latlngs);
this.box.setLatLngs(latlngs); this.box.setLatLngs(latlngs);
} }
} }
@ -216,7 +219,7 @@ L.ParkingSpot = L.Circle.extend({
if(this.direction) { if(this.direction) {
this.direction.setStyle(style); this.direction.setStyle(style);
this.frontWheel.setStyle(style); this.frontWheel.setStyle(style);
} }
this.updateWheelPos(); this.updateWheelPos();
this.updateBox(); this.updateBox();
if(this.box) { if(this.box) {