com.mapitz.gwt.googleMaps.client
Class GLatLng

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.mapitz.gwt.googleMaps.client.GLatLng

public class GLatLng
extends com.google.gwt.core.client.JavaScriptObject

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

Author:
aglaforge

Method Summary
static GLatLng create(double lat, double lng)
          Notice the ordering of latitude and longitude.
static GLatLng create(double lat, double lng, boolean unbounded)
          Notice the ordering of latitude and longitude.
 double distanceFrom(GLatLng other)
          Returns the distance, in meters, from this point to the given point.
 boolean equals(GLatLng other)
          Returns true if the other size has equal components, within certain roundoff margins.
 double lat()
          Returns the latitude coordinate in degrees, as a number between -90 and +90.
 double latRadians()
          Returns the latitude coordinate in radians, as a number between -PI/2 and +PI/2.
 double lng()
          Returns the longitude coordinate in degrees, as a number between -180 and +180.
 double lngRadians()
          Returns the longitude coordinate in radians, as a number between -PI and +PI.
 java.lang.String toUrlValue()
          Returns a string that represents this point that is suitable for use as a URL paramater value.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static GLatLng create(double lat,
                             double lng)
Notice the ordering of latitude and longitude. If the unbounded flag is true, then the numbers will be used as passed, oterwise latitude will be clamped to lie between -90 degrees and +90 degrees, and longitude will be wrapped to lie between -180 degrees and +180 degrees.


create

public static GLatLng create(double lat,
                             double lng,
                             boolean unbounded)
Notice the ordering of latitude and longitude. If the unbounded flag is true, then the numbers will be used as passed, oterwise latitude will be clamped to lie between -90 degrees and +90 degrees, and longitude will be wrapped to lie between -180 degrees and +180 degrees.


lat

public double lat()
Returns the latitude coordinate in degrees, as a number between -90 and +90. If the unbounded flag was set in the constructor, this coordinate can be outside this interval.


lng

public double lng()
Returns the longitude coordinate in degrees, as a number between -180 and +180. If the unbounded flag was set in the constructor, this coordinate can be outside this interval.


latRadians

public double latRadians()
Returns the latitude coordinate in radians, as a number between -PI/2 and +PI/2. If the unbounded flag was set in the constructor, this coordinate can be outside this interval.


lngRadians

public double lngRadians()
Returns the longitude coordinate in radians, as a number between -PI and +PI. If the unbounded flag was set in the constructor, this coordinate can be outside this interval.


distanceFrom

public double distanceFrom(GLatLng other)
Returns the distance, in meters, from this point to the given point. The earth is approximated as a sphere, hence the distance could be off by as much as 0.3%.


equals

public boolean equals(GLatLng other)
Returns true if the other size has equal components, within certain roundoff margins.


toUrlValue

public java.lang.String toUrlValue()
Returns a string that represents this point that is suitable for use as a URL paramater value. It contains the latitude and the longitide in degrees to 6 decimal digits, in this order, separated by a comma, without whitespace.