|
|
@ -14,17 +14,20 @@ export class RouterGISComponent implements OnInit { |
|
|
|
constructor(public _ngZone:NgZone,public snackBar: MatSnackBar,private http:HttpClient,private route:ActivatedRoute,) { } |
|
|
|
constructor(public _ngZone:NgZone,public snackBar: MatSnackBar,private http:HttpClient,private route:ActivatedRoute,) { } |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
this.getCompanyData() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngAfterViewInit(): void { |
|
|
|
ngAfterViewInit(): void { |
|
|
|
|
|
|
|
let async = this.getCompanyData() |
|
|
|
window.setTimeout(()=>{ |
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
|
|
|
async.then(res=>{ |
|
|
|
this.mapInit() |
|
|
|
this.mapInit() |
|
|
|
|
|
|
|
}) |
|
|
|
},0) |
|
|
|
},0) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获取单位 信息
|
|
|
|
//获取单位 信息
|
|
|
|
getCompanyData () { |
|
|
|
getCompanyData () { |
|
|
|
|
|
|
|
return new Promise((resolve,reject)=>{ |
|
|
|
this.http.get(`/api/Companies/${this.route.snapshot.queryParams.id}`).subscribe((data:any)=>{ |
|
|
|
this.http.get(`/api/Companies/${this.route.snapshot.queryParams.id}`).subscribe((data:any)=>{ |
|
|
|
if (data.driveRouteStartPoint && data.driveRouteStartPoint.x && data.driveRouteStartPoint.y && data.driveRouteStartName) { //开始坐标 名称
|
|
|
|
if (data.driveRouteStartPoint && data.driveRouteStartPoint.x && data.driveRouteStartPoint.y && data.driveRouteStartName) { //开始坐标 名称
|
|
|
|
this.routeStart = data.driveRouteStartName |
|
|
|
this.routeStart = data.driveRouteStartName |
|
|
@ -37,6 +40,8 @@ export class RouterGISComponent implements OnInit { |
|
|
|
this.routeEnd = data.name |
|
|
|
this.routeEnd = data.name |
|
|
|
this.endCoordinate = [data.location.x,data.location.y] |
|
|
|
this.endCoordinate = [data.location.x,data.location.y] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
resolve('success') |
|
|
|
|
|
|
|
}) //http
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|