【发布时间】:2017-12-23 06:22:41
【问题描述】:
我想根据从 getLocation 获得的值显示位置,但如果我分配例如,我得到的只是蓝屏 this.lat=25.7777, this.lng=26,777;但如果 a 确实喜欢 this.lat=this.LAT; 则不会这个.lng=这个.LNG;它工作正常最后一件事我想提一下,数据库中的数据类型是双重的,我也尝试过测试文本
lat:number;
lng:number;
LAT:any;
LNG:any;
constructor(public dataservice:DataService,private geolocation: Geolocation) {
this.dataservice.getLocation(ID)
.subscribe(data =>{this.LAT = data[0].lat,
this.LNG=data[0].lng
this.lat=this.LAT;
this.lng=this.LNG;
});
.html
<agm-map [latitude]="lat"[longitude]="lng" [zoom]="10"
[zoomControl]="true">
<agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map>
【问题讨论】:
标签: angularjs google-maps ionic-framework