Class: PointE-mail This Topic Printable Version Give Us Feedback

Description

A location defined by an X- and Y- coordinate. It can be map units or screen units.

Class hierarchy

esri.geometry.Geometry
  |_ esri.geometry.Point

Constructor

Constructor Description
esri.geometry.Point(x, y, spatialReference) Creates a new Point object using x, y, and a spatial reference.
esri.geometry.Point([x,y], spatialReference) Creates a new Point object using an array containing an x,y coordinate value and a spatial reference.
esri.geometry.Point(json) Creates a new Point object using a JSON object.

Properties

Property Type Description
x Number X-coordinate of a point in map units.
y Number Y-coordinate of a point in map units.

Methods

Method Return Value Description
offset(dx, dy) Point Offsets the point in an x and y direction. Units are map units.
setX(x) Point Sets x-coordinate of point.

The return value of Point was added at v1.4.
setY(y) Point Sets y-coordinate of point.

The return value of Point was added at v1.4.
update(x, y) Point Updates a point.
Constructor Detail

esri.geometry.Point(x, y, spatialReference)

Creates a new Point object using x, y, and a spatial reference.
Parameters:
<Number> x Required X-coordinate of a point in map units.
<Number> y Required Y-coordinate of a point in map units.
<SpatialReference> spatialReference Required Spatial reference of the geometry.
Code snippets:
new esri.geometry.Point(-118.15, 33.80, new esri.SpatialReference({ wkid: 4326 }))

esri.geometry.Point([x,y], spatialReference)

Creates a new Point object using an array containing an x,y coordinate value and a spatial reference.
Parameters:
<Array> [x,y] Required An array that includes an x,y coordinate.
<SpatialReference> spatialReference Required Spatial reference of the geometry.

esri.geometry.Point(json)

Creates a new Point object using a JSON object.
Parameters:
<Object> json Required A JSON object that contains an x,y coordinate.
Properties Detail

<Number> x

X-coordinate of a point in map units.

<Number> y

Y-coordinate of a point in map units.
Methods Detail

offset(dx, dy)

Offsets the point in an x and y direction. Units are map units.
Return value: Point
Input Parameters:
<Number> dx Required Value for x-coordinate of point.
<Number> dy Required Value for y-coordinate of point.

setX(x)

Sets x-coordinate of point.

The return value of Point was added at v1.4.
Return value: Point
Input Parameters:
<Number> x Required Value for x-coordinate of point.

setY(y)

Sets y-coordinate of point.

The return value of Point was added at v1.4.
Return value: Point
Input Parameters:
<Number> y Required Value for y-coordinate of point.

update(x, y)

Updates a point. (As of v1.4)
Return value: Point
Input Parameters:
<Number> x Required X-coordinate of the updated point.
<Number> y Required Y-coordinate of the updated point.