【发布时间】:2018-12-12 09:23:30
【问题描述】:
如何从以下代码中检索经纬度的地址:
doLocate() {
this.geolocation.getCurrentPosition().then((resp) => {
// resp.coords.latitude
// resp.coords.longitude
this.datas = 'Lat: ' + resp.coords.latitude + '' + ' Lon: ' + resp.coords.longitude
}).catch((error) => {
console.log('Error getting location', error);
});
}
【问题讨论】:
-
我知道了:获取位置时出错 PositionError 只允许安全来源
标签: android ionic-framework geolocation