Fix an error when removing the entire map and the layers
Merged
requested to merge mkochendorfer/Leaflet.GridLayer.GoogleMutant:fix-control-remove-error into master
Right now I get the following error when the map is destroyed within an Angular 1 application using ui-leaflet. This appears to be due to the controls being destroyed before the layers and thus no longer being around to be reset. This patch will fix that by adding some protection code around that logic. Here is the specific error I was running into:
angular.js:14642 TypeError: Cannot read property 'bottomright' of undefined
at NewClass.onRemove (Leaflet.GoogleMutant.js:101)
at NewClass.removeLayer (leaflet-src.js:6476)
at NewClass.removeFrom (leaflet-src.js:6357)
at NewClass.remove (leaflet-src.js:6350)
at NewClass.remove (leaflet-src.js:3640)
at eval (ui-leaflet.js:138)
at Scope.$broadcast (angular.js:18698)
at Scope.$destroy (angular.js:18313)
at cleanupLastView (angular-ui-router.js:4083)
at eval (angular-ui-router.js:4141)
Edited by Michael Kochendorfer
Merge request reports
Activity
mentioned in issue #54 (closed)
So this fixes #54 (closed), I guess?
mentioned in commit fa28e955
Please register or sign in to reply