Skip to content

feat(google-maps): add input options for google Map component #16759

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 3 commits into from
Aug 15, 2019

Conversation

mbehrlich
Copy link
Collaborator

Add inputs to configure Google Map, including the main options, as well
as center and zoom. Allow resizing the height and width of the
component. Add errors for not loading the API and using malformed
inputs.

Add inputs to configure Google Map, including the main options, as well
as center and zoom. Allow resizing the height and width of the
component. Add errors for not loading the API and using malformed
inputs.
@mbehrlich mbehrlich requested a review from jelbourn as a code owner August 12, 2019 21:34
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 12, 2019
@Input() height = '500px';
@Input() width = '500px';
export class GoogleMap implements OnInit, OnDestroy {
@Input()
Copy link
Member

Choose a reason for hiding this comment

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

What's your rationale for making these all write-only?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I much prefer the setter method over using ngOnChanges, which I will discuss in the other comment. If you're asking why I don't have getter methods for these, I'm concerned that users will expect to get the current configuration of the map rather than the entered inputs, so I plan to copy the Google Maps API https://developers.google.com/maps/documentation/javascript/reference/map and have separate methods that retrieve the current state of the map.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I meant the omission of getters. My only concern here is that our documentation tooling doesn't support expressing something as write-only (vs. readonly), so we'd have to update that.

Make minor changes to conform to style and remove unnecessary error.
Move size changes to ngOnChanges block. Move initialization into helper
functions.
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Aug 15, 2019
@jelbourn jelbourn merged commit a6d1445 into angular:master Aug 15, 2019
@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 Sep 15, 2019
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 target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants