From 868f1c75ea82df4e2a1fa7c23ea5a2c5d254c91f Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Mon, 14 Sep 2020 12:34:04 +0200 Subject: [PATCH] refactor(google-maps): remove deprecated APIs for v11 Removes the APIs that have been marked as deprecated for v11 from the `google-maps` package. BREAKING CHANGES: * `platformId` parameter of the `GoogleMap` constructor is now required. --- src/google-maps/google-map/google-map.ts | 13 +++---------- src/google-maps/map-polyline/map-polyline.ts | 1 - tools/public_api_guard/google-maps/google-maps.d.ts | 5 ++--- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/google-maps/google-map/google-map.ts b/src/google-maps/google-map/google-map.ts index 9f6efcdd4bd7..ed059dd7d003 100644 --- a/src/google-maps/google-map/google-map.ts +++ b/src/google-maps/google-map/google-map.ts @@ -19,7 +19,6 @@ import { OnInit, Output, ViewEncapsulation, - Optional, Inject, PLATFORM_ID, NgZone, @@ -231,15 +230,9 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy { constructor( private readonly _elementRef: ElementRef, private _ngZone: NgZone, - /** - * @deprecated `platformId` parameter to become required. - * @breaking-change 10.0.0 - */ - @Optional() @Inject(PLATFORM_ID) platformId?: Object) { - - // @breaking-change 10.0.0 Remove null check for `platformId`. - this._isBrowser = - platformId ? isPlatformBrowser(platformId) : typeof window === 'object' && !!window; + @Inject(PLATFORM_ID) platformId: Object) { + + this._isBrowser = isPlatformBrowser(platformId); if (this._isBrowser) { const googleMapsWindow: GoogleMapsWindow = window; diff --git a/src/google-maps/map-polyline/map-polyline.ts b/src/google-maps/map-polyline/map-polyline.ts index 082bb2ca4a05..846312e2c0ad 100644 --- a/src/google-maps/map-polyline/map-polyline.ts +++ b/src/google-maps/map-polyline/map-polyline.ts @@ -188,7 +188,6 @@ export class MapPolyline implements OnInit, OnDestroy { */ getPath(): google.maps.MVCArray { this._assertInitialized(); - // @breaking-change 11.0.0 Make the return value nullable. return this.polyline.getPath(); } diff --git a/tools/public_api_guard/google-maps/google-maps.d.ts b/tools/public_api_guard/google-maps/google-maps.d.ts index 5df3db16e9d8..595b08738c7c 100644 --- a/tools/public_api_guard/google-maps/google-maps.d.ts +++ b/tools/public_api_guard/google-maps/google-maps.d.ts @@ -29,8 +29,7 @@ export declare class GoogleMap implements OnChanges, OnInit, OnDestroy { width: string | number | null; set zoom(zoom: number); zoomChanged: Observable; - constructor(_elementRef: ElementRef, _ngZone: NgZone, - platformId?: Object); + constructor(_elementRef: ElementRef, _ngZone: NgZone, platformId: Object); fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void; getBounds(): google.maps.LatLngBounds | null; getCenter(): google.maps.LatLng; @@ -48,7 +47,7 @@ export declare class GoogleMap implements OnChanges, OnInit, OnDestroy { panTo(latLng: google.maps.LatLng | google.maps.LatLngLiteral): void; panToBounds(latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void; static ɵcmp: i0.ɵɵComponentDefWithMeta; - static ɵfac: i0.ɵɵFactoryDef; + static ɵfac: i0.ɵɵFactoryDef; } export declare class GoogleMapsModule {