Description
An ordered collection of points.
Class hierarchy
esri.geometry.Geometry
|_ esri.geometry.Multipoint
Constructor
Properties
| points |
Number[][]
|
An array of one or more points. |
Methods
| addPoint(point or json) |
Multipoint
|
Adds a point to the Multipoint. The point can be one of the following: an ESRI Point, a number array, or a JSON object.
The return value of Multipoint was added at v1.4. |
| getExtent() |
Extent
|
Gets the extent of all the points. If only one point is present, the extent has a width and height of 0. |
| removePoint(index) |
Point
|
Removes a point from the Multipoint. The index specifies which path to remove. |
Constructor Detail
esri.geometry.Multipoint(spatialReference)
Creates a new Multipoint object.
Parameters:
Code snippets:
new esri.geometry.Multipoint(new esri.SpatialReference({ wkid:4326 }));
esri.geometry.Multipoint(json)
Creates a new Multipoint object using a JSON object.
Parameters:
|
<Object>
json |
Required |
JSON object representing the geometry.
|
Code snippets:
var mpJson ={"points":[[-122.63,45.51],[-122.56,45.51],[-122.56,45.55]],"spatialReference":({" wkid":4326 })};
var multipoint = new esri.geometry.Multipoint(mpJson);
Properties Detail
An array of one or more points.
Code snippets:
var mp = new esri.geometry.Multipoint(new esri.SpatialReference({wkid:4326}));
mp.points = [[-122.63,45.51],[-122.56,45.51],[-122.56,45.55],[-122.62,45.],[-122.59,45.53]];
Methods Detail
Adds a point to the Multipoint. The point can be one of the following: an ESRI Point, a number array, or a JSON object.
The return value of Multipoint was added at v1.4.
Input Parameters:
|
<Point or Number[]> point |
Required |
The point to add. The point is either an ESRI Point or a number representing the x,y coordinate. |
|
<object> json |
Required |
A JSON object representing a point. |
Code snippets:
Point example:
multipoint.addPoint(new esri.geometry.Point(-122.63,45.51));
JSON example:
multipoint.addPoint({"x": -122.65, "y": 45.53 });
Gets the extent of all the points. If only one point is present, the extent has a width and height of 0.
Removes a point from the Multipoint. The index specifies which path to remove.
Input Parameters:
|
<Number> index |
Required |
The index of the point to remove. |