Hi All,
I have a web map with three feature layers and one dynamic map layer, and when I use the legend code it is displaying only the three feature layers. What do I need to display all four layers in the legend. Also how do I add a checkbox to display only the checked layers. Here is the code I'm using.
Thanks
//add the legend
map.on("layers-add-result", function (evt) {
var layerInfo = arrayUtils.map(evt.layers, function (layer, index) {
return {layer:layer.layer, title:layer.layer.name};
});
if (layerInfo.length > 0) {
var legendDijit = new Legend({
map: map,
layerInfos: layerInfo
}, "legendDiv");
legendDijit.startup();
}