Ionic Native geocoder reverseGeocode result all undifined

this is my code but all result feild undifined
let options = {
enableHighAccuracy : true
};

this.geolocation.getCurrentPosition(options).then((resp) => {
  this.nativeGeocoder.reverseGeocode(resp.coords.latitude, resp.coords.longitude)
    .then((result: NativeGeocoderReverseResult) =>{
      this.address = result.countryCode+", "+
        result.countryName+", "+
        result.administrativeArea+", "+
        result.subAdministrativeArea+", "+
        result.locality+", "+
        result.subLocality+", "+
        result.thoroughfare+", "+
        result.subThoroughfare+", "+
        result.postalCode;
    })
    .catch((error: any) => {
      this.address = "Vajira Road"
    });
}).catch((error) => {
  console.log('Error getting location', error);
});
1 Like