【问题标题】:Module '" "' has no exported member 'NativeGeocoderReverseResult' in ionic 3 Geolocation模块 '" "' 在 ionic 3 Geolocation 中没有导出成员 'NativeGeocoderReverseResult'
【发布时间】:2019-09-03 07:02:27
【问题描述】:

模块 '" "' 没有导出的成员 'NativeGeocoderReverseResult'。 L13:从'@ionic-native/geolocation/ngx'导入{地理位置}; 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);
        })
    }

【问题讨论】:

    标签: angular ionic-framework geolocation ionic3


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2023-02-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-09
      • 2017-05-20
      • 2017-05-07
      • 2017-08-18
      • 1970-01-01
      相关资源
      最近更新 更多