mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.

Home Page:https://pannellum.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Popup with Animated Lines from Hotspot Location

vhghorecha opened this issue · comments

When clicking on the Hotspot, I want to open a custom popup and draw an animated line from the Hotspot to the custom popup. Just like the below image.

image

Can you tell me how I can achieve this using custom code or any other library combined with your library?

The hot spots are positioned and styled using CSS, and there's no way that I know of to draw lines like that with CSS. Thus, you would probably want to use an SVG overlay to achieve such an effect. You would draw the line in the SVG and would need to update its end points any time the panorama view position changed or your popup changed. Unfortunately, there's current no good was to see when the view position changes (see #310), so you'd probably want to use setInterval to regularly check for movement. You could open your hot spot with the clickHandlerFunc / clickHandlerArgs hot spot parameters to specify a custom click handler for the hot spot; the DOM object for the hot spot could be retrieved from the click event and could be used to determine the position of the hot spot.

In short, what you propose should be possible, but there's no easy way to do it.