Skip to content
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

Cleanup event handling #451

Closed
alexweber opened this issue Jun 20, 2016 · 4 comments
Closed

Cleanup event handling #451

alexweber opened this issue Jun 20, 2016 · 4 comments

Comments

@alexweber
Copy link
Contributor

Hi @SebastianM @brian-singer, Please correct me if I'm wrong but it looks like we could tighten up event handling in a few places:

  1. I'm not sure whether we need to manually remove marker event listeners but it looks like we might benefit from calling google.maps.event.clearInstanceListeners(marker); in the marker manager: https://github.com/SebastianM/angular2-google-maps/blob/master/src/core/services/managers/marker-manager.ts#L25
  2. In the marker directive we're subscribing to events with _addEventListeners but don't explicitly un-subscribe to them on destroy: https://github.com/SebastianM/angular2-google-maps/blob/master/src/core/directives/google-map-marker.ts#L125 similar to what we do here: https://github.com/SebastianM/angular2-google-maps/blob/master/src/core/directives/google-map.ts#L224

There might be others too but these are the ones that come to my attention right away, what are your thoughts? Happy to address in a PR if you want. Thanks!

@brian-singer
Copy link
Contributor

Yes, I agree the google Marker then has a stale reference to the SebM Marker

@sebholstein
Copy link
Owner

@alexweber ya, this is a point that is on my TODO list for a while now. We should address this in the next release. I will think about this a little further and will comment above when I have found a good way for handling this in the future. Thanks guys!

@alexweber
Copy link
Contributor Author

I've addressed item 2 in the commit above, still unclear as to whether we need to use google.maps.event.clearInstanceListeners(marker); so leaving it for now

@stale
Copy link

stale bot commented Nov 14, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 14, 2018
@stale stale bot closed this as completed Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants