diff --git a/src/app/statistic-analysis/home/home.component.ts b/src/app/statistic-analysis/home/home.component.ts index f7748a0..40d74b9 100644 --- a/src/app/statistic-analysis/home/home.component.ts +++ b/src/app/statistic-analysis/home/home.component.ts @@ -14,7 +14,6 @@ export class HomeComponent implements OnInit { constructor(private http:HttpClient, private render2: Renderer2,public element: ElementRef,private router: Router,public emitService: EchartsDataService) { } - map:any; //地图 ngOnInit() { this.emitService.eventEmit.subscribe((value: any) => { @@ -24,25 +23,18 @@ export class HomeComponent implements OnInit { }, 500); } }); + window.addEventListener('resize', () => { + setTimeout(() => { + this.updateEcharts() + }, 0); + }) + window.setTimeout(()=>{ this.unitType() this.unitData() this.keyUnit() this.mapInit() //初始化地图 - let that = this },0) - window.addEventListener('resize', () => { - setTimeout(() => { - this.updateEcharts() - }, 500); - }) - window.addEventListener('keydown', (e) => { - if(e.keyCode == 122){ - setTimeout(() => { - this.updateEcharts() - }, 500); - } - }) } //更新echarts视图 @@ -57,7 +49,7 @@ export class HomeComponent implements OnInit { this.unitType() this.unitData() this.keyUnit() - // this.mapInit() //初始化地图 + } threePlan(){