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

Method _initialize

src/google-maps/map-circle/map-circle.ts:183–201  ·  view source on GitHub ↗
(
    map: google.maps.Map,
    circleConstructor: typeof google.maps.Circle,
    options: google.maps.CircleOptions,
  )

Source from the content-addressed store, hash-verified

181 }
182
183 private _initialize(
184 map: google.maps.Map,
185 circleConstructor: typeof google.maps.Circle,
186 options: google.maps.CircleOptions,
187 ) {
188 // Create the object outside the zone so its events don't trigger change detection.
189 // We'll bring it back in inside the `MapEventManager` only for the events that the
190 // user has subscribed to.
191 this._ngZone.runOutsideAngular(() => {
192 this.circle = new circleConstructor(options);
193 this._assertInitialized();
194 this.circle.setMap(map);
195 this._eventManager.setTarget(this.circle);
196 this.circleInitialized.emit(this.circle);
197 this._watchForOptionsChanges();
198 this._watchForCenterChanges();
199 this._watchForRadiusChanges();
200 });
201 }
202
203 ngOnDestroy() {
204 this._eventManager.destroy();

Callers 1

ngOnInitMethod · 0.95

Calls 5

_assertInitializedMethod · 0.95
setTargetMethod · 0.80

Tested by

no test coverage detected