mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-24 20:00:16 +08:00
fix(native-geocoder): update NativeGeocoderReverse result (#1840)
* feat(nativegeocoder): add NativeGeocoder plugin * add district * update NativeGeocoderReverseResult & refactor code * delete plugins * delete index.ts
This commit is contained in:
parent
fe02c84fd9
commit
7c1b409542
@ -15,7 +15,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818)
|
* 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));
|
* .catch((error: any) => console.log(error));
|
||||||
*
|
*
|
||||||
* this.nativeGeocoder.forwardGeocode('Berlin')
|
* this.nativeGeocoder.forwardGeocode('Berlin')
|
||||||
@ -40,7 +40,7 @@ export class NativeGeocoder extends IonicNativePlugin {
|
|||||||
* Reverse geocode a given latitude and longitude to find location address
|
* Reverse geocode a given latitude and longitude to find location address
|
||||||
* @param latitude {number} The latitude
|
* @param latitude {number} The latitude
|
||||||
* @param longitude {number} The longitude
|
* @param longitude {number} The longitude
|
||||||
* @return {Promise<any>}
|
* @return {Promise<NativeGeocoderReverseResult>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
callbackOrder: 'reverse'
|
callbackOrder: 'reverse'
|
||||||
@ -50,48 +50,59 @@ export class NativeGeocoder extends IonicNativePlugin {
|
|||||||
/**
|
/**
|
||||||
* Forward geocode a given address to find coordinates
|
* Forward geocode a given address to find coordinates
|
||||||
* @param addressString {string} The address to be geocoded
|
* @param addressString {string} The address to be geocoded
|
||||||
* @return {Promise<any>}
|
* @return {Promise<NativeGeocoderForwardResult>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
callbackOrder: 'reverse'
|
callbackOrder: 'reverse'
|
||||||
})
|
})
|
||||||
forwardGeocode(addressString: string): Promise<NativeGeocoderForwardResult> { return; }
|
forwardGeocode(addressString: string): Promise<NativeGeocoderForwardResult> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encapsulates format information about a reverse geocoding result.
|
* 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 {
|
export interface NativeGeocoderReverseResult {
|
||||||
/**
|
/**
|
||||||
* The street.
|
* The country code.
|
||||||
*/
|
*/
|
||||||
street: string;
|
countryCode: string;
|
||||||
/**
|
|
||||||
* The house number.
|
|
||||||
*/
|
|
||||||
houseNumber: string;
|
|
||||||
/**
|
|
||||||
* The postal code.
|
|
||||||
*/
|
|
||||||
postalCode: string;
|
|
||||||
/**
|
|
||||||
* The city.
|
|
||||||
*/
|
|
||||||
city: string;
|
|
||||||
/**
|
|
||||||
* The district.
|
|
||||||
*/
|
|
||||||
district: string;
|
|
||||||
/**
|
/**
|
||||||
* The country name.
|
* The country name.
|
||||||
*/
|
*/
|
||||||
countryName: string;
|
countryName: string;
|
||||||
/**
|
/**
|
||||||
* The country code.
|
* The postal code.
|
||||||
*/
|
*/
|
||||||
countryCode: string;
|
postalCode: string;
|
||||||
|
/**
|
||||||
|
* The administrativeArea.
|
||||||
|
*/
|
||||||
|
administrativeArea: string;
|
||||||
|
/**
|
||||||
|
* The subAdministrativeArea.
|
||||||
|
*/
|
||||||
|
subAdministrativeArea: string;
|
||||||
|
/**
|
||||||
|
* The locality.
|
||||||
|
*/
|
||||||
|
locality: string;
|
||||||
|
/**
|
||||||
|
* The subLocality.
|
||||||
|
*/
|
||||||
|
subLocality: string;
|
||||||
|
/**
|
||||||
|
* The thoroughfare.
|
||||||
|
*/
|
||||||
|
thoroughfare: string;
|
||||||
|
/**
|
||||||
|
* The subThoroughfare.
|
||||||
|
*/
|
||||||
|
subThoroughfare: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encapsulates format information about a forward geocoding result.
|
* Encapsulates format information about a forward geocoding result.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user