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

Method ngOnInit

src/google-maps/map-polyline/map-polyline.ts:140–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138 new EventEmitter<google.maps.Polyline>();
139
140 ngOnInit() {
141 if (this._map._isBrowser) {
142 this._combineOptions()
143 .pipe(take(1))
144 .subscribe(options => {
145 if (google.maps.Polyline && this._map.googleMap) {
146 this._initialize(this._map.googleMap, google.maps.Polyline, options);
147 } else {
148 this._ngZone.runOutsideAngular(() => {
149 Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(
150 ([map, lib]) => {
151 this._initialize(map, (lib as google.maps.MapsLibrary).Polyline, options);
152 },
153 );
154 });
155 }
156 });
157 }
158 }
159
160 private _initialize(
161 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