Select to view content in your preferred language

How to turn off a layer's field name in the legend using CSS?

3058
3
03-31-2016 08:07 AM
ChrisBardash
Deactivated User

Update: I edited this post to clarify.

We are updating our web map to the API version 3.16.  In the prior version the field name for the esriLegendLayer was not showing up in the legend, but now it is with this new version. I am trying to turn it off using CSS for the .esriLegendLayer property but I cannot get access to just the field name.  If I set the display to none for this property then the whole thing disappears.  What's frustrating is that I can successfully turn it off  in the console, but I cannot seem to specify this single component of layer in the legend.  Is there a way to do this using the Legend's CSS?  Thanks.

As displayed in the 3.12 version of the API:

As displayed in the 3.16 version of the API:

0 Kudos
3 Replies
JeffJacobson
Frequent Contributor

It looks like the class you want to hide is esriLegendLayerLabel.

ChrisBardash
Deactivated User

That's what I first thought, but it is not the Layer's label, it is the field name. 

0 Kudos
KenBuja
MVP Esteemed Contributor

How are you creating the legend in your code? And what type of layer are you adding to the legend? I'm not seeing the field information in the legends that I've built.

0 Kudos