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

Commit

Permalink
[android] LatLng bounds cannot be wrapped (#13419)
Browse files Browse the repository at this point in the history
  • Loading branch information
osana authored and Łukasz Paczos committed Dec 12, 2018
1 parent 191d47b commit 6aea5b5
Show file tree
Hide file tree
Showing 14 changed files with 430 additions and 482 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.MAX_VALUE;

/**
* 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.MAX_VALUE;

/**
* 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 6aea5b5

Please sign in to comment.