|
@@ -119,8 +119,14 @@
|
|
|
|
|
|
},
|
|
|
switchStartPoint(newVal) {
|
|
|
- console.log(this.selectTrack)
|
|
|
- let pointNames = this.dataParams.selectedPoints[this.selectTrack.id]["start"];
|
|
|
+ let currentSelectPath = this.dataParams.selectedPoints[this.selectTrack.id];
|
|
|
+ if(!currentSelectPath){
|
|
|
+ currentSelectPath = {
|
|
|
+ 'start':[],
|
|
|
+ 'end':[]
|
|
|
+ };
|
|
|
+ }
|
|
|
+ let pointNames = currentSelectPath["start"];
|
|
|
let searchIndex = pointNames.indexOf(this.preStartPointName);
|
|
|
if (searchIndex != -1) {
|
|
|
pointNames.splice(searchIndex, 1);
|
|
@@ -130,7 +136,15 @@
|
|
|
this.changeMap();
|
|
|
},
|
|
|
switchEndPoint(newVal) {
|
|
|
- let pointNames = this.dataParams.selectedPoints[this.selectTrack.id]["end"];
|
|
|
+ let currentSelectPath = this.dataParams.selectedPoints[this.selectTrack.id];
|
|
|
+ if(!currentSelectPath){
|
|
|
+ currentSelectPath = {
|
|
|
+ 'start':[],
|
|
|
+ 'end':[]
|
|
|
+ };
|
|
|
+ }
|
|
|
+ let pointNames = currentSelectPath["end"];
|
|
|
+
|
|
|
let searchIndex = pointNames.indexOf(this.preEndPointName);
|
|
|
if (searchIndex != -1) {
|
|
|
pointNames.splice(searchIndex, 1);
|