@@ -52,7 +52,7 @@ import {DataLayerManager} from './../services/managers/data-layer-manager';
5252 'scaleControl' , 'scaleControlOptions' , 'mapTypeId' , 'clickableIcons' , 'gestureHandling'
5353 ] ,
5454 outputs : [
55- 'mapClick' , 'mapRightClick' , 'mapDblClick' , 'centerChange' , 'idle' , 'boundsChange' , 'zoomChange'
55+ 'mapClick' , 'mapRightClick' , 'mapDblClick' , 'centerChange' , 'idle' , 'boundsChange' , 'zoomChange' , 'mapReady'
5656 ] ,
5757 host : {
5858 // todo: deprecated - we will remove it with the next version
@@ -314,6 +314,12 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
314314 */
315315 zoomChange : EventEmitter < number > = new EventEmitter < number > ( ) ;
316316
317+ /**
318+ * This event is fired when the google map is fully initialized.
319+ * You get the google.maps.Map instance as a result of this EventEmitter.
320+ */
321+ mapReady : EventEmitter < any > = new EventEmitter < any > ( ) ;
322+
317323 constructor ( private _elem : ElementRef , private _mapsWrapper : GoogleMapsAPIWrapper ) { }
318324
319325 /** @internal */
@@ -355,7 +361,9 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
355361 mapTypeId : this . mapTypeId ,
356362 clickableIcons : this . clickableIcons ,
357363 gestureHandling : this . gestureHandling
358- } ) ;
364+ } )
365+ . then ( ( ) => this . _mapsWrapper . getNativeMap ( ) )
366+ . then ( map => this . mapReady . emit ( map ) ) ;
359367
360368 // register event listeners
361369 this . _handleMapCenterChange ( ) ;
0 commit comments