Select to view content in your preferred language

WAB - Legend Widget Layer label

2075
11
03-22-2017 12:57 PM
RickeyFight
MVP Regular Contributor

How do I change the layer label to be only what the name of the layer is? 

I am using the Developer edition.

I want it to say Building Labels and not Interior_ - Building Labels

0 Kudos
11 Replies
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
RickeyFight
MVP Regular Contributor

rscheitlin I should also add that I am adding the layer with the LocalLayer widget. 

 I have uncommitted out that section but it seems to work for the layer list not the legend. 

Thank you

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rickey,

   That is very odd because there is code in the LL widget to set the legend title to exactly what the layer name is in the LocalLayer widgets settings. What does your LL widget config.json look like?

0 Kudos
RickeyFight
MVP Regular Contributor

rscheitlin‌ I should also add that it is mostly using the LL widget. It is using my custom LL widget that I made a few years ago. It does not use the config.json.  

I was able to get the LayerList widget to remove the unwanted labels just not the legend. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rickey,

   That could be the issue then. Hard to say. I remember in one of the releases of LL widget I added code to specifically set the layer legend title.

0 Kudos
RickeyFight
MVP Regular Contributor

Robert,

Thank you. I was hoping it was not my widget but something else that could be changed.

0 Kudos
RickeyFight
MVP Regular Contributor

Robert,

Do you remember what release that was? 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rickey,

   No I don't (to many widgets and versions). But here is the line in question (line 2):

            if (layer.name) {
              lLayer._titleForLegend = layer.name;
              lLayer.title = layer.name;
              lLayer.noservicename = true;
            }
RickeyFight
MVP Regular Contributor

I will try to make that work.

Thanks! 

0 Kudos