mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.29k stars 726 forks source link

how to set custom hotSpots arrow rotation #1223

Closed himadri-housiey closed 1 month ago

himadri-housiey commented 4 months ago

Screenshot 2024-07-11 180920

but i want like this Screenshot 2024-07-11 131550

this is my code. image

what can i add for this. I want to add rotate(---deg) rotateX(---deg) rotateY(---deg) rotateZ(---deg); each of the custom hotSpots rotation arrow angles separately. How can i do it?

mpetroff commented 3 months ago

The simplest—although less elegant—method would be to create a separate CSS class for each hot spot. The cssClass parameter can be a space-separated list of classes, so you could have a shared class and then only have separate classes for the rotation.

You could also use createTooltipFunc / createTooltipArgs. In this case, the hot spot <div> and the value of createTooltipArgs are both passed to the function assigned to createTooltipFunc, so you could assign the rotation values to createTooltipArgs and write a function to set the rotation on the hot spot <div>.