public class LatLng
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
LatLng.Comparator
Utility class that allows to compare between two geo points.
|
Constructor and Description |
---|
LatLng()
Default constructor required by
Serializable . |
LatLng(double latitude,
double longitude)
Instantiates a new LatLng object with provided latitude and longitude.
|
LatLng(android.location.Location location)
Instantiates a new LatLng object based on data from
Location object. |
Modifier and Type | Method and Description |
---|---|
double |
getLatitude()
Get latitude.
|
java.lang.String |
getLatitudeAsString()
Converts longitude to string.
|
double |
getLongitude()
Get longitude.
|
java.lang.String |
getLongitudeAsString()
Converts latitude to string.
|
static double[] |
toArray(java.util.List<LatLng> locations)
Transforms a list of
LatLng locations into an array of double values, ignoring
altitude, radius and bearing. |
android.location.Location |
toLocation()
Converts to
Location . |
public LatLng()
Serializable
.
Latitude and longitude are set to 0.0.public LatLng(double latitude, double longitude)
latitude
- latitude valuelongitude
- longitude valuepublic LatLng(@NonNull android.location.Location location)
Location
object.location
- a Location objectpublic double getLongitude()
public double getLatitude()
@NonNull public static double[] toArray(java.util.List<LatLng> locations)
LatLng
locations into an array of double values, ignoring
altitude, radius and bearing.
Latitude of location at index n is located at index n*2 in the resulting array.
Longitude of location at index n is located at index n*2+1 in the resulting array.locations
- list of LatLng locations@NonNull public android.location.Location toLocation()
Location
.@NonNull public java.lang.String getLongitudeAsString()
@NonNull public java.lang.String getLatitudeAsString()