WAB: Add show label option in Layer List drop down

1271
8
11-30-2017 05:23 AM
aishvaryvardhan
New Contributor III

Hi,

I want to add a new option in drop down of layer list widget of show label which can show the city names under a selection in map.

How can I proceed with it.

P.S i have added the option in setting.html and setting.js and is appearing in WAB edit portal to show/hide label.

but is not reflecting in main portal. Also how can I show cities name on show label and vice versa on hide label

Please find related screenshot

Any lead on this will be highly helpful

Thanks 

Ash

Tags (2)
0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus

Ash,

   In the app web map you need to configure the layer to have labels. So in AGOL online map viewer choose the layer  then the ellipse button and Create Labels.

When a layer has labels configured then the option will be there in the LayerList Widget action menu.

aishvaryvardhan
New Contributor III

Hi Robert,

The labels are visible on the map when i configured from AGOL online Map. But as you told regarding the option will be available in Layer list widget action menu it is not visible.

Do anything needs to be done from code level.?

Thanks

Ash

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ash,

  No change to code have to be made in WAB 2.6.

  1. Are you using WAB 2.6?
  2. Are the layers you are wanting to be label added as FeatureLayers in the Web Map?

Here are the steps I follow and the label option is show in the map:

4. Save your web Map changes.

5. Restart WAB.

aishvaryvardhan
New Contributor III

Hi Robert,

Thanks for it, Its really helpful.
But I am unable to have this show/hide label option as my layer is child layer to a parent layer. How can I have this option in child layer..
Similarly transparency option I am unable to cascade to the child level.

Thanks

Ash

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ash,

   Those options are not available for a subLayer.

0 Kudos
aishvaryvardhan
New Contributor III

Ok Robert, Cant i Customize at code level to have this feature at child layer.
Your view on this ?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ash,

   No, (well if may be possible for a very advanced developer that wants to spend a lot of man hours to go down this road).

aishvaryvardhan
New Contributor III

Alright Robert ,

Thanks a lot

0 Kudos