Skip to content
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

Is it possible to rotate a marker? #1235

Closed
Fernando-Checa opened this issue Feb 13, 2024 · 12 comments
Closed

Is it possible to rotate a marker? #1235

Fernando-Checa opened this issue Feb 13, 2024 · 12 comments
Labels
Milestone

Comments

@Fernando-Checa
Copy link

Describe your problem

In case os markers with text for example.
I can use yaw and pitch to create a marker but I'd like to rotate it in place to align text with the space for example.

Online demo URL

No response

Photo Sphere Viewer version

5.7.0

Plugins loaded

markersPlugin

Additional context

No response

@mistic100
Copy link
Owner

try this on the marker's properties

style: {
    rotate: '45deg'
}

@Fernando-Checa
Copy link
Author

Fernando-Checa commented Feb 13, 2024

Is not working.
Inspecting the docs I can see it does not work for imageLayer type.

CSS properties to set on the marker (background, border, etc.) (ignored for imagerLayer, videoLayer)

@mistic100
Copy link
Owner

Well you said you used text makers not imageLayer...

There is the orientation option you can try, but is hardcoded values to make it appear on the floor or a wall, the angle is not confgurable.

@Fernando-Checa
Copy link
Author

Yes sorry, I did not express it correctly.
I use text but in an image.. something like this:
CleanShot 2024-02-13 at 18 26 30

Why imageLayer can't be rotated like the others?

orientation is not good here because I need to rotate while horizontal

@mistic100
Copy link
Owner

Why ? Because it is no coded.

Please to a mockup of the desired orientation, so I know exactly what you want.

@Fernando-Checa
Copy link
Author

Fernando-Checa commented Feb 13, 2024

Sorry, I didn't realize that it was a possibility.. I thought more of a technical reason.
Here is what I'd like to be able to do:
ttt

For example, having a pointing marker, be able to rotate it to point in a certain way. Maybe good for stairs, elevators...
The logo with text marker would be better if aligned to the grid of the tiles for example.

If I can help with anything just let me know

@mistic100 mistic100 added this to the 5.7.1 milestone Feb 13, 2024
@mistic100
Copy link
Owner

For the future 5.7.1 version


rotation

  • type: string | number

Rotation applied to the marker, in degrees or radians.

(This option is ignored for polygons and polylines).

@Fernando-Checa
Copy link
Author

Thanks. Great news.

@mistic100
Copy link
Owner

@PanierAvide this could be useful for #1163
You would still have to dynamically place the markers for them to be always visible.

Or as a baseline for a custom renderer like the ArrowsRenderer

Copy link

This feature/bug fix has been released in version 5.7.1.

@Fernando-Checa
Copy link
Author

Fernando-Checa commented Mar 5, 2024

When using a marker that is not square in dimensions, if you rotate the marker it does not retain the proportions.
It seems like the proportion stays the same and the image rotates, distorting the result.

rotation 0deg
CleanShot 2024-03-05 at 10 45 07

rotati
CleanShot 2024-03-05 at 10 46 27
on 90deg

I don't know if this is a limitation of the system or just something to be fixed.

Thanks in advance

@mistic100
Copy link
Owner

Please open a new issue with full code and/or demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants