Skip to content

refactor(google-maps): remove deprecated APIs for v11 #20561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions src/google-maps/google-map/google-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
OnInit,
Output,
ViewEncapsulation,
Optional,
Inject,
PLATFORM_ID,
NgZone,
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/google-maps/map-polyline/map-polyline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ export class MapPolyline implements OnInit, OnDestroy {
*/
getPath(): google.maps.MVCArray<google.maps.LatLng> {
this._assertInitialized();
// @breaking-change 11.0.0 Make the return value nullable.
return this.polyline.getPath();
}

Expand Down
5 changes: 2 additions & 3 deletions tools/public_api_guard/google-maps/google-maps.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export declare class GoogleMap implements OnChanges, OnInit, OnDestroy {
width: string | number | null;
set zoom(zoom: number);
zoomChanged: Observable<void>;
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;
Expand All @@ -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<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, ["*"]>;
static ɵfac: i0.ɵɵFactoryDef<GoogleMap, [null, null, { optional: true; }]>;
static ɵfac: i0.ɵɵFactoryDef<GoogleMap, never>;
}

export declare class GoogleMapsModule {
Expand Down