garethmann

Why is my legend not showing up?

Discussion created by garethmann on Jan 23, 2012
Latest reply on Jan 23, 2012 by khutchins-esristaff
I have added some code to my page to display a legend in a div element. I have placed the div element on the page but for some reason the legend is not showing up. There appears to be no error message in the Javascript tools (Google Chrome browser). The code for the legend is simply a copy-paste from the samples:

//add the legend
        dojo.connect(map,'onLayersAddResult',function(results){
         //add the legend 
          var legend = new esri.dijit.Legend({
            map:map,
            layerInfos:[{layer:dynamicLayer,title:"Legend"}],
            arrangement:esri.dijit.Legend.ALIGN_RIGHT
          },"legendDiv");
          legend.startup();
        });


Here is the page itself:
http://northmiamicra.org/PWorksLayoutdynamic.html

Outcomes