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

Method _initialize

src/google-maps/map-kml-layer/map-kml-layer.ts:104–121  ·  view source on GitHub ↗
(
    map: google.maps.Map,
    layerConstructor: typeof google.maps.KmlLayer,
    options: google.maps.KmlLayerOptions,
  )

Source from the content-addressed store, hash-verified

102 }
103
104 private _initialize(
105 map: google.maps.Map,
106 layerConstructor: typeof google.maps.KmlLayer,
107 options: google.maps.KmlLayerOptions,
108 ) {
109 // Create the object outside the zone so its events don't trigger change detection.
110 // We'll bring it back in inside the `MapEventManager` only for the events that the
111 // user has subscribed to.
112 this._ngZone.runOutsideAngular(() => {
113 this.kmlLayer = new layerConstructor(options);
114 this._assertInitialized();
115 this.kmlLayer.setMap(map);
116 this._eventManager.setTarget(this.kmlLayer);
117 this.kmlLayerInitialized.emit(this.kmlLayer);
118 this._watchForOptionsChanges();
119 this._watchForUrlChanges();
120 });
121 }
122
123 ngOnDestroy() {
124 this._eventManager.destroy();

Callers 1

ngOnInitMethod · 0.95

Calls 4

_assertInitializedMethod · 0.95
_watchForUrlChangesMethod · 0.95
setTargetMethod · 0.80

Tested by

no test coverage detected