AnsweredAssumed Answered

LayerSwipe::Invalid layer type?

Question asked by rwolfe on Aug 6, 2019
Latest reply on Aug 8, 2019 by rwolfe

Hello I am adding a LayerSwipe to my website, and get this error: LayerSwipe::Invalid layer type

 

The layers displayed in the map currently are featureLayers.

 

Here's the bit of code that I think it ties to

 

      var layerIds = currentMap.layerIds;

      console.log(layerIds);                                  // displays ["layer0", "layer1"]

 

      var layer = layerIds[1];

      console.log(layer);                                     // displays layer1

 

      var swipeWidget = new LayerSwipe ({

            type: "vertical",

            map: currentMap,

            layers: [layer]

      }, "swipeWidgetId");

      swipeWidget.startup();

 

When ran I get this error: LayerSwipe::Invalid layer type

 

Any advice for solving this will be greatly appreciated, as I feel I am so close to bringing this functionality to my website. Thanks very much!

Outcomes