| | |
| | | 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'; |
| | |
| | | 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; |
| | |
| | | _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; |
| | |
| | | width: -15 |
| | | } |
| | | }; |
| | | } |
| | | } |
| | | private _marker: any = null; |
| | | loadMarker(marker) { |
| | | if (this._marker == null) { |
| | |
| | | this._map.addEventListener( |
| | | 'tilesloaded', |
| | | (type, fn) => { |
| | | this._map.clearOverlays(); |
| | | // this._map.clearOverlays(); |
| | | this._map.addOverlay(this._marker); |
| | | } |
| | | ); |