Skip to content

fix(google-maps): rendering blank if custom options with no zoom are … #20882

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 1 commit into from
Oct 28, 2020

Conversation

dmitry-stepanenko
Copy link
Contributor

Current Behavior

If an options object without a 'zoom' is passed to the Google Maps API, it'll render a grey rectangle which looks broken.

StackBlitz issue reproduction: https://stackblitz.com/edit/angular-ivy-w1znny?file=src%2Fapp%2Fapp.component.ts
Uncomment zoom option to let map render properly

Steps to reproduce:

  1. setup google maps with options input
<google-map [options]="mapOptions"></google-map>
export class SomeComponent {
  ...
  options = {
    // zoom:15 // uncomment this line for map to render
  };
}
  1. notice that the map won't be visible
  2. add zoom property
export class SomeComponent {
  ...
  options = {
    zoom:15 // uncomment this line for map to render
  };
}
  1. map is being loaded properly

Expected Behavior

Should fallback to default zoom level if not provided either in options or as a separate input

@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 25, 2020
…provided

If an options object without a 'zoom' is passed to the Google Maps API,
it'll render a grey rectangle which looks broken.
These changes make sure that we always pass in a 'zoom' so map is rendered.
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Oct 26, 2020
@wagnermaciel wagnermaciel merged commit f0a4e59 into angular:master Oct 28, 2020
wagnermaciel pushed a commit that referenced this pull request Oct 28, 2020
…provided (#20882)

If an options object without a 'zoom' is passed to the Google Maps API,
it'll render a grey rectangle which looks broken.
These changes make sure that we always pass in a 'zoom' so map is rendered.

(cherry picked from commit f0a4e59)
wagnermaciel pushed a commit that referenced this pull request Oct 28, 2020
…provided (#20882)

If an options object without a 'zoom' is passed to the Google Maps API,
it'll render a grey rectangle which looks broken.
These changes make sure that we always pass in a 'zoom' so map is rendered.

(cherry picked from commit f0a4e59)
@angular-automatic-lock-bot
Copy link

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 Nov 28, 2020
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.

3 participants