Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/components/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import { MapMarkerDirective } from './map-marker';
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MapComponent implements OnChanges, OnInit, OnDestroy {
export class MapComponent implements OnChanges, OnInit, AfterViewInit, OnDestroy {

///
/// Field declarations
Expand All @@ -92,7 +92,7 @@ export class MapComponent implements OnChanges, OnInit, OnDestroy {
private _options: IMapOptions = {};
private _box: IBox = null;
private _mapPromise: Promise<void>;
@HostBinding('class.map-container') public _containerClass: boolean = true;
@HostBinding('class.map-container') public _containerClass = true;
@ViewChild('container') private _container: ElementRef;
@ContentChildren(MapMarkerDirective) private _markers: Array<MapMarkerDirective>;

Expand Down Expand Up @@ -276,11 +276,19 @@ export class MapComponent implements OnChanges, OnInit, OnDestroy {
* @memberof MapComponent
*/
public ngOnInit(): void {
this.InitMapInstance(this._container.nativeElement);
this.MapPromise.emit(this._mapService.MapPromise);
this.MapService.emit(this._mapService);
}

/**
* Called after Angular has fully initialized a component's view. Part of ng Component life cycle.
*
* @memberof MapComponent
*/
public ngAfterViewInit(): void {
this.InitMapInstance(this._container.nativeElement);
}

/**
* Called when changes to the databoud properties occur. Part of the ng Component life cycle.
*
Expand Down