From 049903222af8903ab13abc4089dab0c32786add6 Mon Sep 17 00:00:00 2001 From: Thiery Laverdure Date: Thu, 4 Aug 2016 08:31:51 -0400 Subject: [PATCH 1/3] Updates to google maps docs. I would do more, but I'll see what kind of feedback I get first from these changes. --- src/plugins/googlemaps.ts | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/plugins/googlemaps.ts b/src/plugins/googlemaps.ts index 231a91449..96dff4bda 100644 --- a/src/plugins/googlemaps.ts +++ b/src/plugins/googlemaps.ts @@ -51,7 +51,9 @@ export const GoogleMapsAnimation = { * ... * * // somewhere in your component - * let map = new GoogleMap('elementID'); + * let map = new GoogleMap('elementID', { + * // Map Options: https://developers.google.com/maps/documentation/javascript/3.exp/reference#MapOptions + }); * * map.on(GoogleMapsEvent.MAP_READY).subscribe(() => console.log('Map is ready!')); * ``` @@ -65,8 +67,9 @@ export class GoogleMap { _objectInstance: any; /** - * Checks if a map object has been created. - * @return {Promise} returns a promise that resolves with a boolean that indicates if the plugin is available. + * Checks if a map object has been created and is available. + * + * @return {Promise} */ @Cordova() static isAvailable(): Promise { @@ -76,7 +79,12 @@ 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 { return new Observable( (observer) => { @@ -85,14 +93,18 @@ export class GoogleMap { } ); } - + + /** + * Listen to a map event only once. + * + * @return{ Promise} + */ one(event: any): Promise { return new Promise( resolve => this._objectInstance.one(event, resolve) ); } - @CordovaInstance({ sync: true }) setDebuggable(isDebuggable: boolean): void { } @@ -102,7 +114,9 @@ export class GoogleMap { } /** - * Get the position of the camera + * Get the position of the camera. + * + * @return {Promise} */ @CordovaInstance() getCameraPosition(): Promise { @@ -110,7 +124,9 @@ export class GoogleMap { } /** - * Get the location of the user + * Get the location of the user. + * + * @return {Promise} */ @CordovaInstance() getMyLocation(): Promise { @@ -118,7 +134,9 @@ export class GoogleMap { } /** - * Get the visible region + * Get the visible region. + * + * @return {Promise} */ @CordovaInstance() getVisibleRegion(): Promise { From 484f9a0076b29801dd536d31996c1a41d18683df Mon Sep 17 00:00:00 2001 From: Thiery Laverdure Date: Thu, 4 Aug 2016 08:36:59 -0400 Subject: [PATCH 2/3] Extra space. --- src/plugins/googlemaps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/googlemaps.ts b/src/plugins/googlemaps.ts index 96dff4bda..7a95e7266 100644 --- a/src/plugins/googlemaps.ts +++ b/src/plugins/googlemaps.ts @@ -97,7 +97,7 @@ export class GoogleMap { /** * Listen to a map event only once. * - * @return{ Promise} + * @return{Promise} */ one(event: any): Promise { return new Promise( From 8242c88cbbe11281c420e61aa09c301eb69b6b37 Mon Sep 17 00:00:00 2001 From: Thiery Laverdure Date: Thu, 4 Aug 2016 08:37:45 -0400 Subject: [PATCH 3/3] Update googlemaps.ts --- src/plugins/googlemaps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/googlemaps.ts b/src/plugins/googlemaps.ts index 7a95e7266..c4e5131e1 100644 --- a/src/plugins/googlemaps.ts +++ b/src/plugins/googlemaps.ts @@ -97,7 +97,7 @@ export class GoogleMap { /** * Listen to a map event only once. * - * @return{Promise} + * @return {Promise} */ one(event: any): Promise { return new Promise(