@@ -52,7 +52,7 @@ import {DataLayerManager} from './../services/managers/data-layer-manager';
52
52
'scaleControl' , 'scaleControlOptions' , 'mapTypeId' , 'clickableIcons' , 'gestureHandling'
53
53
] ,
54
54
outputs : [
55
- 'mapClick' , 'mapRightClick' , 'mapDblClick' , 'centerChange' , 'idle' , 'boundsChange' , 'zoomChange'
55
+ 'mapClick' , 'mapRightClick' , 'mapDblClick' , 'centerChange' , 'idle' , 'boundsChange' , 'zoomChange' , 'mapReady'
56
56
] ,
57
57
host : {
58
58
// todo: deprecated - we will remove it with the next version
@@ -314,6 +314,12 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
314
314
*/
315
315
zoomChange : EventEmitter < number > = new EventEmitter < number > ( ) ;
316
316
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
+
317
323
constructor ( private _elem : ElementRef , private _mapsWrapper : GoogleMapsAPIWrapper ) { }
318
324
319
325
/** @internal */
@@ -355,7 +361,9 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
355
361
mapTypeId : this . mapTypeId ,
356
362
clickableIcons : this . clickableIcons ,
357
363
gestureHandling : this . gestureHandling
358
- } ) ;
364
+ } )
365
+ . then ( ( ) => this . _mapsWrapper . getNativeMap ( ) )
366
+ . then ( map => this . mapReady . emit ( map ) ) ;
359
367
360
368
// register event listeners
361
369
this . _handleMapCenterChange ( ) ;
0 commit comments