Mouse click to change color of extruded building footprint

487
0
02-21-2017 02:37 PM
by Anonymous User
Not applicable

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
      }));
0 Kudos
0 Replies