New map styling is coming soon to Google Maps Platform. This update to map styling includes a new default color palette and improvements to map experiences and usability. All map styles will be automatically updated in March 2025. For more information on availability and how to opt in earlier, see
New map style for Google Maps Platform .
Send feedback
LatLng
Stay organized with collections
Save and categorize content based on your preferences.
An immutable class representing a pair of latitude and longitude coordinates, stored as degrees.
Inherited Constant Summary
From interface
android.os.Parcelable
int
CONTENTS_FILE_DESCRIPTOR
int
PARCELABLE_WRITE_RETURN_VALUE
Field Summary
public
final
double
latitude
Latitude, in degrees.
public
final
double
longitude
Longitude, in degrees.
Public Constructor Summary
LatLng (double latitude, double longitude)
Constructs a LatLng with the given latitude and longitude, measured in degrees.
Inherited Method Summary
From class
java.lang.Object
boolean
equals (Object arg0)
final
Class<?>
getClass ()
int
hashCode ()
final
void
notify ()
final
void
notifyAll ()
String
toString ()
final
void
wait (long arg0, int arg1)
final
void
wait (long arg0)
final
void
wait ()
From interface
android.os.Parcelable
abstract
int
describeContents ()
abstract
void
writeToParcel (Parcel arg0, int arg1)
Fields
public
final
double
latitude
Latitude, in degrees. This value is in the range [-90, 90].
public
final
double
longitude
Longitude, in degrees. This value is in the range [-180, 180).
Public Constructors
public
LatLng
(double latitude, double longitude)
Constructs a LatLng with the given latitude and longitude, measured in degrees.
Parameters
latitude
The point's latitude. This will be clamped to between -90 degrees and +90
degrees inclusive.
longitude
The point's longitude. This will be normalized to be within -180 degrees
inclusive and +180 degrees exclusive.
Public Methods
public
boolean
equals
(Object o)
Tests if thisLatLng
is equal to another.
Two points are considered equal if and only if their latitudes are bitwise equal and their
longitudes are bitwise equal. This means that twoLatLng
s that are very near, in terms
of geometric distance, might not be considered.equal()
.
public
String
toString
()
Send feedback
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License ,and code samples are licensed under theApache 2.0 License .For details, see theGoogle Developers Site Policies .Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-11 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label": "Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label": "Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label": "Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label": "Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label": "Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label": "Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label": "Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label": "Other"
}]
Need to tell us more?