MCPcopy Create free account
hub / github.com/angular/components / ngOnInit

Method ngOnInit

src/google-maps/map-kml-layer/map-kml-layer.ts:84–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82 new EventEmitter<google.maps.KmlLayer>();
83
84 ngOnInit() {
85 if (this._map._isBrowser) {
86 this._combineOptions()
87 .pipe(take(1))
88 .subscribe(options => {
89 if (google.maps.KmlLayer && this._map.googleMap) {
90 this._initialize(this._map.googleMap, google.maps.KmlLayer, options);
91 } else {
92 this._ngZone.runOutsideAngular(() => {
93 Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(
94 ([map, lib]) => {
95 this._initialize(map, (lib as google.maps.MapsLibrary).KmlLayer, options);
96 },
97 );
98 });
99 }
100 });
101 }
102 }
103
104 private _initialize(
105 map: google.maps.Map,

Callers

nothing calls this directly

Calls 3

_combineOptionsMethod · 0.95
_initializeMethod · 0.95
_resolveMapMethod · 0.80

Tested by

no test coverage detected