Open soheilhasanjani opened 2 years ago
Yes, you can use addEventListener
to listen left click, and if you like control right click use contextmenu event
And for get actual position i use raycaster:
//Raycaster
viewer.raycaster.intersectObject(viewer.panorama, true);
clickPosition = intersectObjs[0].point;
//If you like check if exist infospot in same position
isInfospot = intersectObjs.filter(e=>e.object.type == "infospot");
// add you hostpot
infospot = new this.PANOLENS.Infospot();
// x position is inverted, i don't know why, but that's how it is
infospot.position.set( clickPosition.x * -1, clickPosition.y, clickPosition.z );
viewer.panorama.add(infospot);
viewer.paronama.toggleInfospotVisibility(true);
Hi , Is there any way to add info spot dynamically by click user ? for example , add event Listener for click , when user click any where , get me x, y ,z and i create a new info spot with this detail and add to panorama . please give me solution .