|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.maryanovsky.map.client.LatLng
public final class LatLng
Represents a location on the surface of the Earth.
Constructor Summary | |
---|---|
LatLng(double latitude,
double longitude)
Creates a new LatLng at the specified latitude and longitude. |
Method Summary | |
---|---|
boolean |
equals(Object object)
Returns whether this LatLng represents the same location on
the globe as the specified one. |
static LatLng |
fromUrlValue(String urlValue)
Creates a new LatLng object from the specified string, in the
format of toUrlValue() . |
double |
getLatitude()
Returns the latitude, in degrees. |
double |
getLongitude()
Returns the longitude, in degrees. |
double |
getX()
Returns the longitude, in degrees. |
double |
getY()
Returns the latitude, in degrees. |
int |
hashCode()
Returns the hashcode of this object. |
String |
toString()
Returns a textual representation of this coordinate. |
String |
toUrlValue()
Same as toUrlValue(int), but with a fixed precision of 6 digits after the decimal point. |
String |
toUrlValue(int precision)
Returns a string representing this LatLng suitable for
use as the value of a URL parameter. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LatLng(double latitude, double longitude)
LatLng
at the specified latitude and longitude.
latitude
- The latitude, in degrees, a value in the range [-90, 90].longitude
- The longitude, in degrees, a value in the range
[-180, 180].Method Detail |
---|
public static LatLng fromUrlValue(String urlValue)
LatLng
object from the specified string, in the
format of toUrlValue()
.
public double getLatitude()
public double getLongitude()
public double getX()
getX
in interface DoublePointView
public double getY()
getY
in interface DoublePointView
public String toUrlValue(int precision)
LatLng
suitable for
use as the value of a URL parameter. The returned value contains the
latitude and longitude, with the specified number of digits after the
decimal point, separated by a comma.
public String toUrlValue()
public boolean equals(Object object)
LatLng
represents the same location on
the globe as the specified one. Note that the latitude and longitude
values may be different while the location is still the same (for
example, any two LatLng
objects with latitude equal to 90 are
equal).
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |