tombatossals/angular-leaflet-directive — pull request #312 by tv (2014-03-06 12:19:40+00:00)
Title: Cleanup leaflet from leafletData after scope.$destroy

On app that constantly initializes new maps and custom directives on top of it had problems when directives launched before map was ready. Directives then added layers to old, already destroyed map. With this patch, directive detects if it's destroyed from scope's $destroy event and then unresolves itself from leafletData. This could and should be done for other directives too, but for most use cases this should be enough.

Issue discussion at #299