Commit 5ca763d3 by niuxiaolin

latet

parent 31e4f790
......@@ -42,7 +42,7 @@ import { Observable } from 'rxjs';
export class DefaultService {
public basePath = 'http://localhost:8081';
//public basePath = 'http://192.168.19.200:8081';
// public basePath = 'http://192.168.19.200:8081';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();
......
......@@ -145,7 +145,7 @@ export class MainComponent implements OnInit {
this.courses = res.data;
//加载全局线路
setTimeout(() => {
this.loadPolys(res);
this.loadPolys(res,false);
}, 5000);
});
this.http.get<any>(this.s.basePath + "/scetion/list").subscribe(res => {
......@@ -172,18 +172,20 @@ export class MainComponent implements OnInit {
///map.clearOverlays();
this.http.get<any>(this.s.basePath + `/project/list/${markType.HIGHWAY}`).subscribe(res => {
this.projects = res.data;
var points = this.loadPolys(res);
this.m.animationLine(points.map(p=>({ lng: p[0], lat: p[1] })));
var points = this.loadPolys(res,true);
});
}
}
private loadPolys(res: any) {
private loadPolys(res: any,animation:boolean) {
var allPoints = [];
res.data.forEach(obj => {
this.addPoly(obj);
// var newPoints = this.corToPoint(obj.coordinate);
// this.m.animationLine(newPoints);
if(animation){
var newPoints = this.corToPoint(obj.coordinate);
this.m.animationLine(newPoints);
}
allPoints = allPoints.concat(JSON.parse(obj.coordinate));
});
return allPoints;
......@@ -236,7 +238,7 @@ export class MainComponent implements OnInit {
// });
//设置标注信息
// this.addLabel(points,obj);
this.addLabel(points,obj);
//设置动画效果
this.m.animationLine(points)
......@@ -245,7 +247,7 @@ export class MainComponent implements OnInit {
setPrj(prj: Project) {
this.http.get<any>(this.s.basePath + "/scetion/findListById/" + prj.id).subscribe(res => {
prj.secs = res.data;
this.loadPolys(res);
this.loadPolys(res,false);
});
}
setCamera(sec: Scetion) {
......
<div class="main">
<div>
<tree-ngx (nameClick)="nameChange($event)" [nodeItems]="nodeItems"> </tree-ngx>
<tree-ngx [nodeItems]="nodeItems"> </tree-ngx>
<a href="http://192.168.19.175/portal/" style=" color: white;
text-decoration: none;
margin-left: 2em;">演示demo</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment