Select to view content in your preferred language

My layerlist is showing an untitled layer in the set. How do I remove?

510
1
07-13-2023 09:35 AM
ChesouyeCoye
Emerging Contributor

How do I take out the untitled layer from my layer list on my map? When I turn off the layer nothing switches on or off which makes me believe that there is no information for the untitled layer. 

 

My code for the layer list is as follows: 


    view.when(() => {
      const layerList = new LayerList({
          view: view,
          visible: false,
          selectionEnabled: true
      });
      const expand = new Expand({
          view: view,
          content: layerList
      });

      // Add widget to the top right corner of the view
      view.ui.add(expand, "top-left");
  });

 

untitled layer.PNG

0 Kudos
1 Reply
EmilyGoldsmith
Occasional Contributor

Hello.

If you added a new graphics layer into your app, then this could be what is causing the untitled layer to show up. You can configure it to be hidden from your LayerList by setting the listMode to "hide", see here:

        const graphicsLayer = new GraphicsLayer({listMode: "hide"});

 I hope this helps.