Select to view content in your preferred language

WAB FeatureLayer not showing labels

267
0
05-22-2023 02:11 PM
ViktorSafar
Frequent Contributor

I have a WAB app on AGE which is running a custom widget (JS v3). The widget adds a few FeatureLayers into the map:

      const newLayer = new FeatureLayer(url, {
        mode: FeatureLayer.MODE_ONDEMAND,
        outFields: ["*"],
        showLabels: true
      });

I explicitly set the showLabels flag to true. However, when the layer loads into the map, the labels are not visible and the LayerList widget shows an option to "Show labels", even though the property showLabels is still set to TRUE on the given layer:

ViktorSafar_0-1684789457837.png

ViktorSafar_1-1684789500462.png

 

Once I click the "Show labels" option, the labels are indeed shown. The showLabels property on the layer continues to show TRUE. The option on the layer in the LayerList changes to "Hide labels" and when I click that, the labels go away and the showLabels property changes to FALSE.

ViktorSafar_2-1684789628332.png

 

What can I do to make the labels show on load? 

0 Kudos
0 Replies