From 66d1da2b55586af910af1922be03ffffd0ec536a Mon Sep 17 00:00:00 2001 From: Guillermo Date: Thu, 11 Aug 2016 14:52:30 +0200 Subject: [PATCH] docs(): Fix GeocoderResult interface (#418) --- src/plugins/googlemaps.ts | 46 +++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/src/plugins/googlemaps.ts b/src/plugins/googlemaps.ts index 97f48c7a..4b4f1530 100644 --- a/src/plugins/googlemaps.ts +++ b/src/plugins/googlemaps.ts @@ -68,7 +68,7 @@ export class GoogleMap { /** * Checks if a map object has been created and is available. - * + * * @return {Promise} */ @Cordova() @@ -79,10 +79,10 @@ export class GoogleMap { constructor(elementId: string, options?: any) { this._objectInstance = plugin.google.maps.Map.getMap(document.getElementById(elementId), options); } - + /** * Listen to a map event. - * + * * @return {Observable} */ on(event: any): Observable { @@ -93,10 +93,10 @@ export class GoogleMap { } ); } - - /** + + /** * Listen to a map event only once. - * + * * @return {Promise} */ one(event: any): Promise { @@ -115,7 +115,7 @@ export class GoogleMap { /** * Get the position of the camera. - * + * * @return {Promise} */ @CordovaInstance() @@ -125,17 +125,17 @@ export class GoogleMap { /** * Get the location of the user. - * + * * @return {Promise} */ @CordovaInstance() - getMyLocation(options?:MyLocationOptions): Promise { + getMyLocation(options?: MyLocationOptions): Promise { return; } /** * Get the visible region. - * + * * @return {Promise} */ @CordovaInstance() @@ -1038,13 +1038,24 @@ export interface GeocoderRequest { * @private */ export interface GeocoderResult { + adminArea?: string; + country?: string; + countryCode?: string; + extra?: { + featureName?: string; + lines?: Array; + permises?: string; + phone?: string; + url?: string + }, + locale?: string; + locality?: string; position?: { lat: number; lng: number }; + postalCode?: string; + subAdminArea?: string; + subLocality?: string; subThoroughfare?: string; thoroughfare?: string; - locality?: string; - adminArea?: string; - postalCode?: string; - country?: string; } /** * @private @@ -1057,8 +1068,11 @@ export class Geocoder { */ static geocode(request: GeocoderRequest): Promise { return new Promise((resolve, reject) => { - if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) reject({ error: 'plugin_not_installed' }); - else plugin.google.maps.Geocoder.geocode(request, resolve); + if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) { + reject({ error: 'plugin_not_installed' }); + } else { + plugin.google.maps.Geocoder.geocode(request, resolve); + } }); } }