AnsweredAssumed Answered

Mouse click to change color of extruded building footprint

Question asked by mshukun1 on Feb 21, 2017

What is the best way to mouse click to change extruded building footprint symbol color (only one selection at a time)?

I prefer using a Graphic layer for this purpose.  I tried the code below and it doesn't work.  I would very much appreciate any of your input. 

 

this.sceneView.on('click', lang.hitch(this, function(evt){
        this.sceneView.hitTest(evt.screenPoint).then(function(res){
          var height = res.results[0].graphic.attributes.Building_Height;
          var highlightSym = new PolygonSymbol3D({
            symbolLayers: [new ExtrudeSymbol3DLayer({
                          size: height,
                          material: { color: [242, 255, 99, 1] }
                        })]
            });
         
          // This is not working...
          var graphic = new Graphic(res.results[0].geometry, highlightSym);
          this.sceneView.graphics(graphic);
        });// End hitTest
      }));

Outcomes