Lines 1268~1270 of leaflet.js where the function is called.
for (var i in baseLayers) {
console.log(typeof baseLayers); ----> Object
console.log(typeof baseLayers[i]); ----> Function, and "i" is a name of function in prototype of the Array.
this._addLayer(baseLayers[i], i);
}
And this happends only when i use Array.prototype.... declarations, if i remove these, works fine.
But i could resolve checking the type of variable layer first in leaf.js.
_addLayer: function (layer, name, overlay) {
if (typeof layer == 'object') {
layer.on ...
}
I don´t know if is something with the way of collections works in AngularJS or what.
Angular version is 1.5.5, leaflet is 1.0.1 and ui-leaflet is 2.0.0
I'm not sure what happened, but I could analyze that everything happens when it goes through the initialization function of the layer in leaflet.js
If i use a Array.prototype.someThing definitions, the overlays layers dont´work and report the error:
Error: layer.on is not a function L.Control.Layers<.addLayer@http://localhost/leaflet/lib/leaflet-src.js:12307:4 L.Control.Layers<.initialize@http://localhost/leaflet/lib/leaflet-src.js:12169:4 L.Class.extend/NewClass@http://localhost/leaflet/lib/leaflet-src.js:310:4 L.control.layers@http://localhost/leaflet/lib/leaflet-src.js:12487:9
Lines 1268~1270 of leaflet.js where the function is called.
And this happends only when i use Array.prototype.... declarations, if i remove these, works fine.
But i could resolve checking the type of variable layer first in leaf.js.
I don´t know if is something with the way of collections works in AngularJS or what. Angular version is 1.5.5, leaflet is 1.0.1 and ui-leaflet is 2.0.0