Exclude Layer from Legend Widget

8108
22
04-14-2015 03:00 PM
MichaelPotter1
New Contributor III

Hi there,

Does anyone happen to know if there is currently a way to exclude specific layers from the Legend Widget?

Regards,

Michael

0 Kudos
22 Replies
RickeyFight
MVP Regular Contributor

I believe the best way to exclude a layer is in the Arcgis online map.

What ever legend is used in that map will display in the legend widget.

0 Kudos
StanMcShinsky
Occasional Contributor III

Rickey,

For Web appbuilder that method does not work for me. I still get items in my legend widget that I hid in AGOL.

-Stan

0 Kudos
MichaelPotter1
New Contributor III

When I use a Web Map from ArcGIS Online then this does work for me.

          Stan, I am not sure why yours is not working but it should.

However, I am testing out the Local Layer Widget so my layers are coming from my ArcGIS Server not AGOL.

As far as I can tell there currently seems to be no way to exclude layers from the Legend when using Local Layers.

If anyone has any suggestions that would be greatly appreciated.

Regards,

Michael

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Michael,

   Would excluding it from the LayerList widget and the Legend widget work for you or are you just wanting to remove it from the Legend?

0 Kudos
StanMcShinsky
Occasional Contributor III

Michael,

My layers are coming from our ArgGIS Server to AGOL and being used in WAB Developers edition.

If I go into the AGOL web map and hide the layer in the legend(as mentioned above), but still have the layer turned on then in WAB when the layer is turned on it shows up in the legend. To me it seems that WAB does not respect the setting in AGOL to hide items in the legend.

-Stan

RobertScheitlin__GISP
MVP Emeritus

Stan,

   That is strange as there is definitely code in the Legend widget to handle the "showLegend" property from the webmap.

0 Kudos
StanMcShinsky
Occasional Contributor III

Robert,

Do you find this same issue or am I just doing something wrong?

-Stan

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Stan,

   I do not find the same issue. When in AGOL I can go to one of my web maps and choose hide in legend and it does not appear in the Legend Widget in WAB.

0 Kudos
StanMcShinsky
Occasional Contributor III

Robert,

OK I looked at it some more and found that it only happens when I hide only a sub layer in a group. When I hide the top layer in the group it works as expected.

Here is a screen shot. When I hide the TOP layer it hides all. When I hide only the buffer layer then WAB does not respect that.

neighborhood legend.png

-Stan