@@ -74,7 +74,13 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
7474 private readonly _zoom = new BehaviorSubject < number | undefined > ( undefined ) ;
7575 private readonly _destroy = new Subject < void > ( ) ;
7676 private _mapEl : HTMLElement ;
77- _googleMap : UpdatedGoogleMap ;
77+
78+ /**
79+ * The underlying google.maps.Map object
80+ *
81+ * See developers.google.com/maps/documentation/javascript/reference/map#Map
82+ */
83+ googleMap ?: google . maps . Map ;
7884
7985 /** Whether we're currently rendering inside a browser. */
8086 _isBrowser : boolean ;
@@ -258,8 +264,8 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
258264 this . _setSize ( ) ;
259265 this . _googleMapChanges = this . _initializeMap ( this . _combineOptions ( ) ) ;
260266 this . _googleMapChanges . subscribe ( ( googleMap : google . maps . Map ) => {
261- this . _googleMap = googleMap as UpdatedGoogleMap ;
262- this . _eventManager . setTarget ( this . _googleMap ) ;
267+ this . googleMap = googleMap ;
268+ this . _eventManager . setTarget ( this . googleMap ) ;
263269 } ) ;
264270
265271 this . _watchForOptionsChanges ( ) ;
@@ -282,7 +288,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
282288 bounds : google . maps . LatLngBounds | google . maps . LatLngBoundsLiteral ,
283289 padding ?: number | google . maps . Padding ) {
284290 this . _assertInitialized ( ) ;
285- this . _googleMap . fitBounds ( bounds , padding ) ;
291+ this . googleMap ! . fitBounds ( bounds , padding ) ;
286292 }
287293
288294 /**
@@ -291,7 +297,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
291297 */
292298 panBy ( x : number , y : number ) {
293299 this . _assertInitialized ( ) ;
294- this . _googleMap . panBy ( x , y ) ;
300+ this . googleMap ! . panBy ( x , y ) ;
295301 }
296302
297303 /**
@@ -300,7 +306,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
300306 */
301307 panTo ( latLng : google . maps . LatLng | google . maps . LatLngLiteral ) {
302308 this . _assertInitialized ( ) ;
303- this . _googleMap . panTo ( latLng ) ;
309+ this . googleMap ! . panTo ( latLng ) ;
304310 }
305311
306312 /**
@@ -311,7 +317,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
311317 latLngBounds : google . maps . LatLngBounds | google . maps . LatLngBoundsLiteral ,
312318 padding ?: number | google . maps . Padding ) {
313319 this . _assertInitialized ( ) ;
314- this . _googleMap . panToBounds ( latLngBounds , padding ) ;
320+ this . googleMap ! . panToBounds ( latLngBounds , padding ) ;
315321 }
316322
317323 /**
@@ -320,7 +326,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
320326 */
321327 getBounds ( ) : google . maps . LatLngBounds | null {
322328 this . _assertInitialized ( ) ;
323- return this . _googleMap . getBounds ( ) || null ;
329+ return this . googleMap ! . getBounds ( ) || null ;
324330 }
325331
326332 /**
@@ -329,7 +335,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
329335 */
330336 getCenter ( ) : google . maps . LatLng {
331337 this . _assertInitialized ( ) ;
332- return this . _googleMap . getCenter ( ) ;
338+ return this . googleMap ! . getCenter ( ) ;
333339 }
334340
335341 /**
@@ -338,7 +344,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
338344 */
339345 getClickableIcons ( ) : boolean {
340346 this . _assertInitialized ( ) ;
341- return this . _googleMap . getClickableIcons ( ) ;
347+ return this . googleMap ! . getClickableIcons ( ) ;
342348 }
343349
344350 /**
@@ -347,7 +353,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
347353 */
348354 getHeading ( ) : number {
349355 this . _assertInitialized ( ) ;
350- return this . _googleMap . getHeading ( ) ;
356+ return this . googleMap ! . getHeading ( ) ;
351357 }
352358
353359 /**
@@ -356,7 +362,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
356362 */
357363 getMapTypeId ( ) : google . maps . MapTypeId | string {
358364 this . _assertInitialized ( ) ;
359- return this . _googleMap . getMapTypeId ( ) ;
365+ return this . googleMap ! . getMapTypeId ( ) ;
360366 }
361367
362368 /**
@@ -365,7 +371,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
365371 */
366372 getProjection ( ) : google . maps . Projection | null {
367373 this . _assertInitialized ( ) ;
368- return this . _googleMap . getProjection ( ) ;
374+ return this . googleMap ! . getProjection ( ) ;
369375 }
370376
371377 /**
@@ -374,7 +380,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
374380 */
375381 getStreetView ( ) : google . maps . StreetViewPanorama {
376382 this . _assertInitialized ( ) ;
377- return this . _googleMap . getStreetView ( ) ;
383+ return this . googleMap ! . getStreetView ( ) ;
378384 }
379385
380386 /**
@@ -383,7 +389,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
383389 */
384390 getTilt ( ) : number {
385391 this . _assertInitialized ( ) ;
386- return this . _googleMap . getTilt ( ) ;
392+ return this . googleMap ! . getTilt ( ) ;
387393 }
388394
389395 /**
@@ -392,7 +398,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
392398 */
393399 getZoom ( ) : number {
394400 this . _assertInitialized ( ) ;
395- return this . _googleMap . getZoom ( ) ;
401+ return this . googleMap ! . getZoom ( ) ;
396402 }
397403
398404 /**
@@ -401,7 +407,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
401407 */
402408 get controls ( ) : Array < google . maps . MVCArray < Node > > {
403409 this . _assertInitialized ( ) ;
404- return this . _googleMap . controls ;
410+ return this . googleMap ! . controls ;
405411 }
406412
407413 /**
@@ -410,7 +416,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
410416 */
411417 get data ( ) : google . maps . Data {
412418 this . _assertInitialized ( ) ;
413- return this . _googleMap . data ;
419+ return this . googleMap ! . data ;
414420 }
415421
416422 /**
@@ -419,7 +425,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
419425 */
420426 get mapTypes ( ) : google . maps . MapTypeRegistry {
421427 this . _assertInitialized ( ) ;
422- return this . _googleMap . mapTypes ;
428+ return this . googleMap ! . mapTypes ;
423429 }
424430
425431 /**
@@ -428,7 +434,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
428434 */
429435 get overlayMapTypes ( ) : google . maps . MVCArray < google . maps . MapType > {
430436 this . _assertInitialized ( ) ;
431- return this . _googleMap . overlayMapTypes ;
437+ return this . googleMap ! . overlayMapTypes ;
432438 }
433439
434440 private _setSize ( ) {
@@ -495,7 +501,7 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
495501
496502 /** Asserts that the map has been initialized. */
497503 private _assertInitialized ( ) {
498- if ( ! this . _googleMap ) {
504+ if ( ! this . googleMap ) {
499505 throw Error ( 'Cannot access Google Map information before the API has been initialized. ' +
500506 'Please wait for the API to load before trying to interact with it.' ) ;
501507 }
0 commit comments