Skip to content

feat(google-maps): expose the underlying Google Maps objects. #18613

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 7 commits into from
Apr 20, 2020

Conversation

mbehrlich
Copy link
Collaborator

Expose the underlying Google Maps objects so they can be interacted with
when it's necessary to do something unimplemented by
angular/google-maps. As part of this change, update DefinitelyTyped so
that we do not need a custom map object. Also standardize how
underlying objects interact with the components and updates new
components to work correctly when loading from the server.

@mbehrlich mbehrlich requested review from jelbourn and a team as code owners February 25, 2020 20:08
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 25, 2020
@mbehrlich mbehrlich added feature This issue represents a new feature or feature request rather than a bug or bug fix google-maps P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: minor This PR is targeted for the next minor release labels Feb 25, 2020
*
* See developers.google.com/maps/documentation/javascript/reference/map#Map
*/
googleMap?: google.maps.Map;
Copy link
Member

Choose a reason for hiding this comment

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

Since the object is created asynchronously, maybe we should expose an Observable or a Promise instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Possibly, I'm unsure if there's actually a case where the component is initialized but the google map object is unset outside of the server-side rendering case. I do not like the idea of an observable wrapped around a union of the map and undefined though. We could have the observable never emit if we are server-side rendering. Any thoughts, @jelbourn ?

Copy link
Member

@jelbourn jelbourn Mar 3, 2020

Choose a reason for hiding this comment

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

Can the map ever be uninitialized by ngOnInit? If so, what would happen? If there's no situation where the map can be undefined without throwing an error by the end of ngOnInit, I don't see the need to make it a promise/stream.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The components were changed so that when they're loaded server side, the map is not initialized. However, in that case, the map is never initialized. To me, that seems like undefined would be more appropriate than an unemitted observable.

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 lgtm action: merge The PR is ready for merge by the caretaker labels Mar 30, 2020
Expose the underlying Google Maps objects so they can be interacted with
when it's necessary to do something unimplemented by
angular/google-maps. As part of this change, update DefinitelyTyped so
that we do not need a custom map object. Also standardize how
underlying objects interact with the components and updates new
components to work correctly when loading from the server.
Remove unused UpdatedGoogleMap type.
Remove references to UpdatedGoogleMap from tests.
Fix merge conflicts and update the Circle component with changes.
Update the public api with new changes.
Correct package.json file with correct version.
Fixes variable name that reverted due to merge.
@jelbourn jelbourn merged commit 3e00f4c into angular:master Apr 20, 2020
soro-google pushed a commit to soro-google/components that referenced this pull request Apr 24, 2020
…r#18613)

Expose the underlying Google Maps objects so they can be interacted with
when it's necessary to do something unimplemented by
angular/google-maps. As part of this change, update DefinitelyTyped so
that we do not need a custom map object. Also standardize how
underlying objects interact with the components and updates new
components to work correctly when loading from the server.
@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 May 21, 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 feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants