-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
fix(google-maps): ensure that a mapTypeId is always passed in #22098
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -35,7 +35,8 @@ interface GoogleMapsWindow extends Window { | |||
/** default options set to the Googleplex */ | |||
export const DEFAULT_OPTIONS: google.maps.MapOptions = { | |||
center: {lat: 37.421995, lng: -122.084092}, | |||
zoom: 17 | |||
zoom: 17, | |||
mapTypeId: 'roadmap' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting this error internally:
TS2322: Type 'string' is not assignable to type 'MapTypeId | undefined'.
Could we instead do 'roadmap' as MapTypeId
to resolve that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, although it's weird that our CI didn't catch it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeesh now I'm getting this
TS2352: Conversion of type 'string' to type 'MapTypeId' may be a mistake because
neither type sufficiently overlaps with the other. If this was intentional, convert the
expression to 'unknown' first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
b528880
to
c22ba94
Compare
We pass in `mapTypeId` as undefined if the provided options don't have it. This seems to trigger a bug in Google Maps where it stops loading map tiles. These changes fix the issue by always providing a `mapTypeId`. Fixes angular#22082.
c22ba94
to
848b85f
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
We pass in
mapTypeId
as undefined if the provided options don't have it. This seems to trigger a bug in Google Maps where it stops loading map tiles.These changes fix the issue by always providing a
mapTypeId
.Fixes #22082.