Module '“ ”' has no exported member 'N

2019-07-13 10:29发布

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

1条回答
我只想做你的唯一
2楼-- · 2019-07-13 11:10

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

Then I found out that NativeGeocoderReverseResult replaced with NativeGeocoderResult: https://github.com/sebastianbaar/cordova-plugin-nativegeocoder/releases

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

查看更多
登录 后发表回答