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

[android] LatLng bounds cannot be wrapped #13419

Merged
merged 2 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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