AnsweredAssumed Answered

this.sceneView.hitTest(screenPoint): Uncaught TypeError

Question asked by mshukun1 on Feb 9, 2017
Latest reply on Feb 10, 2017 by mshukun1

I created a small application using JavaScript API 4.2 (3D) which works fine.  Now, I am trying to replicate the same within WAB.  However, I have a problem executing sceneView.hitTest() function.  it gave me an "Uncaught TypeError".  I am new to WAB so I can't figure out what I am doing wrong.  I would greatly appreciate any inputs.  

 

Here is the error I am getting and code. 

 

onOpen: function(){ 
   console.log('onOpen');
   this.sceneView.on("click", function(event){ 
        var screenPoint = {x: event.x, y: event.y};        
        console.log(screenPoint);        
        this.sceneView.hitTest(screenPoint).then(function(res){
           console.log(res.results[0]);
         });
    });     
},

Thank you,
Makiko

Outcomes