diff --git a/packages/core/directives/map.ts b/packages/core/directives/map.ts index ac1454abf..9b805f8d3 100644 --- a/packages/core/directives/map.ts +++ b/packages/core/directives/map.ts @@ -475,14 +475,11 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy { } protected _updateBounds(bounds: LatLngBounds|LatLngBoundsLiteral) { - if (this._isLatLngBoundsLiteral(bounds)) { + if (this._isLatLngBoundsLiteral(bounds) && google && google.maps) { const newBounds = google.maps.LatLngBounds(); newBounds.union(bounds); bounds = newBounds; } - if (bounds.isEmpty()) { - return; - } if (this.usePanning) { this._mapsWrapper.panToBounds(bounds); return; @@ -491,7 +488,7 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy { } private _isLatLngBoundsLiteral(bounds: LatLngBounds|LatLngBoundsLiteral): bounds is LatLngBoundsLiteral { - return (bounds).extend === undefined; + return bounds != null && (bounds).extend === undefined; } private _handleMapCenterChange() {