I am trying to add a legend, and it gets to the console.log, but it fails at on the line after it.
It does not show any errors saying it failed, but it wont continue past that line.
map[map_div_id]
holds the map (we have multiple maps on the page).
Any Ideas?
//add the legend
dojo.connect(map[map_div_id],'onLayersAddResult',function(results){
var layerInfo = dojo.map(results, function(layer,index){
return {layer:layer.layer,title:index};
});
if(layerInfo.length > 0){
console.log(layerInfo);
var legendDijit = new esri.dijit.Legend({
map:map[map_div_id],
layerInfos:layerInfo
},"legendDiv");
legendDijit.startup();
}
});