Skip to content

Commit 380b039

Browse files
committed
Add map.remove on scope $destroy
1 parent 5dd2a01 commit 380b039

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/directives/leaflet.js

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ angular.module("leaflet-directive", []).directive('leaflet', function ($q, leafl
9999
});
100100

101101
scope.$on('$destroy', function () {
102+
leafletData.getMap().then(function(map) {
103+
map.remove();
104+
});
102105
leafletData.unresolveMap(attrs.id);
103106
});
104107
}

0 commit comments

Comments
 (0)