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

Using PerspectiveMap drops a lot the performance in phones. #1030

Open
sergiotarxz opened this issue Feb 9, 2024 · 2 comments
Open

Using PerspectiveMap drops a lot the performance in phones. #1030

sergiotarxz opened this issue Feb 9, 2024 · 2 comments

Comments

@sergiotarxz
Copy link

sergiotarxz commented Feb 9, 2024

I was wanting to use PerspectiveMap in a Android Phone from Chrome, but a web application that had good performance suddenly when the user moves the phone to rotate the application lags a lot and the app becomes unusable.

Is there any opportunity to improve the performance while center and rotation change frequently?

I think the main problem lies within this transform:

    style.transform = 'translateY(-' + (17 * fac) + '%) perspective(200px) rotateX(' + angle + 'deg) s  caleY(' + (1 - fac / 2) + ')';

I think this graphical operation is too expensive for frequent usage.

@Viglino
Copy link
Owner

Viglino commented Feb 10, 2024

The code should be called only once on setPerspective (use a duration of 0).
When the phone is rotated it's not called...

@sergiotarxz
Copy link
Author

@Viglino It is not called but the filter affects anyway highly to the performance every time it is rotated the map using:

                  this.map.getView().setRotation((this.compassHeading(alpha, beta, gamma) - this.rotationOffset))

Anyway I made this issue just in case something could be done.

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

No branches or pull requests

2 participants