From 6f5128dec839bb8318eef4db11b5730af825246f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 3 Apr 2017 22:57:23 +0200 Subject: [PATCH] feat(AgmMap): know when map is ready You can now listen to the new mapReady output to know when the map is initialized. Closes #740 --- src/core/directives/map.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/directives/map.ts b/src/core/directives/map.ts index 0e8182181..edf74ff5d 100644 --- a/src/core/directives/map.ts +++ b/src/core/directives/map.ts @@ -361,9 +361,9 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy { mapTypeId: this.mapTypeId, clickableIcons: this.clickableIcons, gestureHandling: this.gestureHandling - }).then(() => { - this.mapReady.emit(this._mapsWrapper.getNativeMap()); - }); + }) + .then(() => this._mapsWrapper.getNativeMap()) + .then(map => this.mapReady.emit(map)); // register event listeners this._handleMapCenterChange();