Closed KevinSchiffmann closed 10 years ago
First of all, thanks a lot for your work on angular-gm :)
When adding listener to a map, event is pushed in an array (_listeners) and then removed on destroy.
this.addMapListener = function(event, handler) { var listener = google.maps.event.addListener(this._map, event, handler); if (this._listeners[event] === undefined) { this._listeners[event] = []; } this._listeners[event].push(listener); };
But for listener added once, they aren't. In my case, 'idle' event is never fired, and as it's not removed on destroy, it's causing a memory leak.
controller.addMapListenerOnce('idle', function() { scope.$emit('gmMapIdle', scope.gmMapId()); });
this.addMapListenerOnce = function(event, handler) { google.maps.event.addListenerOnce(this._map, event, handler); }
Let me know if you need more details. Thanks!
Edit: It's easily fixable by just adding that event in the listeners array, but i don't know if there's a better solution to handle this.
First of all, thanks a lot for your work on angular-gm :)
When adding listener to a map, event is pushed in an array (_listeners) and then removed on destroy.
But for listener added once, they aren't. In my case, 'idle' event is never fired, and as it's not removed on destroy, it's causing a memory leak.
Let me know if you need more details. Thanks!
Edit: It's easily fixable by just adding that event in the listeners array, but i don't know if there's a better solution to handle this.