Skip to content

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

Merged
jelbourn merged 7 commits into
angular:masterfrom
mbehrlich:map-object
Apr 20, 2020
Merged

jelbourn merged 7 commits into
angular:masterfrom
mbehrlich:map-object

Conversation

@mbehrlich

Copy link
Copy Markdown
Contributor

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 a review from jelbourn as a code owner February 25, 2020 20:08
@mbehrlich
mbehrlich requested a review from a team 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 Label used to distinguish feature request from other issues 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
Copy Markdown
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
Copy Markdown
Contributor 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 ?

@jelbourn jelbourn Mar 3, 2020 •

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.

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
Copy Markdown
Contributor 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.

@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 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
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 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 Label used to distinguish feature request from other issues 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

5 participants