pannellum
pannellum copied to clipboard
Get the pitch, yaw, hfov after dragging?
How do I get the Hotspot position of pitch, yaw, hfov after dragging the Hotspot? Or is there any workaround to achieve this?
I actually made it to work by targetting the hotspot div
and using the mouseup
event. Is there any workaround for this?
$(".custom-hotspot").on("mouseup", function (e) { console.log(viewer.mouseEventToCoords(e)); });
I assume you're using the recently added hot spot dragging functionality. As noted in the documentation for the dragHandlerFunc
parameter, the specified function is called when hot spot dragging starts and ends. As the mouse event is passed to this function, you can use mouseEventToCoords
in it.
Hi @mpetroff, using mouseEventToCoords only prints the pitch and yaw of the click location. Is there a way to get the HFOV or the pitch/yaw of the center of the screen?
@joshuakoh1 You can use the .getPitch()
, .getYaw()
, and getHfov()
methods on the Viewer
object.