Skip to content

fix(google-maps): ensure that a mapTypeId is always passed in - #22098

Merged
andrewseguin merged 1 commit into
angular:masterfrom
crisbeto:22082/google-maps-type
Mar 23, 2021
Merged

andrewseguin merged 1 commit into
angular:masterfrom
crisbeto:22082/google-maps-type

Conversation

@crisbeto

@crisbeto crisbeto commented Mar 3, 2021

Copy link
Copy Markdown
Member

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.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Mar 3, 2021
@google-cla google-cla Bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 3, 2021

@jelbourn jelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Mar 11, 2021
center: {lat: 37.421995, lng: -122.084092},
zoom: 17
zoom: 17,
mapTypeId: 'roadmap'

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Member Author

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.

@andrewseguin andrewseguin Mar 23, 2021 •

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@crisbeto
crisbeto force-pushed the 22082/google-maps-type branch from b528880 to c22ba94 Compare March 23, 2021 17:53
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.
@crisbeto
crisbeto force-pushed the 22082/google-maps-type branch from c22ba94 to 848b85f Compare March 23, 2021 19:01
@andrewseguin
andrewseguin merged commit 7c9b83a into angular:master Mar 23, 2021
andrewseguin pushed a commit that referenced this pull request Mar 23, 2021
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.

(cherry picked from commit 7c9b83a)
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Apr 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(google-maps): Map won't load after assigning new options

4 participants