-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Unwrap LatLngBounds for the shortest path when requesting camera #11759
Conversation
534d1a2
to
85a8cf7
Compare
@@ -28,7 +28,7 @@ | |||
/** | |||
* Construct a new LatLngBounds based on its corners, given in NESW | |||
* order. | |||
* | |||
* <p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this javadoc intended?
@@ -278,12 +300,12 @@ static LatLngBounds fromLatLngs(final List<? extends ILatLng> latLngs) { | |||
|
|||
/** | |||
* Constructs a LatLngBounds from doubles representing a LatLng pair. | |||
* | |||
* <p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
* This values of latNorth and latSouth should be in the range of [-90, 90], | ||
* see {@link GeometryConstants#MIN_LATITUDE} and {@link GeometryConstants#MAX_LATITUDE}, | ||
* otherwise IllegalArgumentException will be thrown. | ||
* latNorth should be greater or equal latSouth, otherwise IllegalArgumentException will be thrown. | ||
* | ||
* <p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
85a8cf7
to
e9771fb
Compare
e9771fb
to
ded1d89
Compare
I think it might be cleaner to have two versions of LatLngBounds: LatLongBoundsUnwrapped : LatLongBound (wrapped): At the moment we try to mix the two concepts together cc @tobrun, @LukasPaczos |
To make the |
I can live with it but here is what bothers me most: That means that even though we are saying that our LatLngBounds do not wrap and all values will be stored as wrapped, we then allow to do: LatLngBounds latLngBounds = LatLngBounds.from(10, -170, -10, 170).unwrappedBounds(); Now we have latLngBounds.getNorthEast().getLongitude() return 190 (that contradicts our intent to have longitude be between -180, 180). Now this instance of LatLngBounds could be passed around and the notion that bounds were just unwrapped would be lost. Of course, you can get longitude() and compare agains 180.. You can see that more testing will need to be added so that two unwrapped bounds and unwrapped & wrapped bounds produce correct union(), span(), center() etc. |
We can document the |
Adding docs is always good. There are several more APIs in gl-native that use LatLngBounds like Snapshotter. |
Closes #11733.
Refs. #11758.