Select to view content in your preferred language

Add graphicsLayer to legend widget

2125
3
Jump to solution
10-16-2017 09:13 AM
TylerWaring
Frequent Contributor

Greetings, I'd like to be able to add graphicsLayers into my legend instance. Has anyone added a graphicsLayer to the legend widget? 

Thanks, Tyler 

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Tyler,

   The Legend dijit has a layerInfo property for manually specifying layers but it has this:

<Layer> layerRequiredA layer to add to the legend. Valid layer types are: ArcGISTiledMapServiceLayer,ArcGISDynamicMapServiceLayer.

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Tyler,

   The Legend dijit has a layerInfo property for manually specifying layers but it has this:

<Layer> layerRequiredA layer to add to the legend. Valid layer types are: ArcGISTiledMapServiceLayer,ArcGISDynamicMapServiceLayer.
0 Kudos
TylerWaring
Frequent Contributor

I saw that graphicsLayer is not a valid type.  I'm wondering if there is a way to hack into the legend's DOM get the graphics layer's symbology and dynamically create some HTML to push into the legend wrapper. Has anyone doen anything like that?  

RobertScheitlin__GISP
MVP Emeritus

Tyler,

   I have never had the need to do that but you can basically do anything using DOM manipulation. You would juts dojo query for the #legendDiv and add you new dom element to that.

0 Kudos