AnsweredAssumed Answered

Map with a single feature layer won't display a legend

Question asked by drdlund4 on Jul 25, 2014
Latest reply on Jul 8, 2015 by satyanarayana_narmala

I have a map with a single feature layer, layered over a base map, and I can't get the javascript API to display a legend for it. If I throw in another layer, the legend displays. I'm following code example here: Legend | ArcGIS API for JavaScript. Why won't the legend display when only a single feature layer is defined? Do I have to define a dummy feature layer in order to display a legend? Is the legend widget using some kind of an array or something that requires more than one layer to be defined in order for it to work properly or display anything at all?

 

Any help or insights would be appreciated.

Outcomes