-
-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marker rotation behaviour with updateMarker() #1335
Comments
Hi,
The aim was to reproduce the orientation=horizontal effect, according to the docu: I can't guarantee at the moment that it isn't a problem on my end since I did a major refactoring. But suspicious is that it only happens if I set pitch to Math.Pi. I'll likely need 1-2 days if you need an online demo or further investigation from my end. |
@Rai-Rai sorry, it's an error in the migration doc, it must be +/- Pi / 2
pitch = PI of course rotates your marker completely on its axis, so it is invisible |
Thank you, I'll change it accordingly. |
This feature/bug fix has been released in version 5.8.1. |
Describe the bug
Hello!
(I think it was a very wise decision to abandon "orientation" in favor of "rotation" in 5.8, so thank you!)
Here’s my beautiful little ImageLayer marker :
If you apply a rotation using updateMarker() (or directly in the initial marker config in addMarker()) :
updateMarker({id: "yid7gnnhtsb", rotation: {roll: 1.2}}, true)
This works fine, but if you then update another marker config property, for example opacity :
updateMarker({id: "yid7gnnhtsb", opacity: 0.6}, true)
The modification was successful but the marker rotated another 1.2 on roll.
This bug also occurs with yaw and pitch.
I think updateMarker renders again the rotation values contained in marker’s config :
(However, I think it’s not the case with MarkersPlugin.renderMarkers() method.)
The workaround I'm using for now is to call updateMarker a second time after a rotation update call, to reset directly the marker's rotation properties to 0, as it will not replace the visual rotation aspect.
I think it would be nice to have a property or method on MarkerConfig so that we can get the real current "cumulative" rotation values of a marker (in order to reuse them once with addMarker(), for example), as is the case with other MarkerConfig properties (position, size, etc.).
Here if you have any other questions.
Thank you very much!
Online demo URL
No response
Photo Sphere Viewer version
5.8.0
Plugins loaded
No response
OS & browser
Windows, Chrome 126
Additional context
No response
The text was updated successfully, but these errors were encountered: