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