Skip to content

feat(google-maps): Add methods and event handling to Google Map #16804

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 29, 2019

Conversation

mbehrlich
Copy link
Collaborator

Add support for Google Maps event handlers, properties, and methods to
the Google Map component, including click handlers, methods to pan with
the map and access to the controls and data properties.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 17, 2019
@mbehrlich

This comment has been minimized.

]);
const mouseEventHandlers = new Map<string, EventEmitter<google.maps.MouseEvent>>([
['dblclick', this.mapDblclick],
['mousemove', this.mapMousemove],
Copy link
Member

Choose a reason for hiding this comment

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

Is the mousemove handler running inside the Angular zone? This might be one where we want to special case to run outside if so, otherwise we could end up running change detection hundreds of times if someone mouses over the map.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My thoughts on this are that I don't think that this is behaving any differently than angular's native mousemove event, which does cause change detection every time, and makes the user handle it, either by using OnPush or by manually having them run events outside of the Angular zone. My preference would be to do the same, especially since I can imagine a situation where someone has a simple app where they do want change detection to run every time (such as displaying the current lat/lng of the mouse cursor).

Copy link
Member

Choose a reason for hiding this comment

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

That's fair

Add support for Google Maps event handlers, properties, and methods to
the Google Map component, including click handlers, methods to pan with
the map and access to the controls and data properties.
Change event names so they will not collide with native angular events.
Add jsdoc and comments to new events, methods, and properties.
@jelbourn jelbourn added the target: minor This PR is targeted for the next minor release label Aug 29, 2019
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 labels Aug 29, 2019
@jelbourn jelbourn merged commit 94c71b0 into angular:master Aug 29, 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 29, 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