mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
feat(nativegeocoder): update plugin to v3.2.0 (#2958)
* feat(nativegeocoder): update plugin to v3.2.0 * update imports
This commit is contained in:
commit
bd4b2e2bb4
@ -8,7 +8,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
|||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult, NativeGeocoderOptions } from '@ionic-native/native-geocoder/ngx';
|
* import { NativeGeocoder, NativeGeocoderResult, NativeGeocoderOptions } from '@ionic-native/native-geocoder/ngx';
|
||||||
*
|
*
|
||||||
* constructor(private nativeGeocoder: NativeGeocoder) { }
|
* constructor(private nativeGeocoder: NativeGeocoder) { }
|
||||||
*
|
*
|
||||||
@ -18,18 +18,17 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
|||||||
* useLocale: true,
|
* useLocale: true,
|
||||||
* maxResults: 5
|
* maxResults: 5
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818, options)
|
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818, options)
|
||||||
* .then((result: NativeGeocoderReverseResult[]) => console.log(JSON.stringify(result[0])))
|
* .then((result: NativeGeocoderResult[]) => console.log(JSON.stringify(result[0])))
|
||||||
* .catch((error: any) => console.log(error));
|
* .catch((error: any) => console.log(error));
|
||||||
*
|
*
|
||||||
* this.nativeGeocoder.forwardGeocode('Berlin', options)
|
* this.nativeGeocoder.forwardGeocode('Berlin', options)
|
||||||
* .then((coordinates: NativeGeocoderForwardResult[]) => console.log('The coordinates are latitude=' + coordinates[0].latitude + ' and longitude=' + coordinates[0].longitude))
|
* .then((result: NativeGeocoderResult[]) => console.log('The coordinates are latitude=' + result[0].latitude + ' and longitude=' + result[0].longitude))
|
||||||
* .catch((error: any) => console.log(error));
|
* .catch((error: any) => console.log(error));
|
||||||
* ```
|
* ```
|
||||||
* @interfaces
|
* @interfaces
|
||||||
* NativeGeocoderReverseResult
|
* NativeGeocoderResult
|
||||||
* NativeGeocoderForwardResult
|
|
||||||
* NativeGeocoderOptions
|
* NativeGeocoderOptions
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
@ -47,32 +46,40 @@ export class NativeGeocoder extends IonicNativePlugin {
|
|||||||
* @param latitude {number} The latitude
|
* @param latitude {number} The latitude
|
||||||
* @param longitude {number} The longitude
|
* @param longitude {number} The longitude
|
||||||
* @param options {NativeGeocoderOptions} The options
|
* @param options {NativeGeocoderOptions} The options
|
||||||
* @return {Promise<NativeGeocoderReverseResult[]>}
|
* @return {Promise<NativeGeocoderResult[]>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
callbackOrder: 'reverse'
|
callbackOrder: 'reverse'
|
||||||
})
|
})
|
||||||
reverseGeocode(latitude: number, longitude: number, options?: NativeGeocoderOptions): Promise<NativeGeocoderReverseResult[]> { return; }
|
reverseGeocode(latitude: number, longitude: number, options?: NativeGeocoderOptions): Promise<NativeGeocoderResult[]> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
* @param options {NativeGeocoderOptions} The options
|
* @param options {NativeGeocoderOptions} The options
|
||||||
* @return {Promise<NativeGeocoderForwardResult[]>}
|
* @return {Promise<NativeGeocoderResult[]>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
callbackOrder: 'reverse'
|
callbackOrder: 'reverse'
|
||||||
})
|
})
|
||||||
forwardGeocode(addressString: string, options?: NativeGeocoderOptions): Promise<NativeGeocoderForwardResult[]> { return; }
|
forwardGeocode(addressString: string, options?: NativeGeocoderOptions): Promise<NativeGeocoderResult[]> { return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encapsulates format information about a reverse geocoding result.
|
* Encapsulates format information about a geocoding result.
|
||||||
* more Info:
|
* more Info:
|
||||||
* - https://developer.apple.com/documentation/corelocation/clplacemark
|
* - https://developer.apple.com/documentation/corelocation/clplacemark
|
||||||
* - https://developer.android.com/reference/android/location/Address.html
|
* - https://developer.android.com/reference/android/location/Address.html
|
||||||
*/
|
*/
|
||||||
export interface NativeGeocoderReverseResult {
|
export interface NativeGeocoderResult {
|
||||||
|
/**
|
||||||
|
* The latitude.
|
||||||
|
*/
|
||||||
|
latitude: string;
|
||||||
|
/**
|
||||||
|
* The longitude.
|
||||||
|
*/
|
||||||
|
longitude: string;
|
||||||
/**
|
/**
|
||||||
* The country code.
|
* The country code.
|
||||||
*/
|
*/
|
||||||
@ -109,20 +116,10 @@ export interface NativeGeocoderReverseResult {
|
|||||||
* The subThoroughfare.
|
* The subThoroughfare.
|
||||||
*/
|
*/
|
||||||
subThoroughfare: string;
|
subThoroughfare: string;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Encapsulates format information about a forward geocoding result.
|
|
||||||
*/
|
|
||||||
export interface NativeGeocoderForwardResult {
|
|
||||||
/**
|
/**
|
||||||
* The latitude.
|
* The areasOfInterest
|
||||||
*/
|
*/
|
||||||
latitude: string;
|
areasOfInterest: string[];
|
||||||
/**
|
|
||||||
* The longitude.
|
|
||||||
*/
|
|
||||||
longitude: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user