From de14b0ea150572d1ade768bfb3c99a0ec1071bee Mon Sep 17 00:00:00 2001 From: Ibby Hadeed Date: Sun, 17 Jul 2016 02:49:44 -0400 Subject: [PATCH] fix(googlemaps): able to pass array of LatLng to GoogleMapsLatLngBounds constructor closes #298 --- src/plugins/googlemaps.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/googlemaps.ts b/src/plugins/googlemaps.ts index fbbb92ac..5f80a699 100644 --- a/src/plugins/googlemaps.ts +++ b/src/plugins/googlemaps.ts @@ -951,8 +951,9 @@ export class GoogleMapsKmlOverlay { export class GoogleMapsLatLngBounds { private _objectInstance: any; - constructor(public southwest: GoogleMapsLatLng, public northeast: GoogleMapsLatLng) { - this._objectInstance = new plugin.google.maps.LatLngBounds([southwest, northeast]); + constructor(public southwestOrArrayOfLatLng: GoogleMapsLatLng|GoogleMapsLatLng[], public northeast?: GoogleMapsLatLng) { + let args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng; + this._objectInstance = new plugin.google.maps.LatLngBounds(args); } @CordovaInstance({ sync: true })