Hii,
User story:
I have a 3d model loaded, on which I add few markers which is a point on the 3d model.
Now image we have n numbers of markers loaded on 3d model, Now when I click on any of the marker I want to perform few action.
I have added a listener for this which is also working fine, but I am not able to get which icon is clicked.
Below is my code for addListener
public addListeners() {
this.handler = new ScreenSpaceEventHandler(this.mapObject.viewer.canvas);
// Change the event type to LEFT_CLICK
this.handler.setInputAction(
this.iconClickHandler.bind(this),
ScreenSpaceEventType.LEFT_CLICK
);
}
iconClickHandler(event: any) {
// Handle the click event for the icon
console.log("this.mouseOverEntity",this.mouseOverEntity)
const pickedObject = this.mapObject.viewer.scene.pick(event.position);
console.log("picked object", pickedObject)
console.log(this)
console.log(event)
console.log("endposition",event.endPosition)
console.log('Icon Clicked!');
}