MCPcopy
hub / github.com/angular/components / ngOnInit

Method ngOnInit

src/google-maps/map-polygon/map-polygon.ts:142–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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