This repository was archived by the owner on Aug 8, 2023. It is now read-only.
[core] Harden Transform anchor & padding usage#4285
Merged
Conversation
Contributor
|
We should be using |
a0d4188 to
dd6f87e
Compare
Use optional values for anchor & padding in Map and Transform functions instead of NaNs. Added unit tests to stress some edge cases.
dd6f87e to
90b3f0d
Compare
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.
If gesture in progress, we transfer the world rounds from the end longitude into start, so we can guarantee the "scroll effect" of rounding the world while assuring the end longitude remains wrapped. Otherwise, find the shortest path.
90b3f0d to
7a509b0
Compare
Contributor
Author
|
TL;DR: If gesturing, do what the user wants, instead take the shortest path. @1ec5 this fixes the shortest path code I broke in 026b6d4, together with an issue where a user gesture of scrolling around the world would have unexpected behavior due to the shortest path algorithm. We use |
This fixes an issue in both iOS and Android when e.g. adding a marker on both sides of the dateline border in Taveuni island, the marker in one of the sides would have an out-of-bounds longitude.
Contributor
Author
Contributor
Author
Contributor
|
That makes a lot of sense. Thanks @brunoabinader! |
Contributor
This was referenced Mar 24, 2016
This was referenced May 9, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Enforce invalid anchors via
ScreenCoordinate::null()when neeeded, backed up by unit tests. This patch reverts some more changes from b33b2f1 related to the default value for Transform functions. As pointed out by Minh, we use invalid screen coordinates to tell the affected transform functions to use the origin instead./cc @1ec5 @kkaefer