Skip to content

Commit

Permalink
Same implementation as angular-ui#346
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Friedmann committed Oct 16, 2017
1 parent b551246 commit be1b65c
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 26 deletions.
23 changes: 16 additions & 7 deletions dist/ui-leaflet.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions dist/ui-leaflet.min.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions dist/ui-leaflet.min.no-header.js

Large diffs are not rendered by default.

22 changes: 15 additions & 7 deletions dist/ui-leaflet_dev_mapped.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ui-leaflet_dev_mapped.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/directives/leaflet.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ angular.module('ui-leaflet', ['nemLogging']).directive('leaflet',
});

scope.$on('$destroy', function () {
leafletMapDefaults.reset();
leafletMapDefaults.reset(attrs.id);
map.remove();
leafletData.unresolveMap(attrs.id);
});
Expand Down
7 changes: 5 additions & 2 deletions src/services/leafletMapDefaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ angular.module('ui-leaflet').factory('leafletMapDefaults', function ($q, leaflet

// Get the _defaults dictionary, and override the properties defined by the user
return {
reset: function () {
defaults = {};
reset: function (scopeId) {
if (!isDefined(scopeId)){
scopeId = 'main';
}
delete defaults[scopeId];
},
getDefaults: function (scopeId) {
var mapId = obtainEffectiveMapId(defaults, scopeId);
Expand Down

0 comments on commit be1b65c

Please sign in to comment.