Open naixin-coder opened 5 years ago
`
@ionic/app-scripts : 3.2.0 Cordova Platforms : android 6.4.0 ios 4.5.5 Ionic Framework : ionic-angular 3.9.2
return new Promise((resolve) => { console.log('进入定位') baidumap_location.getCurrentPosition(result => { console.log(result); this.address = result; resolve(result); // const { latitude, longitude } = result this.common.setStorage('result', result) // this.common.setStorage('longitude', longitude) }, async (error: any) => { const result = await this.common.getStorage('result') this.address = result; // const longitude = await this.common.getStorage('longitude') resolve(result); console.log(11111111, error); // this.common.showToast('定位失败'); }) }) }
`
ionic 环境如下
代码如下
方法如下 baiduLocation() {
`