模块“””在 ionic 3 Geolocation 中没有导出成员“NativeGeocoderReverseResult”

2024-05-18

模块“””没有导出成员“NativeGeocoderReverseResult”。 L13: 从 '@ionic-native/geolocation/ngx' 导入 { Geolocation }; L14: 导入 { NativeGeocoder, NativeGeocoderOptions,NativeGeocoderReverseResult} 控制台出错 https://i.stack.imgur.com/mFkfe.png

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);
        })
    }

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

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

v3.2.0
...
** 重大变更 **
将 NativeGeocoderForwardResult 替换为 NativeGeocoderResult
将 NativeGeocoderReverseResult 替换为 NativeGeocoderResult

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

模块“””在 ionic 3 Geolocation 中没有导出成员“NativeGeocoderReverseResult” 的相关文章

随机推荐