Select and delete Parkings

This commit is contained in:
portree_kid
2020-02-13 11:39:26 +01:00
parent 3772717291
commit 7c61fedbec
3 changed files with 32 additions and 2 deletions
+18
View File
@@ -144,8 +144,23 @@
switch (this.$store.state.Editable.type) {
case 'node':
this.removeNode(this.$store.state.Editable.index)
break;
case 'parking':
this.removeParking(this.$store.state.Editable.index)
break;
}
},
removeParking (index) {
if(this.featureLookup[index]===undefined) {
console.error("Lookup " + index + " failed ");
return;
}
this.featureLookup[index].forEach((element, i) => {
if (element instanceof L.ParkingSpot) {
element.removeFrom(this.groundnetLayerGroup);
}
});
},
removeNode (index) {
if(this.featureLookup[index]===undefined) {
console.error("Lookup " + index + " failed ");
@@ -205,6 +220,9 @@
},
editedNode() {
if (this.$store.state.Editable.data.node===undefined) {
return;
}
var isOnRunway = Number(this.$store.state.Editable.data.node.isOnRunway);
var isHoldPoint = this.$store.state.Editable.data.node.holdPointType !== 'none' &&
this.$store.state.Editable.data.node.holdPointType !== undefined;