re-render scenelayer

871
1
02-23-2017 08:38 AM
JamesEyre
New Contributor II

I am am writing a web app builder widget, and i want to re-render a scenelayer coming from my sceneview. I set the renderer on the scenelayer, but nothing happens. Any ideas?

see the code below.

public startup() {

   this.sceneView.map.allLayers.forEach((layer: Layer) => {

       if (layer.id == "154bd77e20e-layer-16") {

         this.layerToRender = layer as SceneLayer;

      }

   });

   var symbol = new MeshSymbol3D(
      new FillSymbol3DLayer({
         material: {
            color: [244, 2, 1]
         }
      })
   );
   var renderer = new SimpleRenderer({
      symbol: symbol
   });

   this.layerToRender.renderer = renderer;

}

0 Kudos
1 Reply
RalucaNicola1
Esri Contributor

Hi James,

could you post a snippet with your code? That way it's easier to debug...

But on a first glance looks like you're passing a symbol layer directly to the constructor of the symbol. You should pass it to the symbolLayers property, like this: 

symbol: new MeshSymbol3D({
   symbolLayers: [
      new FillSymbol3DLayer({
        material: {
           color: "#ffffff"
        }
     })
   ]
})‍‍‍‍‍‍‍‍‍‍
0 Kudos