Duplicate items in the legend (picture included)

Discussion created by rwelikal on Jul 15, 2013
Latest reply on Jul 15, 2013 by rwelikal
Hi All,
I have recently created a web map that uses the legend snippet from the ESRI JavaScript API website.

It works great for the most part, but has one issue, there are duplicate entries in the legend. (Refer to this image: [ATTACH=CONFIG]25925[/ATTACH])The rest services that I am using are all symbolized properly without duplicates. The method I'm using to add the services to the map is through a feature layer.

This is the exact code in my .js file.

    dojo.connect(myMap, 'onLayersAddResult', function (results) {
        var layerInfo =, function (layer, index) {
            return { layer: layer.layer, title: };

        if (layerInfo.length > 0) {
            var legendDijit = new esri.dijit.Legend({
                map: myMap,
                layerInfos: layerInfo},

Any information would help.