Follow us on GitHub

com.google.gwt.maps.client.base
Class LatLng

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.maps.client.base.LatLng

public class LatLng
extends JavaScriptObject

LatLng is a point in geographical coordinates, latitude and longitude. Notice that although usual map projections associate longitude with the x-coordinate of the map, and latitude with the y-coordinate, the latitude coordinate is always written first, followed by the longitude. Notice also that you cannot modify the coordinates of a LatLng. If you want to compute another point, you have to create a new one.

See LatLng API Doc


Constructor Summary
protected LatLng()
          LatLng is a point in geographical coordinates, latitude and longitude.
 
Method Summary
 boolean equals(LatLng other)
          is equal?
 double getLatitude()
          get latitude
 double getLongitude()
          Returns the longitude in degrees.
 String getToString()
          Converts to string representation.
 String getToUrlValue(int precision)
          Returns a string of the form "lat,lng" for this LatLng.
static LatLng newInstance(double lat, double lng)
          Notice the ordering of latitude and longitude.
static LatLng newInstance(double lat, double lng, boolean noWrap)
          Notice the ordering of latitude and longitude.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LatLng

protected LatLng()
LatLng is a point in geographical coordinates, latitude and longitude.

Method Detail

newInstance

public static LatLng newInstance(double lat,
                                 double lng)
Notice the ordering of latitude and longitude. If the noWrap flag is true, then the numbers will be used as passed, otherwise latitude will be clamped to lie between -90° and +90 °, and longitude will be wrapped to lie between -180 ° and +180 °.

Parameters:
lat -
lng -

newInstance

public static LatLng newInstance(double lat,
                                 double lng,
                                 boolean noWrap)
Notice the ordering of latitude and longitude. If the noWrap flag is true, then the numbers will be used as passed, otherwise latitude will be clamped to lie between -90° and +90 °, and longitude will be wrapped to lie between -180 ° and +180 °.

Parameters:
lat -
lng -
noWrap -

equals

public final boolean equals(LatLng other)
is equal?

Parameters:
other -

getLatitude

public final double getLatitude()
get latitude

Returns:
double

getLongitude

public final double getLongitude()
Returns the longitude in degrees.

Returns:
double

getToString

public final String getToString()
Converts to string representation.


getToUrlValue

public final String getToUrlValue(int precision)
Returns a string of the form "lat,lng" for this LatLng. We round the lat/lng values to 6 decimal places by default.

Parameters:
precision -
Returns:
String


Follow us on GitHub

Copyright © 2011-2012 Gone Vertical LLC. All Rights Reserved.