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:
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_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#L224There 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!
Yes, I agree the google Marker then has a stale reference to the SebM Marker
@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!
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
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.
Most helpful comment
@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!