Packagecom.esri.ags.geometry
Classpublic class MapPoint
InheritanceMapPoint Inheritance Geometry

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


Example
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>

See also

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


Public Properties
 PropertyDefined by
  extent : Extent
[read-only] The extent of this MapPoint.
MapPoint
 InheritedspatialReference : SpatialReference
The spatial reference of the geometry.
Geometry
  type : String
[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
  
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 mappoint with new values [added in version 1.3].
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]

The extent of this MapPoint. The extent is null for MapPoint.

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

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
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 mappoint with new values [added in version 1.3].

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