-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] Precision loss in Transform::flyTo #4298
Comments
This regression was caused by the additional point-latLng-point round trip added in #3301. I wonder how GL JS gets better precision out of that approach. |
Simplify LatLng::{wrap,unwrapForShortestPath} code, avoiding duplicated code between Transform::{latLngToScreenCoordinate,easeTo,flyTo}. Added unit tests for camera usage in Transform to detect cases like e.g. crossing the antimeridian as a shortest path between two coordinates. Transform::flyTo precision loss to be handled in #4298.
From #9199:
This changes the consequences of this bug: instead of ending up at the slightly wrong position at the end of |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
I guess one way to alleviate this issue would be converting the geographical coordinate all the way into tile coordinates, and keep using that when interpolating. To be honest, I'd love to see |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
Transform::flyTo
loses more precision thanTransform::easeTo
when animating. Example:Given point A
LatLng { -45, -135 }
and point BLatLng { 45, 135 }
:Transform::easeTo
from point A to B:LatLng { 44.999999999695532, 135.00000000038369 }
45 - 44.999999999695532 = 3.0446756E-10
135 - 135.00000000038369 = -3.8369308E-10
Transform::flyTo
from point B to A:LatLng { -44.999808628745399, -135.00024116863571 }
-45 + 44.999808628745399 = -1.9137125E-4
-135 + 135.00024116863571 = 2.4116863E-4
The exponent of precision loss from
easeTo
is -10, whileflyTo
is -4./cc @1ec5
The text was updated successfully, but these errors were encountered: