()
| 283 | marker?: google.maps.Marker; |
| 284 | |
| 285 | ngOnInit() { |
| 286 | if (!this._googleMap._isBrowser) { |
| 287 | return; |
| 288 | } |
| 289 | |
| 290 | if (google.maps.Marker && this._googleMap.googleMap) { |
| 291 | this._initialize(this._googleMap.googleMap, google.maps.Marker); |
| 292 | } else { |
| 293 | this._ngZone.runOutsideAngular(() => { |
| 294 | Promise.all([this._googleMap._resolveMap(), google.maps.importLibrary('marker')]).then( |
| 295 | ([map, lib]) => { |
| 296 | this._initialize(map, (lib as google.maps.MarkerLibrary).Marker); |
| 297 | }, |
| 298 | ); |
| 299 | }); |
| 300 | } |
| 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. |
nothing calls this directly
no test coverage detected