AnsweredAssumed Answered

Layer List - Last Layer Dynamically Added is "Untitled layer"

Question asked by rcoodey on Aug 30, 2018
Latest reply on Sep 4, 2018 by rscheitlin

Running on the WAB built into Portal 10.6 (think that is WAB 2.6) and have a Local Scene added to an app. Used the GUI to create the app and add the widgets. Built out most the custom widget but have a few issues, one of which is with the Layer List not updating properly.


So the custom widget is just adding in some new FeatureLayers and setting their definitionExpressions (example below). The Layer List seems to refresh fine for all the layers except for the last. I have tried a variable number of layers added and it is always only the last one. The last layer shows as "Untitled layer" in the list and the visibility toggle doesn't even work. The data from the layer shows up though. Any ideas?


Example of adding a layer:

     layer = new FeatureLayer({
      title: configLayer.title,
      url: configLayer.url,
      returnZ: true, //Need to manually set as it is not pulled in from the service
      definitionExpression: "ID = 66544" //This is actually set in code just below


Things I have tried:

  • making sure the layers were loaded: layer.load();
  • making sure the layers were refreshed: layer.refresh();
  • get an instance of the WidgetManager, find the LayerList and refresh()
  • this.sceneView.extent = this.sceneView.extent; (saw this potential trick in another post)
  • Add a dummy layer at the end and then remove after "layerview-create"


FYI, the Ledged widget updates just fine with the layers title.


Thanks a lot for any ideas!