Packagecom.yahoo.maps.api.core.location
Classpublic class LatLon
InheritanceLatLon Inheritance flash.events.EventDispatcher
ImplementsILocation

An object that represents the coordinates for a geographical point.


Example
This example creates a new LatLon object and sets the maps centerLatLon value.
   var latlon:LatLon = new LatLon(47.603580, -122.329454);
   _map.centerLatLon = latlon;
  



Public Properties
 PropertyDefined by
  address : Address
[read-only] The address location.
LatLon
  bounded : Boolean
[read-only] Returns true if the latitude will be bounded between -90 and 90, and longitude between -180 and 180 degrees.
LatLon
  geocoded : Boolean
[read-only] Returns true if this address has been geocoded.
LatLon
  geocoderResultSet : GeocoderResultSet
[read-only] Returns the ResultSet provided by the geocoder.
LatLon
  lat : Number
A number representing the north-south geographic coordinate measurement.
LatLon
  latRadians : Number
[read-only] Returns the latitude coordinate in radians, as a number between -PI/2 and +PI/2.
LatLon
  locale : String
LatLon
  lon : Number
A number representing the east-west geographic coordinate measurement.
LatLon
  lonRadians : Number
[read-only] Returns the longitude coordinate in radians, as a number between -PI and +PI.
LatLon
Public Methods
 MethodDefined by
  
LatLon(latitude:Number, longitude:Number, bounded:Boolean = true)
Creates a new LatLon object.
LatLon
  
Creates a new LatLon object with the same latitude and longitude properties.
LatLon
  
Returns the distance from this point to the given LatLon point.
LatLon
  
Returns the shortest distance between this point and the given LatLon point along the surface of a sphere.
LatLon
  
isIdentical(latlon:LatLon, precision:int = 4):Boolean
Returns true if the given LatLon point is identical to this point.
LatLon
  
radians(degrees:Number):Number
[static] Returns the radian value of a decimal degree value.
LatLon
  
Reverse-geocodes the latitude and longitude pair to return an address.
LatLon
  
shift(deltaLat:Number, deltaLon:Number):LatLon
Returns a new LatLon object that is shifted by the provided delta values for latitude and longitude.
LatLon
  
toString():String
Returns a comma-separated string of the latitude and longitude of this point.
LatLon
Events
 EventSummaryDefined by
   Dispatched only if the request failed, the XML did not parse or there were no results.LatLon
   Dispatched when the geocode request was successful and there was at least one result.LatLon
Public Constants
 ConstantDefined by
  LAT_SPAN : int = 170
[static] The latitudinal span of the map in degrees.
LatLon
  LON_SPAN : int = 360
[static] The longitudinal span of the map in degrees.
LatLon
  MAX_LAT_VALUE : int = 85
[static] The maximum latitude allowed.
LatLon
  MAX_LON_VALUE : int = 180
[static] The maximum longitude allowed.
LatLon
  MIN_LAT_VALUE : int = -85
[static] The minimum latitude allowed.
LatLon
  MIN_LON_VALUE : int = -180
[static] The minimum longitude allowed.
LatLon
Property detail
addressproperty
address:Address  [read-only]

The address location.

Implementation
    public function get address():Address
boundedproperty 
bounded:Boolean  [read-only]

Returns true if the latitude will be bounded between -90 and 90, and longitude between -180 and 180 degrees.

Implementation
    public function get bounded():Boolean
geocodedproperty 
geocoded:Boolean  [read-only]

Returns true if this address has been geocoded.

Implementation
    public function get geocoded():Boolean
geocoderResultSetproperty 
geocoderResultSet:GeocoderResultSet  [read-only]

Returns the ResultSet provided by the geocoder.

Implementation
    public function get geocoderResultSet():GeocoderResultSet
latproperty 
lat:Number  [read-write]

A number representing the north-south geographic coordinate measurement.

Implementation
    public function get lat():Number
    public function set lat(value:Number):void
latRadiansproperty 
latRadians:Number  [read-only]

Returns the latitude coordinate in radians, as a number between -PI/2 and +PI/2.

Implementation
    public function get latRadians():Number
localeproperty 
locale:String  [read-write]Implementation
    public function get locale():String
    public function set locale(value:String):void
lonproperty 
lon:Number  [read-write]

A number representing the east-west geographic coordinate measurement.

Implementation
    public function get lon():Number
    public function set lon(value:Number):void
lonRadiansproperty 
lonRadians:Number  [read-only]

Returns the longitude coordinate in radians, as a number between -PI and +PI.

Implementation
    public function get lonRadians():Number
Constructor detail
LatLon()constructor
public function LatLon(latitude:Number, longitude:Number, bounded:Boolean = true)

Creates a new LatLon object.

Parameters
latitude:Number — A number representing a north-south geographic coordinate measurement as decimal degrees.
 
longitude:Number — A number representing an east-west geographic coordinate measurement as decimal degrees.
 
bounded:Boolean (default = true) — If true, the latitude will be bounded between -90 and 90, and longitude between -180 and 180 degrees.
Method detail
clone()method
public function clone():LatLon

Creates a new LatLon object with the same latitude and longitude properties.

Returns
LatLon — A LatLon object
getDistanceFrom()method 
public function getDistanceFrom(point:LatLon):DistanceResult

Returns the distance from this point to the given LatLon point.

Parameters
point:LatLon — A LatLon object.

Returns
DistanceResult — A DistanceResult object.

See also

getGeodesicDistanceFrom()method 
public function getGeodesicDistanceFrom(point:LatLon):DistanceResult

Returns the shortest distance between this point and the given LatLon point along the surface of a sphere.

Parameters
point:LatLon — A LatLon object

Returns
DistanceResult — A DistanceResult object.

See also

isIdentical()method 
public function isIdentical(latlon:LatLon, precision:int = 4):Boolean

Returns true if the given LatLon point is identical to this point.

Parameters
latlon:LatLon — The LatLon object to check against.
 
precision:int (default = 4)

Returns
Boolean
radians()method 
public static function radians(degrees:Number):Number

Returns the radian value of a decimal degree value.

Parameters
degrees:Number

Returns
Number
reverseGeocode()method 
public function reverseGeocode():void

Reverse-geocodes the latitude and longitude pair to return an address.

shift()method 
public function shift(deltaLat:Number, deltaLon:Number):LatLon

Returns a new LatLon object that is shifted by the provided delta values for latitude and longitude.

Parameters
deltaLat:Number
 
deltaLon:Number

Returns
LatLon
toString()method 
public override function toString():String

Returns a comma-separated string of the latitude and longitude of this point.

Returns
String
Event detail
geocoderFailureevent 
Event object type: GeocoderEvent

Dispatched only if the request failed, the XML did not parse or there were no results.

geocoderSuccessevent  
Event object type: GeocoderEvent

Dispatched when the geocode request was successful and there was at least one result.

Constant detail
LAT_SPANconstant
public static const LAT_SPAN:int = 170

The latitudinal span of the map in degrees.

LON_SPANconstant 
public static const LON_SPAN:int = 360

The longitudinal span of the map in degrees.

MAX_LAT_VALUEconstant 
public static const MAX_LAT_VALUE:int = 85

The maximum latitude allowed.

MAX_LON_VALUEconstant 
public static const MAX_LON_VALUE:int = 180

The maximum longitude allowed.

MIN_LAT_VALUEconstant 
public static const MIN_LAT_VALUE:int = -85

The minimum latitude allowed.

MIN_LON_VALUEconstant 
public static const MIN_LON_VALUE:int = -180

The minimum longitude allowed.