AnsweredAssumed Answered

Display UniqueValueRenderer symbols in custom legend?

Question asked by sarahclark on Jul 10, 2014

I recently figured out how to use esri/request to retrieve legend images from our server to make a custom legend div. However, now I am moving onto using the UniqueValueRenderer for layers after they load....so all the symbols are changing. In the JavaScript API documentation it mentions that .getUniqueValueInfo(graphic) "Returns rendering and legend information (as defined by the renderer) associated with the given graphic." I'm not sure what graphic to feed it though. It doesn't work if I offer it the layer with the renderer assigned to it or its graphics or a single graphic (e.g. renderer.getUniqueValueInfo(layer.graphics[0])).

 

Does anyone have tips on getting images from a layer with a renderer to use in the legend?

 

Thanks for any help.

Outcomes