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

Use empty objects instead of arrays, fix #333 #344

Closed v1r0x closed 6 years ago

v1r0x commented 7 years ago

Fix #333 The L.control.layers contructor expects two objects, but two arrays were given. This PR fixes a bug appearing when the user extends arrays (e.g. Array.prototype.whatever). I replaced the empty arrays [] in the constructor with empty objects {}.

cc @elesdoar

elesdoar commented 6 years ago

This is a breaking change, closing this PR.

v1r0x commented 6 years ago

It's especially a bug in ui-leaflet if I remember correctly or am I wrong? Afair the L.control.layers constructor expects two objects ({}) instead of two arrays ([]).