Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
LatLng bounds cannot be wrapped
Browse files Browse the repository at this point in the history
  • Loading branch information
“osana” committed Nov 20, 2018
1 parent 9be6c8b commit 4f6b495
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 212 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,25 @@ public class GeometryConstants {
*/
public static final int RADIUS_EARTH_METERS = 6378137;

/**
* This constant represents the lowest longitude value available to represent a wrapped geolocation.
*/
public static final double MIN_WRAP_LONGITUDE = -180;

/**
* This constant represents the highest longitude value available to represent a wrapped geolocation.
*/
public static final double MAX_WRAP_LONGITUDE = 180;

/**
* This constant represents the lowest longitude value available to represent a geolocation.
*/
public static final double MIN_LONGITUDE = -180;
public static final double MIN_LONGITUDE = Double.NEGATIVE_INFINITY;

/**
* This constant represents the highest longitude value available to represent a geolocation.
*/
public static final double MAX_LONGITUDE = 180;
public static final double MAX_LONGITUDE = Double.POSITIVE_INFINITY;

/**
* This constant represents the lowest latitude value available to represent a geolocation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ public double getAltitude() {
*/
@NonNull
public LatLng wrap() {
return new LatLng(latitude, wrap(longitude, GeometryConstants.MIN_LONGITUDE, GeometryConstants.MAX_LONGITUDE));
return new LatLng(latitude, wrap(longitude,
GeometryConstants.MIN_WRAP_LONGITUDE, GeometryConstants.MAX_WRAP_LONGITUDE));
}


Expand Down
Loading

0 comments on commit 4f6b495

Please sign in to comment.