ediot
This commit is contained in:
@ -3,6 +3,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
|
|||||||
import { amapConf } from '@conf/amap.config';
|
import { amapConf } from '@conf/amap.config';
|
||||||
import { NzModalRef } from 'ng-zorro-antd/modal';
|
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||||
import { throwError } from 'rxjs';
|
import { throwError } from 'rxjs';
|
||||||
|
import { AmapService } from '../amap.service';
|
||||||
declare var AMap: any;
|
declare var AMap: any;
|
||||||
declare var AMapUI: any;
|
declare var AMapUI: any;
|
||||||
declare var Loca: any;
|
declare var Loca: any;
|
||||||
@ -26,7 +27,7 @@ export class AmapPoiPickerComponent implements OnInit {
|
|||||||
infoWindow: any;
|
infoWindow: any;
|
||||||
geocoder: any;
|
geocoder: any;
|
||||||
|
|
||||||
constructor(private modalRef: NzModalRef) {}
|
constructor(private modalRef: NzModalRef, private service: AmapService) {}
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.mapInit();
|
this.mapInit();
|
||||||
// this.PoiPicker();
|
// this.PoiPicker();
|
||||||
@ -112,6 +113,12 @@ export class AmapPoiPickerComponent implements OnInit {
|
|||||||
radius: 1000 //范围,默认:500
|
radius: 1000 //范围,默认:500
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.service.getCurrentPosition().subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.selectedPOI(res.position);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//选取了某个POI
|
//选取了某个POI
|
||||||
poiPicker.on('poiPicked', (poiResult: any) => {
|
poiPicker.on('poiPicked', (poiResult: any) => {
|
||||||
const source = poiResult.source,
|
const source = poiResult.source,
|
||||||
|
|||||||
Reference in New Issue
Block a user