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

Method _initialize

src/google-maps/map-marker/map-marker.ts:303–314  ·  view source on GitHub ↗
(map: google.maps.Map, markerConstructor: typeof google.maps.Marker)

Source from the content-addressed store, hash-verified

301 }
302
303 private _initialize(map: google.maps.Map, markerConstructor: typeof google.maps.Marker) {
304 // Create the object outside the zone so its events don't trigger change detection.
305 // We'll bring it back in inside the `MapEventManager` only for the events that the
306 // user has subscribed to.
307 this._ngZone.runOutsideAngular(() => {
308 this.marker = new markerConstructor(this._combineOptions());
309 this._assertInitialized();
310 this.marker.setMap(map);
311 this._eventManager.setTarget(this.marker);
312 this.markerInitialized.next(this.marker);
313 });
314 }
315
316 ngOnChanges(changes: SimpleChanges<this>) {
317 const {marker, _title, _position, _label, _clickable, _icon, _visible} = this;

Callers 1

ngOnInitMethod · 0.95

Calls 4

_combineOptionsMethod · 0.95
_assertInitializedMethod · 0.95
setTargetMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected