mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
docs(): Fix GeocoderResult interface (#418)
This commit is contained in:
parent
ecbe5faef8
commit
66d1da2b55
@ -68,7 +68,7 @@ export class GoogleMap {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a map object has been created and is available.
|
* Checks if a map object has been created and is available.
|
||||||
*
|
*
|
||||||
* @return {Promise<boolean>}
|
* @return {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
@ -79,10 +79,10 @@ export class GoogleMap {
|
|||||||
constructor(elementId: string, options?: any) {
|
constructor(elementId: string, options?: any) {
|
||||||
this._objectInstance = plugin.google.maps.Map.getMap(document.getElementById(elementId), options);
|
this._objectInstance = plugin.google.maps.Map.getMap(document.getElementById(elementId), options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen to a map event.
|
* Listen to a map event.
|
||||||
*
|
*
|
||||||
* @return {Observable<any>}
|
* @return {Observable<any>}
|
||||||
*/
|
*/
|
||||||
on(event: any): Observable<any> {
|
on(event: any): Observable<any> {
|
||||||
@ -93,10 +93,10 @@ export class GoogleMap {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen to a map event only once.
|
* Listen to a map event only once.
|
||||||
*
|
*
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
one(event: any): Promise<any> {
|
one(event: any): Promise<any> {
|
||||||
@ -115,7 +115,7 @@ export class GoogleMap {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the position of the camera.
|
* Get the position of the camera.
|
||||||
*
|
*
|
||||||
* @return {Promise<CameraPosition>}
|
* @return {Promise<CameraPosition>}
|
||||||
*/
|
*/
|
||||||
@CordovaInstance()
|
@CordovaInstance()
|
||||||
@ -125,17 +125,17 @@ export class GoogleMap {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the location of the user.
|
* Get the location of the user.
|
||||||
*
|
*
|
||||||
* @return {Promise<MyLocation>}
|
* @return {Promise<MyLocation>}
|
||||||
*/
|
*/
|
||||||
@CordovaInstance()
|
@CordovaInstance()
|
||||||
getMyLocation(options?:MyLocationOptions): Promise<MyLocation> {
|
getMyLocation(options?: MyLocationOptions): Promise<MyLocation> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the visible region.
|
* Get the visible region.
|
||||||
*
|
*
|
||||||
* @return {Promise<VisibleRegion>}
|
* @return {Promise<VisibleRegion>}
|
||||||
*/
|
*/
|
||||||
@CordovaInstance()
|
@CordovaInstance()
|
||||||
@ -1038,13 +1038,24 @@ export interface GeocoderRequest {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export interface GeocoderResult {
|
export interface GeocoderResult {
|
||||||
|
adminArea?: string;
|
||||||
|
country?: string;
|
||||||
|
countryCode?: string;
|
||||||
|
extra?: {
|
||||||
|
featureName?: string;
|
||||||
|
lines?: Array<string>;
|
||||||
|
permises?: string;
|
||||||
|
phone?: string;
|
||||||
|
url?: string
|
||||||
|
},
|
||||||
|
locale?: string;
|
||||||
|
locality?: string;
|
||||||
position?: { lat: number; lng: number };
|
position?: { lat: number; lng: number };
|
||||||
|
postalCode?: string;
|
||||||
|
subAdminArea?: string;
|
||||||
|
subLocality?: string;
|
||||||
subThoroughfare?: string;
|
subThoroughfare?: string;
|
||||||
thoroughfare?: string;
|
thoroughfare?: string;
|
||||||
locality?: string;
|
|
||||||
adminArea?: string;
|
|
||||||
postalCode?: string;
|
|
||||||
country?: string;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@ -1057,8 +1068,11 @@ export class Geocoder {
|
|||||||
*/
|
*/
|
||||||
static geocode(request: GeocoderRequest): Promise<GeocoderResult[]> {
|
static geocode(request: GeocoderRequest): Promise<GeocoderResult[]> {
|
||||||
return new Promise<GeocoderResult[]>((resolve, reject) => {
|
return new Promise<GeocoderResult[]>((resolve, reject) => {
|
||||||
if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) reject({ error: 'plugin_not_installed' });
|
if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) {
|
||||||
else plugin.google.maps.Geocoder.geocode(request, resolve);
|
reject({ error: 'plugin_not_installed' });
|
||||||
|
} else {
|
||||||
|
plugin.google.maps.Geocoder.geocode(request, resolve);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user