angular-ui / ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
http://angular-ui.github.io/ui-leaflet
Other
315 stars 137 forks source link

Array.prototype breaks Layer Control #333

Open v1r0x opened 7 years ago

v1r0x commented 7 years ago

Hi,

I have extended Arrays using Array.prototype. The added function swap completely breaks Layer Control (leaflet-1.X branch) and adds an overlay with the title "swap" on master branch. On leaflet-1.X branch I get t.on is not a function. After some searching for a solution I found an open issue in https://github.com/tombatossals/angular-leaflet-directive/issues/1024. Switching from [] to {} in master and leaflet-1.X fixed the error for me. Should I open a pull request for this?