Issue description
Upgrading from 1.0.0-beta.3 to 1.0.0-beta.5 causes the following error in Chrome:
ERROR Error: Uncaught (in promise): InvalidValueError: not a LatLngBounds or LatLngBoundsLiteral: not an Object Error
This only happens on maps that I am using the following function on. Any other maps with a single marker do not cause the error.
this.mapsAPILoader.load().then(() => {
this.latlngBounds = new window['google'].maps.LatLngBounds();
for (const point of this.points) {
this.latlngBounds.extend(new window['google'].maps.LatLng(point['lat'], point['lng']));
}
});
After diving into it a little more, it is the [fitBounds] input on the agm-map tag that is causing the error. Has the format of how we are supposed to pass the data object into [fitBounds] changed?
<agm-map [latitude]=""
[longitude]=""
[zoom]=""
[fitBounds]="latlngBounds"> <!-- passing it into fitBounds is what is causing the error -->
Steps to reproduce and a minimal demo of the problem
Here is a stackblitz, that shows the error. Changing the agm/core dependency to beta.3 will fix the error.
https://stackblitz.com/edit/angular-google-maps-demo-fjugvd?file=app%2Fapp.module.ts
_What steps should we try in your demo to see the problem?_
Current behavior
Error being thrown when upgrading when previous version did not throw the error. Or an explanation of a proper way to upgrade.
Expected/desired behavior
No errors should be caused by the upgrade.
angular2 & angular-google-maps version
1.0.0-beta.3 works
1.0.0-beta.4 errors
1.0.0-beta.5 errors
Other information

Getting the same issue here. I'm giving the bounds a value on ngAfterViewInit.
try this it worked for me:
with setting the initial value to false worked for me.
this.latlngBounds : any = false;
@chakstud that solves the error message. I think there is still something underlying that is wrong but seeing as this has had no activity for the last 3 months and this technically solves my issue , I will close it.
@chakstud thanks for your solution.
Most helpful comment
with setting the initial value to false worked for me.
this.latlngBounds : any = false;