From fdfb6c02afe00a20e0527493b30c2648a02e87e9 Mon Sep 17 00:00:00 2001 From: Evaldas Stanelis Date: Fri, 17 Jan 2020 12:41:55 +0200 Subject: [PATCH] Fixed to let Map instamce handle default center and zoom if not defined --- src/components/map.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/map.ts b/src/components/map.ts index b496476..8aec077 100644 --- a/src/components/map.ts +++ b/src/components/map.ts @@ -440,8 +440,8 @@ export class MapComponent implements OnChanges, OnInit, OnDestroy { */ private InitMapInstance(el: HTMLElement) { this._zone.runOutsideAngular(() => { - if (this._options.center == null) { this._options.center = { latitude: this._latitude, longitude: this._longitude }; } - if (this._options.zoom == null) { this._options.zoom = this._zoom; } + if (this._options.center === null) { this._options.center = { latitude: this._latitude, longitude: this._longitude }; } + if (this._options.zoom === null) { this._options.zoom = this._zoom; } if (this._options.mapTypeId == null) { this._options.mapTypeId = MapTypeId.hybrid; } if (this._box != null) { this._options.bounds = this._box; } this._mapPromise = this._mapService.CreateMap(el, this._options);