模块“" "'在ionic 3 Geolocation中没有导出的成员"NativeGeocoderReverseResult" [英] Module '" "' has no exported member 'NativeGeocoderReverseResult' in ionic 3 Geolocation

查看:60
本文介绍了模块“" "'在ionic 3 Geolocation中没有导出的成员"NativeGeocoderReverseResult"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

模块'"'没有导出的成员'NativeGeocoderReverseResult'. L13:从"@ ionic-native/geolocation/ngx"导入{Geolocation}; L14:导入{NativeGeocoder,NativeGeocoderOptions,NativeGeocoderReverseResult} 控制台错误

Module '" "' has no exported member 'NativeGeocoderReverseResult'. L13: import { Geolocation } from '@ionic-native/geolocation/ngx'; L14: import { 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 docs中的代码时,我遇到了相同的问题:

I had the same issue when use the code from ionic docs: https://ionicframework.com/docs/native/native-geocoder

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

v3.2.0
...
**突破性变化**
用NativeGeocoderResult替换NativeGeocoderForwardResult
用NativeGeocoderResult替换NativeGeocoderReverseResult

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

这篇关于模块“" "'在ionic 3 Geolocation中没有导出的成员"NativeGeocoderReverseResult"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆