diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java index b66dd46b4c..263780f473 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java @@ -256,6 +256,7 @@ public class LatLngBounds implements Parcelable { * 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 @since 7.0.0 lonEast and lonWest will NOT be wrapped to be in the range of [-180, 180], * see {@link GeometryConstants#MIN_LONGITUDE} and {@link GeometryConstants#MAX_LONGITUDE} * lonEast should be greater or equal lonWest, otherwise IllegalArgumentException will be thrown. @@ -286,6 +287,10 @@ public class LatLngBounds implements Parcelable { throw new IllegalArgumentException("longitude must not be NaN"); } + if (Double.isInfinite(lonEast) || Double.isInfinite(lonWest)) { + throw new IllegalArgumentException("longitude must not be infinite"); + } + if (latNorth > MAX_LATITUDE || latNorth < MIN_LATITUDE || latSouth > MAX_LATITUDE || latSouth < MIN_LATITUDE) { throw new IllegalArgumentException("latitude must be between -90 and 90"); |