gpt4 book ai didi

angular - 模块 '" "' 在 ionic 3 Geolocation 中没有导出成员 'NativeGeocoderReverseResult'

转载 作者:太空狗 更新时间:2023-10-29 18:27:51 29 4
gpt4 key购买 nike

模块“””没有导出成员“NativeGeocoderReverseResult”。 L13:从'@ionic-native/geolocation/ngx'导入{Geolocation}; L14: 导入 { NativeGeocoder, NativeGeocoderOptions,NativeGeocoderReverseResult} Error In Console

getUserLocation(){
let options: NativeGeocoderOptions = {
useLocale: true,
maxResults: 5
};
this.geolocation.getCurrentPosition().then(resp => {
this.nativeGeocoder.reverseGeocode(resp.coords.latitude, resp.coords.longitude, options)
.then((result: NativeGeocoderReverseResult[]) => {
this.userlocation = result[0].toString();
}, error => {
console.log(error)
});
}, error => {
console.log('Error getting location', error);
})
}

最佳答案

我在使用 ionic 文档中的代码时遇到了同样的问题:https://ionicframework.com/docs/native/native-geocoder

然后我发现NativeGeocoderReverseResult替换为NativeGeocoderResult:https://github.com/sebastianbaar/cordova-plugin-nativegeocoder/releases

v3.2.0
...
** BREAKING CHANGES **
replace NativeGeocoderForwardResult with NativeGeocoderResult
replace NativeGeocoderReverseResult with NativeGeocoderResult

关于angular - 模块 '" "' 在 ionic 3 Geolocation 中没有导出成员 'NativeGeocoderReverseResult',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55652890/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com