This page describes an older version, please see latest API at http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/geometry/MapPoint.html.
Packagecom.esri.ags.geometry
Classpublic class MapPoint
InheritanceMapPoint Inheritance Geometry Inheritance Object
Subclasses WebMercatorMapPoint

A location defined by an x- and y-coordinate (in map units). Use the SpatialReference for best practice.

Default MXML PropertyspatialReference

View the examples

See also

Live Sample - shows how to add MapPoints with both MXML and ActionScript.


Public Properties
 PropertyDefined By
  extent : Extent
[override] [read-only] The extent of a MapPoint is always null.
MapPoint
 InheritedspatialReference : SpatialReference
The spatial reference of the geometry.
Geometry
  type : String
[override] [read-only] The type of geometry is MAPPOINT.
MapPoint
  x : Number = 0.0
The x coordinate of the MapPoint.
MapPoint
  y : Number = 0.0
The y coordinate of the MapPoint.
MapPoint
Public Methods
 MethodDefined By
  
MapPoint(x:Number = 0, y:Number = 0, spatialReference:SpatialReference = null)
Creates a new MapPoint object.
MapPoint
  
Shifts "x" to within +/- 180 span
MapPoint
  
offset(dx:Number, dy:Number):MapPoint
Returns a new point that is offset with specified x and y distance.
MapPoint
  
update(x:Number, y:Number, spatialReference:SpatialReference = null):void
Updates the point with new values.
MapPoint
Public Constants
 ConstantDefined By
 InheritedEXTENT : String = esriGeometryEnvelope
[static] An extent is defined by xmin, ymin, xmax and ymax.
Geometry
 InheritedMAPPOINT : String = esriGeometryPoint
[static] A MapPoint is a basic point with x (often longitude), y (often latitude) and an optional spatial reference.
Geometry
 InheritedMULTIPOINT : String = esriGeometryMultipoint
[static] A multipoint consists of one or more MapPoint(s).
Geometry
 InheritedPOLYGON : String = esriGeometryPolygon
[static] A polygon is a set of areas with three or more points.
Geometry
 InheritedPOLYLINE : String = esriGeometryPolyline
[static] A polyline is set of lines with two or more points.
Geometry
Property Detail
extentproperty
extent:Extent  [read-only] [override]

The extent of a MapPoint is always null.


Implementation
    public function get extent():Extent
typeproperty 
type:String  [read-only] [override]

The type of geometry is MAPPOINT.


Implementation
    public function get type():String
xproperty 
public var x:Number = 0.0

The x coordinate of the MapPoint.

yproperty 
public var y:Number = 0.0

The y coordinate of the MapPoint.

Constructor Detail
MapPoint()Constructor
public function MapPoint(x:Number = 0, y:Number = 0, spatialReference:SpatialReference = null)

Creates a new MapPoint object.

Parameters
x:Number (default = 0) — The x-coordinate.
 
y:Number (default = 0) — The y-coordinate.
 
spatialReference:SpatialReference (default = null) — The spatial reference of the point.
Method Detail
normalize()method
public function normalize():MapPoint

Since : ArcGIS API for Flex 2.3

Shifts "x" to within +/- 180 span

Returns
MapPoint — A new normalized point.
offset()method 
public function offset(dx:Number, dy:Number):MapPoint

Returns a new point that is offset with specified x and y distance. Units are map units.

Parameters

dx:Number — The offset distance in map units for the x-coordinate.
 
dy:Number — The offset distance in map units for the y-coordinate.

Returns
MapPoint — A new point with the given offset from this point.
update()method 
public function update(x:Number, y:Number, spatialReference:SpatialReference = null):void

Updates the point with new values.

Parameters

x:Number — The new x-coordinate value.
 
y:Number — The new y-coordinate value.
 
spatialReference:SpatialReference (default = null) — The new spatial reference.

Examples
MXML usage of MapPoint (using spatialReference property):
 <esri:Graphic>
     <esri:MapPoint x="37.229" y="-3.107" spatialReference="{new SpatialReference(4326)}"/>
 </esri:Graphic>
MXML usage of MapPoint (with SpatialReference as a child):
 <esri:Graphic>
     <esri:MapPoint x="37.229" y="-3.107">
         <esri:SpatialReference wkid="4326"/>
     </esri:MapPoint>
 </esri:Graphic>