mpetroff / pannellum

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

Feature Request: Navigation (Scene) hotpoints that can be applied into a floorplan #1155

Open Macfelon opened 1 year ago

Macfelon commented 1 year ago

Love the navigation, was wondering if it was possible to add a feature where you could put the hotspots to the scene also outside the pano display block, like a floor plan?

mpetroff commented 1 year ago

I'd argue that something like this is out of the scope of the library, as many different variations of it are possible. There are various ways to display floor plans, and for outdoor use, a map would be more appropriate, for which there are many mapping libraries.

Thus, I think this is the type of functionality that is best left to custom implementation using the API (although it might make a good advanced example for use of the API). To implement something like this, you'd want to add click handlers to the hot spots on your floor plan that call Pannellum's loadScene method with the appropriate scene name to switch scenes. You could also attach an event handler for Pannellum's load event to highlight the active scene on your floor plan.

Macfelon commented 1 year ago

Ok, I'll try those options, seems a way to do it.

Macfelon commented 1 year ago

Ok, I was able to do a imgmap, and then on the areas use the api (loadScene) as an onclick call for each map to make it change, it's working precisely as I would want it to!