This page describes an older version, please see latest API at http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/SpatialReference.html.
Packagecom.esri.ags
Classpublic class SpatialReference
InheritanceSpatialReference Inheritance flash.events.EventDispatcher

The spatial reference of a map, layer, or inputs to and outputs from a task. Each coordinate system is defined by a well-known ID (WKID) or a definition string (WKT). Note that before ArcGIS Server 10.0, the ArcGIS Server REST API only supported well-known IDs (not definition strings), but as of ArcGIS Server 10.0 both are supported. For a complete list of supported well-known IDs and their corresponding definition strings, see links below.

See also

Geographic Coordinate Systems Listing
Projected Coordinate Systems Listing


Public Properties
 PropertyDefined By
  wkid : Number
The well-known ID of a spatial reference.
SpatialReference
  wkt : String
The well-known text of a spatial reference.
SpatialReference
Public Methods
 MethodDefined By
  
SpatialReference(wkid:Number, wkt:String = null)
Creates a new SpatialReference.
SpatialReference
Property Detail
wkidproperty
wkid:Number

The well-known ID of a spatial reference. Common WKIDs for geographic coordinate systems include 4326 (GCS_WGS_1984) and 4269 (GCS_North_American_1983). Common WKIDs for projected coordinate systems include 102100/102113/3857 (web mercator), state plan coordinate systems, for example 26985 (Maryland) and 2249 (Massachusetts), as well as UTM zones, for example 26912 (12N) and 26915 (15N).

This property can be used as the source for data binding.


Implementation
    public function get wkid():Number
    public function set wkid(value:Number):void
wktproperty 
wkt:String

The well-known text of a spatial reference. Requires the server to be ArcGIS Server 10.0 or higher. For earlier versions, use wkid.

This property can be used as the source for data binding.


Implementation
    public function get wkt():String
    public function set wkt(value:String):void

Example
Using a well-known text to create an Extent:
     var extent:Extent = new Extent(661140,-1420246,3015668,1594451, new SpatialReference(NaN,'PROJCS["NAD_1927_StatePlane_Kansas_North_FIPS_1501",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",2000000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-98.0],PARAMETER["Standard_Parallel_1",38.71666666666667],PARAMETER["Standard_Parallel_2",39.78333333333333],PARAMETER["Latitude_Of_Origin",38.33333333333334],UNIT["Foot_US",0.3048006096012192]]'));
Constructor Detail
SpatialReference()Constructor
public function SpatialReference(wkid:Number, wkt:String = null)

Creates a new SpatialReference.

Parameters
wkid:Number (default = NaN) — The well-known ID of a spatial reference [optional].
 
wkt:String (default = null) — The well-known text of a spatial reference [optional].