()
| 302 | } |
| 303 | |
| 304 | ngOnInit() { |
| 305 | // It should be a noop during server-side rendering. |
| 306 | if (this._isBrowser) { |
| 307 | this._mapEl = this._elementRef.nativeElement.querySelector('.map-container')!; |
| 308 | this._setSize(); |
| 309 | |
| 310 | // Create the object outside the zone so its events don't trigger change detection. |
| 311 | // We'll bring it back in inside the `MapEventManager` only for the events that the |
| 312 | // user has subscribed to. |
| 313 | if (google.maps.Map) { |
| 314 | this._initialize(google.maps.Map); |
| 315 | } else { |
| 316 | this._ngZone.runOutsideAngular(() => { |
| 317 | google.maps |
| 318 | .importLibrary('maps') |
| 319 | .then(lib => this._initialize((lib as google.maps.MapsLibrary).Map)); |
| 320 | }); |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | private _initialize(mapConstructor: typeof google.maps.Map) { |
| 326 | this._ngZone.runOutsideAngular(() => { |
nothing calls this directly
no test coverage detected