Photo-Sphere-Viewer
Photo-Sphere-Viewer copied to clipboard
Mouse pointer as zoom/pan direction
This is more of a feature request than an issue. Since an animation method is already implemented, it would be great if it can somehow be reused to change the zoom behaviour to zoom/pan towards where the mouse is currently pointing at and not the center.
Do you have an example of such behaviour ? I tried to implement it but it is not pleasant at all.
The main problem is that the mouse interations does not use the animation system but instead controls each value (longitude, latitude, zoom) independently, with no way to synchronize them.
I have a draft helper for this problem but it does not work https://github.com/mistic100/Photo-Sphere-Viewer/blob/v4/src/utils/DynamicXD.js
Thanks for giving this a try so quickly!
I was thinking of google streetview! It seems like they have implemented some sort of curve that is calculated from the horizontal position of the mouse, e.g. if you zoom all the way in, and place your mouse pointer all the way to the left or right and then zoom out, it does so along some sort of curve. Also when zooming in it does not necessarily center the position that the mouse is pointing at, but at least it pans and zoom towards that direction.
+1 to that request. Currently the zoom is "central" but it would be nice to zoom where the cursor is. That would allow the user to zoom without having to "pan" after that in order to get to the point of interest
Please refrain to comment "+1" and use the Github reactions on the initial post.
Unless of course you have a proposal of algorithm to do that correctly because personally my tries were all a failure.