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

Description

An ordered collection of points.

Class hierarchy

esri.geometry.Geometry
  |_ esri.geometry.Multipoint

Constructor

Constructor Description
esri.geometry.Multipoint(spatialReference) Creates a new Multipoint object.
esri.geometry.Multipoint(json) Creates a new Multipoint object using a JSON object.

Properties

Property Type Description
points Number[][] An array of one or more points.

Methods

Method Return Value Description
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:
<SpatialReference> spatialReference Required Spatial reference of the geometry.
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

<Number[][]> points

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]];

See also:
addPoint  
Methods Detail

addPoint(point or json)

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.
Return value: Multipoint
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 });

getExtent()

Gets the extent of all the points. If only one point is present, the extent has a width and height of 0.
Return value: Extent

removePoint(index)

Removes a point from the Multipoint. The index specifies which path to remove.
Return value: Point
Input Parameters:
<Number> index Required The index of the point to remove.