From 7ca521e4267b987270f6ccbb9a6c076aeb467d96 Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Wed, 04 Jul 2018 17:11:33 +0800 Subject: [PATCH] 设备,监控站 管理功能增强 --- src/app/routes/map/coordinates-picker/coordinates-picker.component.ts | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/routes/map/coordinates-picker/coordinates-picker.component.ts b/src/app/routes/map/coordinates-picker/coordinates-picker.component.ts index 470d625..726a069 100644 --- a/src/app/routes/map/coordinates-picker/coordinates-picker.component.ts +++ b/src/app/routes/map/coordinates-picker/coordinates-picker.component.ts @@ -1,6 +1,6 @@ import { NzModalSubject } from 'ng-zorro-antd'; import { ReactiveFormsModule } from '@angular/forms'; -import { ViewEncapsulation, Component, ViewChild, ElementRef, NgZone } from '@angular/core'; +import { ViewEncapsulation, Component, ViewChild, ElementRef, NgZone, OnInit } from '@angular/core'; import { MapOptions, Point, MarkerOptions, ControlAnchor, NavigationControlOptions, NavigationControlType, BMapInstance } from 'angular2-baidu-map'; import { CoorPicker } from '@business/entity/data'; import { CoorPickerService } from 'app/routes/map/coordinates-picker/coordinates-picker.service'; @@ -13,7 +13,7 @@ templateUrl: './coordinates-picker.component.html', styleUrls: [ './coordinates-picker.component.css' ], }) -export class CoordinatesPickerComponent { +export class CoordinatesPickerComponent implements OnInit { Default_LNG = 121; Default_LAT = 31.4; isSaving = false; @@ -30,6 +30,9 @@ _BMap: any = null; constructor(private subject: NzModalSubject, private coorPickerService: CoorPickerService) { + + } + ngOnInit(): void { this.data = this.coorPickerService.data; let lng = this.data.longitude; lng = lng === 0 || lng == null ? this.Default_LNG : lng; @@ -69,7 +72,7 @@ width: -15 } }; - } + } private _marker: any = null; loadMarker(marker) { if (this._marker == null) { @@ -84,7 +87,7 @@ this._map.addEventListener( 'tilesloaded', (type, fn) => { - this._map.clearOverlays(); + // this._map.clearOverlays(); this._map.addOverlay(this._marker); } ); -- Gitblit v1.8.0