-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Conversation
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.
@Input() height = '500px'; | ||
@Input() width = '500px'; | ||
export class GoogleMap implements OnInit, OnDestroy { | ||
@Input() |
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.
What's your rationale for making these all write-only?
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.
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.
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.
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.
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
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. |
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.