I'm using the directive to show markers on maps that all have a different ID. There seems to however be a memory leak in leafletControlHelpers, which is caused by _controls[mapId] holding a reference to map data, which is not destroyed when the directive gets destroyed.
var _layersControl = _controls[mapId];
_controls = {};
_controls[mapId] = _layersControl;
which removes all but the current references from the _controls object.
This is not a suitable workaround though, because it essentially prevents having multiple directives running at the same time. Do you have any suggestions as to how to remove the reference when the map with the corresponding mapId is destroyed?
Hi,
I'm using the directive to show markers on maps that all have a different ID. There seems to however be a memory leak in leafletControlHelpers, which is caused by _controls[mapId] holding a reference to map data, which is not destroyed when the directive gets destroyed.
I was able to get rid of the memory leak by changing the line https://github.com/angular-ui/ui-leaflet/blob/master/src/services/leafletControlHelpers.js#L162 to
which removes all but the current references from the _controls object.
This is not a suitable workaround though, because it essentially prevents having multiple directives running at the same time. Do you have any suggestions as to how to remove the reference when the map with the corresponding mapId is destroyed?
A-P