Модуль "" "не имеет экспортированного члена" NativeGeocoderReverseResult "в ионной геолокации 3 - PullRequest
3 голосов
/ 12 апреля 2019

Модуль "" "" не имеет экспортированного члена "NativeGeocoderReverseResult". L13: импорт {Geolocation} из '@ ionic-native / geolocation / ngx'; L14: импорт {NativeGeocoder, NativeGeocoderOptions, NativeGeocoderReverseResult} Ошибка в консоли

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 Ответ

1 голос
/ 13 мая 2019

У меня была такая же проблема при использовании кода из ионных документов: https://ionicframework.com/docs/native/native-geocoder

Затем я обнаружил, что NativeGeocoderReverseResult заменен на NativeGeocoderResult : https://github.com/sebastianbaar/cordova-plugin-nativegeocoder/releases

v3.2.0
...
** НАРУШЕНИЕ ИЗМЕНЕНИЙ **
заменить NativeGeocoderForwardResult на NativeGeocoderResult
заменить NativeGeocoderReverseResult на NativeGeocoderResult

...