Commit 5ca763d3 by niuxiaolin

latet

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