dojo.require("esri.geometry.Point")
Description
(Added at v1.0)
A location defined by an X- and Y- coordinate. It can be map units or screen units.
Samples
Search for
samples that use this class.
Class hierarchy
esri/geometry.Geometry
|_esri/geometry.Point
Constructors
Properties
Methods
Constructor Details
Creates a new Point object using x, y, and a spatial reference. At version 3.3 if a spatial reference is not provided a default spatial reference of 4326 will be assigned.
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. |
Sample: new esri.geometry.Point(-118.15, 33.80, new esri.SpatialReference({ wkid: 4326 }));
Creates a new Point object using an array containing an x,y coordinate value and a spatial reference. At version 3.3 if a spatial reference is not provided a default spatial reference of 4326 will be assigned.
Parameters:
<Number[] > coords |
Required |
An array that includes an x,y coordinate. For example: [-117,34]. |
<SpatialReference > spatialReference |
Required |
Spatial reference of the geometry. |
Sample:
var point = new esri.geometry.Point([-122.65,45.53],new esri.SpatialReference({ wkid:4326 }));
Creates a new Point object using a JSON object.
Parameters:
<Object > json |
Required |
A JSON object that contains an x,y coordinate. |
Sample:
var point = new esri.geometry.Point( {"x": -122.65, "y": 45.53, "spatialReference": {" wkid": 4326 } });
Create a point object and initialize it with specified longitude and latitude. (Added at v3.3)
Parameters:
<Number > long |
Required |
Longitude value. |
<Number > lat |
Required |
Latitude value. |
Sample:
var point = new esri.geometry.Point(-98, 38);
Create a point object and initialize it with an array containing longitude and latitude values.
Parameters:
<Number[] > point |
Required |
An input array containing the longitude and latitude values for the point. |
Sample:
var point = new esri.geometry.Point([-98, 38]);
Create a point object and initialize it with an object that has latitude and longitude properties. (Added at v3.3)
Parameters:
<Object > point |
Required |
An object with latitude and longitude properties. |
Sample:
var point = new esri.geometry.Point({
latitude: 38,
longitude: -98
});
Property Details
The cache is used to store values computed from geometries that need to cleared or recomputed upon mutation. An example is the extent of a polygon. The default value is undefined
. (Added at v3.13)
Default value: undefined
The type of geometry.
Known values: point
| multipoint
| polyline
| polygon
| extent
X-coordinate of a point in map units.
Y-coordinate of a point in map units.
Method Details
Sets the cache property to undefined
. (Added at v3.13)
Returns the value for a named property stored in the cache. (Added at v3.13)
Parameters:
<String > name |
Required |
The property name of the value to retrieve from the cache. |
Returns the latitude coordinate for this point if the spatial reference of the point is Web Mercator or Geographic (4326). (Added at v3.3)
Returns the longitude coordinate for this point if the spatial reference of the point is Web Mercator or Geographic (4326). (Added at v3.3)
Shifts the x coordinate to within +/- 180 span. (Added at v3.8)
Returns a new Point with x and y offsets. Units are map units.
Parameters:
<Number > dx |
Required |
The offset distance in map units from the x-coordinate. |
<Number > dy |
Required |
The offset distance in map units from the y-coordinate. |
Sets the value for a named property stored in the cache. (Added at v3.13)
Parameters:
<String > name |
Required |
The property name for the value Object to store in the cache. |
<Object > value |
Required |
The value Object for a named property to store in the cache. |
Sets the latitude coordinate for this point to the specified value if the point's spatial reference is Web Mercator or Geographic (4326). (Added at v3.3)
Parameters:
<Number > lat |
Required |
A valid latitude value. |
Sets the longitude coordinate for this point to the specified value if the point's spatial reference is Web Mercator or Geographic (4326). (Added at v3.3)
Parameters:
<Number > lon |
Required |
A valid longitude value. |
Sets the spatial reference.
Sets x-coordinate of point.
Parameters:
<Number > x |
Required |
Value for x-coordinate of point. |
Sets y-coordinate of point.
Parameters:
<Number > y |
Required |
Value for y-coordinate of point. |
Updates a point. (Added at v1.4)
Parameters:
<Number > x |
Required |
X-coordinate of the updated point. |
<Number > y |
Required |
Y-coordinate of the updated point. |