Open mahmoudmy opened 8 years ago
What does your layer config look like? Can you make a jsbin or plnkr?
This is my map config in the controller:
angular.extend($scope, {
center: {
lat: 31.91,
lng: 54.31,
zoom: 7
},
events: {},
layers: {
baselayers: {
OSM: {
name: 'OSM',
url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
type: 'xyz'
},
Bing: {
name: 'Bing',
type: 'bing',
key: 'Aj6XtE1Q1rIvedmjn2Rh1Lj2qvMhZ-8vPS9HnfjCeUiToM77JFnf-kFRzyMELDol',
layerOptions: {
type: 'AerialWithLabels'
}
}
},
overlays: {}
},
defaults: {
scrollWheelZoom: false
}
});
and in the tempalte:
<leaflet layers="layers" geojson="geojson" defaults="defaults" lf-center="center" height="300px" width="100%"></leaflet>
@nmccready
+1
and I just figured out why. it is because the layer control initialization loops the overlays and baseLayers with for(var i in -)
loop.
so. if you have Array.prototype.toNumber
declared somewhere, it will be enumerated.
for (var i in baseLayers) {
this._addLayer(baseLayers[i], i);
}
for (i in overlays) {
this._addLayer(overlays[i], i, true);
}
check #333 there's a workaround
I recently updated to version (1.0.1). But in the layers menu there is an unknown layer named toNumber. In the controller I didn't define any overlays!
There isn't any error or log in browser's console.