Skip to content
Snippets Groups Projects

Fix an error when removing the entire map and the layers

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading