[android] LatLngBounds: latNorth should be greater or equal than latSouth
This commit is contained in:
@@ -283,6 +283,8 @@ public class LatLngBounds implements Parcelable {
|
||||
* 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>
|
||||
* This method doesn't recalculate most east or most west boundaries.
|
||||
* Note that lonEast and lonWest will be wrapped to be in the range of [-180, 180],
|
||||
@@ -312,6 +314,10 @@ public class LatLngBounds implements Parcelable {
|
||||
throw new IllegalArgumentException("latitude must be between -90 and 90");
|
||||
}
|
||||
|
||||
if (latNorth < latSouth) {
|
||||
throw new IllegalArgumentException("LatSouth cannot be less than latNorth");
|
||||
}
|
||||
|
||||
lonEast = LatLng.wrap(lonEast, GeometryConstants.MIN_LONGITUDE, GeometryConstants.MAX_LONGITUDE);
|
||||
lonWest = LatLng.wrap(lonWest, GeometryConstants.MIN_LONGITUDE, GeometryConstants.MAX_LONGITUDE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user