diff --git a/src/@ionic-native/plugins/native-geocoder/index.ts b/src/@ionic-native/plugins/native-geocoder/index.ts index 27408d6bb5..176be80279 100644 --- a/src/@ionic-native/plugins/native-geocoder/index.ts +++ b/src/@ionic-native/plugins/native-geocoder/index.ts @@ -15,7 +15,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; * ... * * this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818) - * .then((result: NativeGeocoderReverseResult) => console.log('The address is ' + result.street + ' in ' + result.countryCode)) + * .then((result: NativeGeocoderReverseResult) => console.log(JSON.stringify(result))) * .catch((error: any) => console.log(error)); * * this.nativeGeocoder.forwardGeocode('Berlin') @@ -40,7 +40,7 @@ export class NativeGeocoder extends IonicNativePlugin { * Reverse geocode a given latitude and longitude to find location address * @param latitude {number} The latitude * @param longitude {number} The longitude - * @return {Promise} + * @return {Promise} */ @Cordova({ callbackOrder: 'reverse' @@ -50,48 +50,59 @@ export class NativeGeocoder extends IonicNativePlugin { /** * Forward geocode a given address to find coordinates * @param addressString {string} The address to be geocoded - * @return {Promise} + * @return {Promise} */ @Cordova({ callbackOrder: 'reverse' }) forwardGeocode(addressString: string): Promise { return; } - } /** * Encapsulates format information about a reverse geocoding result. + * more Info: + * - https://developer.apple.com/documentation/corelocation/clplacemark + * - https://developer.android.com/reference/android/location/Address.html */ export interface NativeGeocoderReverseResult { /** - * The street. + * The country code. */ - street: string; + countryCode: string; /** - * The house number. + * The country name. */ - houseNumber: string; + countryName: string; /** * The postal code. */ postalCode: string; /** - * The city. + * The administrativeArea. */ - city: string; + administrativeArea: string; /** - * The district. + * The subAdministrativeArea. */ - district: string; + subAdministrativeArea: string; /** - * The country name. + * The locality. */ - countryName: string; + locality: string; /** - * The country code. + * The subLocality. */ - countryCode: string; + subLocality: string; + /** + * The thoroughfare. + */ + thoroughfare: string; + /** + * The subThoroughfare. + */ + subThoroughfare: string; } + /** * Encapsulates format information about a forward geocoding result. */