Skip to content

Commit 4f13fcf

Browse files
authored
refactor(google-maps): remove deprecated APIs for v11 (#20561)
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.
1 parent 8d643a0 commit 4f13fcf

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

src/google-maps/google-map/google-map.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
OnInit,
2020
Output,
2121
ViewEncapsulation,
22-
Optional,
2322
Inject,
2423
PLATFORM_ID,
2524
NgZone,
@@ -231,15 +230,9 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
231230
constructor(
232231
private readonly _elementRef: ElementRef,
233232
private _ngZone: NgZone,
234-
/**
235-
* @deprecated `platformId` parameter to become required.
236-
* @breaking-change 10.0.0
237-
*/
238-
@Optional() @Inject(PLATFORM_ID) platformId?: Object) {
239-
240-
// @breaking-change 10.0.0 Remove null check for `platformId`.
241-
this._isBrowser =
242-
platformId ? isPlatformBrowser(platformId) : typeof window === 'object' && !!window;
233+
@Inject(PLATFORM_ID) platformId: Object) {
234+
235+
this._isBrowser = isPlatformBrowser(platformId);
243236

244237
if (this._isBrowser) {
245238
const googleMapsWindow: GoogleMapsWindow = window;

src/google-maps/map-polyline/map-polyline.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ export class MapPolyline implements OnInit, OnDestroy {
188188
*/
189189
getPath(): google.maps.MVCArray<google.maps.LatLng> {
190190
this._assertInitialized();
191-
// @breaking-change 11.0.0 Make the return value nullable.
192191
return this.polyline.getPath();
193192
}
194193

tools/public_api_guard/google-maps/google-maps.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ export declare class GoogleMap implements OnChanges, OnInit, OnDestroy {
2929
width: string | number | null;
3030
set zoom(zoom: number);
3131
zoomChanged: Observable<void>;
32-
constructor(_elementRef: ElementRef, _ngZone: NgZone,
33-
platformId?: Object);
32+
constructor(_elementRef: ElementRef, _ngZone: NgZone, platformId: Object);
3433
fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void;
3534
getBounds(): google.maps.LatLngBounds | null;
3635
getCenter(): google.maps.LatLng;
@@ -48,7 +47,7 @@ export declare class GoogleMap implements OnChanges, OnInit, OnDestroy {
4847
panTo(latLng: google.maps.LatLng | google.maps.LatLngLiteral): void;
4948
panToBounds(latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void;
5049
static ɵcmp: i0.ɵɵComponentDefWithMeta<GoogleMap, "google-map", ["googleMap"], { "height": "height"; "width": "width"; "mapTypeId": "mapTypeId"; "center": "center"; "zoom": "zoom"; "options": "options"; }, { "boundsChanged": "boundsChanged"; "centerChanged": "centerChanged"; "mapClick": "mapClick"; "mapDblclick": "mapDblclick"; "mapDrag": "mapDrag"; "mapDragend": "mapDragend"; "mapDragstart": "mapDragstart"; "headingChanged": "headingChanged"; "idle": "idle"; "maptypeidChanged": "maptypeidChanged"; "mapMousemove": "mapMousemove"; "mapMouseout": "mapMouseout"; "mapMouseover": "mapMouseover"; "projectionChanged": "projectionChanged"; "mapRightclick": "mapRightclick"; "tilesloaded": "tilesloaded"; "tiltChanged": "tiltChanged"; "zoomChanged": "zoomChanged"; }, never, ["*"]>;
51-
static ɵfac: i0.ɵɵFactoryDef<GoogleMap, [null, null, { optional: true; }]>;
50+
static ɵfac: i0.ɵɵFactoryDef<GoogleMap, never>;
5251
}
5352

5453
export declare class GoogleMapsModule {

0 commit comments

Comments
 (0)