ol-ext icon indicating copy to clipboard operation
ol-ext copied to clipboard

Using PerspectiveMap drops a lot the performance in phones.

Open sergiotarxz opened this issue 1 year ago • 2 comments

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.

sergiotarxz avatar Feb 09 '24 19:02 sergiotarxz

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

Viglino avatar Feb 10 '24 10:02 Viglino

@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.

sergiotarxz avatar Feb 10 '24 10:02 sergiotarxz